From nickleiten at gmail.com  Sat Aug  1 04:38:22 2015
From: nickleiten at gmail.com (N.Leiten)
Date: Sat, 1 Aug 2015 11:38:22 +0300
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
Message-ID: <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>

You can also use uci-defaults mechanism for your purpose. Just put
script in base-files/etc/uci-defaults and set your preferrable
parameters with uci and don't forget to 'exit 0' at the end of script,
in elsecase it'll be run every time at boot ruining changes.

2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
> Hi,
>
> I am working on Ar71xx openWRT Luci project. By default the Wi-Fi is
> disabled and SSID is OpenWrt. I need to change the default settings.
> Could anyone help me to change the default settings.
>
>
> Best Regards,
> John
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kevin at darbyshire-bryant.me.uk  Sat Aug  1 04:57:53 2015
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Sat, 1 Aug 2015 09:57:53 +0100
Subject: [OpenWrt-Devel] [PATCH] dnsmasq: Bump to dnsmasq2.75
Message-ID: <1438419473-28672-1-git-send-email-kevin@darbyshire-bryant.me.uk>

Fixes a 100% cpu usage issue if using dhcp-script.

Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 9b0ecc5..444459b 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
-PKG_VERSION:=2.74
+PKG_VERSION:=2.75
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
-PKG_MD5SUM:=f48cd0fe26a55617a375ffc95b71e3c3
+PKG_MD5SUM:=887236f1ddde6eb57cdb9d01916c9f72
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bittorf at bluebottle.com  Sat Aug  1 07:04:21 2015
From: bittorf at bluebottle.com (Bastian Bittorf)
Date: Sat, 1 Aug 2015 13:04:21 +0200
Subject: [OpenWrt-Devel] RFC: adding 'traceroute6' to busybox / base
Message-ID: <20150801110420.GD25597@medion.lan>

i build it for ar71xx, and these are the numbers [bytes]:

before:
359736 build_dir/target-mips_34kc_musl-1.1.10/busybox-1.23.2/busybox
208071 bin/ar71xx/packages/base/busybox_1.23.2-1_ar71xx.ipk

after:
359884 build_dir/target-mips_34kc_musl-1.1.10/busybox-1.23.2/busybox
209115 bin/ar71xx/packages/base/busybox_1.23.2-1_ar71xx.ipk

so it adds ~1k to the image. (strange that uncompressed ~148 bytes)
it's as simple as adding CONFIG_BUSYBOX_CONFIG_TRACEROUTE6=y
what do you think?

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sami at olmari.fi  Sat Aug  1 10:33:12 2015
From: sami at olmari.fi (Sami Olmari)
Date: Sat, 1 Aug 2015 17:33:12 +0300
Subject: [OpenWrt-Devel] RFC: adding 'traceroute6' to busybox / base
In-Reply-To: <20150801110420.GD25597@medion.lan>
References: <20150801110420.GD25597@medion.lan>
Message-ID: <CAENOc+x-Mb6briWecbWTY5aCUotqk_o1=9Z9V3X1vsVt=Kc2Bw@mail.gmail.com>

Mine opinion is that if there is IPv4 version per default then IPv6 version
should be there too... Whole another thing is to decide what there should
be at default installation :)

Sami Olmari
On Aug 1, 2015 13:54, "Bastian Bittorf" <bittorf at bluebottle.com> wrote:

> i build it for ar71xx, and these are the numbers [bytes]:
>
> before:
> 359736 build_dir/target-mips_34kc_musl-1.1.10/busybox-1.23.2/busybox
> 208071 bin/ar71xx/packages/base/busybox_1.23.2-1_ar71xx.ipk
>
> after:
> 359884 build_dir/target-mips_34kc_musl-1.1.10/busybox-1.23.2/busybox
> 209115 bin/ar71xx/packages/base/busybox_1.23.2-1_ar71xx.ipk
>
> so it adds ~1k to the image. (strange that uncompressed ~148 bytes)
> it's as simple as adding CONFIG_BUSYBOX_CONFIG_TRACEROUTE6=y
> what do you think?
>
> bye, bastian
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150801/066d85e3/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Sat Aug  1 10:47:02 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Sat, 1 Aug 2015 16:47:02 +0200
Subject: [OpenWrt-Devel] RFC: adding 'traceroute6' to busybox / base
In-Reply-To: <20150801110420.GD25597@medion.lan>
References: <20150801110420.GD25597@medion.lan>
Message-ID: <55BCDBE6.9040901@openwrt.org>

On 2015-08-01 13:04, Bastian Bittorf wrote:
> i build it for ar71xx, and these are the numbers [bytes]:
> 
> before:
> 359736 build_dir/target-mips_34kc_musl-1.1.10/busybox-1.23.2/busybox
> 208071 bin/ar71xx/packages/base/busybox_1.23.2-1_ar71xx.ipk
> 
> after:
> 359884 build_dir/target-mips_34kc_musl-1.1.10/busybox-1.23.2/busybox
> 209115 bin/ar71xx/packages/base/busybox_1.23.2-1_ar71xx.ipk
> 
> so it adds ~1k to the image. (strange that uncompressed ~148 bytes)
> it's as simple as adding CONFIG_BUSYBOX_CONFIG_TRACEROUTE6=y
> what do you think?
Feel free to send a patch.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nico at vthadden.de  Sat Aug  1 10:57:47 2015
From: nico at vthadden.de (Nicola von Thadden)
Date: Sat, 01 Aug 2015 16:57:47 +0200
Subject: [OpenWrt-Devel] [OpenWrt] 2.4Ghz limited to 50mW in DFS-ETSI
In-Reply-To: <995875F1-6101-4411-9804-FC0A42D01751@yahoo.de>
References: <038.d6a7daa6d80787b9084a590df87b6f6d@lists.openwrt.org>
 <55B89216.5080304@vthadden.de>
 <4247F4A8-7077-461A-92A8-118136A5D40E@yahoo.de>
 <CADSh-SOz0C9NZBHdWPvWiNy6huTO6EV6Tu_8Cdf3vXRa6e3MhA@mail.gmail.com>
 <14eda9e7e68.2756.7ad4c461edc3bafd55f3b540b1bdce64@bsdbg.net>
 <55B9E124.2050500@vthadden.de>
 <CADSh-SNzCpOo7WD58tYJhdh+2JxJS87nRd5xdFdR_+=CntKF8w@mail.gmail.com>
 <995875F1-6101-4411-9804-FC0A42D01751@yahoo.de>
Message-ID: <55BCDE6B.4030900@vthadden.de>

Hi,

my main problem isn't the 17dBm on the lower 5ghz channels. I can
happily use a higher channel with DFS and 250mW (which seems to be the
hardware limit).
My main problem is the DFS implementation which seems to limit 2.4ghz to
a lower value:
I have two similar regulatory entries:
country DF: DFS-FCC
        (2402 - 2472 @ 40), (30)
        (5170 - 5250 @ 80), (17), AUTO-BW
        (5250 - 5330 @ 80), (23), DFS, AUTO-BW
        (5490 - 5730 @ 160), (23), DFS
        (5735 - 5835 @ 80), (30)
country DG: DFS-ETSI
        (2402 - 2472 @ 40), (30)
        (5170 - 5250 @ 80), (17), AUTO-BW
        (5250 - 5330 @ 80), (23), DFS, AUTO-BW
        (5490 - 5730 @ 160), (23), DFS
        (5735 - 5835 @ 80), (30)

root at ap02:~# iw reg set DF
root at ap02:~# iwinfo wlan0 txp
   0 dBm (   1 mW)
   1 dBm (   1 mW)
   2 dBm (   1 mW)
   3 dBm (   1 mW)
   4 dBm (   2 mW)
   5 dBm (   3 mW)
   6 dBm (   3 mW)
   7 dBm (   5 mW)
   8 dBm (   6 mW)
   9 dBm (   7 mW)
  10 dBm (  10 mW)
  11 dBm (  12 mW)
  12 dBm (  15 mW)
  13 dBm (  19 mW)
  14 dBm (  25 mW)
  15 dBm (  31 mW)
  16 dBm (  39 mW)
  17 dBm (  50 mW)
  18 dBm (  63 mW)
  19 dBm (  79 mW)
  20 dBm ( 100 mW)
  21 dBm ( 125 mW)
  22 dBm ( 158 mW)
  23 dBm ( 199 mW)
  24 dBm ( 251 mW)
  25 dBm ( 316 mW)
  26 dBm ( 398 mW)
  27 dBm ( 501 mW)
* 28 dBm ( 630 mW)
  29 dBm ( 794 mW)
root at ap02:~# iw reg set DG
root at ap02:~# iw phy phy0 set txpower fixed 2000
root at ap02:~# iwinfo wlan0 txp
   0 dBm (   1 mW)
   1 dBm (   1 mW)
   2 dBm (   1 mW)
   3 dBm (   1 mW)
   4 dBm (   2 mW)
   5 dBm (   3 mW)
   6 dBm (   3 mW)
   7 dBm (   5 mW)
   8 dBm (   6 mW)
   9 dBm (   7 mW)
  10 dBm (  10 mW)
  11 dBm (  12 mW)
  12 dBm (  15 mW)
  13 dBm (  19 mW)
  14 dBm (  25 mW)
  15 dBm (  31 mW)
  16 dBm (  39 mW)
* 17 dBm (  50 mW)
  18 dBm (  63 mW)
  19 dBm (  79 mW)
  20 dBm ( 100 mW)
  21 dBm ( 125 mW)
  22 dBm ( 158 mW)
  23 dBm ( 199 mW)
  24 dBm ( 251 mW)
  25 dBm ( 316 mW)
  26 dBm ( 398 mW)
  27 dBm ( 501 mW)
  28 dBm ( 630 mW)
  29 dBm ( 794 mW)
root at ap02:~#


You see what I mean? The problem is not the power level in the
regulatory database. The problem is that the software thinks it's right
to limit it to 17dBm. It also does not depend which antenna gain is set
via iw of what power levels are defined in the regulatory database.
Everything higher than 17dBm is ignored and set to 17dBm, on 2.4Ghz.

Since the only difference is the DFS regulatory information, I think the
part parsing those information from the database is faulty. Maybe it
thinks that it's okay to limit it to 17dBm because DFS is not used on
2.4Ghz, which is sonsense.

I don't think that any part in hardware is causing the problem. I can
use higher power levels on 2.4Ghz when using DFS-FCC or no regulatory
limitations at all.

Thanks
Nico



On 07/30/2015 06:08 PM, Gerald Matzka wrote:
> Ben is right, take a look at 
> https://forum.openwrt.org/viewtopic.php?id=42197
> 
> In newer Openwrt versions the kernel modules are compiled to respect the
> reg-domain settings programmed in hardware.
> 
> Kind regards
> 
> ... sent from my iPhone
> 
> Am 30.07.2015 um 17:11 schrieb Ben West <ben at gowasabi.net
> <mailto:ben at gowasabi.net>>:
> 
>> You can look up your respective country's spectrum regulations.  It is
>> possible prior versions OpenWRT didn't fully conform to each
>> regulatory domain and were fixed in more recent versions (just as the
>> converse is possible).
>>
>> For example, for the USA, here is a table of power limits for the
>> 2.4GHz and 5GHz bands.  Channels 36-48 are limited to 16dBm
>> transmitter power.
>> http://www.air802.com/fcc-rules-and-regulations.html
>>
>> On Thu, Jul 30, 2015 at 3:32 AM, Nicola von Thadden <nico at vthadden.de
>> <mailto:nico at vthadden.de>> wrote:
>>
>>     Hi,
>>
>>     I also thought to have used 20dBm or 23dBm in earlier releases (AA).
>>     Is there a way to find out to which txpower levels the 5Ghz
>>     transceiver
>>     is limited? I think the driver reads them out, maybe there is a way to
>>     print them on the cmd?
>>
>>     But my main problem is the 17dBm on 2.4Ghz when setting DFS-ETSI
>>     countries. I don't think that it is a problem of the hardware but
>>     of the
>>     software parsing the regdom. Maybe there is a fixed limit of 17dBm on
>>     non-DFS channels, even when DFS is not required, which is not very
>>     useful. Does anyone have an idea where that could be set? My search in
>>     the source code had no results until now, where it could be.
>>
>>     Thanks
>>     Nico
>>
>>     On 07/29/2015 06:21 PM, Atanas Vladimirov wrote:
>>     > https://dev.openwrt.org/ticket/20201
>>     >
>>     > On BB I used 20dBm for both 2.4 and 5GHz on the same router.
>>     >
>>     > Sent with AquaMail for Android
>>     > http://www.aqua-mail.com
>>     >
>>     > On 29 ??? 2015 ?. 18:40:10 Ben West <ben at gowasabi.net <mailto:ben at gowasabi.net>> wrote:
>>     >
>>     >> This is what I observe running Barrier Breaker on UBNT M5 products,
>>     >> too.  I believe the 17dBm limit is intentional, i.e. per regulation.
>>     >> The 30dBm tx power limit applies to channels 149 and above, I believe.
>>     >>
>>     >> >  Also (kind of off-topic): Do you know why 5Ghz channels 36-48 are
>>     >> forced
>>     >> >  to be 17dBm only on the WNDR3800? I found two possible explanations:
>>     >> >  either because of the factory calibration
>>     >>
>>     >>
>>     >> On Wed, Jul 29, 2015 at 10:25 AM, Gerald Matzka <mgerald21 at yahoo.de <mailto:mgerald21 at yahoo.de>
>>     >> <mailto:mgerald21 at yahoo.de <mailto:mgerald21 at yahoo.de>>> wrote:
>>     >>
>>     >>     Well, it looks like the txpower of your wdnr3800 is limited to
>>     >>     17dBm because of the hardware reg-domain settings.
>>     >>
>>     >>     Kind regards,
>>     >>
>>     >>     ... sent from my iPhone
>>     >>
>>     >>     > Am 29.07.2015 um 10:43 schrieb Nicola von Thadden
>>     >>     <nico at vthadden.de <mailto:nico at vthadden.de>
>>     <mailto:nico at vthadden.de <mailto:nico at vthadden.de>>>:
>>     >>     >
>>     >>     > Hi,
>>     >>     >
>>     >>     > I have this strange behaviour down below, for which I
>>     also opened a
>>     >>     > ticket because I think this should not be like that ;)
>>     >>     >
>>     >>     > Does anyone have an idea where the problem could
>>     originate from
>>     >>     and how
>>     >>     > to fix it?
>>     >>     >
>>     >>     > Thanks
>>     >>     > Nico
>>     >>     >
>>     >>     >> On 07/29/2015 12:37 AM, OpenWrt wrote:
>>     >>     >> #20222: 2.4Ghz limited to 50mW in DFS-ETSI
>>     >>     >> ----------------------+----------------------------------
>>     >>     >> Reporter:  nicoduck  |      Owner:  developers
>>     >>     >>     Type:  defect    |     Status:  new
>>     >>     >> Priority:  normal    |  Milestone:  Chaos Calmer (trunk)
>>     >>     >> Component:  kernel    |    Version:  Trunk
>>     >>     >> Keywords:  wndr3800  |
>>     >>     >> ----------------------+----------------------------------
>>     >>     >> I have got a Netgear WNDR 3800 running with openwrt
>>     since quite
>>     >>     a while.
>>     >>     >> I now upgraded to the latest version (trunk) and wanted
>>     to use
>>     >>     WLAN within
>>     >>     >> the regulations here in Germany but also wanted to max
>>     out the
>>     >>     output
>>     >>     >> power (within the regulations).
>>     >>     >> Switching the country to Germany limits the maximum output
>>     >>     power to 17dBm,
>>     >>     >> although it does show as being limited on 20dBm:
>>     >>     >> root at OpenWrt:/# iwinfo wlan0 txpower
>>     >>     >>    0 dBm (   1 mW)
>>     >>     >>    1 dBm (   1 mW)
>>     >>     >>    2 dBm (   1 mW)
>>     >>     >>    3 dBm (   1 mW)
>>     >>     >>    4 dBm (   2 mW)
>>     >>     >>    5 dBm (   3 mW)
>>     >>     >>    6 dBm (   3 mW)
>>     >>     >>    7 dBm (   5 mW)
>>     >>     >>    8 dBm (   6 mW)
>>     >>     >>    9 dBm (   7 mW)
>>     >>     >>   10 dBm (  10 mW)
>>     >>     >>   11 dBm (  12 mW)
>>     >>     >>   12 dBm (  15 mW)
>>     >>     >>   13 dBm (  19 mW)
>>     >>     >>   14 dBm (  25 mW)
>>     >>     >>   15 dBm (  31 mW)
>>     >>     >>   16 dBm (  39 mW)
>>     >>     >> * 17 dBm (  50 mW)
>>     >>     >>   18 dBm (  63 mW)
>>     >>     >>   19 dBm (  79 mW)
>>     >>     >>   20 dBm ( 100 mW)
>>     >>     >>
>>     >>     >> What I did: reset the device, flash it with various
>>     builts from
>>     >>     trunk and
>>     >>     >> try to figure out what was going on.
>>     >>     >> I now modified my regdb and was able to isolate the
>>     source of
>>     >>     the problem:
>>     >>     >> country DE: DFS-ETSI
>>     >>     >>         # entries 279004 and 280006
>>     >>     >>         (2400 - 2483.5 @ 40), (100 mW)
>>     >>     >>         # entry 303005
>>     >>     >>         (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW
>>     >>     >>         # entries 304002 and 305002
>>     >>     >>         (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS,
>>     AUTO-BW
>>     >>     >>         # entries 308002, 309001 and 310003
>>     >>     >>         (5470 - 5725 @ 160), (500 mW), DFS
>>     >>     >>         # 60 gHz band channels 1-4, ref: Etsi En 302 567
>>     >>     >>         (57000 - 66000 @ 2160), (40)
>>     >>     >> Thas does not work and has the mentioned behaviour,
>>     2.4Ghz is
>>     >>     limited at
>>     >>     >> 17dBm. It also does not depend on which values are set
>>     in the
>>     >>     regulatory
>>     >>     >> database for the 2.4Ghz channels, anything over 17dBm
>>     will be
>>     >>     limited to
>>     >>     >> 17dBm.
>>     >>     >> running "iw phy phy0 set txpower fixed 2000" gives no
>>     error but
>>     >>     does not
>>     >>     >> change it to 20dBm. Changing the value to anything below
>>     17dBm
>>     >>     works
>>     >>     >> though.
>>     >>     >>
>>     >>     >> country DE: DFS-FCC
>>     >>     >>         # entries 279004 and 280006
>>     >>     >>         (2400 - 2483.5 @ 40), (100 mW)
>>     >>     >>         # entry 303005
>>     >>     >>         (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW
>>     >>     >>         # entries 304002 and 305002
>>     >>     >>         (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS,
>>     AUTO-BW
>>     >>     >>         # entries 308002, 309001 and 310003
>>     >>     >>         (5470 - 5725 @ 160), (500 mW), DFS
>>     >>     >>         # 60 gHz band channels 1-4, ref: Etsi En 302 567
>>     >>     >>         (57000 - 66000 @ 2160), (40)
>>     >>     >>
>>     >>     >> Thad does work. The only change to the entry above is
>>     "DFS-FCC"
>>     >>     instead of
>>     >>     >> "DFS-ETSI". I can now select any powerlevel between 1
>>     and 20dBm
>>     >>     and it is
>>     >>     >> also reported as being used:
>>     >>     >> root at OpenWrt:/# iwinfo wlan0 txpower
>>     >>     >>    0 dBm (   1 mW)
>>     >>     >>    1 dBm (   1 mW)
>>     >>     >>    2 dBm (   1 mW)
>>     >>     >>    3 dBm (   1 mW)
>>     >>     >>    4 dBm (   2 mW)
>>     >>     >>    5 dBm (   3 mW)
>>     >>     >>    6 dBm (   3 mW)
>>     >>     >>    7 dBm (   5 mW)
>>     >>     >>    8 dBm (   6 mW)
>>     >>     >>    9 dBm (   7 mW)
>>     >>     >>   10 dBm (  10 mW)
>>     >>     >>   11 dBm (  12 mW)
>>     >>     >>   12 dBm (  15 mW)
>>     >>     >>   13 dBm (  19 mW)
>>     >>     >>   14 dBm (  25 mW)
>>     >>     >>   15 dBm (  31 mW)
>>     >>     >>   16 dBm (  39 mW)
>>     >>     >>   17 dBm (  50 mW)
>>     >>     >>   18 dBm (  63 mW)
>>     >>     >>   19 dBm (  79 mW)
>>     >>     >> * 20 dBm ( 100 mW)
>>     >>     >>
>>     >>     >>
>>     >>     >> I have no idea why but there seems to be a bug in the code
>>     >>     parsing the DFS
>>     >>     >> regulations, limiting 2.4Ghz to lot lower values than
>>     allowed.
>>     >>     Changing it
>>     >>     >> to DFS-FCC works for using the applicaple output power
>>     but does
>>     >>     not seem
>>     >>     >> to be in compliance which German law.
>>     >>     >>
>>     >>     >> Do you have an idea where the problem could be? I'm happy to
>>     >>     try out more
>>     >>     >> builds and future versions.
>>     >>     >>
>>     >>     >> Also (kind of off-topic): Do you know why 5Ghz channels
>>     36-48
>>     >>     are forced
>>     >>     >> to be 17dBm only on the WNDR3800? I found two possible
>>     >>     explanations:
>>     >>     >> either because of the factory calibration (is it possible to
>>     >>     get them in a
>>     >>     >> human readable form somehow? The hexdump is not really
>>     readable
>>     >>     and I have
>>     >>     >> not been able to find the code which pases them) or because
>>     >>     these channels
>>     >>     >> are considered as "edge-channels" and someone thought it
>>     would
>>     >>     be safe to
>>     >>     >> limit the power, to not disturb any other systems running on
>>     >>     even lower
>>     >>     >> channels. The latter explanation is kind of weird because it
>>     >>     would make no
>>     >>     >> sense to limit these 4 channels but no other ones. I find it
>>     >>     especially
>>     >>     >> strange because that is typically the job of regulatory
>>     >>     authorities, to
>>     >>     >> define those power levels.
>>     >>     >>
>>     >>     >> --
>>     >>     >> Ticket URL: <https://dev.openwrt.org/ticket/20222>
>>     >>     >> OpenWrt <http://openwrt.org>
>>     >>     >> Opensource Wireless Router Technology
>>     >>     > _______________________________________________
>>     >>     > openwrt-devel mailing list
>>     >>     > openwrt-devel at lists.openwrt.org
>>     <mailto:openwrt-devel at lists.openwrt.org>
>>     >>     <mailto:openwrt-devel at lists.openwrt.org
>>     <mailto:openwrt-devel at lists.openwrt.org>>
>>     >>     > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>     >>     _______________________________________________
>>     >>     openwrt-devel mailing list
>>     >>     openwrt-devel at lists.openwrt.org
>>     <mailto:openwrt-devel at lists.openwrt.org>
>>     >>     <mailto:openwrt-devel at lists.openwrt.org
>>     <mailto:openwrt-devel at lists.openwrt.org>>
>>     >>     https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>     >>
>>     >>
>>     >>
>>     >>
>>     >> --
>>     >> Ben West
>>     >> http://gowasabi.net
>>     >> ben at gowasabi.net <mailto:ben at gowasabi.net>
>>     <mailto:ben at gowasabi.net <mailto:ben at gowasabi.net>>
>>     >> 314-246-9434 <tel:314-246-9434>
>>     >> _______________________________________________
>>     >> openwrt-devel mailing list
>>     >> openwrt-devel at lists.openwrt.org
>>     <mailto:openwrt-devel at lists.openwrt.org>
>>     <mailto:openwrt-devel%40lists.openwrt.org
>>     <mailto:openwrt-devel%2540lists.openwrt.org>>
>>     >> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>     >>
>>     >
>>     >
>>     > _______________________________________________
>>     > openwrt-devel mailing list
>>     > openwrt-devel at lists.openwrt.org
>>     <mailto:openwrt-devel at lists.openwrt.org>
>>     > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>     >
>>
>>
>>
>>
>> -- 
>> Ben West
>> http://gowasabi.net
>> ben at gowasabi.net <mailto:ben at gowasabi.net>
>> 314-246-9434
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Sun Aug  2 01:03:14 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:03:14 -0400
Subject: [OpenWrt-Devel] [PATCH 1/9] CC PowerCloud CAP324 Kernel BSP
Message-ID: <20150811030612.013FC23A1549@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../814-MIPS-ath79-add-cap324-support.patch        | 183 +++++++++++++++++++++
 2 files changed, 184 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 1e31a01..c01ec6e 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -47,6 +47,7 @@ CONFIG_ATH79_MACH_AP96=y
 CONFIG_ATH79_MACH_ARCHER_C7=y
 CONFIG_ATH79_MACH_AW_NR580=y
 CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
+CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
diff --git a/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch
new file mode 100644
index 0000000..62e36c5
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch
@@ -0,0 +1,183 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -896,6 +896,16 @@ config ATH79_MACH_MR900
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CAP324
++	bool "PowerCloud Systems CAP324 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -56,6 +56,7 @@ obj-$(CONFIG_ATH79_MACH_AP96)		+= mach-a
+ obj-$(CONFIG_ATH79_MACH_ARCHER_C7)	+= mach-archer-c7.o
+ obj-$(CONFIG_ATH79_MACH_AW_NR580)	+= mach-aw-nr580.o
+ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)+= mach-bhu-bxu2000n2-a.o
++obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cap324.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cap324.c
+@@ -0,0 +1,133 @@
++/*
++ *  PowerCloud Systems CAP324 board support
++ *
++ *  Copyright (C) 2012 Gabor Juhos <juhosg at openwrt.org>
++ *  Copyright (C) 2012-2013 PowerCloud Systems
++ *  Copyright (C) 2015 Daniel Dickinson
++ *
++ *  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.
++ */
++
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CAP324_GPIO_LED_POWER_GREEN	12
++#define CAP324_GPIO_LED_POWER_AMBER	13
++#define CAP324_GPIO_LED_LAN_GREEN	14
++#define CAP324_GPIO_LED_LAN_AMBER	15
++#define CAP324_GPIO_LED_WLAN_GREEN	18
++#define CAP324_GPIO_LED_WLAN_AMBER	19
++
++#define CAP324_GPIO_BTN_RESET	17
++
++#define CAP324_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CAP324_KEYS_DEBOUNCE_INTERVAL (3 * CAP324_KEYS_POLL_INTERVAL)
++
++#define CAP324_MAC_OFFSET		0
++#define CAP324_WMAC_CALDATA_OFFSET	0x1000
++#define CAP324_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cap324_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:green:power",
++		.gpio		= CAP324_GPIO_LED_POWER_GREEN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CAP324_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:green:lan",
++		.gpio		= CAP324_GPIO_LED_LAN_GREEN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:amber:lan",
++		.gpio		= CAP324_GPIO_LED_LAN_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:green:wlan",
++		.gpio		= CAP324_GPIO_LED_WLAN_GREEN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:amber:wlan",
++		.gpio		= CAP324_GPIO_LED_WLAN_AMBER,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cap324_gpio_keys[] __initdata = {
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_RESTART,
++		.debounce_interval = CAP324_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CAP324_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cap324_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++	u8 mac[6];
++
++	ath79_gpio_output_select(CAP324_GPIO_LED_LAN_GREEN,
++				 AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CAP324_GPIO_LED_LAN_AMBER,
++				 AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cap324_leds_gpio),
++				 cap324_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CAP324_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cap324_gpio_keys),
++					cap324_gpio_keys);
++
++	ath79_init_mac(mac, art + CAP324_MAC_OFFSET, -1);
++	ath79_wmac_disable_2ghz();
++	ath79_register_wmac(art + CAP324_WMAC_CALDATA_OFFSET, mac);
++
++	ath79_init_mac(mac, art + CAP324_MAC_OFFSET, -2);
++	ap91_pci_init(art + CAP324_PCIE_CALDATA_OFFSET, mac);
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr,
++		       art + CAP324_MAC_OFFSET, -2);
++
++	/* GMAC0 is connected to an external PHY */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CAP324, "CAP324", "PowerCloud CAP324",
++	     cap324_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -39,6 +39,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_ARCHER_C7,		/* TP-LINK Archer C7 board */
+ 	ATH79_MACH_AW_NR580,		/* AzureWave AW-NR580 */
+ 	ATH79_MACH_BHU_BXU2000N2_A1,	/* BHU BXU2000n-2 A1 */
++	ATH79_MACH_CAP324,		/* PowerCloud Systems CAP324 */
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [OpenWrt-Devel] [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <20150810154128.30E2723A1542@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [OpenWrt-Devel] [PATCH 2/9] CC PowerCloud CAP324 Image generation
Message-ID: <20150811030612.05D8723A154A@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PCS CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PCS CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [OpenWrt-Devel] [PATCH 2/8] CC PowerCloud CAP324 OpenWrt
	configuration
Message-ID: <20150810154128.3652723A1543@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [OpenWrt-Devel] [PATCH 3/9] CC PowerCloud CAP324 OpenWrt
	configuration
Message-ID: <20150811030612.0A87B23A154C@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [OpenWrt-Devel] [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <20150810154128.3AB0523A1549@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [OpenWrt-Devel] [PATCH 4/9] CC PowerCloud CR3000 Kernel BSP
Message-ID: <20150811030612.0F0FE23A154F@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [OpenWrt-Devel] [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <20150810154128.3FA7A23A154A@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [OpenWrt-Devel] [PATCH 5/9] CC PowerCloud CR3000 image generation
Message-ID: <20150811030612.136DD23A1550@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PCS CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PCS CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [OpenWrt-Devel] [PATCH 5/8] CC PowerCloud CR3000 OpenWrt
	configuration
Message-ID: <20150810154128.440F523A154C@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [OpenWrt-Devel] [PATCH 6/9] CC PowerCloud CR3000 OpenWrt
	configuration
Message-ID: <20150811030612.17BCF23A1551@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nickleiten at gmail.com  Sun Aug  2 03:12:58 2015
From: nickleiten at gmail.com (N.Leiten)
Date: Sun, 02 Aug 2015 10:12:58 +0300
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
Message-ID: <2367757.IMc5zkIGE4@nl-ubook>

Hi,

Don't answer to my e-mail only, you need to add openwrt-devel maillist to CC or just answer to CC, in each case I'll receive message but also everyone could see all discussion.

In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry wrote:
> Hi Leiten,
> 
> I have added new files under and written below :
> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless

Use index in prefix of filename to set order of execution, so it'll be like '99-wireless'.

> 
> #!/bin/sh
> #
> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
> # Copyright (C) 2011 OpenWrt.org
> #
> 
> [ -e /etc/config/wireless ] && exit 0

Here is the problem. When uci-defaults invoke scripts there's already preconfiguration done and /etc/config/wireless already exists, so your script just exit at this point. Remove this line.

> 
> touch /etc/config/wireless
> 
> uci set wireless. at wifi-device[0].disabled=0;
> uci set system. at system[0].hostname=test_ap
> uci set wireless. at wifi-iface[0].mode=ap
> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
> uci set wireless. at wifi-iface[0].encryption=none
> uci set wireless. at wifi-iface[0].wds=1
> uci set wireless.radio0.disabled=0
> 
> uci commit wireless
> 
> exit 0
> 
> and compile the source code using make V=s but still not changed default
> settings.
> 
> Please help me to make it works.
> 
> Thanks,
> 
> 
> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com> wrote:
> 
> > You can also use uci-defaults mechanism for your purpose. Just put
> > script in base-files/etc/uci-defaults and set your preferrable
> > parameters with uci and don't forget to 'exit 0' at the end of script,
> > in elsecase it'll be run every time at boot ruining changes.
> >
> > 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
> > > Hi,
> > >
> > > I am working on Ar71xx openWRT Luci project. By default the Wi-Fi is
> > > disabled and SSID is OpenWrt. I need to change the default settings.
> > > Could anyone help me to change the default settings.
> > >
> > >
> > > Best Regards,
> > > John
> > >
> > > _______________________________________________
> > > openwrt-devel mailing list
> > > openwrt-devel at lists.openwrt.org
> > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> > >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel at lists.openwrt.org
> > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> >
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [OpenWrt-Devel] [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <20150810154128.485A823A154F@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [OpenWrt-Devel] [PATCH 7/9] CC PowerCloud CR5000 Kernel BSP
Message-ID: <20150811030612.1C0B223A1552@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [OpenWrt-Devel] [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <20150810154128.4CA8E23A1550@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [OpenWrt-Devel] [PATCH 8/9] CC PowerCloud CR5000 image generation
Message-ID: <20150811030612.203A323A1553@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Sun Aug  2 03:45:29 2015
From: kerry9842 at gmail.com (John kerry)
Date: Sun, 2 Aug 2015 15:45:29 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <2367757.IMc5zkIGE4@nl-ubook>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
Message-ID: <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>

Hi Leiten,

Thank you so much, Its working :)

On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com> wrote:

> Hi,
>
> Don't answer to my e-mail only, you need to add openwrt-devel maillist to
> CC or just answer to CC, in each case I'll receive message but also
> everyone could see all discussion.
>
> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
> wrote:
> > Hi Leiten,
> >
> > I have added new files under and written below :
> > vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>
> Use index in prefix of filename to set order of execution, so it'll be
> like '99-wireless'.
>
> >
> > #!/bin/sh
> > #
> > # Copyright (c) 2013 The Linux Foundation. All rights reserved.
> > # Copyright (C) 2011 OpenWrt.org
> > #
> >
> > [ -e /etc/config/wireless ] && exit 0
>
> Here is the problem. When uci-defaults invoke scripts there's already
> preconfiguration done and /etc/config/wireless already exists, so your
> script just exit at this point. Remove this line.
>
> >
> > touch /etc/config/wireless
> >
> > uci set wireless. at wifi-device[0].disabled=0;
> > uci set system. at system[0].hostname=test_ap
> > uci set wireless. at wifi-iface[0].mode=ap
> > uci set wireless. at wifi-iface[0].ssid=CD-2.4D
> > uci set wireless. at wifi-iface[0].encryption=none
> > uci set wireless. at wifi-iface[0].wds=1
> > uci set wireless.radio0.disabled=0
> >
> > uci commit wireless
> >
> > exit 0
> >
> > and compile the source code using make V=s but still not changed default
> > settings.
> >
> > Please help me to make it works.
> >
> > Thanks,
> >
> >
> > On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com> wrote:
> >
> > > You can also use uci-defaults mechanism for your purpose. Just put
> > > script in base-files/etc/uci-defaults and set your preferrable
> > > parameters with uci and don't forget to 'exit 0' at the end of script,
> > > in elsecase it'll be run every time at boot ruining changes.
> > >
> > > 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
> > > > Hi,
> > > >
> > > > I am working on Ar71xx openWRT Luci project. By default the Wi-Fi is
> > > > disabled and SSID is OpenWrt. I need to change the default settings.
> > > > Could anyone help me to change the default settings.
> > > >
> > > >
> > > > Best Regards,
> > > > John
> > > >
> > > > _______________________________________________
> > > > openwrt-devel mailing list
> > > > openwrt-devel at lists.openwrt.org
> > > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> > > >
> > > _______________________________________________
> > > openwrt-devel mailing list
> > > openwrt-devel at lists.openwrt.org
> > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> > >
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150802/00f6c9dc/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [OpenWrt-Devel] [PATCH 8/8] CC PowerCloud CR5000 OpenWrt
	configuration
Message-ID: <20150810154128.5127423A1551@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [OpenWrt-Devel] [PATCH 9/9] CC PowerCloud CR5000 OpenWrt
	configuration
Message-ID: <20150811030612.24E5723A1554@danielcent.thecshore.com>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 03:58:17 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:58:17 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] sysupgrade,
	wndr3700/wndr3800: Add allnet safety check
Message-ID: <20150810153011.F2FF723A1534@danielcent.thecshore.com>

This patch may not actually be necessary, but adds the allnet
uboot-envtools safety checks before allow a firmware upgrade to
and Netgear WNDR3700/3800 device.

Note that the Netgear devices already have a hardware id check so
this may be superfulous.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 5 ++++-
 target/linux/ar71xx/generic/profiles/netgear.mk        | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index bc53040..5241752 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -400,7 +400,10 @@ platform_check_image() {
 		}
 		return 0
 		;;
-	wndr3700 | \
+	wndr3700)
+		# Use the new ubootenvtools safety check
+		platform_check_image_allnet "$1" || return 1
+		# Fall through to common wnndr/wnr hardware check
 	wnr2000-v3 | \
 	wnr612-v2 | \
 	wnr1000-v2)
diff --git a/target/linux/ar71xx/generic/profiles/netgear.mk b/target/linux/ar71xx/generic/profiles/netgear.mk
index 16b1087..34067c6 100644
--- a/target/linux/ar71xx/generic/profiles/netgear.mk
+++ b/target/linux/ar71xx/generic/profiles/netgear.mk
@@ -18,7 +18,7 @@ $(eval $(call Profile,WNDAP360))
 
 define Profile/WNDR3700
 	NAME:=NETGEAR WNDR3700/WNDR3800/WNDRMAC
-	PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev kmod-leds-wndr3700-usb
+	PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev kmod-leds-wndr3700-usb uboot-envtools
 endef
 
 define Profile/WNDR3700/Description
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mbastian at netcologne.de  Sun Aug  2 07:15:15 2015
From: mbastian at netcologne.de (Michael Bastian)
Date: Sun, 2 Aug 2015 13:15:15 +0200 (CEST)
Subject: [OpenWrt-Devel] [PATCH] ramips: Fix Ticket #20153 swap radio
 calibration data pointers on the RE6500
In-Reply-To: <1438162407-10674-1-git-send-email-ldpinney@gmail.com>
References: <1438162407-10674-1-git-send-email-ldpinney@gmail.com>
Message-ID: <2115739893.28938.1438514115669.JavaMail.open-xchange@cc-app3.netcologne.de>

I applied this patch against CC r46531 and the signal levels on both bands are now fine.
A bit lower than on my Archer C7(CC RC2) but that was to be expected.

> "L. D. Pinney" <ldpinney at gmail.com> hat am 29. Juli 2015 um 11:33 geschrieben:
> 
> 
> This patch fixes weak radio signal reported by nikola.georgiev
> 
> Signed-off-by: L. D. Pinney <ldpinney at gmail.com>
> ---
> Patch applies to CC as well.
> 
>  target/linux/ramips/dts/RE6500.dts | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ramips/dts/RE6500.dts b/target/linux/ramips/dts/RE6500.dts
> index 0c33994..36d6218 100644
> --- a/target/linux/ramips/dts/RE6500.dts
> +++ b/target/linux/ramips/dts/RE6500.dts
> @@ -69,7 +69,7 @@
>  			mt76 at 0,0 {
>  				reg = <0x0000 0 0 0 0>;
>  				device_type = "pci";
> -				mediatek,mtd-eeprom = <&factory 0x8000>;
> +				mediatek,mtd-eeprom = <&factory 0x0000>;
>  				mediatek,2ghz = <0>;
>  			};
>  		};
> @@ -78,7 +78,7 @@
>  			mt76 at 1,0 {
>  				reg = <0x0000 0 0 0 0>;
>  				device_type = "pci";
> -				mediatek,mtd-eeprom = <&factory 0x0000>;
> +				mediatek,mtd-eeprom = <&factory 0x8000>;
>  				mediatek,5ghz = <0>;
>  			};
>  		};
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  2 07:46:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 07:46:46 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [polarssl] Fix build failures due to
	PKG_NAME != dir name
Message-ID: <20150810153015.371DF23A1534@danielcent.thecshore.com>

Packages that depend on PolarSSL fail to build because polarssl's InstallDev
section never actually gets executed because (prior to this patch) the package
name does not match the subdir the package is in (presumably due to upstream
name change).  As a workaround I have changed the package name back to 
polarssl and used a new variable SRC_PKG_NAME for the purposes of downloading
the upstream tarball and creating PKG_BUILD_DIR.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/libs/polarssl/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/libs/polarssl/Makefile b/package/libs/polarssl/Makefile
index c7e6036..5d5e857 100644
--- a/package/libs/polarssl/Makefile
+++ b/package/libs/polarssl/Makefile
@@ -7,15 +7,18 @@
 
 include $(TOPDIR)/rules.mk
 
-PKG_NAME:=mbedtls
+PKG_NAME:=polarssl
+SRC_PKG_NAME:=mbedtls
 PKG_VERSION:=1.3.11
 PKG_RELEASE:=2
 PKG_USE_MIPS16:=0
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz
+PKG_SOURCE:=$(SRC_PKG_NAME)-$(PKG_VERSION)-gpl.tgz
 PKG_SOURCE_URL:=https://polarssl.org/download/
 PKG_MD5SUM:=c02ce2e54862d678604794ee484fb59e
 
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(SRC_PKG_NAME)-$(PKG_VERSION)
+
 PKG_BUILD_PARALLEL:=1
 PKG_LICENSE:=GPL-2.0+
 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Sun Aug  2 09:19:26 2015
From: kerry9842 at gmail.com (John kerry)
Date: Sun, 2 Aug 2015 21:19:26 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
Message-ID: <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>

Hi Leiten,

I have one issue, after upgrading this firmware it will load wireless
configuration with this changes, actually it should load when i do factory
reset.

Thanks,

On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com> wrote:

> Hi Leiten,
>
> Thank you so much, Its working :)
>
> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com> wrote:
>
>> Hi,
>>
>> Don't answer to my e-mail only, you need to add openwrt-devel maillist to
>> CC or just answer to CC, in each case I'll receive message but also
>> everyone could see all discussion.
>>
>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
>> wrote:
>> > Hi Leiten,
>> >
>> > I have added new files under and written below :
>> > vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>
>> Use index in prefix of filename to set order of execution, so it'll be
>> like '99-wireless'.
>>
>> >
>> > #!/bin/sh
>> > #
>> > # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>> > # Copyright (C) 2011 OpenWrt.org
>> > #
>> >
>> > [ -e /etc/config/wireless ] && exit 0
>>
>> Here is the problem. When uci-defaults invoke scripts there's already
>> preconfiguration done and /etc/config/wireless already exists, so your
>> script just exit at this point. Remove this line.
>>
>> >
>> > touch /etc/config/wireless
>> >
>> > uci set wireless. at wifi-device[0].disabled=0;
>> > uci set system. at system[0].hostname=test_ap
>> > uci set wireless. at wifi-iface[0].mode=ap
>> > uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>> > uci set wireless. at wifi-iface[0].encryption=none
>> > uci set wireless. at wifi-iface[0].wds=1
>> > uci set wireless.radio0.disabled=0
>> >
>> > uci commit wireless
>> >
>> > exit 0
>> >
>> > and compile the source code using make V=s but still not changed default
>> > settings.
>> >
>> > Please help me to make it works.
>> >
>> > Thanks,
>> >
>> >
>> > On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com> wrote:
>> >
>> > > You can also use uci-defaults mechanism for your purpose. Just put
>> > > script in base-files/etc/uci-defaults and set your preferrable
>> > > parameters with uci and don't forget to 'exit 0' at the end of script,
>> > > in elsecase it'll be run every time at boot ruining changes.
>> > >
>> > > 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>> > > > Hi,
>> > > >
>> > > > I am working on Ar71xx openWRT Luci project. By default the Wi-Fi is
>> > > > disabled and SSID is OpenWrt. I need to change the default settings.
>> > > > Could anyone help me to change the default settings.
>> > > >
>> > > >
>> > > > Best Regards,
>> > > > John
>> > > >
>> > > > _______________________________________________
>> > > > openwrt-devel mailing list
>> > > > openwrt-devel at lists.openwrt.org
>> > > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>> > > >
>> > > _______________________________________________
>> > > openwrt-devel mailing list
>> > > openwrt-devel at lists.openwrt.org
>> > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>> > >
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150802/63367f8e/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Sun Aug  2 10:34:17 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 10:34:17 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [kernel] Fix kmod-v4l2 modules have
 missing symbols due to lack of clk support
Message-ID: <20150810153018.6240123A1534@danielcent.thecshore.com>

The v4l kernel modules fail to compile on latest kernels due to a new
dependency on a clock source.  Since most routers won't have a suitable
clock source, I have added a kernel config option that omits the functionality
that requires the clock source.  

That means v4l modules in OpenWrt can't support DV devices (DV requires
the clock source support) but unless clock source support was addded to
OpenWrt the other alternative is to drop v4l altogether).

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/kernel/linux/modules/video.mk              |   3 +-
 ...avoid-clk-for-devices-that-do-not-need-it.patch | 348 +++++++++++++++++++++
 2 files changed, 350 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch

diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk
index 3b06a14..ba99c3c 100644
--- a/package/kernel/linux/modules/video.mk
+++ b/package/kernel/linux/modules/video.mk
@@ -92,7 +92,8 @@ define KernelPackage/video-core
 	CONFIG_V4L_USB_DRIVERS=y \
 	CONFIG_V4L_PCI_DRIVERS=y \
 	CONFIG_V4L_PLATFORM_DRIVERS=y \
-	CONFIG_V4L_ISA_PARPORT_DRIVERS=y
+	CONFIG_V4L_ISA_PARPORT_DRIVERS=y \
+	CONFIG_VIDEO_V4L2_DV_SUPPORT=n
   FILES:= \
 	$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-common.ko \
 	$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videodev.ko
diff --git a/target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch b/target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch
new file mode 100644
index 0000000..6d84adf
--- /dev/null
+++ b/target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch
@@ -0,0 +1,348 @@
+Index: linux-4.1.3/drivers/media/i2c/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/i2c/Kconfig
++++ linux-4.1.3/drivers/media/i2c/Kconfig
+@@ -196,7 +196,7 @@ config VIDEO_ADV7183
+ 
+ config VIDEO_ADV7604
+ 	tristate "Analog Devices ADV7604 decoder"
+-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Analog Devices ADV7604 video decoder.
+ 
+@@ -208,7 +208,7 @@ config VIDEO_ADV7604
+ 
+ config VIDEO_ADV7842
+ 	tristate "Analog Devices ADV7842 decoder"
+-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && VIDEO_V4L2_DV_SUPPORT
+ 	select HDMI
+ 	---help---
+ 	  Support for the Analog Devices ADV7842 video decoder.
+@@ -306,7 +306,7 @@ config VIDEO_TVP5150
+ 	  module will be called tvp5150.
+ 
+ config VIDEO_TVP7002
+ 	tristate "Texas Instruments TVP7002 video decoder"
+-	depends on VIDEO_V4L2 && I2C
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Texas Instruments TVP7002 video decoder.
+@@ -423,7 +423,7 @@ config VIDEO_ADV7393
+ 
+ config VIDEO_ADV7511
+ 	tristate "Analog Devices ADV7511 encoder"
+-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Analog Devices ADV7511 video encoder.
+ 
+@@ -434,7 +434,7 @@ config VIDEO_ADV7511
+ 
+ config VIDEO_AD9389B
+ 	tristate "Analog Devices AD9389B encoder"
+-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Analog Devices AD9389B video encoder.
+ 
+@@ -451,7 +451,7 @@ config VIDEO_AK881X
+ 
+ config VIDEO_THS8200
+ 	tristate "Texas Instruments THS8200 video encoder"
+-	depends on VIDEO_V4L2 && I2C
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Texas Instruments THS8200 video encoder.
+ 
+@@ -692,7 +692,7 @@ comment "Miscellaneous helper chips"
+ 
+ config VIDEO_THS7303
+ 	tristate "THS7303/53 Video Amplifier"
+-	depends on VIDEO_V4L2 && I2C
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	help
+ 	  Support for TI THS7303/53 video amplifier
+ 
+Index: linux-4.1.3/drivers/media/platform/blackfin/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/platform/blackfin/Kconfig
++++ linux-4.1.3/drivers/media/platform/blackfin/Kconfig
+@@ -1,6 +1,6 @@
+ config VIDEO_BLACKFIN_CAPTURE
+ 	tristate "Blackfin Video Capture Driver"
+-	depends on VIDEO_V4L2 && BLACKFIN && I2C
++	depends on VIDEO_V4L2 && BLACKFIN && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+ 	help
+Index: linux-4.1.3/drivers/media/platform/davinci/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/platform/davinci/Kconfig
++++ linux-4.1.3/drivers/media/platform/davinci/Kconfig
+@@ -1,6 +1,6 @@
+ config VIDEO_DAVINCI_VPIF_DISPLAY
+ 	tristate "TI DaVinci VPIF V4L2-Display driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on ARCH_DAVINCI || COMPILE_TEST
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+@@ -16,7 +16,7 @@ config VIDEO_DAVINCI_VPIF_DISPLAY
+ 
+ config VIDEO_DAVINCI_VPIF_CAPTURE
+ 	tristate "TI DaVinci VPIF video capture driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on ARCH_DAVINCI || COMPILE_TEST
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+@@ -30,7 +30,7 @@ config VIDEO_DAVINCI_VPIF_CAPTURE
+ 
+ config VIDEO_DM6446_CCDC
+ 	tristate "TI DM6446 CCDC video capture driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on ARCH_DAVINCI || COMPILE_TEST
+ 	depends on HAS_DMA
+ 	select VIDEOBUF_DMA_CONTIG
+@@ -46,7 +46,7 @@ config VIDEO_DM6446_CCDC
+ 
+ config VIDEO_DM355_CCDC
+ 	tristate "TI DM355 CCDC video capture driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on ARCH_DAVINCI || COMPILE_TEST
+ 	depends on HAS_DMA
+ 	select VIDEOBUF_DMA_CONTIG
+@@ -62,7 +62,7 @@ config VIDEO_DM355_CCDC
+ 
+ config VIDEO_DM365_ISIF
+ 	tristate "TI DM365 ISIF video capture driver"
+-	depends on VIDEO_V4L2 && ARCH_DAVINCI
++	depends on VIDEO_V4L2 && ARCH_DAVINCI && VIDEO_V4L2_DV_SUPPORT
+ 	depends on HAS_DMA
+ 	select VIDEOBUF_DMA_CONTIG
+ 	help
+@@ -75,7 +75,7 @@ config VIDEO_DM365_ISIF
+ 
+ config VIDEO_DAVINCI_VPBE_DISPLAY
+ 	tristate "TI DaVinci VPBE V4L2-Display driver"
+-	depends on VIDEO_V4L2 && ARCH_DAVINCI
++	depends on VIDEO_V4L2 && ARCH_DAVINCI && VIDEO_V4L2_DV_SUPPORT
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+ 	help
+Index: linux-4.1.3/drivers/media/platform/s5p-tv/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/platform/s5p-tv/Kconfig
++++ linux-4.1.3/drivers/media/platform/s5p-tv/Kconfig
+@@ -19,7 +19,7 @@ if VIDEO_SAMSUNG_S5P_TV
+ 
+ config VIDEO_SAMSUNG_S5P_HDMI
+ 	tristate "Samsung HDMI Driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on I2C
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	select VIDEO_SAMSUNG_S5P_HDMIPHY
+@@ -39,7 +39,7 @@ config VIDEO_SAMSUNG_S5P_HDMI_DEBUG
+ 
+ config VIDEO_SAMSUNG_S5P_HDMIPHY
+ 	tristate "Samsung HDMIPHY Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2 && I2C
++	depends on VIDEO_DEV && VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	help
+ 	  Say Y here if you want support for the physical HDMI
+@@ -49,7 +49,7 @@ config VIDEO_SAMSUNG_S5P_HDMIPHY
+ 
+ config VIDEO_SAMSUNG_S5P_SII9234
+ 	tristate "Samsung SII9234 Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2 && I2C
++	depends on VIDEO_DEV && VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	help
+ 	  Say Y here if you want support for the MHL interface
+@@ -59,7 +59,7 @@ config VIDEO_SAMSUNG_S5P_SII9234
+ 
+ config VIDEO_SAMSUNG_S5P_SDO
+ 	tristate "Samsung Analog TV Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2
++	depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	help
+ 	  Say Y here if you want support for the analog TV output
+@@ -70,7 +70,7 @@ config VIDEO_SAMSUNG_S5P_SDO
+ 
+ config VIDEO_SAMSUNG_S5P_MIXER
+ 	tristate "Samsung Mixer and Video Processor Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2
++	depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+Index: linux-4.1.3/drivers/media/platform/vivid/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/platform/vivid/Kconfig
++++ linux-4.1.3/drivers/media/platform/vivid/Kconfig
+@@ -1,6 +1,6 @@
+ config VIDEO_VIVID
+ 	tristate "Virtual Video Test Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64 && FB
++	depends on VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64 && FB && VIDEO_V4L2_DV_SUPPORT
+ 	select FONT_SUPPORT
+ 	select FONT_8x16
+ 	select FB_CFB_FILLRECT
+Index: linux-4.1.3/drivers/media/usb/hdpvr/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/usb/hdpvr/Kconfig
++++ linux-4.1.3/drivers/media/usb/hdpvr/Kconfig
+@@ -1,7 +1,7 @@
+ 
+ config VIDEO_HDPVR
+ 	tristate "Hauppauge HD PVR support"
+-	depends on VIDEO_DEV && VIDEO_V4L2
++	depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  This is a video4linux driver for Hauppauge's HD PVR USB device.
+ 
+Index: linux-4.1.3/drivers/media/v4l2-core/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/Kconfig
++++ linux-4.1.3/drivers/media/v4l2-core/Kconfig
+@@ -8,6 +8,11 @@ config VIDEO_V4L2
+ 	depends on (I2C || I2C=n) && VIDEO_DEV
+ 	default (I2C || I2C=n) && VIDEO_DEV
+ 
++config VIDEO_V4L2_DV_SUPPORT
++	bool "Enable support for DV devices"
++	depends on VIDEO_V4L2
++	default y
++
+ config VIDEO_ADV_DEBUG
+ 	bool "Enable advanced debug functionality on V4L2 drivers"
+ 	default n
+@@ -96,3 +101,4 @@ config VIDEOBUF2_DMA_SG
+ config VIDEOBUF2_DVB
+ 	tristate
+ 	select VIDEOBUF2_CORE
++	depends on VIDEO_V4L2_DV_SUPPORT
+Index: linux-4.1.3/drivers/media/v4l2-core/Makefile
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/Makefile
++++ linux-4.1.3/drivers/media/v4l2-core/Makefile
+@@ -5,18 +5,21 @@
+ tuner-objs	:=	tuner-core.o
+ 
+ videodev-objs	:=	v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \
+-			v4l2-event.o v4l2-ctrls.o v4l2-subdev.o v4l2-clk.o \
++			v4l2-event.o v4l2-ctrls.o v4l2-subdev.o \
+ 			v4l2-async.o
+ ifeq ($(CONFIG_COMPAT),y)
+   videodev-objs += v4l2-compat-ioctl32.o
+ endif
+ ifeq ($(CONFIG_OF),y)
+-  videodev-objs += v4l2-of.o
++  videodev-objs += v4l2-of.o v4l2-clk.o
+ endif
+ 
+ obj-$(CONFIG_VIDEO_V4L2) += videodev.o
+ obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
+-obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
++
++ifeq ($(CONFIG_VIDEO_V4L2_DV_SUPPORT),y)
++obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o v4l2-clk.o
++endif
+ 
+ obj-$(CONFIG_VIDEO_TUNER) += tuner.o
+ 
+Index: linux-4.1.3/drivers/media/v4l2-core/v4l2-dev.c
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/v4l2-dev.c
++++ linux-4.1.3/drivers/media/v4l2-core/v4l2-dev.c
+@@ -676,7 +676,9 @@ static void determine_valid_ioctls(struc
+ 			SET_VALID_IOCTL(ops, VIDIOC_ENUMAUDIO, vidioc_enumaudio);
+ 			SET_VALID_IOCTL(ops, VIDIOC_G_AUDIO, vidioc_g_audio);
+ 			SET_VALID_IOCTL(ops, VIDIOC_S_AUDIO, vidioc_s_audio);
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 			SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_TIMINGS, vidioc_query_dv_timings);
++#endif
+ 			SET_VALID_IOCTL(ops, VIDIOC_S_EDID, vidioc_s_edid);
+ 		}
+ 		if (is_tx) {
+@@ -691,10 +693,12 @@ static void determine_valid_ioctls(struc
+ 					ops->vidioc_g_std))
+ 			set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls);
+ 		SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm);
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 		SET_VALID_IOCTL(ops, VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings);
+ 		SET_VALID_IOCTL(ops, VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings);
+ 		SET_VALID_IOCTL(ops, VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings);
+ 		SET_VALID_IOCTL(ops, VIDIOC_DV_TIMINGS_CAP, vidioc_dv_timings_cap);
++#endif
+ 		SET_VALID_IOCTL(ops, VIDIOC_G_EDID, vidioc_g_edid);
+ 	}
+ 	if (is_tx && (is_radio || is_sdr)) {
+Index: linux-4.1.3/drivers/media/v4l2-core/v4l2-ioctl.c
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/v4l2-ioctl.c
++++ linux-4.1.3/drivers/media/v4l2-core/v4l2-ioctl.c
+@@ -676,6 +676,7 @@ static void v4l_print_dbg_register(const
+ 			p->reg, p->val);
+ }
+ 
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ static void v4l_print_dv_timings(const void *arg, bool write_only)
+ {
+ 	const struct v4l2_dv_timings *p = arg;
+@@ -731,6 +732,7 @@ static void v4l_print_dv_timings_cap(con
+ 		break;
+ 	}
+ }
++#endif
+ 
+ static void v4l_print_frmsizeenum(const void *arg, bool write_only)
+ {
+@@ -2257,16 +2259,20 @@ static struct v4l2_ioctl_info v4l2_ioctl
+ 	IOCTL_INFO_FNC(VIDIOC_DBG_S_REGISTER, v4l_dbg_s_register, v4l_print_dbg_register, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_DBG_G_REGISTER, v4l_dbg_g_register, v4l_print_dbg_register, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_S_HW_FREQ_SEEK, v4l_s_hw_freq_seek, v4l_print_hw_freq_seek, INFO_FL_PRIO),
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 	IOCTL_INFO_STD(VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings, v4l_print_dv_timings, INFO_FL_PRIO),
+ 	IOCTL_INFO_STD(VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings, v4l_print_dv_timings, 0),
++#endif
+ 	IOCTL_INFO_FNC(VIDIOC_DQEVENT, v4l_dqevent, v4l_print_event, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_SUBSCRIBE_EVENT, v4l_subscribe_event, v4l_print_event_subscription, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_UNSUBSCRIBE_EVENT, v4l_unsubscribe_event, v4l_print_event_subscription, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_CREATE_BUFS, v4l_create_bufs, v4l_print_create_buffers, INFO_FL_PRIO | INFO_FL_QUEUE),
+ 	IOCTL_INFO_FNC(VIDIOC_PREPARE_BUF, v4l_prepare_buf, v4l_print_buffer, INFO_FL_QUEUE),
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 	IOCTL_INFO_STD(VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings, v4l_print_enum_dv_timings, 0),
+ 	IOCTL_INFO_STD(VIDIOC_QUERY_DV_TIMINGS, vidioc_query_dv_timings, v4l_print_dv_timings, 0),
+ 	IOCTL_INFO_STD(VIDIOC_DV_TIMINGS_CAP, vidioc_dv_timings_cap, v4l_print_dv_timings_cap, INFO_FL_CLEAR(v4l2_dv_timings_cap, type)),
++#endif
+ 	IOCTL_INFO_FNC(VIDIOC_ENUM_FREQ_BANDS, v4l_enum_freq_bands, v4l_print_freq_band, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_DBG_G_CHIP_INFO, v4l_dbg_g_chip_info, v4l_print_dbg_chip_info, INFO_FL_CLEAR(v4l2_dbg_chip_info, match)),
+ 	IOCTL_INFO_FNC(VIDIOC_QUERY_EXT_CTRL, v4l_query_ext_ctrl, v4l_print_query_ext_ctrl, INFO_FL_CTRL | INFO_FL_CLEAR(v4l2_query_ext_ctrl, id)),
+Index: linux-4.1.3/drivers/media/v4l2-core/v4l2-subdev.c
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/v4l2-subdev.c
++++ linux-4.1.3/drivers/media/v4l2-core/v4l2-subdev.c
+@@ -419,6 +419,7 @@ static long subdev_do_ioctl(struct file
+ 		return v4l2_subdev_call(sd, pad, set_edid, edid);
+ 	}
+ 
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 	case VIDIOC_SUBDEV_DV_TIMINGS_CAP: {
+ 		struct v4l2_dv_timings_cap *cap = arg;
+ 
+@@ -446,6 +447,7 @@ static long subdev_do_ioctl(struct file
+ 	case VIDIOC_SUBDEV_S_DV_TIMINGS:
+ 		return v4l2_subdev_call(sd, video, s_dv_timings, arg);
+ #endif
++#endif
+ 	default:
+ 		return v4l2_subdev_call(sd, core, ioctl, cmd, arg);
+ 	}
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Sun Aug  2 12:19:04 2015
From: kerry9842 at gmail.com (John kerry)
Date: Mon, 3 Aug 2015 00:19:04 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
Message-ID: <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>

Hi,

I am using below uci script,

vi target/linux/ar71xx/base-files/etc/uci-defaults/99-wireless

#copyright (c) 2013 The Linux Foundation. All rights reserved.
# Copyright (C) 2011 OpenWrt.org
#


touch /etc/config/wireless

uci set wireless. at wifi-device[0].disabled=0;
uci set system. at system[0].hostname=OpenWrt
uci set wireless. at wifi-iface[0].mode=ap
uci set wireless. at wifi-iface[0].ssid=Home_plug_1
uci set wireless. at wifi-iface[0].encryption=wpa2
uci set wireless. at wifi-iface[0].key="Home_plug_1"
#uci set wireless.radio0.disabled=0

uci set wireless. at wifi-device[1].disabled=0;
uci set wireless. at wifi-iface[1].mode=ap
uci set wireless. at wifi-iface[1].ssid=Home_plug_2
uci set wireless. at wifi-iface[1].encryption=wpa2
uci set wireless. at wifi-iface[1].key="Home_plug_2"
#uci set wireless.radio0.disabled=0


uci commit wireless

exit 0

The default SSID is working but not able to set encryption type and key.

Thanks,


On Sun, Aug 2, 2015 at 9:19 PM, John kerry <kerry9842 at gmail.com> wrote:

> Hi Leiten,
>
> I have one issue, after upgrading this firmware it will load wireless
> configuration with this changes, actually it should load when i do factory
> reset.
>
> Thanks,
>
> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com> wrote:
>
>> Hi Leiten,
>>
>> Thank you so much, Its working :)
>>
>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Don't answer to my e-mail only, you need to add openwrt-devel maillist
>>> to CC or just answer to CC, in each case I'll receive message but also
>>> everyone could see all discussion.
>>>
>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
>>> wrote:
>>> > Hi Leiten,
>>> >
>>> > I have added new files under and written below :
>>> > vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>
>>> Use index in prefix of filename to set order of execution, so it'll be
>>> like '99-wireless'.
>>>
>>> >
>>> > #!/bin/sh
>>> > #
>>> > # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>> > # Copyright (C) 2011 OpenWrt.org
>>> > #
>>> >
>>> > [ -e /etc/config/wireless ] && exit 0
>>>
>>> Here is the problem. When uci-defaults invoke scripts there's already
>>> preconfiguration done and /etc/config/wireless already exists, so your
>>> script just exit at this point. Remove this line.
>>>
>>> >
>>> > touch /etc/config/wireless
>>> >
>>> > uci set wireless. at wifi-device[0].disabled=0;
>>> > uci set system. at system[0].hostname=test_ap
>>> > uci set wireless. at wifi-iface[0].mode=ap
>>> > uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>> > uci set wireless. at wifi-iface[0].encryption=none
>>> > uci set wireless. at wifi-iface[0].wds=1
>>> > uci set wireless.radio0.disabled=0
>>> >
>>> > uci commit wireless
>>> >
>>> > exit 0
>>> >
>>> > and compile the source code using make V=s but still not changed
>>> default
>>> > settings.
>>> >
>>> > Please help me to make it works.
>>> >
>>> > Thanks,
>>> >
>>> >
>>> > On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>> >
>>> > > You can also use uci-defaults mechanism for your purpose. Just put
>>> > > script in base-files/etc/uci-defaults and set your preferrable
>>> > > parameters with uci and don't forget to 'exit 0' at the end of
>>> script,
>>> > > in elsecase it'll be run every time at boot ruining changes.
>>> > >
>>> > > 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>> > > > Hi,
>>> > > >
>>> > > > I am working on Ar71xx openWRT Luci project. By default the Wi-Fi
>>> is
>>> > > > disabled and SSID is OpenWrt. I need to change the default
>>> settings.
>>> > > > Could anyone help me to change the default settings.
>>> > > >
>>> > > >
>>> > > > Best Regards,
>>> > > > John
>>> > > >
>>> > > > _______________________________________________
>>> > > > openwrt-devel mailing list
>>> > > > openwrt-devel at lists.openwrt.org
>>> > > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>> > > >
>>> > > _______________________________________________
>>> > > openwrt-devel mailing list
>>> > > openwrt-devel at lists.openwrt.org
>>> > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>> > >
>>> _______________________________________________
>>> openwrt-devel mailing list
>>> openwrt-devel at lists.openwrt.org
>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150803/cefb4e39/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From weedy2887 at gmail.com  Sun Aug  2 12:22:53 2015
From: weedy2887 at gmail.com (Weedy)
Date: Sun, 2 Aug 2015 12:22:53 -0400
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>
Message-ID: <CAFE24U1bA6Cn8DVwU2muJQp1SLrG_M-UxbCq5yz2UeFs9+xBMQ@mail.gmail.com>

On 2 Aug 2015 12:19, "John kerry" <kerry9842 at gmail.com> wrote:
>
> Hi,
>
> I am using below uci script,
>
> vi target/linux/ar71xx/base-files/etc/uci-defaults/99-wireless

If you're building images yourself you might like to use files/ instead.

<svn checkout>/files/etc/config/wireless

You can dump any file you want in the finished image in there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150802/188864ec/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Sun Aug  2 12:34:56 2015
From: kerry9842 at gmail.com (John kerry)
Date: Mon, 3 Aug 2015 00:34:56 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAFE24U1bA6Cn8DVwU2muJQp1SLrG_M-UxbCq5yz2UeFs9+xBMQ@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>
 <CAFE24U1bA6Cn8DVwU2muJQp1SLrG_M-UxbCq5yz2UeFs9+xBMQ@mail.gmail.com>
Message-ID: <CAGUNxBGOSi9=bZ0zP0gdzsHmjx=cgV1uobWzj8N9+=NVLgJ7CA@mail.gmail.com>

Hi,

Sorry i didn't get, you mean to say i should not add files under

vi target/linux/ar71xx/base-files/etc/uci-defaults/99-wireless

Could you please explain.



On Mon, Aug 3, 2015 at 12:22 AM, Weedy <weedy2887 at gmail.com> wrote:

>
> On 2 Aug 2015 12:19, "John kerry" <kerry9842 at gmail.com> wrote:
> >
> > Hi,
> >
> > I am using below uci script,
> >
> > vi target/linux/ar71xx/base-files/etc/uci-defaults/99-wireless
>
> If you're building images yourself you might like to use files/ instead.
>
> <svn checkout>/files/etc/config/wireless
>
> You can dump any file you want in the finished image in there.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150803/4e4bce49/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From weedy2887 at gmail.com  Sun Aug  2 12:38:21 2015
From: weedy2887 at gmail.com (Weedy)
Date: Sun, 2 Aug 2015 12:38:21 -0400
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBGOSi9=bZ0zP0gdzsHmjx=cgV1uobWzj8N9+=NVLgJ7CA@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>
 <CAFE24U1bA6Cn8DVwU2muJQp1SLrG_M-UxbCq5yz2UeFs9+xBMQ@mail.gmail.com>
 <CAGUNxBGOSi9=bZ0zP0gdzsHmjx=cgV1uobWzj8N9+=NVLgJ7CA@mail.gmail.com>
Message-ID: <CAFE24U2nROJiDUZQ+hGixO09_qsK04gzGZK1PypMkm3zy1MD5A@mail.gmail.com>

You seem to be having problems using uci-defaults. So forget that.

Copy the running/working/complete config file from your device into
files/etc/config/wireless.
You need to make the files directory. You can put anything in there.

weedy at HAF ~/projects/openwrt $ ls -al files/etc/config/
total 60
drwxr-xr-x 2 weedy weedy 4096 Jul 13 23:05 .
drwxr-xr-x 8 weedy weedy 4096 Jul 31 00:35 ..
-rw-r--r-- 1 weedy weedy  138 Jul 13 23:05 darkstat
-rw-r--r-- 1 weedy weedy  441 Jul 13 23:05 ddns
-rw-r--r-- 1 weedy weedy 1204 Jul 30 22:48 dhcp
-rw-r--r-- 1 weedy weedy  119 Jul 13 23:05 dropbear
-rw-r--r-- 1 weedy weedy 4290 Jul 13 23:05 firewall
-rw-r--r-- 1 weedy weedy   38 Jun 11  2013 netcheck
-rw-r--r-- 1 weedy weedy 1059 Jul 13 23:05 network
-rw-r--r-- 1 weedy weedy 1821 Jun 30 21:04 qos
-rw-r--r-- 1 weedy weedy  761 Jul 13 23:05 system
-rw-r--r-- 1 weedy weedy 2165 Jul 13 23:05 uhttpd
-rw-r--r-- 1 weedy weedy  639 Jul 13 23:05 upnpd
-rw-r--r-- 1 weedy weedy 1353 Jul 13 23:05 wireless
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Sun Aug  2 12:56:18 2015
From: kerry9842 at gmail.com (John kerry)
Date: Mon, 3 Aug 2015 00:56:18 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAFE24U2nROJiDUZQ+hGixO09_qsK04gzGZK1PypMkm3zy1MD5A@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>
 <CAFE24U1bA6Cn8DVwU2muJQp1SLrG_M-UxbCq5yz2UeFs9+xBMQ@mail.gmail.com>
 <CAGUNxBGOSi9=bZ0zP0gdzsHmjx=cgV1uobWzj8N9+=NVLgJ7CA@mail.gmail.com>
 <CAFE24U2nROJiDUZQ+hGixO09_qsK04gzGZK1PypMkm3zy1MD5A@mail.gmail.com>
Message-ID: <CAGUNxBHZsVS81a6MPLX2+ALGMLKWqFvdCWAuqQmr_8DEdoZdag@mail.gmail.com>

Hi,

so i created directory as below  and copy the following files

root at OpenWrt:/# ls -al files/etc/config/
drwxr-xr-x    2 root     root             0 Jul 30 18:42 .
drwxr-xr-x    3 root     root             0 Jul 30 18:35 ..
-rw-r--r--    1 root     root          4045 Jul 30 18:42 ddns
-rw-r--r--    1 root     root           885 Jul 30 18:41 dhcp
-rw-r--r--    1 root     root          2148 Jul 30 18:41 firewall
-rw-r--r--    1 root     root           763 Jul 30 18:41 network
-rw-r--r--    1 root     root           646 Jul 30 18:42 upnpd
-rw-r--r--    1 root     root           718 Jul 30 18:36 wireless

but how i will link this into building image.




2015-08-03 0:38 GMT+08:00 Weedy <weedy2887 at gmail.com>:

> You seem to be having problems using uci-defaults. So forget that.
>
> Copy the running/working/complete config file from your device into
> files/etc/config/wireless.
> You need to make the files directory. You can put anything in there.
>
> weedy at HAF ~/projects/openwrt $ ls -al files/etc/config/
> total 60
> drwxr-xr-x 2 weedy weedy 4096 Jul 13 23:05 .
> drwxr-xr-x 8 weedy weedy 4096 Jul 31 00:35 ..
> -rw-r--r-- 1 weedy weedy  138 Jul 13 23:05 darkstat
> -rw-r--r-- 1 weedy weedy  441 Jul 13 23:05 ddns
> -rw-r--r-- 1 weedy weedy 1204 Jul 30 22:48 dhcp
> -rw-r--r-- 1 weedy weedy  119 Jul 13 23:05 dropbear
> -rw-r--r-- 1 weedy weedy 4290 Jul 13 23:05 firewall
> -rw-r--r-- 1 weedy weedy   38 Jun 11  2013 netcheck
> -rw-r--r-- 1 weedy weedy 1059 Jul 13 23:05 network
> -rw-r--r-- 1 weedy weedy 1821 Jun 30 21:04 qos
> -rw-r--r-- 1 weedy weedy  761 Jul 13 23:05 system
> -rw-r--r-- 1 weedy weedy 2165 Jul 13 23:05 uhttpd
> -rw-r--r-- 1 weedy weedy  639 Jul 13 23:05 upnpd
> -rw-r--r-- 1 weedy weedy 1353 Jul 13 23:05 wireless
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150803/d164d00a/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From weedy2887 at gmail.com  Sun Aug  2 12:58:26 2015
From: weedy2887 at gmail.com (Weedy)
Date: Sun, 2 Aug 2015 12:58:26 -0400
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBHZsVS81a6MPLX2+ALGMLKWqFvdCWAuqQmr_8DEdoZdag@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>
 <CAFE24U1bA6Cn8DVwU2muJQp1SLrG_M-UxbCq5yz2UeFs9+xBMQ@mail.gmail.com>
 <CAGUNxBGOSi9=bZ0zP0gdzsHmjx=cgV1uobWzj8N9+=NVLgJ7CA@mail.gmail.com>
 <CAFE24U2nROJiDUZQ+hGixO09_qsK04gzGZK1PypMkm3zy1MD5A@mail.gmail.com>
 <CAGUNxBHZsVS81a6MPLX2+ALGMLKWqFvdCWAuqQmr_8DEdoZdag@mail.gmail.com>
Message-ID: <CAFE24U2hQ_UUQnsX1VrV+xbAXD-=0oE7aFUW3UqPh4fSD5fAvQ@mail.gmail.com>

make

On Sun, Aug 2, 2015 at 12:56 PM, John kerry <kerry9842 at gmail.com> wrote:
> Hi,
>
> so i created directory as below  and copy the following files
>
> root at OpenWrt:/# ls -al files/etc/config/
> drwxr-xr-x    2 root     root             0 Jul 30 18:42 .
> drwxr-xr-x    3 root     root             0 Jul 30 18:35 ..
> -rw-r--r--    1 root     root          4045 Jul 30 18:42 ddns
> -rw-r--r--    1 root     root           885 Jul 30 18:41 dhcp
> -rw-r--r--    1 root     root          2148 Jul 30 18:41 firewall
> -rw-r--r--    1 root     root           763 Jul 30 18:41 network
> -rw-r--r--    1 root     root           646 Jul 30 18:42 upnpd
> -rw-r--r--    1 root     root           718 Jul 30 18:36 wireless
>
> but how i will link this into building image.
>
>
>
>
> 2015-08-03 0:38 GMT+08:00 Weedy <weedy2887 at gmail.com>:
>>
>> You seem to be having problems using uci-defaults. So forget that.
>>
>> Copy the running/working/complete config file from your device into
>> files/etc/config/wireless.
>> You need to make the files directory. You can put anything in there.
>>
>> weedy at HAF ~/projects/openwrt $ ls -al files/etc/config/
>> total 60
>> drwxr-xr-x 2 weedy weedy 4096 Jul 13 23:05 .
>> drwxr-xr-x 8 weedy weedy 4096 Jul 31 00:35 ..
>> -rw-r--r-- 1 weedy weedy  138 Jul 13 23:05 darkstat
>> -rw-r--r-- 1 weedy weedy  441 Jul 13 23:05 ddns
>> -rw-r--r-- 1 weedy weedy 1204 Jul 30 22:48 dhcp
>> -rw-r--r-- 1 weedy weedy  119 Jul 13 23:05 dropbear
>> -rw-r--r-- 1 weedy weedy 4290 Jul 13 23:05 firewall
>> -rw-r--r-- 1 weedy weedy   38 Jun 11  2013 netcheck
>> -rw-r--r-- 1 weedy weedy 1059 Jul 13 23:05 network
>> -rw-r--r-- 1 weedy weedy 1821 Jun 30 21:04 qos
>> -rw-r--r-- 1 weedy weedy  761 Jul 13 23:05 system
>> -rw-r--r-- 1 weedy weedy 2165 Jul 13 23:05 uhttpd
>> -rw-r--r-- 1 weedy weedy  639 Jul 13 23:05 upnpd
>> -rw-r--r-- 1 weedy weedy 1353 Jul 13 23:05 wireless
>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Sun Aug  2 13:07:42 2015
From: kerry9842 at gmail.com (John kerry)
Date: Mon, 3 Aug 2015 01:07:42 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAFE24U2hQ_UUQnsX1VrV+xbAXD-=0oE7aFUW3UqPh4fSD5fAvQ@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>
 <CAFE24U1bA6Cn8DVwU2muJQp1SLrG_M-UxbCq5yz2UeFs9+xBMQ@mail.gmail.com>
 <CAGUNxBGOSi9=bZ0zP0gdzsHmjx=cgV1uobWzj8N9+=NVLgJ7CA@mail.gmail.com>
 <CAFE24U2nROJiDUZQ+hGixO09_qsK04gzGZK1PypMkm3zy1MD5A@mail.gmail.com>
 <CAGUNxBHZsVS81a6MPLX2+ALGMLKWqFvdCWAuqQmr_8DEdoZdag@mail.gmail.com>
 <CAFE24U2hQ_UUQnsX1VrV+xbAXD-=0oE7aFUW3UqPh4fSD5fAvQ@mail.gmail.com>
Message-ID: <CAGUNxBFZV2HJfCssVfX2BAc2WzH6u7-rUOmkca_K5L0VR0Nd8g@mail.gmail.com>

Hi,

See that i created files in console,

The main source code there is path :

package/base-files/files/etc/config/

under this now already two files are there, but if i see in console under
/etc/config it shows
rwxrwxr-x    1 root     root             0 Jan  1  1970 .
drwxrwxr-x    1 root     root             0 Jul 30 18:33 ..
-rw-rw-r--    1 root     root          4045 Jul 30 16:47 ddns
-rw-r--r--    1 root     root           885 Jul 30 18:08 dhcp
-rw-r--r--    1 root     root          1642 Jul 30  2015 dhcp6c
-rw-r--r--    1 root     root           134 Jul 30 18:09 dropbear
-rw-r--r--    1 root     root          2148 Jul 30 18:33 firewall
-rw-r--r--    1 root     root           645 Jul 30 18:33 luci
-rw-r--r--    1 root     root           131 Jul 30 18:44 mcproxy
-rw-r--r--    1 root     root           763 Jul 30 18:33 network
-rw-rw-r--    1 root     root            89 Jul 30 16:47 pppoe
-rw-rw-r--    1 root     root          1773 Jul 30 16:47 qos
-rw-r--r--    1 root     root           652 Jul 30 18:49 radvd
-rw-r--r--    1 root     root           324 Jul 30 18:49 ripd
-rw-r--r--    1 root     root             0 Jul 30 18:33 sound
-rw-rw-r--    1 root     root           407 Jul 30 18:33 system
-rw-r--r--    1 root     root           128 Jul 30 18:33 ubootenv
-rw-r--r--    1 root     root           680 Jul 30 18:33 ucitrack
-rw-r--r--    1 root     root          2408 Jul 30 18:23 uhttpd
-rw-r--r--    1 root     root           646 Jul 30 18:33 upnpd

I am not getting where to create new directory and add this files.

Sorry I am totally new in this, It may be silly question please guide me.

Thanks,

On Mon, Aug 3, 2015 at 12:58 AM, Weedy <weedy2887 at gmail.com> wrote:

> make
>
> On Sun, Aug 2, 2015 at 12:56 PM, John kerry <kerry9842 at gmail.com> wrote:
> > Hi,
> >
> > so i created directory as below  and copy the following files
> >
> > root at OpenWrt:/# ls -al files/etc/config/
> > drwxr-xr-x    2 root     root             0 Jul 30 18:42 .
> > drwxr-xr-x    3 root     root             0 Jul 30 18:35 ..
> > -rw-r--r--    1 root     root          4045 Jul 30 18:42 ddns
> > -rw-r--r--    1 root     root           885 Jul 30 18:41 dhcp
> > -rw-r--r--    1 root     root          2148 Jul 30 18:41 firewall
> > -rw-r--r--    1 root     root           763 Jul 30 18:41 network
> > -rw-r--r--    1 root     root           646 Jul 30 18:42 upnpd
> > -rw-r--r--    1 root     root           718 Jul 30 18:36 wireless
> >
> > but how i will link this into building image.
> >
> >
> >
> >
> > 2015-08-03 0:38 GMT+08:00 Weedy <weedy2887 at gmail.com>:
> >>
> >> You seem to be having problems using uci-defaults. So forget that.
> >>
> >> Copy the running/working/complete config file from your device into
> >> files/etc/config/wireless.
> >> You need to make the files directory. You can put anything in there.
> >>
> >> weedy at HAF ~/projects/openwrt $ ls -al files/etc/config/
> >> total 60
> >> drwxr-xr-x 2 weedy weedy 4096 Jul 13 23:05 .
> >> drwxr-xr-x 8 weedy weedy 4096 Jul 31 00:35 ..
> >> -rw-r--r-- 1 weedy weedy  138 Jul 13 23:05 darkstat
> >> -rw-r--r-- 1 weedy weedy  441 Jul 13 23:05 ddns
> >> -rw-r--r-- 1 weedy weedy 1204 Jul 30 22:48 dhcp
> >> -rw-r--r-- 1 weedy weedy  119 Jul 13 23:05 dropbear
> >> -rw-r--r-- 1 weedy weedy 4290 Jul 13 23:05 firewall
> >> -rw-r--r-- 1 weedy weedy   38 Jun 11  2013 netcheck
> >> -rw-r--r-- 1 weedy weedy 1059 Jul 13 23:05 network
> >> -rw-r--r-- 1 weedy weedy 1821 Jun 30 21:04 qos
> >> -rw-r--r-- 1 weedy weedy  761 Jul 13 23:05 system
> >> -rw-r--r-- 1 weedy weedy 2165 Jul 13 23:05 uhttpd
> >> -rw-r--r-- 1 weedy weedy  639 Jul 13 23:05 upnpd
> >> -rw-r--r-- 1 weedy weedy 1353 Jul 13 23:05 wireless
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150803/c7ac2a54/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From donk at evhr.net  Sun Aug  2 13:19:20 2015
From: donk at evhr.net (Donk)
Date: Sun, 2 Aug 2015 19:19:20 +0200
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBFZV2HJfCssVfX2BAc2WzH6u7-rUOmkca_K5L0VR0Nd8g@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <CAGUNxBE_MzYSZAHeGDHu-gYr5Kqxh9J5RjTX4xGWOUBbJLogLw@mail.gmail.com>
 <CAFE24U1bA6Cn8DVwU2muJQp1SLrG_M-UxbCq5yz2UeFs9+xBMQ@mail.gmail.com>
 <CAGUNxBGOSi9=bZ0zP0gdzsHmjx=cgV1uobWzj8N9+=NVLgJ7CA@mail.gmail.com>
 <CAFE24U2nROJiDUZQ+hGixO09_qsK04gzGZK1PypMkm3zy1MD5A@mail.gmail.com>
 <CAGUNxBHZsVS81a6MPLX2+ALGMLKWqFvdCWAuqQmr_8DEdoZdag@mail.gmail.com>
 <CAFE24U2hQ_UUQnsX1VrV+xbAXD-=0oE7aFUW3UqPh4fSD5fAvQ@mail.gmail.com>
 <CAGUNxBFZV2HJfCssVfX2BAc2WzH6u7-rUOmkca_K5L0VR0Nd8g@mail.gmail.com>
Message-ID: <55BE5118.6080106@evhr.net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

A how-to for create your own firmware with your own default files:
http://wiki.openwrt.org/doc/howto/obtain.firmware.generate
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJVvlEPAAoJEFk5KK+nQki4+4kQAIzZDpsGuDvRv+EVJMOTWEkR
wnxnCY5SccLMkBKi3S14Klm8z/gnScUpPmv628tUeg6E8MBdCSLCHdShF9Y/cNtO
TgEEo5zUi0dmRSGkGZhctsyKr3u3ua2tXSDPm5cBLVJuWQmXZB04kabky94uCFOH
bTQ51tgFMw6MZvQ1gZ4PRwlNjHl2LqrvZ1j6m3iPFykJbpMBtwD101XiXNfHU/SQ
zzGR5KHWGrATMmb1Gq7v5ibC4yrjYJSk96+psTlbh+0jZTCB5EydsfWcXz1s6/uG
N9cAa6CZk2K1QkpvdXNSG37BzKlSm9XYxKfJTHx/tBlBDyk+7GwvVEMCho2M5umb
jrozr6FqB9wdkFZAiFfOqBzN+TyyTnYZB6UgTrREEj7XKr7/MLV8oGJWnObz8wVI
Yg/X6UqcV7Ev7capldbpfsZzh3HQMybM8ps3X6u7FvJwCn5PpFskYrfN+z6PW+Lx
/MxG03YoolIQAgQA7mrnn0p1XygAzNZaq44z7cerx1B/8ts1LTd4mQrn0QQHaQn1
I9ab7P599C5dzAUEn0IvmDr7CL+H6CWonRYoi/Tt+FbuGhobITvh1Aq8cXlnsXtw
PWxxKNrz2ibNbIIIOIKf29I7R30kIklh2tKBbemI7Z222L3HIb6gur/ZMgccPmua
pQeba8dGEjlyQNQtuaTN
=21X+
-----END PGP SIGNATURE-----
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Sun Aug  2 16:21:26 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Sun, 2 Aug 2015 22:21:26 +0200
Subject: [OpenWrt-Devel] [PATCH 1/2] sunxi: fix uboot install location
In-Reply-To: <alpine.DEB.2.02.1507311756090.30913@trabant.deployis.eu>
References: <cdf84b4e2925344468b40e494043e47075e410a9.1437077949.git.mschiffer@universe-factory.net>
 <55B1E9A8.1050302@openwrt.org>
 <alpine.DEB.2.02.1507261052490.30913@trabant.deployis.eu>
 <alpine.DEB.2.02.1507311756090.30913@trabant.deployis.eu>
Message-ID: <55BE7BC6.1050006@universe-factory.net>

On 07/31/2015 06:06 PM, Zoltan HERPAI wrote:
> On Sun, 26 Jul 2015, Zoltan HERPAI wrote:
> 
>> On Fri, 24 Jul 2015, John Crispin wrote:
>>
>>> On 16/07/2015 22:20, Matthias Schiffer wrote:
>>>> -BOARDS:= \
>>>> -    sun4i-a10-cubieboard \
>>>> -    sun4i-a10-olinuxino-lime \
>>>> -    sun4i-a10-pcduino \
>>>> -    sun5i-a13-olinuxino \
>>>> -    sun6i-a31-colombus \
>>>> -    sun6i-a31-m9 \
>>>> -    sun7i-a20-bananapi \
>>>> -    sun7i-a20-bananapro \
>>>> -    sun7i-a20-cubieboard2 \
>>>> -    sun7i-a20-cubietruck \
>>>> -    sun7i-a20-olinuxino-lime \
>>>> -    sun7i-a20-olinuxino-micro \
>>>> -    sun7i-a20-pcduino3 \
>>>> -    sun7i-a20-lamobo-r1
>>>> -
>>>>  define Image/BuildKernel
>>>>      mkimage -A arm -O linux -T kernel -C none \
>>>>          -a 0x40008000 -e 0x40008000 \
>>>>          -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
>>>>          -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
>>>> -
>>>> +
>>>>      ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
>>>>      $(CP) $(KDIR)/zImage-initramfs
>>>> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
>>>>      echo -ne '\x00\x00\x00\x00' >>
>>>> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
>>>> @@ -42,27 +26,23 @@ define Image/BuildKernel
>>>>          $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
>>>>      )
>>>>      endif
>>>> -
>>>> -    $(foreach board,$(BOARDS),
>>>> -        $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
>>>> -    )
>>>>  endef
>>>
>>> not sure about this change. maybe just stage the dtb file of the
>>> selected profile. i am not sure if zoltan added this for a reason.
>>
>> Thanks John and Matthias for checking on this. I'm offline until the
>> 30th, will get back on this at that time.
> 
> Before the sdcard imagebuilder, the dtb files for the supported boards
> were copied to BIN_DIR so the user could pick the correct dtb for the
> board. When the imagebuilder was rolled out, this was not removed from
> the Makefile - now it can go away, so I'm OK with removing this part.
> Although it's a good place to see which boards are supported, there are
> much better ways to do this.
> 
> Building boot.img is probably fine to stay in KDIR - that's an interim
> file and not the final image. If you want that changed, please send a v2
> - if not, I'm happy to apply the series in its current form.
> 
> Thanks,
> -w-

I think KDIR should be considered read-only for the Image Builder, it
should not put files there (please correct me if I'm wrong, I'm only
deducing this from how it's done on other targets...).

My updated patch will build the boot image in KDIR_TMP instead, which is
more appropriate in my opinion.

Matthias



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150802/c6bf3eb3/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Sun Aug  2 18:40:51 2015
From: david at lang.hm (David Lang)
Date: Sun, 2 Aug 2015 15:40:51 -0700 (PDT)
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>

to make the config be there after a factory reset, you need to put the changes 
into the image that you build.

you already did this for /etc/config/network, do the same thing for 
/etc/config/wireless

David Lang

On Sun, 2 Aug 2015, John kerry wrote:

> Hi Leiten,
>
> I have one issue, after upgrading this firmware it will load wireless
> configuration with this changes, actually it should load when i do factory
> reset.
>
> Thanks,
>
> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com> wrote:
>
>> Hi Leiten,
>>
>> Thank you so much, Its working :)
>>
>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Don't answer to my e-mail only, you need to add openwrt-devel maillist to
>>> CC or just answer to CC, in each case I'll receive message but also
>>> everyone could see all discussion.
>>>
>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
>>> wrote:
>>>> Hi Leiten,
>>>>
>>>> I have added new files under and written below :
>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>
>>> Use index in prefix of filename to set order of execution, so it'll be
>>> like '99-wireless'.
>>>
>>>>
>>>> #!/bin/sh
>>>> #
>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>> # Copyright (C) 2011 OpenWrt.org
>>>> #
>>>>
>>>> [ -e /etc/config/wireless ] && exit 0
>>>
>>> Here is the problem. When uci-defaults invoke scripts there's already
>>> preconfiguration done and /etc/config/wireless already exists, so your
>>> script just exit at this point. Remove this line.
>>>
>>>>
>>>> touch /etc/config/wireless
>>>>
>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>> uci set system. at system[0].hostname=test_ap
>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>> uci set wireless. at wifi-iface[0].wds=1
>>>> uci set wireless.radio0.disabled=0
>>>>
>>>> uci commit wireless
>>>>
>>>> exit 0
>>>>
>>>> and compile the source code using make V=s but still not changed default
>>>> settings.
>>>>
>>>> Please help me to make it works.
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>>>
>>>>> You can also use uci-defaults mechanism for your purpose. Just put
>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>> parameters with uci and don't forget to 'exit 0' at the end of script,
>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>
>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>> Hi,
>>>>>>
>>>>>> I am working on Ar71xx openWRT Luci project. By default the Wi-Fi is
>>>>>> disabled and SSID is OpenWrt. I need to change the default settings.
>>>>>> Could anyone help me to change the default settings.
>>>>>>
>>>>>>
>>>>>> Best Regards,
>>>>>> John
>>>>>>
>>>>>> _______________________________________________
>>>>>> openwrt-devel mailing list
>>>>>> openwrt-devel at lists.openwrt.org
>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>
>>>>> _______________________________________________
>>>>> openwrt-devel mailing list
>>>>> openwrt-devel at lists.openwrt.org
>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>
>>> _______________________________________________
>>> openwrt-devel mailing list
>>> openwrt-devel at lists.openwrt.org
>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>
>>
>>
>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Sun Aug  2 22:26:36 2015
From: kerry9842 at gmail.com (John kerry)
Date: Mon, 3 Aug 2015 10:26:36 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
Message-ID: <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>

Hi All,

I created separate files directory and added network and wireless files and
its working everything but still i am not able to use encryption wpa2.
Below is the my script.
config wifi-device  wifi0
        option type     qcawifi
        option channel  auto
        option macaddr  00:03:7f:42:06:61
        option hwmode   11ng
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 0

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     CD-1
        option encryption psk2
        option key      CD-1

M I doing anything wrong?

Thanks,

On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:

> to make the config be there after a factory reset, you need to put the
> changes into the image that you build.
>
> you already did this for /etc/config/network, do the same thing for
> /etc/config/wireless
>
> David Lang
>
>
> On Sun, 2 Aug 2015, John kerry wrote:
>
> Hi Leiten,
>>
>> I have one issue, after upgrading this firmware it will load wireless
>> configuration with this changes, actually it should load when i do factory
>> reset.
>>
>> Thanks,
>>
>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com> wrote:
>>
>> Hi Leiten,
>>>
>>> Thank you so much, Its working :)
>>>
>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>>
>>> Hi,
>>>>
>>>> Don't answer to my e-mail only, you need to add openwrt-devel maillist
>>>> to
>>>> CC or just answer to CC, in each case I'll receive message but also
>>>> everyone could see all discussion.
>>>>
>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
>>>> wrote:
>>>>
>>>>> Hi Leiten,
>>>>>
>>>>> I have added new files under and written below :
>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>
>>>>
>>>> Use index in prefix of filename to set order of execution, so it'll be
>>>> like '99-wireless'.
>>>>
>>>>
>>>>> #!/bin/sh
>>>>> #
>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>> #
>>>>>
>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>
>>>>
>>>> Here is the problem. When uci-defaults invoke scripts there's already
>>>> preconfiguration done and /etc/config/wireless already exists, so your
>>>> script just exit at this point. Remove this line.
>>>>
>>>>
>>>>> touch /etc/config/wireless
>>>>>
>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>> uci set system. at system[0].hostname=test_ap
>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>> uci set wireless.radio0.disabled=0
>>>>>
>>>>> uci commit wireless
>>>>>
>>>>> exit 0
>>>>>
>>>>> and compile the source code using make V=s but still not changed
>>>>> default
>>>>> settings.
>>>>>
>>>>> Please help me to make it works.
>>>>>
>>>>> Thanks,
>>>>>
>>>>>
>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>>>>
>>>>> You can also use uci-defaults mechanism for your purpose. Just put
>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>> parameters with uci and don't forget to 'exit 0' at the end of script,
>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>
>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am working on Ar71xx openWRT Luci project. By default the Wi-Fi is
>>>>>>> disabled and SSID is OpenWrt. I need to change the default settings.
>>>>>>> Could anyone help me to change the default settings.
>>>>>>>
>>>>>>>
>>>>>>> Best Regards,
>>>>>>> John
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> openwrt-devel mailing list
>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>
>>>>>>> _______________________________________________
>>>>>> openwrt-devel mailing list
>>>>>> openwrt-devel at lists.openwrt.org
>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>
>>>>>> _______________________________________________
>>>> openwrt-devel mailing list
>>>> openwrt-devel at lists.openwrt.org
>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>
>>>>
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150803/cbc5b32c/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Sun Aug  2 22:43:20 2015
From: david at lang.hm (David Lang)
Date: Sun, 2 Aug 2015 19:43:20 -0700 (PDT)
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>

The way to do this is to first forget about the factory reset problem and 
configure the AP to do what you want (including any encryption)

then you can take the resulting file and put it into the build system so that it 
becomes the 'factory default' settings.

Since you are not understanding how to configure the files from the 
documentation, configure them from the GUI and then look at the resulting files.

David Lang

On Mon, 3 Aug 2015, John kerry wrote:

> Hi All,
>
> I created separate files directory and added network and wireless files and
> its working everything but still i am not able to use encryption wpa2.
> Below is the my script.
> config wifi-device  wifi0
>        option type     qcawifi
>        option channel  auto
>        option macaddr  00:03:7f:42:06:61
>        option hwmode   11ng
>        # REMOVE THIS LINE TO ENABLE WIFI:
>        option disabled 0
>
> config wifi-iface
>        option device   wifi0
>        option network  lan
>        option mode     ap
>        option ssid     CD-1
>        option encryption psk2
>        option key      CD-1
>
> M I doing anything wrong?
>
> Thanks,
>
> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>
>> to make the config be there after a factory reset, you need to put the
>> changes into the image that you build.
>>
>> you already did this for /etc/config/network, do the same thing for
>> /etc/config/wireless
>>
>> David Lang
>>
>>
>> On Sun, 2 Aug 2015, John kerry wrote:
>>
>> Hi Leiten,
>>>
>>> I have one issue, after upgrading this firmware it will load wireless
>>> configuration with this changes, actually it should load when i do factory
>>> reset.
>>>
>>> Thanks,
>>>
>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com> wrote:
>>>
>>> Hi Leiten,
>>>>
>>>> Thank you so much, Its working :)
>>>>
>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>>>
>>>> Hi,
>>>>>
>>>>> Don't answer to my e-mail only, you need to add openwrt-devel maillist
>>>>> to
>>>>> CC or just answer to CC, in each case I'll receive message but also
>>>>> everyone could see all discussion.
>>>>>
>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
>>>>> wrote:
>>>>>
>>>>>> Hi Leiten,
>>>>>>
>>>>>> I have added new files under and written below :
>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>
>>>>>
>>>>> Use index in prefix of filename to set order of execution, so it'll be
>>>>> like '99-wireless'.
>>>>>
>>>>>
>>>>>> #!/bin/sh
>>>>>> #
>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>> #
>>>>>>
>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>
>>>>>
>>>>> Here is the problem. When uci-defaults invoke scripts there's already
>>>>> preconfiguration done and /etc/config/wireless already exists, so your
>>>>> script just exit at this point. Remove this line.
>>>>>
>>>>>
>>>>>> touch /etc/config/wireless
>>>>>>
>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>> uci set wireless.radio0.disabled=0
>>>>>>
>>>>>> uci commit wireless
>>>>>>
>>>>>> exit 0
>>>>>>
>>>>>> and compile the source code using make V=s but still not changed
>>>>>> default
>>>>>> settings.
>>>>>>
>>>>>> Please help me to make it works.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>>
>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>>>>>
>>>>>> You can also use uci-defaults mechanism for your purpose. Just put
>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of script,
>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>
>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the Wi-Fi is
>>>>>>>> disabled and SSID is OpenWrt. I need to change the default settings.
>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>
>>>>>>>>
>>>>>>>> Best Regards,
>>>>>>>> John
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> openwrt-devel mailing list
>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>> openwrt-devel mailing list
>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>
>>>>>>> _______________________________________________
>>>>> openwrt-devel mailing list
>>>>> openwrt-devel at lists.openwrt.org
>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>
>>>>>
>>>>
>>>>
>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Sun Aug  2 23:29:34 2015
From: kerry9842 at gmail.com (John kerry)
Date: Mon, 3 Aug 2015 11:29:34 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
Message-ID: <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>

Hello Guys,

It's working. Thanks a lot to all of you :)

On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:

> The way to do this is to first forget about the factory reset problem and
> configure the AP to do what you want (including any encryption)
>
> then you can take the resulting file and put it into the build system so
> that it becomes the 'factory default' settings.
>
> Since you are not understanding how to configure the files from the
> documentation, configure them from the GUI and then look at the resulting
> files.
>
> David Lang
>
>
> On Mon, 3 Aug 2015, John kerry wrote:
>
> Hi All,
>>
>> I created separate files directory and added network and wireless files
>> and
>> its working everything but still i am not able to use encryption wpa2.
>> Below is the my script.
>> config wifi-device  wifi0
>>        option type     qcawifi
>>        option channel  auto
>>        option macaddr  00:03:7f:42:06:61
>>        option hwmode   11ng
>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>        option disabled 0
>>
>> config wifi-iface
>>        option device   wifi0
>>        option network  lan
>>        option mode     ap
>>        option ssid     CD-1
>>        option encryption psk2
>>        option key      CD-1
>>
>> M I doing anything wrong?
>>
>> Thanks,
>>
>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>
>> to make the config be there after a factory reset, you need to put the
>>> changes into the image that you build.
>>>
>>> you already did this for /etc/config/network, do the same thing for
>>> /etc/config/wireless
>>>
>>> David Lang
>>>
>>>
>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>
>>> Hi Leiten,
>>>
>>>>
>>>> I have one issue, after upgrading this firmware it will load wireless
>>>> configuration with this changes, actually it should load when i do
>>>> factory
>>>> reset.
>>>>
>>>> Thanks,
>>>>
>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com> wrote:
>>>>
>>>> Hi Leiten,
>>>>
>>>>>
>>>>> Thank you so much, Its working :)
>>>>>
>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>>>
>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel maillist
>>>>>> to
>>>>>> CC or just answer to CC, in each case I'll receive message but also
>>>>>> everyone could see all discussion.
>>>>>>
>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
>>>>>> wrote:
>>>>>>
>>>>>> Hi Leiten,
>>>>>>>
>>>>>>> I have added new files under and written below :
>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>
>>>>>>>
>>>>>> Use index in prefix of filename to set order of execution, so it'll be
>>>>>> like '99-wireless'.
>>>>>>
>>>>>>
>>>>>> #!/bin/sh
>>>>>>> #
>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>> #
>>>>>>>
>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>
>>>>>>>
>>>>>> Here is the problem. When uci-defaults invoke scripts there's already
>>>>>> preconfiguration done and /etc/config/wireless already exists, so your
>>>>>> script just exit at this point. Remove this line.
>>>>>>
>>>>>>
>>>>>> touch /etc/config/wireless
>>>>>>>
>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>
>>>>>>> uci commit wireless
>>>>>>>
>>>>>>> exit 0
>>>>>>>
>>>>>>> and compile the source code using make V=s but still not changed
>>>>>>> default
>>>>>>> settings.
>>>>>>>
>>>>>>> Please help me to make it works.
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> You can also use uci-defaults mechanism for your purpose. Just put
>>>>>>>
>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>> script,
>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>
>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the Wi-Fi
>>>>>>>>> is
>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>> settings.
>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Best Regards,
>>>>>>>>> John
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> openwrt-devel mailing list
>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>>
>>>>>>>> openwrt-devel mailing list
>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>>
>>>>>>> openwrt-devel mailing list
>>>>>> openwrt-devel at lists.openwrt.org
>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150803/571314b6/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From Guenther.Kelleter at devolo.de  Mon Aug  3 03:03:37 2015
From: Guenther.Kelleter at devolo.de (Guenther Kelleter)
Date: Mon, 3 Aug 2015 07:03:37 +0000
Subject: [OpenWrt-Devel] [PATCH v3 2/3] mcs814x: fix interrupts
In-Reply-To: <1438355005-8947-3-git-send-email-guenther.kelleter@devolo.de>
References: <1438355005-8947-1-git-send-email-guenther.kelleter@devolo.de>
 <1438355005-8947-3-git-send-email-guenther.kelleter@devolo.de>
Message-ID: <EF6DF72779EE294A8A2425E8DA3BC0CC2857AF34@Ceres.devolo.intern>

Please ignore this patch.
I have another (better? bigger!) patch which switches to generic chip interrupt domains. Finally.

G?nther

> -----Original Message-----
> From: G?nther Kelleter [mailto:guenther.kelleter at devolo.de]
> Sent: Friday, July 31, 2015 5:03 PM
> To: openwrt-devel at lists.openwrt.org
> Cc: Guenther Kelleter
> Subject: [PATCH v3 2/3] mcs814x: fix interrupts
> 
> create explicit 1:1 mapping before mcs814x_alloc_gc/irq_setup_generic_chip
> marks all interrupts used and prevents mapping by dts init.
> IRQ 0 is the timer interrupt and is not illegal!
> 
> Was broken since kernel 3.14.
> 
> Signed-off-by: G?nther Kelleter <guenther.kelleter at devolo.de>
> ---
>  target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c |  6 +++++-
>  target/linux/mcs814x/patches-3.18/015-timer-irq.patch       | 11 +++++++++++
>  2 files changed, 16 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/mcs814x/patches-3.18/015-timer-irq.patch
> 
> diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
> b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
> index f84c412..fd4345f 100644
> --- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
> +++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
> @@ -71,6 +71,7 @@ static const struct of_device_id mcs814x_intc_ids[] = {
>  void __init mcs814x_of_irq_init(void)
>  {
>  	struct device_node *np;
> +	struct irq_domain *domain;
> 
>  	np = of_find_matching_node(NULL, mcs814x_intc_ids);
>  	if (!np)
> @@ -80,7 +81,10 @@ void __init mcs814x_of_irq_init(void)
>  	if (!mcs814x_intc_base)
>  		panic("unable to map intc cpu registers\n");
> 
> -	irq_domain_add_simple(np, 32, 0, &irq_generic_chip_ops, NULL);
> +	domain = irq_domain_add_simple(np, 32, 0, &irq_domain_simple_ops, NULL);
> +	if (!domain)
> +		panic("unable to add irq domain\n");
> +	irq_create_strict_mappings(domain, 0, 0, 32);
> 
>  	of_node_put(np);
> 
> diff --git a/target/linux/mcs814x/patches-3.18/015-timer-irq.patch
> b/target/linux/mcs814x/patches-3.18/015-timer-irq.patch
> new file mode 100644
> index 0000000..9bbb094
> --- /dev/null
> +++ b/target/linux/mcs814x/patches-3.18/015-timer-irq.patch
> @@ -0,0 +1,11 @@
> +--- a/kernel/irq/irqdesc.c
> ++++ b/kernel/irq/irqdesc.c
> +@@ -381,7 +381,7 @@ int __handle_domain_irq(struct irq_domai
> + 	 * Some hardware gives randomly wrong interrupts.  Rather
> + 	 * than crashing, do something sensible.
> + 	 */
> +-	if (unlikely(!irq || irq >= nr_irqs)) {
> ++	if (unlikely(irq >= nr_irqs)) {
> + 		ack_bad_irq(irq);
> + 		ret = -EINVAL;
> + 	} else {
> --
> 2.4.6.89.g851dcf4

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From guenther.kelleter at devolo.de  Mon Aug  3 04:21:19 2015
From: guenther.kelleter at devolo.de (=?UTF-8?q?G=C3=BCnther=20Kelleter?=)
Date: Mon,  3 Aug 2015 10:21:19 +0200
Subject: [OpenWrt-Devel] [PATCH v4 0/3] fix mcs814x dLAN USB Extender
Message-ID: <1438590082-2018-1-git-send-email-guenther.kelleter@devolo.de>

Patches fix interrupt init, timer irq and debug UART for mcs814x.
dLAN USB Extender kernel got too big to fit in 1MB so I changed dts
partition layout and image builder to make use of automatic
partition splitting.

Please apply to trunk and CC/15.05!

changes since v3:
change commit messages
I'm sorry but I cannot find another solution to fix interrupt handling.
Interrupt handling switched to domain generic chip interrupts. Removed
generic kernel irq patch.


G?nther Kelleter (3):
  mcs814x: fix debug UART
  mcs814x: fix interrupt handling
  mcs814x: use firmware partition splitter on dLAN USB Extender

 target/linux/mcs814x/config-3.18                   | 14 ++++++--
 .../arch/arm/boot/dts/dlan-usb-extender.dts        |  8 -----
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 21 ++++++-----
 .../files-3.18/arch/arm/mach-mcs814x/timer.c       | 28 +++++++--------
 target/linux/mcs814x/image/Makefile                |  2 +-
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++++++++++++++++++++++
 6 files changed, 80 insertions(+), 34 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

-- 
2.4.6.89.g851dcf4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From guenther.kelleter at devolo.de  Mon Aug  3 04:21:20 2015
From: guenther.kelleter at devolo.de (=?UTF-8?q?G=C3=BCnther=20Kelleter?=)
Date: Mon,  3 Aug 2015 10:21:20 +0200
Subject: [OpenWrt-Devel] [PATCH v4 1/3] mcs814x: fix debug UART
In-Reply-To: <1438590082-2018-1-git-send-email-guenther.kelleter@devolo.de>
References: <1438590082-2018-1-git-send-email-guenther.kelleter@devolo.de>
Message-ID: <1438590082-2018-2-git-send-email-guenther.kelleter@devolo.de>

Switch to new 8250 debug uart code because the old
mach-mcs814x/include/mach/debug-macro.S tries to include
asm/hardware/debug-8250.S which no longer exists since kernel 3.14

Signed-off-by: G?nther Kelleter <guenther.kelleter at devolo.de>
---
 target/linux/mcs814x/config-3.18                   | 10 ++++--
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++++++++++++++++++++++
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index 87a8382..e57f5ff 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -49,10 +49,15 @@ CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_LL_UART_NONE=y
-# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_UART_8250=y
+# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+CONFIG_DEBUG_UART_PHYS=0x400dc000
 # CONFIG_DEBUG_UART_PL01X is not set
+CONFIG_DEBUG_UART_VIRT=0xf00dc000
 # CONFIG_DEBUG_USER is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
@@ -157,7 +162,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
-CONFIG_NEED_MACH_MEMORY_H=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_KEY=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
diff --git a/target/linux/mcs814x/patches-3.18/014-debuguart.patch b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
new file mode 100644
index 0000000..5f1b67f
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
@@ -0,0 +1,41 @@
+--- a/arch/arm/mach-mcs814x/include/mach/debug-macro.S
++++ /dev/null
+@@ -1,11 +0,0 @@
+-#include <mach/mcs814x.h>
+-
+-                .macro  addruart, rp, rv, tmp
+-		ldr	\rp, =MCS814X_PHYS_BASE
+-		ldr	\rv, =MCS814X_VIRT_BASE
+-		orr	\rp, \rp, #MCS814X_UART
+-		orr	\rv, \rv, #MCS814X_UART
+-                .endm
+-
+-#define UART_SHIFT	2
+-#include <asm/hardware/debug-8250.S>
+--- a/arch/arm/Kconfig.debug
++++ b/arch/arm/Kconfig.debug
+@@ -1089,7 +1089,7 @@ config DEBUG_UART_8250
+ 		(FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
+ 		ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
+ 		ARCH_IOP33X || ARCH_IXP4XX || \
+-		ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
++		ARCH_LPC32XX || ARCH_MCS814X || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
+ 
+ # Compatibility options for BCM63xx
+ config DEBUG_UART_BCM63XX
+@@ -1124,6 +1124,7 @@ config DEBUG_UART_PHYS
+ 	default 0x3e000000 if DEBUG_BCM_KONA_UART
+ 	default 0x4000e400 if DEBUG_LL_UART_EFM32
+ 	default 0x40090000 if ARCH_LPC32XX
++	default 0x400dc000 if ARCH_MCS814X
+ 	default 0x40100000 if DEBUG_PXA_UART1
+ 	default 0x42000000 if ARCH_GEMINI
+ 	default 0x50000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
+@@ -1178,6 +1179,7 @@ config DEBUG_UART_VIRT
+ 	default 0xe0010fe0 if ARCH_RPC
+ 	default 0xe1000000 if DEBUG_MSM_UART
+ 	default 0xf0000be0 if ARCH_EBSA110
++	default 0xf00dc000 if ARCH_MCS814X
+ 	default 0xf01fb000 if DEBUG_NOMADIK_UART
+ 	default 0xf0201000 if DEBUG_BCM2835
+ 	default 0xf1000300 if DEBUG_BCM_5301X
-- 
2.4.6.89.g851dcf4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From guenther.kelleter at devolo.de  Mon Aug  3 04:21:21 2015
From: guenther.kelleter at devolo.de (=?UTF-8?q?G=C3=BCnther=20Kelleter?=)
Date: Mon,  3 Aug 2015 10:21:21 +0200
Subject: [OpenWrt-Devel] [PATCH v4 2/3] mcs814x: fix interrupt handling
In-Reply-To: <1438590082-2018-1-git-send-email-guenther.kelleter@devolo.de>
References: <1438590082-2018-1-git-send-email-guenther.kelleter@devolo.de>
Message-ID: <1438590082-2018-3-git-send-email-guenther.kelleter@devolo.de>

Switch to generich chip irqs/irq domains.
Interrupts were broken since kernel 3.14. dLAN USB extender is now
booting again.

Signed-off-by: G?nther Kelleter <guenther.kelleter at devolo.de>
---
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 21 +++++++++-------
 .../files-3.18/arch/arm/mach-mcs814x/timer.c       | 28 +++++++++++-----------
 2 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
index f84c412..d1cab68 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
@@ -17,6 +17,7 @@
 #include <mach/mcs814x.h>
 
 static void __iomem *mcs814x_intc_base;
+static struct irq_domain *domain;
 
 static void __init mcs814x_alloc_gc(void __iomem *base, unsigned int irq_start,
 					unsigned int num)
@@ -24,11 +25,15 @@ static void __init mcs814x_alloc_gc(void __iomem *base, unsigned int irq_start,
 	struct irq_chip_generic *gc;
 	struct irq_chip_type *ct;
 
-	gc = irq_alloc_generic_chip("mcs814x-intc", 1,
-			irq_start, base, handle_level_irq);
+	if (irq_alloc_domain_generic_chips(domain, num, 1, "mcs814x-intc", handle_level_irq,
+                IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST, 0))
+		panic("unable to allocate domain generic irq chip");
+
+	gc = irq_get_domain_generic_chip(domain, irq_start);
 	if (!gc)
-		panic("unable to allocate generic irq chip");
+		panic("unable to get generic irq chip");
 
+	gc->reg_base = base;
 	ct = gc->chip_types;
 	ct->chip.irq_ack = irq_gc_unmask_enable_reg;
 	ct->chip.irq_mask = irq_gc_mask_clr_bit;
@@ -36,9 +41,6 @@ static void __init mcs814x_alloc_gc(void __iomem *base, unsigned int irq_start,
 	ct->regs.mask = MCS814X_IRQ_MASK;
 	ct->regs.enable = MCS814X_IRQ_ICR;
 
-	irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
-		IRQ_NOREQUEST, 0);
-
 	/* Clear all interrupts */
 	writel_relaxed(0xffffffff, base + MCS814X_IRQ_ICR);
 }
@@ -58,7 +60,7 @@ asmlinkage void __exception_irq_entry mcs814x_handle_irq(struct pt_regs *regs)
 		/* clear the interrupt */
 		__raw_writel(status, mcs814x_intc_base + MCS814X_IRQ_STS0);
 		/* call the generic handler */
-		handle_IRQ(irq, regs);
+		handle_domain_irq(domain, irq, regs);
 
 	} while (1);
 }
@@ -80,7 +82,10 @@ void __init mcs814x_of_irq_init(void)
 	if (!mcs814x_intc_base)
 		panic("unable to map intc cpu registers\n");
 
-	irq_domain_add_simple(np, 32, 0, &irq_generic_chip_ops, NULL);
+	domain = irq_domain_add_linear(np, 32, &irq_generic_chip_ops, NULL);
+	if (!domain)
+		panic("unable to add irq domain\n");
+	irq_set_default_host(domain);
 
 	of_node_put(np);
 
diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
index ff9d44a..31d0ba6 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
@@ -15,6 +15,7 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/mach/time.h>
 #include <mach/mcs814x.h>
@@ -71,21 +72,15 @@ static irqreturn_t mcs814x_timer_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static struct irqaction mcs814x_timer_irq = {
-	.name		= "mcs814x-timer",
-	.flags		= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-	.handler	= mcs814x_timer_interrupt,
-};
-
 static struct of_device_id mcs814x_timer_ids[] = {
 	{ .compatible = "moschip,mcs814x-timer" },
 	{ /* sentinel */ },
 };
 
-static void __init mcs814x_of_timer_init(void)
+static int __init mcs814x_of_timer_init(void)
 {
 	struct device_node *np;
-	const unsigned int *intspec;
+	int irq;
 
 	np = of_find_matching_node(NULL, mcs814x_timer_ids);
 	if (!np)
@@ -95,16 +90,17 @@ static void __init mcs814x_of_timer_init(void)
 	if (!mcs814x_timer_base)
 		panic("unable to remap timer cpu registers");
 
-	intspec = of_get_property(np, "interrupts", NULL);
-	if (!intspec)
-		panic("no interrupts property for timer");
+	irq = irq_of_parse_and_map(np, 0);
+	if (!irq)
+		panic("no interrupts property/mapping failed for timer");
 
-	mcs814x_timer_irq.irq = be32_to_cpup(intspec);
+	return irq;
 }
 
 void __init mcs814x_timer_init(void)
 {
 	struct clk *clk;
+	int irq;
 
 	arch_gettimeoffset = mcs814x_gettimeoffset;
 
@@ -114,7 +110,7 @@ void __init mcs814x_timer_init(void)
 
 	clock_rate = clk_get_rate(clk);
 
-	mcs814x_of_timer_init();
+	irq = mcs814x_of_timer_init();
 
 	pr_info("Timer frequency: %d (kHz)\n", clock_rate / 1000);
 
@@ -125,7 +121,11 @@ void __init mcs814x_timer_init(void)
 	writel_relaxed(timer_reload_value, mcs814x_timer_base + TIMER_VAL);
 	last_reload = timer_reload_value;
 
-	setup_irq(mcs814x_timer_irq.irq, &mcs814x_timer_irq);
+	if (request_irq(irq, mcs814x_timer_interrupt,
+		IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+		"mcs814x-timer", NULL))
+		panic("unable to request timer0 irq %d", irq);
+
 	/* enable timer, stop timer in debug mode */
 	writel_relaxed(TIMER_CTL_EN | TIMER_CTL_DBG,
 		mcs814x_timer_base + TIMER_CTL);
-- 
2.4.6.89.g851dcf4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From guenther.kelleter at devolo.de  Mon Aug  3 04:21:22 2015
From: guenther.kelleter at devolo.de (=?UTF-8?q?G=C3=BCnther=20Kelleter?=)
Date: Mon,  3 Aug 2015 10:21:22 +0200
Subject: [OpenWrt-Devel] [PATCH v4 3/3] mcs814x: use firmware partition
	splitter on dLAN USB Extender
In-Reply-To: <1438590082-2018-1-git-send-email-guenther.kelleter@devolo.de>
References: <1438590082-2018-1-git-send-email-guenther.kelleter@devolo.de>
Message-ID: <1438590082-2018-4-git-send-email-guenther.kelleter@devolo.de>

to avoid editing the dts every time the kernel size changes.
uImage is now bigger than 1MB. Pad uImage to 64k erase block size.

Signed-off-by: G?nther Kelleter <guenther.kelleter at devolo.de>
---
 target/linux/mcs814x/config-3.18                                  | 4 ++++
 .../mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts    | 8 --------
 target/linux/mcs814x/image/Makefile                               | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index e57f5ff..427a7c9 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -159,6 +159,10 @@ CONFIG_MODULES_USE_ELF_REL=y
 # CONFIG_MTD_IMPA7 is not set
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_ROOTFS_SPLIT is not set
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
diff --git a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
index 0c85b94..59830e8 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
+++ b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
@@ -48,14 +48,6 @@
 						reg = <0x40000 0x10000>;
 					};
 					partition at 50000 {
-						label = "kernel";
-						reg = <0x50000 0x100000>;
-					};
-					partition at 150000 {
-						label = "rootfs";
-						reg = <0x150000 0x3C0000>;
-					};
-					partition at 50001 {
 						label = "linux";
 						reg = <0x50000 0x4C0000>;
 					};
diff --git a/target/linux/mcs814x/image/Makefile b/target/linux/mcs814x/image/Makefile
index 4c8af97..74f8ad4 100644
--- a/target/linux/mcs814x/image/Makefile
+++ b/target/linux/mcs814x/image/Makefile
@@ -30,7 +30,7 @@ define Image/Build/DTB
 endef
 
 define Image/Build/Profile/dLAN_USB_Extender
-	dd if=$(KDIR)/uImage-dlan-usb-extender bs=1M conv=sync of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
+	dd if=$(KDIR)/uImage-dlan-usb-extender bs=64k conv=sync of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
 	cat $(KDIR)/root.$(1) >> $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
 	cp $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin $(BIN_DIR)/
 endef
-- 
2.4.6.89.g851dcf4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From noltari at gmail.com  Mon Aug  3 05:28:51 2015
From: noltari at gmail.com (=?UTF-8?Q?=c3=81lvaro_Fern=c3=a1ndez_Rojas?=)
Date: Mon, 3 Aug 2015 11:28:51 +0200
Subject: [OpenWrt-Devel] Raspberry Pi 2 buildbot (brcm2708/bcm2709)
In-Reply-To: <55413D84.8070802@gmail.com>
References: <55413D84.8070802@gmail.com>
Message-ID: <55BF3453.20404@gmail.com>

Bump,

As I requested some months ago, is it possible to add a Raspberry Pi 2 
buildbot? (brcm2708/bcm2709)
I've sent another email to Travis like a month ago and got no answer, 
and from the first email it's been over 5 months...

Regards,
?lvaro.

El 29/04/2015 a las 22:22, ?lvaro Fern?ndez Rojas escribi?:
> Hello guys,
>
> It's been over 3 months since Raspberry PI 2 (brcm2708/bcm2709) target was added.
> I requested Travis a buildbot over a month ago but my email wasn't responded.
> So, can we have a buildbot please :D?
>
> Regards,
> ?lvaro.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt-devel at couprie.net  Mon Aug  3 08:11:18 2015
From: openwrt-devel at couprie.net (openwrt-devel at couprie.net)
Date: Mon, 03 Aug 2015 14:11:18 +0200
Subject: [OpenWrt-Devel] [PATCH] Restore AP scan patch
In-Reply-To: <20150731120138.ff56e86ba0d52db03316a717@ubnt.com>
References: <20150731120138.ff56e86ba0d52db03316a717@ubnt.com>
Message-ID: <55BF5A66.7070300@couprie.net>

Hi Dimitry,

Does this patch, fix the problem that when a router is a wifi access 
client and access point.
The local access point does not work when de wifi access client is not 
connected ?

Greeting from Amsterdam,

Perry

On 31-07-15 11:01, Dmitry Ivanov wrote:
> Restore AP scan patch.
>
> Signed-off-by: Dmitry Ivanov<dima at ubnt.com>
> ---
>   package/kernel/mac80211/patches/210-ap_scan.patch | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>   create mode 100644 package/kernel/mac80211/patches/210-ap_scan.patch
>
> diff --git a/package/kernel/mac80211/patches/210-ap_scan.patch b/package/kernel/mac80211/patches/210-ap_scan.patch
> new file mode 100644
> index 0000000..29f05c4
> --- /dev/null
> +++ b/package/kernel/mac80211/patches/210-ap_scan.patch
> @@ -0,0 +1,11 @@
> +--- a/net/mac80211/cfg.c
> ++++ b/net/mac80211/cfg.c
> +@@ -2008,7 +2008,7 @@ static int ieee80211_scan(struct wiphy *
> + 		 * the  frames sent while scanning on other channel will be
> + 		 * lost)
> + 		 */
> +-		if (sdata->u.ap.beacon &&
> ++		if (0 && sdata->u.ap.beacon &&
> + 		    (!(wiphy->features & NL80211_FEATURE_AP_SCAN) ||
> + 		     !(req->flags & NL80211_SCAN_FLAG_AP)))
> + 			return -EOPNOTSUPP;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From a.heider at gmail.com  Mon Aug  3 13:13:37 2015
From: a.heider at gmail.com (Andre Heider)
Date: Mon, 3 Aug 2015 19:13:37 +0200
Subject: [OpenWrt-Devel] [PATCH v2] lantiq: get more status information
 from xDSL
In-Reply-To: <1438333261-11217-1-git-send-email-Eckert.Florian@googlemail.com>
References: <1438333261-11217-1-git-send-email-Eckert.Florian@googlemail.com>
Message-ID: <CAHsu+b9OkBkGHLm7g5w0LHuf2YWbCZcMQGJMpRRRkWM=y1kN9A@mail.gmail.com>

Hi,

On Fri, Jul 31, 2015 at 11:01 AM, feckert <eckert.florian at googlemail.com> wrote:
> +               echo "dsl.latency_num_down=$sidu"
> +               echo "dsl.latency_num_up=$sidd"

this hunk breaks the luci status/overview page, see `logread` for a
syntax error message. Both values need to be "-quoted, they're
whitespace seperated strings ("x ms").

>  status() {
> +       echo "-------------------------------------------------------------------------------------"

lucistat() calls status(), so these lines are now part of the
generated lua code ran by luci. Doesn't seem to break anything, but
seems unindented?

Regards,
Andre
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From a.heider at gmail.com  Mon Aug  3 13:54:39 2015
From: a.heider at gmail.com (Andre Heider)
Date: Mon, 3 Aug 2015 19:54:39 +0200
Subject: [OpenWrt-Devel] lantiq DSL drivers / firmware info
In-Reply-To: <20150724000306.11ac27b4@lazus.yip>
References: <1430320363.2279.3.camel@sipsolutions.net>
 <CAONAcYM2L7A1nQTM+u1azA+LJVUsXGuCTJ_co0TRg8ihOOFnqg@mail.gmail.com>
 <CAONAcYMi4YkE2=GkjgUmpi6j1Mtx=WzHcqoTs41SwMm_fH4xyA@mail.gmail.com>
 <CAFBinCB7arL+Lts1mpnCm3pX=ze=V800wy9xOUqjvsWfA7oYeg@mail.gmail.com>
 <CAONAcYObB1dRcbjq6aicdMSuBfhayr+T7o61cvLnVcxMiys=GQ@mail.gmail.com>
 <CAFBinCDZ2oz4BGMOLiKVx9zGuS3hL95EdqFnDpnQ=XX-SLHwuw@mail.gmail.com>
 <CAONAcYPuxYG9LAApLZdO2QNtw_N7v7Dvt1fjMZVARGAKkkpqBg@mail.gmail.com>
 <55714F60.6040402@gmail.com>
 <CAONAcYP30ZdjgQ=fkK2fX5KNgdqctSJ00COQdW0D-aPK4v6pCA@mail.gmail.com>
 <5572F43B.1080509@gmail.com>
 <CAFBinCAC+AVpfQ-1xCQ_mfW95Cm4VvsixcoSD4hBiT62bA8Nbg@mail.gmail.com>
 <CAONAcYMnkRxKdfNyDfn_QPjUrA=pA-O=hbMjxdiV_LhFvtp0RQ@mail.gmail.com>
 <55A0C816.3050703@gmail.com>
 <CAFBinCDO8koQ7ZGj=0PNpqCUqkVq=iU7FrTpj3E+2zyeN0unug@mail.gmail.com>
 <CAHsu+b-j8dZ+GWG6QgGTKL_xqQyqOaieo9=c5bDVfW5i=-EzqA@mail.gmail.com>
 <CAFBinCCtrCt73rkh3jqVzYnCL5+Ajic0aCmZw8cEoy2KPpSDNQ@mail.gmail.com>
 <20150724000306.11ac27b4@lazus.yip>
Message-ID: <CAHsu+b-AKNsBn=86aJ2UJ2Z2CYYgyQC+85Kqs9XRmUR8Y3wNCw@mail.gmail.com>

Hi all,

On Fri, Jul 24, 2015 at 12:03 AM, Alexander Couzens <lynxis at fe80.eu> wrote:
> I've seen the same. With annex b device, same firmware, the modem syncs to adsl, with annex a not.

meanwhile, I got an annex b device, and with the same openwrt build,
dsl firmware and config (sysupgrade backup) it just works with my
adsl2+ line.

I'll look for hardware differences next week, but I get the feeling
I'm not going to find anything.

PS: by poking around I found
target/linux/lantiq/patches-3.18/0007-MIPS-lantiq-add-basic-tffs-driver.patch
which looks like it reads the annex version off a mtd part I don't
have. Any idea what that is about?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From thess at kitschensync.net  Mon Aug  3 13:55:06 2015
From: thess at kitschensync.net (Ted Hess)
Date: Mon, 3 Aug 2015 13:55:06 -0400
Subject: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl commands
	(from Silicon Labs)
Message-ID: <A3C746EC1C774B0DA57E652520837D00@fortmeadow.com>

Silicon Labs driver has ioctl support on devices which have GPIO pins. The 
driver
in the kernel repo does not have this feature.

Ref: 
http://www.silabs.com/Support%20Documents/Software/Linux_CP210x_VCP_3.x.x_Release_Notes.txt

Signed-off-by: Ted Hess <thess at kitschensync.net>
---
.../patches-3.18/824-cp210x_add_gpio_ioctl.patch   | 194 +++++++++++++++++++++
.../patches-4.1/824-cp210x_add_gpio_ioctl.patch    | 194 +++++++++++++++++++++
2 files changed, 388 insertions(+)
create mode 100644 
target/linux/generic/patches-3.18/824-cp210x_add_gpio_ioctl.patch
create mode 100644 
target/linux/generic/patches-4.1/824-cp210x_add_gpio_ioctl.patch

diff --git a/target/linux/generic/patches-3.18/824-cp210x_add_gpio_ioctl.patch 
b/target/linux/generic/patches-3.18/824-cp210x_add_gpio_ioctl.patch
new file mode 100644
index 0000000..695647a
--- /dev/null
+++ b/target/linux/generic/patches-3.18/824-cp210x_add_gpio_ioctl.patch
@@ -0,0 +1,194 @@
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -24,13 +24,15 @@
+ #include <linux/uaccess.h>
+ #include <linux/usb/serial.h>
+
+-#define DRIVER_DESC "Silicon Labs CP210x RS232 serial adaptor driver"
++#define DRIVER_DESC "Silicon Labs CP210x RS232 serial adaptor driver (with 
GPIO support)"
+
+ /*
+  * Function Prototypes
+  */
+ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *);
+ static void cp210x_close(struct usb_serial_port *);
++static int cp210x_ioctl(struct tty_struct *tty,
++    unsigned int cmd, unsigned long arg);
+ static void cp210x_get_termios(struct tty_struct *, struct usb_serial_port *);
+ static void cp210x_get_termios_port(struct usb_serial_port *port,
+     unsigned int *cflagp, unsigned int *baudp);
+@@ -185,6 +187,7 @@
+
+ struct cp210x_serial_private {
+     __u8            bInterfaceNumber;
++    __u8            bPartNumber;
+ };
+
+ static struct usb_serial_driver cp210x_device = {
+@@ -198,6 +201,7 @@
+     .bulk_out_size        = 256,
+     .open            = cp210x_open,
+     .close            = cp210x_close,
++    .ioctl            = cp210x_ioctl,
+     .break_ctl        = cp210x_break_ctl,
+     .set_termios        = cp210x_set_termios,
+     .tiocmget        = cp210x_tiocmget,
+@@ -211,6 +215,17 @@
+     &cp210x_device, NULL
+ };
+
++/* Part number definitions */
++#define CP2101_PARTNUM        0x01
++#define CP2102_PARTNUM        0x02
++#define CP2103_PARTNUM        0x03
++#define CP2104_PARTNUM        0x04
++#define CP2105_PARTNUM        0x05
++
++/* IOCTLs */
++#define IOCTL_GPIOGET        0x8000
++#define IOCTL_GPIOSET        0x8001
++
+ /* Config request types */
+ #define REQTYPE_HOST_TO_INTERFACE    0x41
+ #define REQTYPE_INTERFACE_TO_HOST    0xc1
+@@ -244,11 +259,17 @@
+ #define CP210X_SET_CHARS    0x19
+ #define CP210X_GET_BAUDRATE    0x1D
+ #define CP210X_SET_BAUDRATE    0x1E
++#define CP210X_VENDOR_SPECIFIC    0xFF
+
+ /* CP210X_IFC_ENABLE */
+ #define UART_ENABLE        0x0001
+ #define UART_DISABLE        0x0000
+
++/* CP210X_VENDOR_SPECIFIC */
++#define CP210X_WRITE_LATCH    0x37E1
++#define CP210X_READ_LATCH    0x00C2
++#define CP210X_GET_PARTNUM    0x370B
++
+ /* CP210X_(SET|GET)_BAUDDIV */
+ #define BAUD_RATE_GEN_FREQ    0x384000
+
+@@ -469,6 +490,96 @@
+     cp210x_set_config_single(port, CP210X_IFC_ENABLE, UART_DISABLE);
+ }
+
++static int cp210x_ioctl(struct tty_struct *tty,
++    unsigned int cmd, unsigned long arg)
++{
++    struct usb_serial_port *port = tty->driver_data;
++    struct usb_serial *serial = port->serial;
++    struct cp210x_serial_private *port_priv = usb_get_serial_data(serial);
++    int result = 0;
++    unsigned int latch_setting = 0;
++
++    switch (cmd) {
++
++    case IOCTL_GPIOGET:
++        if ((port_priv->bPartNumber == CP2103_PARTNUM) ||
++            (port_priv->bPartNumber == CP2104_PARTNUM)) {
++            result = usb_control_msg(port->serial->dev,
++                    usb_rcvctrlpipe(port->serial->dev, 0),
++                    CP210X_VENDOR_SPECIFIC,
++                    REQTYPE_DEVICE_TO_HOST,
++                    CP210X_READ_LATCH,
++                    port_priv->bInterfaceNumber,
++                    &latch_setting, 1,
++                    USB_CTRL_GET_TIMEOUT);
++            if (result != 1)
++                return -EPROTO;
++            *(unsigned long *)arg = (unsigned long)latch_setting;
++            return 0;
++        } else if (port_priv->bPartNumber == CP2105_PARTNUM) {
++            result = usb_control_msg(port->serial->dev,
++                    usb_rcvctrlpipe(port->serial->dev, 0),
++                    CP210X_VENDOR_SPECIFIC,
++                    REQTYPE_INTERFACE_TO_HOST,
++                    CP210X_READ_LATCH,
++                    port_priv->bInterfaceNumber,
++                    &latch_setting, 1,
++                    USB_CTRL_GET_TIMEOUT);
++            if (result != 1)
++                return -EPROTO;
++            *(unsigned long *)arg = (unsigned long)latch_setting;
++            return 0;
++        } else {
++            return -ENOTSUPP;
++        }
++        break;
++
++    case IOCTL_GPIOSET:
++        if ((port_priv->bPartNumber == CP2103_PARTNUM) ||
++            (port_priv->bPartNumber == CP2104_PARTNUM)) {
++            latch_setting =
++                *(unsigned int *)arg & 0x000000FF;
++            latch_setting |=
++                (*(unsigned int *)arg & 0x00FF0000) >> 8;
++            result = usb_control_msg(port->serial->dev,
++                    usb_sndctrlpipe(port->serial->dev, 0),
++                    CP210X_VENDOR_SPECIFIC,
++                    REQTYPE_HOST_TO_DEVICE,
++                    CP210X_WRITE_LATCH,
++                    latch_setting,
++                    NULL, 0,
++                    USB_CTRL_SET_TIMEOUT);
++            if (result != 0)
++                return -EPROTO;
++            return 0;
++        } else if (port_priv->bPartNumber == CP2105_PARTNUM) {
++            latch_setting =
++                *(unsigned int *)arg & 0x000000FF;
++            latch_setting |=
++                (*(unsigned int *)arg & 0x00FF0000) >> 8;
++            result = usb_control_msg(port->serial->dev,
++                    usb_sndctrlpipe(port->serial->dev, 0),
++                    CP210X_VENDOR_SPECIFIC,
++                    REQTYPE_HOST_TO_INTERFACE,
++                    CP210X_WRITE_LATCH,
++                    port_priv->bInterfaceNumber,
++                    &latch_setting, 2,
++                    USB_CTRL_SET_TIMEOUT);
++            if (result != 2)
++                return -EPROTO;
++            return 0;
++        } else {
++            return -ENOTSUPP;
++        }
++        break;
++
++    default:
++        break;
++    }
++
++    return -ENOIOCTLCMD;
++}
++
+ /*
+  * cp210x_get_termios
+  * Reads the baud rate, data bits, parity, stop bits and flow control mode
+@@ -862,6 +973,7 @@
+ {
+     struct usb_host_interface *cur_altsetting;
+     struct cp210x_serial_private *spriv;
++    unsigned int partNum;
+
+     /* cp210x buffers behave strangely unless device is reset */
+     usb_reset_device(serial->dev);
+@@ -875,6 +987,17 @@
+
+     usb_set_serial_data(serial, spriv);
+
++    /* Get the 1-byte part number of the cp210x device */
++    usb_control_msg(serial->dev,
++        usb_rcvctrlpipe(serial->dev, 0),
++        CP210X_VENDOR_SPECIFIC,
++        REQTYPE_DEVICE_TO_HOST,
++        CP210X_GET_PARTNUM,
++        spriv->bInterfaceNumber,
++        &partNum, 1,
++        USB_CTRL_GET_TIMEOUT);
++    spriv->bPartNumber = partNum & 0xFF;
++
+     return 0;
+ }
+
diff --git a/target/linux/generic/patches-4.1/824-cp210x_add_gpio_ioctl.patch 
b/target/linux/generic/patches-4.1/824-cp210x_add_gpio_ioctl.patch
new file mode 100644
index 0000000..f737140
--- /dev/null
+++ b/target/linux/generic/patches-4.1/824-cp210x_add_gpio_ioctl.patch
@@ -0,0 +1,194 @@
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -24,13 +24,15 @@
+ #include <linux/uaccess.h>
+ #include <linux/usb/serial.h>
+
+-#define DRIVER_DESC "Silicon Labs CP210x RS232 serial adaptor driver"
++#define DRIVER_DESC "Silicon Labs CP210x RS232 serial adaptor driver (with 
GPIO support)"
+
+ /*
+  * Function Prototypes
+  */
+ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *);
+ static void cp210x_close(struct usb_serial_port *);
++static int cp210x_ioctl(struct tty_struct *tty,
++    unsigned int cmd, unsigned long arg);
+ static void cp210x_get_termios(struct tty_struct *, struct usb_serial_port *);
+ static void cp210x_get_termios_port(struct usb_serial_port *port,
+     unsigned int *cflagp, unsigned int *baudp);
+@@ -198,6 +200,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
+
+ struct cp210x_serial_private {
+     __u8            bInterfaceNumber;
++    __u8            bPartNumber;
+ };
+
+ static struct usb_serial_driver cp210x_device = {
+@@ -211,6 +214,7 @@ static struct usb_serial_driver cp210x_d
+     .bulk_out_size        = 256,
+     .open            = cp210x_open,
+     .close            = cp210x_close,
++    .ioctl            = cp210x_ioctl,
+     .break_ctl        = cp210x_break_ctl,
+     .set_termios        = cp210x_set_termios,
+     .tiocmget        = cp210x_tiocmget,
+@@ -224,6 +228,17 @@ static struct usb_serial_driver * const
+     &cp210x_device, NULL
+ };
+
++/* Part number definitions */
++#define CP2101_PARTNUM        0x01
++#define CP2102_PARTNUM        0x02
++#define CP2103_PARTNUM        0x03
++#define CP2104_PARTNUM        0x04
++#define CP2105_PARTNUM        0x05
++
++/* IOCTLs */
++#define IOCTL_GPIOGET        0x8000
++#define IOCTL_GPIOSET        0x8001
++
+ /* Config request types */
+ #define REQTYPE_HOST_TO_INTERFACE    0x41
+ #define REQTYPE_INTERFACE_TO_HOST    0xc1
+@@ -257,11 +272,17 @@ static struct usb_serial_driver * const
+ #define CP210X_SET_CHARS    0x19
+ #define CP210X_GET_BAUDRATE    0x1D
+ #define CP210X_SET_BAUDRATE    0x1E
++#define CP210X_VENDOR_SPECIFIC    0xFF
+
+ /* CP210X_IFC_ENABLE */
+ #define UART_ENABLE        0x0001
+ #define UART_DISABLE        0x0000
+
++/* CP210X_VENDOR_SPECIFIC */
++#define CP210X_WRITE_LATCH    0x37E1
++#define CP210X_READ_LATCH    0x00C2
++#define CP210X_GET_PARTNUM    0x370B
++
+ /* CP210X_(SET|GET)_BAUDDIV */
+ #define BAUD_RATE_GEN_FREQ    0x384000
+
+@@ -478,6 +499,96 @@ static void cp210x_close(struct usb_seri
+     cp210x_set_config_single(port, CP210X_IFC_ENABLE, UART_DISABLE);
+ }
+
++static int cp210x_ioctl(struct tty_struct *tty,
++    unsigned int cmd, unsigned long arg)
++{
++    struct usb_serial_port *port = tty->driver_data;
++    struct usb_serial *serial = port->serial;
++    struct cp210x_serial_private *port_priv = usb_get_serial_data(serial);
++    int result = 0;
++    unsigned int latch_setting = 0;
++
++    switch (cmd) {
++
++    case IOCTL_GPIOGET:
++        if ((port_priv->bPartNumber == CP2103_PARTNUM) ||
++            (port_priv->bPartNumber == CP2104_PARTNUM)) {
++            result = usb_control_msg(port->serial->dev,
++                    usb_rcvctrlpipe(port->serial->dev, 0),
++                    CP210X_VENDOR_SPECIFIC,
++                    REQTYPE_DEVICE_TO_HOST,
++                    CP210X_READ_LATCH,
++                    port_priv->bInterfaceNumber,
++                    &latch_setting, 1,
++                    USB_CTRL_GET_TIMEOUT);
++            if (result != 1)
++                return -EPROTO;
++            *(unsigned long *)arg = (unsigned long)latch_setting;
++            return 0;
++        } else if (port_priv->bPartNumber == CP2105_PARTNUM) {
++            result = usb_control_msg(port->serial->dev,
++                    usb_rcvctrlpipe(port->serial->dev, 0),
++                    CP210X_VENDOR_SPECIFIC,
++                    REQTYPE_INTERFACE_TO_HOST,
++                    CP210X_READ_LATCH,
++                    port_priv->bInterfaceNumber,
++                    &latch_setting, 1,
++                    USB_CTRL_GET_TIMEOUT);
++            if (result != 1)
++                return -EPROTO;
++            *(unsigned long *)arg = (unsigned long)latch_setting;
++            return 0;
++        } else {
++            return -ENOTSUPP;
++        }
++        break;
++
++    case IOCTL_GPIOSET:
++        if ((port_priv->bPartNumber == CP2103_PARTNUM) ||
++            (port_priv->bPartNumber == CP2104_PARTNUM)) {
++            latch_setting =
++                *(unsigned int *)arg & 0x000000FF;
++            latch_setting |=
++                (*(unsigned int *)arg & 0x00FF0000) >> 8;
++            result = usb_control_msg(port->serial->dev,
++                    usb_sndctrlpipe(port->serial->dev, 0),
++                    CP210X_VENDOR_SPECIFIC,
++                    REQTYPE_HOST_TO_DEVICE,
++                    CP210X_WRITE_LATCH,
++                    latch_setting,
++                    NULL, 0,
++                    USB_CTRL_SET_TIMEOUT);
++            if (result != 0)
++                return -EPROTO;
++            return 0;
++        } else if (port_priv->bPartNumber == CP2105_PARTNUM) {
++            latch_setting =
++                *(unsigned int *)arg & 0x000000FF;
++            latch_setting |=
++                (*(unsigned int *)arg & 0x00FF0000) >> 8;
++            result = usb_control_msg(port->serial->dev,
++                    usb_sndctrlpipe(port->serial->dev, 0),
++                    CP210X_VENDOR_SPECIFIC,
++                    REQTYPE_HOST_TO_INTERFACE,
++                    CP210X_WRITE_LATCH,
++                    port_priv->bInterfaceNumber,
++                    &latch_setting, 2,
++                    USB_CTRL_SET_TIMEOUT);
++            if (result != 2)
++                return -EPROTO;
++            return 0;
++        } else {
++            return -ENOTSUPP;
++        }
++        break;
++
++    default:
++        break;
++    }
++
++    return -ENOIOCTLCMD;
++}
++
+ /*
+  * cp210x_get_termios
+  * Reads the baud rate, data bits, parity, stop bits and flow control mode
+@@ -866,6 +977,7 @@ static int cp210x_startup(struct usb_ser
+ {
+     struct usb_host_interface *cur_altsetting;
+     struct cp210x_serial_private *spriv;
++    unsigned int partNum;
+
+     spriv = kzalloc(sizeof(*spriv), GFP_KERNEL);
+     if (!spriv)
+@@ -876,6 +988,17 @@ static int cp210x_startup(struct usb_ser
+
+     usb_set_serial_data(serial, spriv);
+
++    /* Get the 1-byte part number of the cp210x device */
++    usb_control_msg(serial->dev,
++        usb_rcvctrlpipe(serial->dev, 0),
++        CP210X_VENDOR_SPECIFIC,
++        REQTYPE_DEVICE_TO_HOST,
++        CP210X_GET_PARTNUM,
++        spriv->bInterfaceNumber,
++        &partNum, 1,
++        USB_CTRL_GET_TIMEOUT);
++    spriv->bPartNumber = partNum & 0xFF;
++
+     return 0;
+ }
+
-- 
1.9.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Mon Aug  3 14:08:22 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Mon, 3 Aug 2015 20:08:22 +0200
Subject: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl
 commands (from Silicon Labs)
In-Reply-To: <A3C746EC1C774B0DA57E652520837D00@fortmeadow.com>
References: <A3C746EC1C774B0DA57E652520837D00@fortmeadow.com>
Message-ID: <55BFAE16.30000@openwrt.org>

On 2015-08-03 19:55, Ted Hess wrote:
> Silicon Labs driver has ioctl support on devices which have GPIO pins. The 
> driver
> in the kernel repo does not have this feature.
> 
> Ref: 
> http://www.silabs.com/Support%20Documents/Software/Linux_CP210x_VCP_3.x.x_Release_Notes.txt
> 
> Signed-off-by: Ted Hess <thess at kitschensync.net>
Wouldn't it make more sense to expose this as a GPIO controller instead
of a driver specific ioctl interface?

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From thess at kitschensync.net  Mon Aug  3 14:17:34 2015
From: thess at kitschensync.net (Ted Hess)
Date: Mon, 3 Aug 2015 14:17:34 -0400
Subject: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl
	commands (from Silicon Labs)
In-Reply-To: <55BFAE16.30000@openwrt.org>
References: <A3C746EC1C774B0DA57E652520837D00@fortmeadow.com>
 <55BFAE16.30000@openwrt.org>
Message-ID: <AFEE55169B924D60B6D2F4892ADE2CD6@fortmeadow.com>

It would probably make sense to do it that way however, there are apps which already use the ioctl interface on this device and this 
code came directly from the the manufacturer's linux driver.

I'm not sure how to add general GPIO support for a specific USB device? Things to research...

(I think I may have to re-submit this without the gratuitous word-wrapping too)

/ted

-----Original Message----- 
From: Felix Fietkau
Sent: Monday, August 03, 2015 2:08 PM
To: Ted Hess ; OpenWrt developers
Subject: Re: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl commands (from Silicon Labs)

On 2015-08-03 19:55, Ted Hess wrote:
> Silicon Labs driver has ioctl support on devices which have GPIO pins. The
> driver
> in the kernel repo does not have this feature.
>
> Ref:
> http://www.silabs.com/Support%20Documents/Software/Linux_CP210x_VCP_3.x.x_Release_Notes.txt
>
> Signed-off-by: Ted Hess <thess at kitschensync.net>
Wouldn't it make more sense to expose this as a GPIO controller instead
of a driver specific ioctl interface?

- Felix 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Mon Aug  3 14:33:20 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Mon, 3 Aug 2015 20:33:20 +0200
Subject: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl
 commands (from Silicon Labs)
In-Reply-To: <AFEE55169B924D60B6D2F4892ADE2CD6@fortmeadow.com>
References: <A3C746EC1C774B0DA57E652520837D00@fortmeadow.com>
 <55BFAE16.30000@openwrt.org>
 <AFEE55169B924D60B6D2F4892ADE2CD6@fortmeadow.com>
Message-ID: <55BFB3F0.6080107@openwrt.org>

On 2015-08-03 20:17, Ted Hess wrote:
> It would probably make sense to do it that way however, there are apps which already use the ioctl interface on this device and this 
> code came directly from the the manufacturer's linux driver.
> 
> I'm not sure how to add general GPIO support for a specific USB device? Things to research...
Did the manufacturer submit this upstream already, or is somebody else
(maybe you) going to do so?

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From lynxis at fe80.eu  Mon Aug  3 15:25:00 2015
From: lynxis at fe80.eu (Alexander Couzens)
Date: Mon, 3 Aug 2015 21:25:00 +0200
Subject: [OpenWrt-Devel] lantiq DSL drivers / firmware info
In-Reply-To: <CAHsu+b-AKNsBn=86aJ2UJ2Z2CYYgyQC+85Kqs9XRmUR8Y3wNCw@mail.gmail.com>
References: <1430320363.2279.3.camel@sipsolutions.net>
 <CAFBinCB7arL+Lts1mpnCm3pX=ze=V800wy9xOUqjvsWfA7oYeg@mail.gmail.com>
 <CAONAcYObB1dRcbjq6aicdMSuBfhayr+T7o61cvLnVcxMiys=GQ@mail.gmail.com>
 <CAFBinCDZ2oz4BGMOLiKVx9zGuS3hL95EdqFnDpnQ=XX-SLHwuw@mail.gmail.com>
 <CAONAcYPuxYG9LAApLZdO2QNtw_N7v7Dvt1fjMZVARGAKkkpqBg@mail.gmail.com>
 <55714F60.6040402@gmail.com>
 <CAONAcYP30ZdjgQ=fkK2fX5KNgdqctSJ00COQdW0D-aPK4v6pCA@mail.gmail.com>
 <5572F43B.1080509@gmail.com>
 <CAFBinCAC+AVpfQ-1xCQ_mfW95Cm4VvsixcoSD4hBiT62bA8Nbg@mail.gmail.com>
 <CAONAcYMnkRxKdfNyDfn_QPjUrA=pA-O=hbMjxdiV_LhFvtp0RQ@mail.gmail.com>
 <55A0C816.3050703@gmail.com>
 <CAFBinCDO8koQ7ZGj=0PNpqCUqkVq=iU7FrTpj3E+2zyeN0unug@mail.gmail.com>
 <CAHsu+b-j8dZ+GWG6QgGTKL_xqQyqOaieo9=c5bDVfW5i=-EzqA@mail.gmail.com>
 <CAFBinCCtrCt73rkh3jqVzYnCL5+Ajic0aCmZw8cEoy2KPpSDNQ@mail.gmail.com>
 <20150724000306.11ac27b4@lazus.yip>
 <CAHsu+b-AKNsBn=86aJ2UJ2Z2CYYgyQC+85Kqs9XRmUR8Y3wNCw@mail.gmail.com>
Message-ID: <20150803212500.5dff23d6@lazus.yip>

I've took a look on 2 devices.
They differ a lot, there might be different revisions.
I'll take some photos tomorrow.

> PS: by poking around I found
> target/linux/lantiq/patches-3.18/0007-MIPS-lantiq-add-basic-tffs-driver.patch
> which looks like it reads the annex version off a mtd part I don't
> have. Any idea what that is about?
good question... no idea


-- 
Alexander Couzens

mail: lynxis at fe80.eu
jabber: lynxis at jabber.ccc.de
mobile: +4915123277221
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150803/3df03763/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From thess at kitschensync.net  Mon Aug  3 15:27:14 2015
From: thess at kitschensync.net (Ted Hess)
Date: Mon, 3 Aug 2015 15:27:14 -0400
Subject: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl
	commands (from Silicon Labs)
In-Reply-To: <55BFB3F0.6080107@openwrt.org>
References: <A3C746EC1C774B0DA57E652520837D00@fortmeadow.com>
 <55BFAE16.30000@openwrt.org>
 <AFEE55169B924D60B6D2F4892ADE2CD6@fortmeadow.com>
 <55BFB3F0.6080107@openwrt.org>
Message-ID: <313D826A9A24468BB60A7181383A1C2F@fortmeadow.com>

After a bit more research - This is what I know:

The upstream cp210x driver is not completely up-to-date with the driver silabs maintains on
their site. In their own words: "... unfortunately GPIO is not something that has been
committed to the Linux kernel yet for community maintenance. We leave the drivers on our
website, even though they are a bit behind the curve of the maintained kernels, to
demonstrate how to do this quickly using an ioctl() call."

I also noted that the patch I submitted is not up-to-date with their latest devices which are
supported in their driver - whoops.

I could try to submit this upstream even if it was snatched from their driver. Is this OK?

There is a small relay controller package (crelay) that I am going to submit to the packages
repo it this patch gets accepted. It uses the cp210x ioctl interface.

I will also submit this patch again here with the correct format and all the latest fixes from
the old Silicon Labs driver.

/ted

-----Original Message----- 
From: Felix Fietkau
Sent: Monday, August 03, 2015 2:33 PM
To: Ted Hess ; OpenWrt developers
Subject: Re: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl commands (from Silicon Labs)

On 2015-08-03 20:17, Ted Hess wrote:
> It would probably make sense to do it that way however, there are apps which already use the ioctl interface on this device and 
> this
> code came directly from the the manufacturer's linux driver.
>
> I'm not sure how to add general GPIO support for a specific USB device? Things to research...
Did the manufacturer submit this upstream already, or is somebody else
(maybe you) going to do so?

- Felix 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Mon Aug  3 16:59:06 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon, 03 Aug 2015 22:59:06 +0200
Subject: [OpenWrt-Devel] [PATCHv2 5/7] mac80211/linux-firmware: include
 firmware for brcmfmac-sdio
In-Reply-To: <CACna6rzgSfxrTs6JK6fctjYFvoiF4Hdq0fk7Uai7mQpdf3qdow@mail.gmail.com>
References: <CACna6rysSR86kbd1t7E4wERhygz1nPo5n+nCtKb9UQ5p2GpsPQ@mail.gmail.com>
 <20150730085216.GA20369@makrotopia.org>
 <CACna6rzgSfxrTs6JK6fctjYFvoiF4Hdq0fk7Uai7mQpdf3qdow@mail.gmail.com>
Message-ID: <55BFD61A.8040507@hauke-m.de>

On 07/30/2015 06:34 PM, Rafa? Mi?ecki wrote:
> On 30 July 2015 at 10:52, Daniel Golle <daniel at makrotopia.org> wrote:
>> @@ -2000,6 +2000,50 @@ endef
>>
>>  define KernelPackage/brcmfmac/install
>>         $(INSTALL_DIR) $(1)/lib/firmware/brcm
>> +ifneq ($(CONFIG_BRCMFMAC_SDIO),)
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43143-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43241b0-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43241b4-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43241b5-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4329-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4330-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4334-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4334-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43340-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43362-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4339-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43430-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43435-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +       $(INSTALL_DATA) \
>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4354-sdio.bin \
>> +               $(1)/lib/firmware/brcm/
>> +endef
> 
> Looks much better, thanks.
> 
> Two things:
> 1) Do we want to include firmware for all brcmfmac supported devices?
> I guess some of them are e.g. smartphones and I'm not sure if anyone
> wants to run OpenWrt on them. Or should we split it into more options
> maybe?

I think we should only add the firmware files we found on devices
running OpenWrt, each firmware is 216 to 580 KBytes.

You could do it similar to the iwlwifi firmware and only select the
firmware files by default which are found in routers and if some special
firmware could be needed from some target only select it by default for
that target.

> 2) If we want all firmware files then for SDIO devices we could try
> something clever like: $(PKG_BUILD_DIR)/brcm/brcmfmac*-sdio.bin maybe?
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From zajec5 at gmail.com  Mon Aug  3 18:27:18 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Tue, 4 Aug 2015 00:27:18 +0200
Subject: [OpenWrt-Devel] [PATCHv2 5/7] mac80211/linux-firmware: include
 firmware for brcmfmac-sdio
In-Reply-To: <55BFD61A.8040507@hauke-m.de>
References: <CACna6rysSR86kbd1t7E4wERhygz1nPo5n+nCtKb9UQ5p2GpsPQ@mail.gmail.com>
 <20150730085216.GA20369@makrotopia.org>
 <CACna6rzgSfxrTs6JK6fctjYFvoiF4Hdq0fk7Uai7mQpdf3qdow@mail.gmail.com>
 <55BFD61A.8040507@hauke-m.de>
Message-ID: <CACna6rxghmhtc=DwZk5OEuLF3ctXTDJpe5=wwDqDahqU3a5Mcw@mail.gmail.com>

On 3 August 2015 at 22:59, Hauke Mehrtens <hauke at hauke-m.de> wrote:
> On 07/30/2015 06:34 PM, Rafa? Mi?ecki wrote:
>> On 30 July 2015 at 10:52, Daniel Golle <daniel at makrotopia.org> wrote:
>>> @@ -2000,6 +2000,50 @@ endef
>>>
>>>  define KernelPackage/brcmfmac/install
>>>         $(INSTALL_DIR) $(1)/lib/firmware/brcm
>>> +ifneq ($(CONFIG_BRCMFMAC_SDIO),)
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43143-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43241b0-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43241b4-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43241b5-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4329-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4330-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4334-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4334-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43340-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43362-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4339-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43430-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43435-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +       $(INSTALL_DATA) \
>>> +               $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac4354-sdio.bin \
>>> +               $(1)/lib/firmware/brcm/
>>> +endef
>>
>> Looks much better, thanks.
>>
>> Two things:
>> 1) Do we want to include firmware for all brcmfmac supported devices?
>> I guess some of them are e.g. smartphones and I'm not sure if anyone
>> wants to run OpenWrt on them. Or should we split it into more options
>> maybe?
>
> I think we should only add the firmware files we found on devices
> running OpenWrt, each firmware is 216 to 580 KBytes.
>
> You could do it similar to the iwlwifi firmware and only select the
> firmware files by default which are found in routers and if some special
> firmware could be needed from some target only select it by default for
> that target.

Sounds sane for me.

Daniel: can you rewrite your patch to include only "really required"
firmware files by default? And if you have some time, you can also add
an extra option for adding rest of firmwares.

-- 
Rafa?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From Thomas.Huehn at dai-labor.de  Mon Aug  3 19:00:32 2015
From: Thomas.Huehn at dai-labor.de (=?utf-8?B?VGhvbWFzIEjDvGhu?=)
Date: Mon, 3 Aug 2015 23:00:32 +0000
Subject: [OpenWrt-Devel] Release of RegMon - a fast in-kernel phy/mac
 dmonitoring tool for QCA/Atheros WiFi cards
References: <C0531DDF-0033-4125-A1D7-0E3F197C54E3@dai-labor.de>
Message-ID: <2C4BC2EC-E905-4757-85C0-747F6EAA1294@dai-labor.de>

Hi all,

Today I???ve released my WiFi register monitoring tool RegMon on GitHub: https://github.com/thuehn/RegMon

RegMon consists of Atheros driver patches to monitor arbitrary registers under ath9k, ath5k and madwifi from user space with high sampling rates (up to ~20kHz). My common research use case is the fine-grained monitoring and analysis of all busy states (tx, rx, energy detection & idle), TSF and noise floor of the mac/phy layer from an Atheros WiFi card. But it can be used to sample any available register (like NAV, error registers, ect.).
There are also a bunch of scripts in the repo to set-up a wireless experiment, collect RegMon traces, parse, merge and plot them with R.

Feel free to use and change RegMon for your own purpose. As RegMon is still work in progress I am happy to receive and include your feedback and ideas.

Greetings from Berlin
Thomas

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From mathieu at codeaurora.org  Mon Aug  3 21:28:17 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Mon, 3 Aug 2015 18:28:17 -0700
Subject: [OpenWrt-Devel] [PATCH 2/2] tools/quilt: fix build error during
	kernel_menuconfig on a cleaned env
In-Reply-To: <55AF4632.7080604@openwrt.org>
References: <1437525579-8950-1-git-send-email-mathieu@codeaurora.org>
 <1437525579-8950-2-git-send-email-mathieu@codeaurora.org>
 <55AF4632.7080604@openwrt.org>
Message-ID: <017701d0ce54$d75aef20$8610cd60$@codeaurora.org>

Hi Jow,
I just tried it out. I confirm the SDK works after the patch as well.
Thanks,
Mathieu

-----Original Message-----
From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] On
Behalf Of Jo-Philipp Wich
Sent: Wednesday, July 22, 2015 12:29 AM
To: openwrt-devel at lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH 2/2] tools/quilt: fix build error during
kernel_menuconfig on a cleaned env

Hi,

this was originally done to fix quilt in the SDK. Did you test it there
after your change?

~ Jow
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Mon Aug  3 23:15:50 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 4 Aug 2015 11:15:50 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
Message-ID: <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>

Hi,

I am using ar71xx OpenWrt. I have connected internet connection to WAN port
and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i am
able to open GUI and even my mobile i connected to Wifi AP and able to open
GUI in mobile. But I am not able to access internet on mobile which is
connected to wifi0 AP.

I have added below script under /etc/firewall.user file.
iptables ...flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state NEW
iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
echo 1 >  /proc/sys/net/ipv4/ip_forward

#where br-lan = LAN
       eth0.2 = WAN

Could anyone help me to write the proper NAT rules so that able to access
the internet.

Thanks,

On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com> wrote:

> Hello Guys,
>
> It's working. Thanks a lot to all of you :)
>
> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>
>> The way to do this is to first forget about the factory reset problem and
>> configure the AP to do what you want (including any encryption)
>>
>> then you can take the resulting file and put it into the build system so
>> that it becomes the 'factory default' settings.
>>
>> Since you are not understanding how to configure the files from the
>> documentation, configure them from the GUI and then look at the resulting
>> files.
>>
>> David Lang
>>
>>
>> On Mon, 3 Aug 2015, John kerry wrote:
>>
>> Hi All,
>>>
>>> I created separate files directory and added network and wireless files
>>> and
>>> its working everything but still i am not able to use encryption wpa2.
>>> Below is the my script.
>>> config wifi-device  wifi0
>>>        option type     qcawifi
>>>        option channel  auto
>>>        option macaddr  00:03:7f:42:06:61
>>>        option hwmode   11ng
>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>        option disabled 0
>>>
>>> config wifi-iface
>>>        option device   wifi0
>>>        option network  lan
>>>        option mode     ap
>>>        option ssid     CD-1
>>>        option encryption psk2
>>>        option key      CD-1
>>>
>>> M I doing anything wrong?
>>>
>>> Thanks,
>>>
>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>
>>> to make the config be there after a factory reset, you need to put the
>>>> changes into the image that you build.
>>>>
>>>> you already did this for /etc/config/network, do the same thing for
>>>> /etc/config/wireless
>>>>
>>>> David Lang
>>>>
>>>>
>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>
>>>> Hi Leiten,
>>>>
>>>>>
>>>>> I have one issue, after upgrading this firmware it will load wireless
>>>>> configuration with this changes, actually it should load when i do
>>>>> factory
>>>>> reset.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com>
>>>>> wrote:
>>>>>
>>>>> Hi Leiten,
>>>>>
>>>>>>
>>>>>> Thank you so much, Its working :)
>>>>>>
>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>>
>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>> maillist
>>>>>>> to
>>>>>>> CC or just answer to CC, in each case I'll receive message but also
>>>>>>> everyone could see all discussion.
>>>>>>>
>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hi Leiten,
>>>>>>>>
>>>>>>>> I have added new files under and written below :
>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>
>>>>>>>>
>>>>>>> Use index in prefix of filename to set order of execution, so it'll
>>>>>>> be
>>>>>>> like '99-wireless'.
>>>>>>>
>>>>>>>
>>>>>>> #!/bin/sh
>>>>>>>> #
>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>> #
>>>>>>>>
>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>
>>>>>>>>
>>>>>>> Here is the problem. When uci-defaults invoke scripts there's already
>>>>>>> preconfiguration done and /etc/config/wireless already exists, so
>>>>>>> your
>>>>>>> script just exit at this point. Remove this line.
>>>>>>>
>>>>>>>
>>>>>>> touch /etc/config/wireless
>>>>>>>>
>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>
>>>>>>>> uci commit wireless
>>>>>>>>
>>>>>>>> exit 0
>>>>>>>>
>>>>>>>> and compile the source code using make V=s but still not changed
>>>>>>>> default
>>>>>>>> settings.
>>>>>>>>
>>>>>>>> Please help me to make it works.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> You can also use uci-defaults mechanism for your purpose. Just put
>>>>>>>>
>>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>>> script,
>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>
>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the Wi-Fi
>>>>>>>>>> is
>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>> settings.
>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Best Regards,
>>>>>>>>>> John
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>>
>>>>>>>>> openwrt-devel mailing list
>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>>
>>>>>>>> openwrt-devel mailing list
>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/913c6342/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Mon Aug  3 23:56:28 2015
From: david at lang.hm (David Lang)
Date: Mon, 3 Aug 2015 20:56:28 -0700 (PDT)
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>

can you connect via a wired port?

given that you've been changing /etc/config/network and /etc/config/wireless, 
could you show us what you ended up with there?

David Lang

On Tue, 4 Aug 2015, John kerry wrote:

> Hi,
>
> I am using ar71xx OpenWrt. I have connected internet connection to WAN port
> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i am
> able to open GUI and even my mobile i connected to Wifi AP and able to open
> GUI in mobile. But I am not able to access internet on mobile which is
> connected to wifi0 AP.
>
> I have added below script under /etc/firewall.user file.
> iptables ...flush
> iptables --table nat --flush
> iptables --delete-chain
> iptables --table nat --delete-chain
> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state NEW
> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
> echo 1 >  /proc/sys/net/ipv4/ip_forward
>
> #where br-lan = LAN
>       eth0.2 = WAN
>
> Could anyone help me to write the proper NAT rules so that able to access
> the internet.
>
> Thanks,
>
> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com> wrote:
>
>> Hello Guys,
>>
>> It's working. Thanks a lot to all of you :)
>>
>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>
>>> The way to do this is to first forget about the factory reset problem and
>>> configure the AP to do what you want (including any encryption)
>>>
>>> then you can take the resulting file and put it into the build system so
>>> that it becomes the 'factory default' settings.
>>>
>>> Since you are not understanding how to configure the files from the
>>> documentation, configure them from the GUI and then look at the resulting
>>> files.
>>>
>>> David Lang
>>>
>>>
>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>
>>> Hi All,
>>>>
>>>> I created separate files directory and added network and wireless files
>>>> and
>>>> its working everything but still i am not able to use encryption wpa2.
>>>> Below is the my script.
>>>> config wifi-device  wifi0
>>>>        option type     qcawifi
>>>>        option channel  auto
>>>>        option macaddr  00:03:7f:42:06:61
>>>>        option hwmode   11ng
>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>        option disabled 0
>>>>
>>>> config wifi-iface
>>>>        option device   wifi0
>>>>        option network  lan
>>>>        option mode     ap
>>>>        option ssid     CD-1
>>>>        option encryption psk2
>>>>        option key      CD-1
>>>>
>>>> M I doing anything wrong?
>>>>
>>>> Thanks,
>>>>
>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>
>>>> to make the config be there after a factory reset, you need to put the
>>>>> changes into the image that you build.
>>>>>
>>>>> you already did this for /etc/config/network, do the same thing for
>>>>> /etc/config/wireless
>>>>>
>>>>> David Lang
>>>>>
>>>>>
>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>
>>>>> Hi Leiten,
>>>>>
>>>>>>
>>>>>> I have one issue, after upgrading this firmware it will load wireless
>>>>>> configuration with this changes, actually it should load when i do
>>>>>> factory
>>>>>> reset.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hi Leiten,
>>>>>>
>>>>>>>
>>>>>>> Thank you so much, Its working :)
>>>>>>>
>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>>
>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>> maillist
>>>>>>>> to
>>>>>>>> CC or just answer to CC, in each case I'll receive message but also
>>>>>>>> everyone could see all discussion.
>>>>>>>>
>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John kerry
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hi Leiten,
>>>>>>>>>
>>>>>>>>> I have added new files under and written below :
>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>
>>>>>>>>>
>>>>>>>> Use index in prefix of filename to set order of execution, so it'll
>>>>>>>> be
>>>>>>>> like '99-wireless'.
>>>>>>>>
>>>>>>>>
>>>>>>>> #!/bin/sh
>>>>>>>>> #
>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>> #
>>>>>>>>>
>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>
>>>>>>>>>
>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's already
>>>>>>>> preconfiguration done and /etc/config/wireless already exists, so
>>>>>>>> your
>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>
>>>>>>>>
>>>>>>>> touch /etc/config/wireless
>>>>>>>>>
>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>
>>>>>>>>> uci commit wireless
>>>>>>>>>
>>>>>>>>> exit 0
>>>>>>>>>
>>>>>>>>> and compile the source code using make V=s but still not changed
>>>>>>>>> default
>>>>>>>>> settings.
>>>>>>>>>
>>>>>>>>> Please help me to make it works.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> You can also use uci-defaults mechanism for your purpose. Just put
>>>>>>>>>
>>>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>>>> script,
>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>
>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the Wi-Fi
>>>>>>>>>>> is
>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>> settings.
>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Best Regards,
>>>>>>>>>>> John
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>
>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>>
>>>>>>>>> openwrt-devel mailing list
>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>
>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Tue Aug  4 00:07:38 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 4 Aug 2015 12:07:38 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
Message-ID: <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>

Hi,

below is the /etc/config/network and /etc/config/wireless changes.

*/etc/config/network:*
config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0.1 eth1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.5'
        option netmask '255.255.255.0'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config switch
        option name 'eth0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'eth0'
        option vlan '1'
        option ports '0t 2 3 4 5'

config switch_vlan
        option device 'eth0'
        option vlan '2'
        option ports '0t 1'

config switch
        option name 'eth1'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'eth1'
        option vlan '1'
        option ports '0 1 2 3 4 5'



















*/etc/config/wireless:config wifi-device 'wifi0'        option type
'qcawifi'        option channel 'auto'        option macaddr
'00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
'19'        option htmode 'HT20'config wifi-iface        option device
'wifi0'        option network 'lan'        option mode 'ap'        option
encryption 'psk2'        option ssid 'Test_ap_1'        option key *
*'Test_ap_1'*

















*config wifi-device 'wifi1'        option type 'qcawifi'        option
channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
hwmode '11na'        option txpower '23'        option htmode 'HT20'config
wifi-iface        option device 'wifi1'        option network 'lan'
option mode 'ap'        option ssid 'Test_ap_2'        option encryption
'psk2'        option key 'test_ap_2''*


*Thanks,*

On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:

> can you connect via a wired port?
>
> given that you've been changing /etc/config/network and
> /etc/config/wireless, could you show us what you ended up with there?
>
> David Lang
>
>
> On Tue, 4 Aug 2015, John kerry wrote:
>
> Hi,
>>
>> I am using ar71xx OpenWrt. I have connected internet connection to WAN
>> port
>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i am
>> able to open GUI and even my mobile i connected to Wifi AP and able to
>> open
>> GUI in mobile. But I am not able to access internet on mobile which is
>> connected to wifi0 AP.
>>
>> I have added below script under /etc/firewall.user file.
>> iptables ...flush
>> iptables --table nat --flush
>> iptables --delete-chain
>> iptables --table nat --delete-chain
>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state NEW
>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>
>> #where br-lan = LAN
>>       eth0.2 = WAN
>>
>> Could anyone help me to write the proper NAT rules so that able to access
>> the internet.
>>
>> Thanks,
>>
>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com> wrote:
>>
>> Hello Guys,
>>>
>>> It's working. Thanks a lot to all of you :)
>>>
>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>>
>>> The way to do this is to first forget about the factory reset problem and
>>>> configure the AP to do what you want (including any encryption)
>>>>
>>>> then you can take the resulting file and put it into the build system so
>>>> that it becomes the 'factory default' settings.
>>>>
>>>> Since you are not understanding how to configure the files from the
>>>> documentation, configure them from the GUI and then look at the
>>>> resulting
>>>> files.
>>>>
>>>> David Lang
>>>>
>>>>
>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>
>>>> Hi All,
>>>>
>>>>>
>>>>> I created separate files directory and added network and wireless files
>>>>> and
>>>>> its working everything but still i am not able to use encryption wpa2.
>>>>> Below is the my script.
>>>>> config wifi-device  wifi0
>>>>>        option type     qcawifi
>>>>>        option channel  auto
>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>        option hwmode   11ng
>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>        option disabled 0
>>>>>
>>>>> config wifi-iface
>>>>>        option device   wifi0
>>>>>        option network  lan
>>>>>        option mode     ap
>>>>>        option ssid     CD-1
>>>>>        option encryption psk2
>>>>>        option key      CD-1
>>>>>
>>>>> M I doing anything wrong?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>>
>>>>> to make the config be there after a factory reset, you need to put the
>>>>>
>>>>>> changes into the image that you build.
>>>>>>
>>>>>> you already did this for /etc/config/network, do the same thing for
>>>>>> /etc/config/wireless
>>>>>>
>>>>>> David Lang
>>>>>>
>>>>>>
>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>
>>>>>> Hi Leiten,
>>>>>>
>>>>>>
>>>>>>> I have one issue, after upgrading this firmware it will load wireless
>>>>>>> configuration with this changes, actually it should load when i do
>>>>>>> factory
>>>>>>> reset.
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hi Leiten,
>>>>>>>
>>>>>>>
>>>>>>>> Thank you so much, Its working :)
>>>>>>>>
>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>>
>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>> maillist
>>>>>>>>> to
>>>>>>>>> CC or just answer to CC, in each case I'll receive message but also
>>>>>>>>> everyone could see all discussion.
>>>>>>>>>
>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John
>>>>>>>>> kerry
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi Leiten,
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Use index in prefix of filename to set order of execution, so
>>>>>>>>> it'll
>>>>>>>>> be
>>>>>>>>> like '99-wireless'.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> #!/bin/sh
>>>>>>>>>
>>>>>>>>>> #
>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>> #
>>>>>>>>>>
>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's
>>>>>>>>> already
>>>>>>>>> preconfiguration done and /etc/config/wireless already exists, so
>>>>>>>>> your
>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>
>>>>>>>>>> uci commit wireless
>>>>>>>>>>
>>>>>>>>>> exit 0
>>>>>>>>>>
>>>>>>>>>> and compile the source code using make V=s but still not changed
>>>>>>>>>> default
>>>>>>>>>> settings.
>>>>>>>>>>
>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> You can also use uci-defaults mechanism for your purpose. Just put
>>>>>>>>>>
>>>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>>>>> script,
>>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>>
>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the
>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>> is
>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>>> settings.
>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>> John
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>
>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>
>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>
>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/446da7f5/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Tue Aug  4 00:37:03 2015
From: david at lang.hm (David Lang)
Date: Mon, 3 Aug 2015 21:37:03 -0700 (PDT)
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508032135440.2262@nftneq.ynat.uz>

just changes doesn't help a lot (and it's rather hard to see what's what with 
the wireless file)

but it doesn't look like the wireless interfaces are configured to be part of 
the LAN interface.

David Lang

On Tue, 4 Aug 2015, John kerry wrote:

> Date: Tue, 4 Aug 2015 12:07:38 +0800
> From: John kerry <kerry9842 at gmail.com>
> To: David Lang <david at lang.hm>
> Cc: N.Leiten <nickleiten at gmail.com>,
>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>,
>     Alex Weedy <weedy2887 at gmail.com>
> Subject: Re: [OpenWrt-Devel] Change OpenWrt Wifi default settings
> 
> Hi,
>
> below is the /etc/config/network and /etc/config/wireless changes.
>
> */etc/config/network:*
> config interface 'loopback'
>        option ifname 'lo'
>        option proto 'static'
>        option ipaddr '127.0.0.1'
>        option netmask '255.0.0.0'
>
> config interface 'lan'
>        option ifname 'eth0.1 eth1'
>        option type 'bridge'
>        option proto 'static'
>        option ipaddr '192.168.1.5'
>        option netmask '255.255.255.0'
>
> config interface 'wan'
>        option ifname 'eth0.2'
>        option proto 'dhcp'
>
> config switch
>        option name 'eth0'
>        option reset '1'
>        option enable_vlan '1'
>
> config switch_vlan
>        option device 'eth0'
>        option vlan '1'
>        option ports '0t 2 3 4 5'
>
> config switch_vlan
>        option device 'eth0'
>        option vlan '2'
>        option ports '0t 1'
>
> config switch
>        option name 'eth1'
>        option reset '1'
>        option enable_vlan '1'
>
> config switch_vlan
>        option device 'eth1'
>        option vlan '1'
>        option ports '0 1 2 3 4 5'
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> */etc/config/wireless:config wifi-device 'wifi0'        option type
> 'qcawifi'        option channel 'auto'        option macaddr
> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
> '19'        option htmode 'HT20'config wifi-iface        option device
> 'wifi0'        option network 'lan'        option mode 'ap'        option
> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
> *'Test_ap_1'*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *config wifi-device 'wifi1'        option type 'qcawifi'        option
> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
> hwmode '11na'        option txpower '23'        option htmode 'HT20'config
> wifi-iface        option device 'wifi1'        option network 'lan'
> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
> 'psk2'        option key 'test_ap_2''*
>
>
> *Thanks,*
>
> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>
>> can you connect via a wired port?
>>
>> given that you've been changing /etc/config/network and
>> /etc/config/wireless, could you show us what you ended up with there?
>>
>> David Lang
>>
>>
>> On Tue, 4 Aug 2015, John kerry wrote:
>>
>> Hi,
>>>
>>> I am using ar71xx OpenWrt. I have connected internet connection to WAN
>>> port
>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i am
>>> able to open GUI and even my mobile i connected to Wifi AP and able to
>>> open
>>> GUI in mobile. But I am not able to access internet on mobile which is
>>> connected to wifi0 AP.
>>>
>>> I have added below script under /etc/firewall.user file.
>>> iptables ...flush
>>> iptables --table nat --flush
>>> iptables --delete-chain
>>> iptables --table nat --delete-chain
>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state NEW
>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>
>>> #where br-lan = LAN
>>>       eth0.2 = WAN
>>>
>>> Could anyone help me to write the proper NAT rules so that able to access
>>> the internet.
>>>
>>> Thanks,
>>>
>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com> wrote:
>>>
>>> Hello Guys,
>>>>
>>>> It's working. Thanks a lot to all of you :)
>>>>
>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>>>
>>>> The way to do this is to first forget about the factory reset problem and
>>>>> configure the AP to do what you want (including any encryption)
>>>>>
>>>>> then you can take the resulting file and put it into the build system so
>>>>> that it becomes the 'factory default' settings.
>>>>>
>>>>> Since you are not understanding how to configure the files from the
>>>>> documentation, configure them from the GUI and then look at the
>>>>> resulting
>>>>> files.
>>>>>
>>>>> David Lang
>>>>>
>>>>>
>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>
>>>>> Hi All,
>>>>>
>>>>>>
>>>>>> I created separate files directory and added network and wireless files
>>>>>> and
>>>>>> its working everything but still i am not able to use encryption wpa2.
>>>>>> Below is the my script.
>>>>>> config wifi-device  wifi0
>>>>>>        option type     qcawifi
>>>>>>        option channel  auto
>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>        option hwmode   11ng
>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>        option disabled 0
>>>>>>
>>>>>> config wifi-iface
>>>>>>        option device   wifi0
>>>>>>        option network  lan
>>>>>>        option mode     ap
>>>>>>        option ssid     CD-1
>>>>>>        option encryption psk2
>>>>>>        option key      CD-1
>>>>>>
>>>>>> M I doing anything wrong?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>>>
>>>>>> to make the config be there after a factory reset, you need to put the
>>>>>>
>>>>>>> changes into the image that you build.
>>>>>>>
>>>>>>> you already did this for /etc/config/network, do the same thing for
>>>>>>> /etc/config/wireless
>>>>>>>
>>>>>>> David Lang
>>>>>>>
>>>>>>>
>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>
>>>>>>> Hi Leiten,
>>>>>>>
>>>>>>>
>>>>>>>> I have one issue, after upgrading this firmware it will load wireless
>>>>>>>> configuration with this changes, actually it should load when i do
>>>>>>>> factory
>>>>>>>> reset.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hi Leiten,
>>>>>>>>
>>>>>>>>
>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>
>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>> maillist
>>>>>>>>>> to
>>>>>>>>>> CC or just answer to CC, in each case I'll receive message but also
>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>
>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John
>>>>>>>>>> kerry
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi Leiten,
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Use index in prefix of filename to set order of execution, so
>>>>>>>>>> it'll
>>>>>>>>>> be
>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> #!/bin/sh
>>>>>>>>>>
>>>>>>>>>>> #
>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>> #
>>>>>>>>>>>
>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's
>>>>>>>>>> already
>>>>>>>>>> preconfiguration done and /etc/config/wireless already exists, so
>>>>>>>>>> your
>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>
>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>
>>>>>>>>>>> exit 0
>>>>>>>>>>>
>>>>>>>>>>> and compile the source code using make V=s but still not changed
>>>>>>>>>>> default
>>>>>>>>>>> settings.
>>>>>>>>>>>
>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose. Just put
>>>>>>>>>>>
>>>>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>>>>>> script,
>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>>>
>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the
>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>> is
>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>>>> settings.
>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>> John
>>>>>>>>>>>>>
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>
>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>
>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>
>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>
>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From weedy2887 at gmail.com  Tue Aug  4 00:38:41 2015
From: weedy2887 at gmail.com (Weedy)
Date: Tue, 4 Aug 2015 00:38:41 -0400
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
Message-ID: <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>

Is there something wrong with the default rules for your use case?

Your WiFi interfaces are tagged LAN, things should just work.
On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:

> Hi,
>
> below is the /etc/config/network and /etc/config/wireless changes.
>
> */etc/config/network:*
> config interface 'loopback'
>         option ifname 'lo'
>         option proto 'static'
>         option ipaddr '127.0.0.1'
>         option netmask '255.0.0.0'
>
> config interface 'lan'
>         option ifname 'eth0.1 eth1'
>         option type 'bridge'
>         option proto 'static'
>         option ipaddr '192.168.1.5'
>         option netmask '255.255.255.0'
>
> config interface 'wan'
>         option ifname 'eth0.2'
>         option proto 'dhcp'
>
> config switch
>         option name 'eth0'
>         option reset '1'
>         option enable_vlan '1'
>
> config switch_vlan
>         option device 'eth0'
>         option vlan '1'
>         option ports '0t 2 3 4 5'
>
> config switch_vlan
>         option device 'eth0'
>         option vlan '2'
>         option ports '0t 1'
>
> config switch
>         option name 'eth1'
>         option reset '1'
>         option enable_vlan '1'
>
> config switch_vlan
>         option device 'eth1'
>         option vlan '1'
>         option ports '0 1 2 3 4 5'
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> */etc/config/wireless:config wifi-device 'wifi0'        option type
> 'qcawifi'        option channel 'auto'        option macaddr
> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
> '19'        option htmode 'HT20'config wifi-iface        option device
> 'wifi0'        option network 'lan'        option mode 'ap'        option
> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
> *'Test_ap_1'*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *config wifi-device 'wifi1'        option type 'qcawifi'        option
> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
> hwmode '11na'        option txpower '23'        option htmode 'HT20'config
> wifi-iface        option device 'wifi1'        option network 'lan'
> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
> 'psk2'        option key 'test_ap_2''*
>
>
> *Thanks,*
>
> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>
>> can you connect via a wired port?
>>
>> given that you've been changing /etc/config/network and
>> /etc/config/wireless, could you show us what you ended up with there?
>>
>> David Lang
>>
>>
>> On Tue, 4 Aug 2015, John kerry wrote:
>>
>> Hi,
>>>
>>> I am using ar71xx OpenWrt. I have connected internet connection to WAN
>>> port
>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i am
>>> able to open GUI and even my mobile i connected to Wifi AP and able to
>>> open
>>> GUI in mobile. But I am not able to access internet on mobile which is
>>> connected to wifi0 AP.
>>>
>>> I have added below script under /etc/firewall.user file.
>>> iptables ...flush
>>> iptables --table nat --flush
>>> iptables --delete-chain
>>> iptables --table nat --delete-chain
>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state NEW
>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>
>>> #where br-lan = LAN
>>>       eth0.2 = WAN
>>>
>>> Could anyone help me to write the proper NAT rules so that able to access
>>> the internet.
>>>
>>> Thanks,
>>>
>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com> wrote:
>>>
>>> Hello Guys,
>>>>
>>>> It's working. Thanks a lot to all of you :)
>>>>
>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>>>
>>>> The way to do this is to first forget about the factory reset problem
>>>>> and
>>>>> configure the AP to do what you want (including any encryption)
>>>>>
>>>>> then you can take the resulting file and put it into the build system
>>>>> so
>>>>> that it becomes the 'factory default' settings.
>>>>>
>>>>> Since you are not understanding how to configure the files from the
>>>>> documentation, configure them from the GUI and then look at the
>>>>> resulting
>>>>> files.
>>>>>
>>>>> David Lang
>>>>>
>>>>>
>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>
>>>>> Hi All,
>>>>>
>>>>>>
>>>>>> I created separate files directory and added network and wireless
>>>>>> files
>>>>>> and
>>>>>> its working everything but still i am not able to use encryption wpa2.
>>>>>> Below is the my script.
>>>>>> config wifi-device  wifi0
>>>>>>        option type     qcawifi
>>>>>>        option channel  auto
>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>        option hwmode   11ng
>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>        option disabled 0
>>>>>>
>>>>>> config wifi-iface
>>>>>>        option device   wifi0
>>>>>>        option network  lan
>>>>>>        option mode     ap
>>>>>>        option ssid     CD-1
>>>>>>        option encryption psk2
>>>>>>        option key      CD-1
>>>>>>
>>>>>> M I doing anything wrong?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>>>
>>>>>> to make the config be there after a factory reset, you need to put the
>>>>>>
>>>>>>> changes into the image that you build.
>>>>>>>
>>>>>>> you already did this for /etc/config/network, do the same thing for
>>>>>>> /etc/config/wireless
>>>>>>>
>>>>>>> David Lang
>>>>>>>
>>>>>>>
>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>
>>>>>>> Hi Leiten,
>>>>>>>
>>>>>>>
>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>> wireless
>>>>>>>> configuration with this changes, actually it should load when i do
>>>>>>>> factory
>>>>>>>> reset.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hi Leiten,
>>>>>>>>
>>>>>>>>
>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>
>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>> maillist
>>>>>>>>>> to
>>>>>>>>>> CC or just answer to CC, in each case I'll receive message but
>>>>>>>>>> also
>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>
>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John
>>>>>>>>>> kerry
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi Leiten,
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Use index in prefix of filename to set order of execution, so
>>>>>>>>>> it'll
>>>>>>>>>> be
>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> #!/bin/sh
>>>>>>>>>>
>>>>>>>>>>> #
>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>> #
>>>>>>>>>>>
>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's
>>>>>>>>>> already
>>>>>>>>>> preconfiguration done and /etc/config/wireless already exists, so
>>>>>>>>>> your
>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>
>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>
>>>>>>>>>>> exit 0
>>>>>>>>>>>
>>>>>>>>>>> and compile the source code using make V=s but still not changed
>>>>>>>>>>> default
>>>>>>>>>>> settings.
>>>>>>>>>>>
>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose. Just
>>>>>>>>>>> put
>>>>>>>>>>>
>>>>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>>>>>> script,
>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>>>
>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the
>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>> is
>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>>>> settings.
>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>> John
>>>>>>>>>>>>>
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>
>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>
>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>
>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>
>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/2063c8a1/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Tue Aug  4 00:42:05 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 4 Aug 2015 12:42:05 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
Message-ID: <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>

Hi
This is my firewall file:

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        option network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'wan'
        option network 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fe80::/10'
        option src_port '547'
        option dest_ip 'fe80::/10'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

config include 'miniupnpd'
        option type 'script'
        option path '/usr/share/miniupnpd/firewall.include'
        option family 'IPv4'
        option reload '1'

On Tue, Aug 4, 2015 at 12:38 PM, Weedy <weedy2887 at gmail.com> wrote:

> Is there something wrong with the default rules for your use case?
>
> Your WiFi interfaces are tagged LAN, things should just work.
> On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:
>
>> Hi,
>>
>> below is the /etc/config/network and /etc/config/wireless changes.
>>
>> */etc/config/network:*
>> config interface 'loopback'
>>         option ifname 'lo'
>>         option proto 'static'
>>         option ipaddr '127.0.0.1'
>>         option netmask '255.0.0.0'
>>
>> config interface 'lan'
>>         option ifname 'eth0.1 eth1'
>>         option type 'bridge'
>>         option proto 'static'
>>         option ipaddr '192.168.1.5'
>>         option netmask '255.255.255.0'
>>
>> config interface 'wan'
>>         option ifname 'eth0.2'
>>         option proto 'dhcp'
>>
>> config switch
>>         option name 'eth0'
>>         option reset '1'
>>         option enable_vlan '1'
>>
>> config switch_vlan
>>         option device 'eth0'
>>         option vlan '1'
>>         option ports '0t 2 3 4 5'
>>
>> config switch_vlan
>>         option device 'eth0'
>>         option vlan '2'
>>         option ports '0t 1'
>>
>> config switch
>>         option name 'eth1'
>>         option reset '1'
>>         option enable_vlan '1'
>>
>> config switch_vlan
>>         option device 'eth1'
>>         option vlan '1'
>>         option ports '0 1 2 3 4 5'
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> */etc/config/wireless:config wifi-device 'wifi0'        option type
>> 'qcawifi'        option channel 'auto'        option macaddr
>> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
>> '19'        option htmode 'HT20'config wifi-iface        option device
>> 'wifi0'        option network 'lan'        option mode 'ap'        option
>> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
>> *'Test_ap_1'*
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *config wifi-device 'wifi1'        option type 'qcawifi'        option
>> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
>> hwmode '11na'        option txpower '23'        option htmode 'HT20'config
>> wifi-iface        option device 'wifi1'        option network 'lan'
>> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
>> 'psk2'        option key 'test_ap_2''*
>>
>>
>> *Thanks,*
>>
>> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>>
>>> can you connect via a wired port?
>>>
>>> given that you've been changing /etc/config/network and
>>> /etc/config/wireless, could you show us what you ended up with there?
>>>
>>> David Lang
>>>
>>>
>>> On Tue, 4 Aug 2015, John kerry wrote:
>>>
>>> Hi,
>>>>
>>>> I am using ar71xx OpenWrt. I have connected internet connection to WAN
>>>> port
>>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i am
>>>> able to open GUI and even my mobile i connected to Wifi AP and able to
>>>> open
>>>> GUI in mobile. But I am not able to access internet on mobile which is
>>>> connected to wifi0 AP.
>>>>
>>>> I have added below script under /etc/firewall.user file.
>>>> iptables ...flush
>>>> iptables --table nat --flush
>>>> iptables --delete-chain
>>>> iptables --table nat --delete-chain
>>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state NEW
>>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>>
>>>> #where br-lan = LAN
>>>>       eth0.2 = WAN
>>>>
>>>> Could anyone help me to write the proper NAT rules so that able to
>>>> access
>>>> the internet.
>>>>
>>>> Thanks,
>>>>
>>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com>
>>>> wrote:
>>>>
>>>> Hello Guys,
>>>>>
>>>>> It's working. Thanks a lot to all of you :)
>>>>>
>>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>>>>
>>>>> The way to do this is to first forget about the factory reset problem
>>>>>> and
>>>>>> configure the AP to do what you want (including any encryption)
>>>>>>
>>>>>> then you can take the resulting file and put it into the build system
>>>>>> so
>>>>>> that it becomes the 'factory default' settings.
>>>>>>
>>>>>> Since you are not understanding how to configure the files from the
>>>>>> documentation, configure them from the GUI and then look at the
>>>>>> resulting
>>>>>> files.
>>>>>>
>>>>>> David Lang
>>>>>>
>>>>>>
>>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>>>
>>>>>>> I created separate files directory and added network and wireless
>>>>>>> files
>>>>>>> and
>>>>>>> its working everything but still i am not able to use encryption
>>>>>>> wpa2.
>>>>>>> Below is the my script.
>>>>>>> config wifi-device  wifi0
>>>>>>>        option type     qcawifi
>>>>>>>        option channel  auto
>>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>>        option hwmode   11ng
>>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>>        option disabled 0
>>>>>>>
>>>>>>> config wifi-iface
>>>>>>>        option device   wifi0
>>>>>>>        option network  lan
>>>>>>>        option mode     ap
>>>>>>>        option ssid     CD-1
>>>>>>>        option encryption psk2
>>>>>>>        option key      CD-1
>>>>>>>
>>>>>>> M I doing anything wrong?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>>>>
>>>>>>> to make the config be there after a factory reset, you need to put
>>>>>>> the
>>>>>>>
>>>>>>>> changes into the image that you build.
>>>>>>>>
>>>>>>>> you already did this for /etc/config/network, do the same thing for
>>>>>>>> /etc/config/wireless
>>>>>>>>
>>>>>>>> David Lang
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>>
>>>>>>>> Hi Leiten,
>>>>>>>>
>>>>>>>>
>>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>>> wireless
>>>>>>>>> configuration with this changes, actually it should load when i do
>>>>>>>>> factory
>>>>>>>>> reset.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi Leiten,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>>
>>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>>> maillist
>>>>>>>>>>> to
>>>>>>>>>>> CC or just answer to CC, in each case I'll receive message but
>>>>>>>>>>> also
>>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>>
>>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John
>>>>>>>>>>> kerry
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Use index in prefix of filename to set order of execution, so
>>>>>>>>>>> it'll
>>>>>>>>>>> be
>>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> #!/bin/sh
>>>>>>>>>>>
>>>>>>>>>>>> #
>>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>>> #
>>>>>>>>>>>>
>>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's
>>>>>>>>>>> already
>>>>>>>>>>> preconfiguration done and /etc/config/wireless already exists, so
>>>>>>>>>>> your
>>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>>
>>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>>
>>>>>>>>>>>> exit 0
>>>>>>>>>>>>
>>>>>>>>>>>> and compile the source code using make V=s but still not changed
>>>>>>>>>>>> default
>>>>>>>>>>>> settings.
>>>>>>>>>>>>
>>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose. Just
>>>>>>>>>>>> put
>>>>>>>>>>>>
>>>>>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>>>>>>> script,
>>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>>>>
>>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the
>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>> is
>>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>
>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>
>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>
>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/9c1f134d/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Tue Aug  4 01:27:08 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 4 Aug 2015 13:27:08 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CALcFQX5tFWVOOtY3R-qfTcgh8+1LNu5t3vwdEhBEDmEfvW8wqQ@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
Message-ID: <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>

Hi,

Its working, i am able to access internet but there is one problem,

When i scan the wireless devices, its gives the list of devices are there
nearby, then i connect anyone device, it will connect but my board wifi0
SSID name will change to that router which i connected. I mean LAN side
SSID should not change after connecting to WAN SSID.



On Tue, Aug 4, 2015 at 12:42 PM, John kerry <kerry9842 at gmail.com> wrote:

> Hi
> This is my firewall file:
>
> config defaults
>         option syn_flood '1'
>         option input 'ACCEPT'
>         option output 'ACCEPT'
>         option forward 'REJECT'
>
> config zone
>         option name 'lan'
>         option network 'lan'
>         option input 'ACCEPT'
>         option output 'ACCEPT'
>         option forward 'REJECT'
>
> config zone
>         option name 'wan'
>         option network 'wan'
>         option input 'REJECT'
>         option output 'ACCEPT'
>         option forward 'REJECT'
>         option masq '1'
>         option mtu_fix '1'
>
> config forwarding
>         option src 'lan'
>         option dest 'wan'
>
> config rule
>         option name 'Allow-DHCP-Renew'
>         option src 'wan'
>         option proto 'udp'
>         option dest_port '68'
>         option target 'ACCEPT'
>         option family 'ipv4'
>
> config rule
>         option name 'Allow-Ping'
>         option src 'wan'
>         option proto 'icmp'
>         option icmp_type 'echo-request'
>         option family 'ipv4'
>         option target 'ACCEPT'
>
> config rule
>         option name 'Allow-DHCPv6'
>         option src 'wan'
>         option proto 'udp'
>         option src_ip 'fe80::/10'
>         option src_port '547'
>         option dest_ip 'fe80::/10'
>         option dest_port '546'
>         option family 'ipv6'
>         option target 'ACCEPT'
>
> config rule
>         option name 'Allow-ICMPv6-Input'
>         option src 'wan'
>         option proto 'icmp'
>         list icmp_type 'echo-request'
>         list icmp_type 'echo-reply'
>         list icmp_type 'destination-unreachable'
>         list icmp_type 'packet-too-big'
>         list icmp_type 'time-exceeded'
>         list icmp_type 'bad-header'
>         list icmp_type 'unknown-header-type'
>         list icmp_type 'router-solicitation'
>         list icmp_type 'neighbour-solicitation'
>         list icmp_type 'router-advertisement'
>         list icmp_type 'neighbour-advertisement'
>         option limit '1000/sec'
>         option family 'ipv6'
>         option target 'ACCEPT'
>
> config rule
>         option name 'Allow-ICMPv6-Forward'
>         option src 'wan'
>         option dest '*'
>         option proto 'icmp'
>         list icmp_type 'echo-request'
>         list icmp_type 'echo-reply'
>         list icmp_type 'destination-unreachable'
>         list icmp_type 'packet-too-big'
>         list icmp_type 'time-exceeded'
>         list icmp_type 'bad-header'
>         list icmp_type 'unknown-header-type'
>         option limit '1000/sec'
>         option family 'ipv6'
>         option target 'ACCEPT'
>
> config include
>         option path '/etc/firewall.user'
>
> config include 'miniupnpd'
>         option type 'script'
>         option path '/usr/share/miniupnpd/firewall.include'
>         option family 'IPv4'
>         option reload '1'
>
> On Tue, Aug 4, 2015 at 12:38 PM, Weedy <weedy2887 at gmail.com> wrote:
>
>> Is there something wrong with the default rules for your use case?
>>
>> Your WiFi interfaces are tagged LAN, things should just work.
>> On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> below is the /etc/config/network and /etc/config/wireless changes.
>>>
>>> */etc/config/network:*
>>> config interface 'loopback'
>>>         option ifname 'lo'
>>>         option proto 'static'
>>>         option ipaddr '127.0.0.1'
>>>         option netmask '255.0.0.0'
>>>
>>> config interface 'lan'
>>>         option ifname 'eth0.1 eth1'
>>>         option type 'bridge'
>>>         option proto 'static'
>>>         option ipaddr '192.168.1.5'
>>>         option netmask '255.255.255.0'
>>>
>>> config interface 'wan'
>>>         option ifname 'eth0.2'
>>>         option proto 'dhcp'
>>>
>>> config switch
>>>         option name 'eth0'
>>>         option reset '1'
>>>         option enable_vlan '1'
>>>
>>> config switch_vlan
>>>         option device 'eth0'
>>>         option vlan '1'
>>>         option ports '0t 2 3 4 5'
>>>
>>> config switch_vlan
>>>         option device 'eth0'
>>>         option vlan '2'
>>>         option ports '0t 1'
>>>
>>> config switch
>>>         option name 'eth1'
>>>         option reset '1'
>>>         option enable_vlan '1'
>>>
>>> config switch_vlan
>>>         option device 'eth1'
>>>         option vlan '1'
>>>         option ports '0 1 2 3 4 5'
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> */etc/config/wireless:config wifi-device 'wifi0'        option type
>>> 'qcawifi'        option channel 'auto'        option macaddr
>>> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
>>> '19'        option htmode 'HT20'config wifi-iface        option device
>>> 'wifi0'        option network 'lan'        option mode 'ap'        option
>>> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
>>> *'Test_ap_1'*
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *config wifi-device 'wifi1'        option type 'qcawifi'        option
>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
>>> hwmode '11na'        option txpower '23'        option htmode 'HT20'config
>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
>>> 'psk2'        option key 'test_ap_2''*
>>>
>>>
>>> *Thanks,*
>>>
>>> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>>>
>>>> can you connect via a wired port?
>>>>
>>>> given that you've been changing /etc/config/network and
>>>> /etc/config/wireless, could you show us what you ended up with there?
>>>>
>>>> David Lang
>>>>
>>>>
>>>> On Tue, 4 Aug 2015, John kerry wrote:
>>>>
>>>> Hi,
>>>>>
>>>>> I am using ar71xx OpenWrt. I have connected internet connection to WAN
>>>>> port
>>>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i am
>>>>> able to open GUI and even my mobile i connected to Wifi AP and able to
>>>>> open
>>>>> GUI in mobile. But I am not able to access internet on mobile which is
>>>>> connected to wifi0 AP.
>>>>>
>>>>> I have added below script under /etc/firewall.user file.
>>>>> iptables ...flush
>>>>> iptables --table nat --flush
>>>>> iptables --delete-chain
>>>>> iptables --table nat --delete-chain
>>>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state NEW
>>>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>>>
>>>>> #where br-lan = LAN
>>>>>       eth0.2 = WAN
>>>>>
>>>>> Could anyone help me to write the proper NAT rules so that able to
>>>>> access
>>>>> the internet.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com>
>>>>> wrote:
>>>>>
>>>>> Hello Guys,
>>>>>>
>>>>>> It's working. Thanks a lot to all of you :)
>>>>>>
>>>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>>>>>
>>>>>> The way to do this is to first forget about the factory reset problem
>>>>>>> and
>>>>>>> configure the AP to do what you want (including any encryption)
>>>>>>>
>>>>>>> then you can take the resulting file and put it into the build
>>>>>>> system so
>>>>>>> that it becomes the 'factory default' settings.
>>>>>>>
>>>>>>> Since you are not understanding how to configure the files from the
>>>>>>> documentation, configure them from the GUI and then look at the
>>>>>>> resulting
>>>>>>> files.
>>>>>>>
>>>>>>> David Lang
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>>>
>>>>>>> Hi All,
>>>>>>>
>>>>>>>>
>>>>>>>> I created separate files directory and added network and wireless
>>>>>>>> files
>>>>>>>> and
>>>>>>>> its working everything but still i am not able to use encryption
>>>>>>>> wpa2.
>>>>>>>> Below is the my script.
>>>>>>>> config wifi-device  wifi0
>>>>>>>>        option type     qcawifi
>>>>>>>>        option channel  auto
>>>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>>>        option hwmode   11ng
>>>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>>>        option disabled 0
>>>>>>>>
>>>>>>>> config wifi-iface
>>>>>>>>        option device   wifi0
>>>>>>>>        option network  lan
>>>>>>>>        option mode     ap
>>>>>>>>        option ssid     CD-1
>>>>>>>>        option encryption psk2
>>>>>>>>        option key      CD-1
>>>>>>>>
>>>>>>>> M I doing anything wrong?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>>>>>
>>>>>>>> to make the config be there after a factory reset, you need to put
>>>>>>>> the
>>>>>>>>
>>>>>>>>> changes into the image that you build.
>>>>>>>>>
>>>>>>>>> you already did this for /etc/config/network, do the same thing for
>>>>>>>>> /etc/config/wireless
>>>>>>>>>
>>>>>>>>> David Lang
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>>>
>>>>>>>>> Hi Leiten,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>>>> wireless
>>>>>>>>>> configuration with this changes, actually it should load when i do
>>>>>>>>>> factory
>>>>>>>>>> reset.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi Leiten,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>>>
>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>>>> maillist
>>>>>>>>>>>> to
>>>>>>>>>>>> CC or just answer to CC, in each case I'll receive message but
>>>>>>>>>>>> also
>>>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>>>
>>>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John
>>>>>>>>>>>> kerry
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Use index in prefix of filename to set order of execution, so
>>>>>>>>>>>> it'll
>>>>>>>>>>>> be
>>>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> #!/bin/sh
>>>>>>>>>>>>
>>>>>>>>>>>>> #
>>>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>>>> #
>>>>>>>>>>>>>
>>>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's
>>>>>>>>>>>> already
>>>>>>>>>>>> preconfiguration done and /etc/config/wireless already exists,
>>>>>>>>>>>> so
>>>>>>>>>>>> your
>>>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>>>
>>>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>>>
>>>>>>>>>>>>> exit 0
>>>>>>>>>>>>>
>>>>>>>>>>>>> and compile the source code using make V=s but still not
>>>>>>>>>>>>> changed
>>>>>>>>>>>>> default
>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com
>>>>>>>>>>>>> >
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose. Just
>>>>>>>>>>>>> put
>>>>>>>>>>>>>
>>>>>>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>>>>>>>> script,
>>>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the
>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>
>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/e8c40a33/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Tue Aug  4 02:26:08 2015
From: david at lang.hm (David Lang)
Date: Mon, 3 Aug 2015 23:26:08 -0700 (PDT)
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>

A given radio can be either an AP or a client, but not both at once.

so if you use a radio to connect to another AP, you are making it a client, and 
in client mode all it can do is connect to that other AP as shows up as the SSID 
of that other AP.

you can do this with one radio, while using the other radio (assuming you have 
two) to act as an AP for local clients.

David Lang

  On Tue, 4 Aug 2015, John kerry wrote:

> Hi,
>
> Its working, i am able to access internet but there is one problem,
>
> When i scan the wireless devices, its gives the list of devices are there
> nearby, then i connect anyone device, it will connect but my board wifi0
> SSID name will change to that router which i connected. I mean LAN side
> SSID should not change after connecting to WAN SSID.
>
>
>
> On Tue, Aug 4, 2015 at 12:42 PM, John kerry <kerry9842 at gmail.com> wrote:
>
>> Hi
>> This is my firewall file:
>>
>> config defaults
>>         option syn_flood '1'
>>         option input 'ACCEPT'
>>         option output 'ACCEPT'
>>         option forward 'REJECT'
>>
>> config zone
>>         option name 'lan'
>>         option network 'lan'
>>         option input 'ACCEPT'
>>         option output 'ACCEPT'
>>         option forward 'REJECT'
>>
>> config zone
>>         option name 'wan'
>>         option network 'wan'
>>         option input 'REJECT'
>>         option output 'ACCEPT'
>>         option forward 'REJECT'
>>         option masq '1'
>>         option mtu_fix '1'
>>
>> config forwarding
>>         option src 'lan'
>>         option dest 'wan'
>>
>> config rule
>>         option name 'Allow-DHCP-Renew'
>>         option src 'wan'
>>         option proto 'udp'
>>         option dest_port '68'
>>         option target 'ACCEPT'
>>         option family 'ipv4'
>>
>> config rule
>>         option name 'Allow-Ping'
>>         option src 'wan'
>>         option proto 'icmp'
>>         option icmp_type 'echo-request'
>>         option family 'ipv4'
>>         option target 'ACCEPT'
>>
>> config rule
>>         option name 'Allow-DHCPv6'
>>         option src 'wan'
>>         option proto 'udp'
>>         option src_ip 'fe80::/10'
>>         option src_port '547'
>>         option dest_ip 'fe80::/10'
>>         option dest_port '546'
>>         option family 'ipv6'
>>         option target 'ACCEPT'
>>
>> config rule
>>         option name 'Allow-ICMPv6-Input'
>>         option src 'wan'
>>         option proto 'icmp'
>>         list icmp_type 'echo-request'
>>         list icmp_type 'echo-reply'
>>         list icmp_type 'destination-unreachable'
>>         list icmp_type 'packet-too-big'
>>         list icmp_type 'time-exceeded'
>>         list icmp_type 'bad-header'
>>         list icmp_type 'unknown-header-type'
>>         list icmp_type 'router-solicitation'
>>         list icmp_type 'neighbour-solicitation'
>>         list icmp_type 'router-advertisement'
>>         list icmp_type 'neighbour-advertisement'
>>         option limit '1000/sec'
>>         option family 'ipv6'
>>         option target 'ACCEPT'
>>
>> config rule
>>         option name 'Allow-ICMPv6-Forward'
>>         option src 'wan'
>>         option dest '*'
>>         option proto 'icmp'
>>         list icmp_type 'echo-request'
>>         list icmp_type 'echo-reply'
>>         list icmp_type 'destination-unreachable'
>>         list icmp_type 'packet-too-big'
>>         list icmp_type 'time-exceeded'
>>         list icmp_type 'bad-header'
>>         list icmp_type 'unknown-header-type'
>>         option limit '1000/sec'
>>         option family 'ipv6'
>>         option target 'ACCEPT'
>>
>> config include
>>         option path '/etc/firewall.user'
>>
>> config include 'miniupnpd'
>>         option type 'script'
>>         option path '/usr/share/miniupnpd/firewall.include'
>>         option family 'IPv4'
>>         option reload '1'
>>
>> On Tue, Aug 4, 2015 at 12:38 PM, Weedy <weedy2887 at gmail.com> wrote:
>>
>>> Is there something wrong with the default rules for your use case?
>>>
>>> Your WiFi interfaces are tagged LAN, things should just work.
>>> On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> below is the /etc/config/network and /etc/config/wireless changes.
>>>>
>>>> */etc/config/network:*
>>>> config interface 'loopback'
>>>>         option ifname 'lo'
>>>>         option proto 'static'
>>>>         option ipaddr '127.0.0.1'
>>>>         option netmask '255.0.0.0'
>>>>
>>>> config interface 'lan'
>>>>         option ifname 'eth0.1 eth1'
>>>>         option type 'bridge'
>>>>         option proto 'static'
>>>>         option ipaddr '192.168.1.5'
>>>>         option netmask '255.255.255.0'
>>>>
>>>> config interface 'wan'
>>>>         option ifname 'eth0.2'
>>>>         option proto 'dhcp'
>>>>
>>>> config switch
>>>>         option name 'eth0'
>>>>         option reset '1'
>>>>         option enable_vlan '1'
>>>>
>>>> config switch_vlan
>>>>         option device 'eth0'
>>>>         option vlan '1'
>>>>         option ports '0t 2 3 4 5'
>>>>
>>>> config switch_vlan
>>>>         option device 'eth0'
>>>>         option vlan '2'
>>>>         option ports '0t 1'
>>>>
>>>> config switch
>>>>         option name 'eth1'
>>>>         option reset '1'
>>>>         option enable_vlan '1'
>>>>
>>>> config switch_vlan
>>>>         option device 'eth1'
>>>>         option vlan '1'
>>>>         option ports '0 1 2 3 4 5'
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> */etc/config/wireless:config wifi-device 'wifi0'        option type
>>>> 'qcawifi'        option channel 'auto'        option macaddr
>>>> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
>>>> '19'        option htmode 'HT20'config wifi-iface        option device
>>>> 'wifi0'        option network 'lan'        option mode 'ap'        option
>>>> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
>>>> *'Test_ap_1'*
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *config wifi-device 'wifi1'        option type 'qcawifi'        option
>>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
>>>> hwmode '11na'        option txpower '23'        option htmode 'HT20'config
>>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>>> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
>>>> 'psk2'        option key 'test_ap_2''*
>>>>
>>>>
>>>> *Thanks,*
>>>>
>>>> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>>>>
>>>>> can you connect via a wired port?
>>>>>
>>>>> given that you've been changing /etc/config/network and
>>>>> /etc/config/wireless, could you show us what you ended up with there?
>>>>>
>>>>> David Lang
>>>>>
>>>>>
>>>>> On Tue, 4 Aug 2015, John kerry wrote:
>>>>>
>>>>> Hi,
>>>>>>
>>>>>> I am using ar71xx OpenWrt. I have connected internet connection to WAN
>>>>>> port
>>>>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i am
>>>>>> able to open GUI and even my mobile i connected to Wifi AP and able to
>>>>>> open
>>>>>> GUI in mobile. But I am not able to access internet on mobile which is
>>>>>> connected to wifi0 AP.
>>>>>>
>>>>>> I have added below script under /etc/firewall.user file.
>>>>>> iptables ...flush
>>>>>> iptables --table nat --flush
>>>>>> iptables --delete-chain
>>>>>> iptables --table nat --delete-chain
>>>>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state NEW
>>>>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>>>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>>>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>>>>
>>>>>> #where br-lan = LAN
>>>>>>       eth0.2 = WAN
>>>>>>
>>>>>> Could anyone help me to write the proper NAT rules so that able to
>>>>>> access
>>>>>> the internet.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hello Guys,
>>>>>>>
>>>>>>> It's working. Thanks a lot to all of you :)
>>>>>>>
>>>>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>>>>>>
>>>>>>> The way to do this is to first forget about the factory reset problem
>>>>>>>> and
>>>>>>>> configure the AP to do what you want (including any encryption)
>>>>>>>>
>>>>>>>> then you can take the resulting file and put it into the build
>>>>>>>> system so
>>>>>>>> that it becomes the 'factory default' settings.
>>>>>>>>
>>>>>>>> Since you are not understanding how to configure the files from the
>>>>>>>> documentation, configure them from the GUI and then look at the
>>>>>>>> resulting
>>>>>>>> files.
>>>>>>>>
>>>>>>>> David Lang
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I created separate files directory and added network and wireless
>>>>>>>>> files
>>>>>>>>> and
>>>>>>>>> its working everything but still i am not able to use encryption
>>>>>>>>> wpa2.
>>>>>>>>> Below is the my script.
>>>>>>>>> config wifi-device  wifi0
>>>>>>>>>        option type     qcawifi
>>>>>>>>>        option channel  auto
>>>>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>>>>        option hwmode   11ng
>>>>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>>>>        option disabled 0
>>>>>>>>>
>>>>>>>>> config wifi-iface
>>>>>>>>>        option device   wifi0
>>>>>>>>>        option network  lan
>>>>>>>>>        option mode     ap
>>>>>>>>>        option ssid     CD-1
>>>>>>>>>        option encryption psk2
>>>>>>>>>        option key      CD-1
>>>>>>>>>
>>>>>>>>> M I doing anything wrong?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>>>>>>
>>>>>>>>> to make the config be there after a factory reset, you need to put
>>>>>>>>> the
>>>>>>>>>
>>>>>>>>>> changes into the image that you build.
>>>>>>>>>>
>>>>>>>>>> you already did this for /etc/config/network, do the same thing for
>>>>>>>>>> /etc/config/wireless
>>>>>>>>>>
>>>>>>>>>> David Lang
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>>>>
>>>>>>>>>> Hi Leiten,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>>>>> wireless
>>>>>>>>>>> configuration with this changes, actually it should load when i do
>>>>>>>>>>> factory
>>>>>>>>>>> reset.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>>>>
>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>>>>> maillist
>>>>>>>>>>>>> to
>>>>>>>>>>>>> CC or just answer to CC, in each case I'll receive message but
>>>>>>>>>>>>> also
>>>>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>>>>
>>>>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user John
>>>>>>>>>>>>> kerry
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Use index in prefix of filename to set order of execution, so
>>>>>>>>>>>>> it'll
>>>>>>>>>>>>> be
>>>>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> #!/bin/sh
>>>>>>>>>>>>>
>>>>>>>>>>>>>> #
>>>>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights reserved.
>>>>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's
>>>>>>>>>>>>> already
>>>>>>>>>>>>> preconfiguration done and /etc/config/wireless already exists,
>>>>>>>>>>>>> so
>>>>>>>>>>>>> your
>>>>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> exit 0
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> and compile the source code using make V=s but still not
>>>>>>>>>>>>>> changed
>>>>>>>>>>>>>> default
>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <nickleiten at gmail.com
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose. Just
>>>>>>>>>>>>>> put
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> script in base-files/etc/uci-defaults and set your preferrable
>>>>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end of
>>>>>>>>>>>>>>> script,
>>>>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com>:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the
>>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>
>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>
>>>>
>>
>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Tue Aug  4 02:41:38 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 4 Aug 2015 14:41:38 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFFeJqcfcp6eY5cgdx-fZsGYhCV729+FM3Wycj-Hp0Zow@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
Message-ID: <CAGUNxBEhBJGscazcy_224ZN5Y0s-0ra6DVZ21LzGU0TO1=nFvw@mail.gmail.com>

Hi,

Yes i configured the mode as AP. could you please guide how i can add
script for another radio.

presently my wireless script is as below:















*config wifi-device 'wifi0'        option type 'qcawifi'        option
channel 'auto'        option macaddr '00:03:7f:42:06:61'        option
hwmode '11ng'        option txpower '19'        option htmode 'HT20'config
wifi-iface        option device 'wifi0'        option network 'lan'
option mode 'ap'        option encryption 'psk2'        option ssid
'Test_ap_1'        option key **'Test_ap_1'*

















*config wifi-device 'wifi1'        option type 'qcawifi'        option
channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
hwmode '11na'        option txpower '23'        option htmode 'HT20'config
wifi-iface        option device 'wifi1'        option network 'lan'
option mode 'ap'        option ssid 'Test_ap_2'        option encryption
'psk2'        option key 'test_ap_2'*


*How i can change this to make it work.*


*Thanks,*

On Tue, Aug 4, 2015 at 2:26 PM, David Lang <david at lang.hm> wrote:

> A given radio can be either an AP or a client, but not both at once.
>
> so if you use a radio to connect to another AP, you are making it a
> client, and in client mode all it can do is connect to that other AP as
> shows up as the SSID of that other AP.
>
> you can do this with one radio, while using the other radio (assuming you
> have two) to act as an AP for local clients.
>
> David Lang
>
>  On Tue, 4 Aug 2015, John kerry wrote:
>
> Hi,
>>
>> Its working, i am able to access internet but there is one problem,
>>
>> When i scan the wireless devices, its gives the list of devices are there
>> nearby, then i connect anyone device, it will connect but my board wifi0
>> SSID name will change to that router which i connected. I mean LAN side
>> SSID should not change after connecting to WAN SSID.
>>
>>
>>
>> On Tue, Aug 4, 2015 at 12:42 PM, John kerry <kerry9842 at gmail.com> wrote:
>>
>> Hi
>>> This is my firewall file:
>>>
>>> config defaults
>>>         option syn_flood '1'
>>>         option input 'ACCEPT'
>>>         option output 'ACCEPT'
>>>         option forward 'REJECT'
>>>
>>> config zone
>>>         option name 'lan'
>>>         option network 'lan'
>>>         option input 'ACCEPT'
>>>         option output 'ACCEPT'
>>>         option forward 'REJECT'
>>>
>>> config zone
>>>         option name 'wan'
>>>         option network 'wan'
>>>         option input 'REJECT'
>>>         option output 'ACCEPT'
>>>         option forward 'REJECT'
>>>         option masq '1'
>>>         option mtu_fix '1'
>>>
>>> config forwarding
>>>         option src 'lan'
>>>         option dest 'wan'
>>>
>>> config rule
>>>         option name 'Allow-DHCP-Renew'
>>>         option src 'wan'
>>>         option proto 'udp'
>>>         option dest_port '68'
>>>         option target 'ACCEPT'
>>>         option family 'ipv4'
>>>
>>> config rule
>>>         option name 'Allow-Ping'
>>>         option src 'wan'
>>>         option proto 'icmp'
>>>         option icmp_type 'echo-request'
>>>         option family 'ipv4'
>>>         option target 'ACCEPT'
>>>
>>> config rule
>>>         option name 'Allow-DHCPv6'
>>>         option src 'wan'
>>>         option proto 'udp'
>>>         option src_ip 'fe80::/10'
>>>         option src_port '547'
>>>         option dest_ip 'fe80::/10'
>>>         option dest_port '546'
>>>         option family 'ipv6'
>>>         option target 'ACCEPT'
>>>
>>> config rule
>>>         option name 'Allow-ICMPv6-Input'
>>>         option src 'wan'
>>>         option proto 'icmp'
>>>         list icmp_type 'echo-request'
>>>         list icmp_type 'echo-reply'
>>>         list icmp_type 'destination-unreachable'
>>>         list icmp_type 'packet-too-big'
>>>         list icmp_type 'time-exceeded'
>>>         list icmp_type 'bad-header'
>>>         list icmp_type 'unknown-header-type'
>>>         list icmp_type 'router-solicitation'
>>>         list icmp_type 'neighbour-solicitation'
>>>         list icmp_type 'router-advertisement'
>>>         list icmp_type 'neighbour-advertisement'
>>>         option limit '1000/sec'
>>>         option family 'ipv6'
>>>         option target 'ACCEPT'
>>>
>>> config rule
>>>         option name 'Allow-ICMPv6-Forward'
>>>         option src 'wan'
>>>         option dest '*'
>>>         option proto 'icmp'
>>>         list icmp_type 'echo-request'
>>>         list icmp_type 'echo-reply'
>>>         list icmp_type 'destination-unreachable'
>>>         list icmp_type 'packet-too-big'
>>>         list icmp_type 'time-exceeded'
>>>         list icmp_type 'bad-header'
>>>         list icmp_type 'unknown-header-type'
>>>         option limit '1000/sec'
>>>         option family 'ipv6'
>>>         option target 'ACCEPT'
>>>
>>> config include
>>>         option path '/etc/firewall.user'
>>>
>>> config include 'miniupnpd'
>>>         option type 'script'
>>>         option path '/usr/share/miniupnpd/firewall.include'
>>>         option family 'IPv4'
>>>         option reload '1'
>>>
>>> On Tue, Aug 4, 2015 at 12:38 PM, Weedy <weedy2887 at gmail.com> wrote:
>>>
>>> Is there something wrong with the default rules for your use case?
>>>>
>>>> Your WiFi interfaces are tagged LAN, things should just work.
>>>> On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>
>>>> Hi,
>>>>>
>>>>> below is the /etc/config/network and /etc/config/wireless changes.
>>>>>
>>>>> */etc/config/network:*
>>>>>
>>>>> config interface 'loopback'
>>>>>         option ifname 'lo'
>>>>>         option proto 'static'
>>>>>         option ipaddr '127.0.0.1'
>>>>>         option netmask '255.0.0.0'
>>>>>
>>>>> config interface 'lan'
>>>>>         option ifname 'eth0.1 eth1'
>>>>>         option type 'bridge'
>>>>>         option proto 'static'
>>>>>         option ipaddr '192.168.1.5'
>>>>>         option netmask '255.255.255.0'
>>>>>
>>>>> config interface 'wan'
>>>>>         option ifname 'eth0.2'
>>>>>         option proto 'dhcp'
>>>>>
>>>>> config switch
>>>>>         option name 'eth0'
>>>>>         option reset '1'
>>>>>         option enable_vlan '1'
>>>>>
>>>>> config switch_vlan
>>>>>         option device 'eth0'
>>>>>         option vlan '1'
>>>>>         option ports '0t 2 3 4 5'
>>>>>
>>>>> config switch_vlan
>>>>>         option device 'eth0'
>>>>>         option vlan '2'
>>>>>         option ports '0t 1'
>>>>>
>>>>> config switch
>>>>>         option name 'eth1'
>>>>>         option reset '1'
>>>>>         option enable_vlan '1'
>>>>>
>>>>> config switch_vlan
>>>>>         option device 'eth1'
>>>>>         option vlan '1'
>>>>>         option ports '0 1 2 3 4 5'
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> */etc/config/wireless:config wifi-device 'wifi0'        option type
>>>>> 'qcawifi'        option channel 'auto'        option macaddr
>>>>> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
>>>>> '19'        option htmode 'HT20'config wifi-iface        option device
>>>>> 'wifi0'        option network 'lan'        option mode 'ap'
>>>>> option
>>>>> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
>>>>> *'Test_ap_1'*
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *config wifi-device 'wifi1'        option type 'qcawifi'        option
>>>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
>>>>> hwmode '11na'        option txpower '23'        option htmode
>>>>> 'HT20'config
>>>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>>>> option mode 'ap'        option ssid 'Test_ap_2'        option
>>>>> encryption
>>>>> 'psk2'        option key 'test_ap_2''*
>>>>>
>>>>>
>>>>> *Thanks,*
>>>>>
>>>>>
>>>>> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>>>>>
>>>>> can you connect via a wired port?
>>>>>>
>>>>>> given that you've been changing /etc/config/network and
>>>>>> /etc/config/wireless, could you show us what you ended up with there?
>>>>>>
>>>>>> David Lang
>>>>>>
>>>>>>
>>>>>> On Tue, 4 Aug 2015, John kerry wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>>
>>>>>>> I am using ar71xx OpenWrt. I have connected internet connection to
>>>>>>> WAN
>>>>>>> port
>>>>>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i
>>>>>>> am
>>>>>>> able to open GUI and even my mobile i connected to Wifi AP and able
>>>>>>> to
>>>>>>> open
>>>>>>> GUI in mobile. But I am not able to access internet on mobile which
>>>>>>> is
>>>>>>> connected to wifi0 AP.
>>>>>>>
>>>>>>> I have added below script under /etc/firewall.user file.
>>>>>>> iptables ...flush
>>>>>>> iptables --table nat --flush
>>>>>>> iptables --delete-chain
>>>>>>> iptables --table nat --delete-chain
>>>>>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state
>>>>>>> NEW
>>>>>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>>>>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>>>>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>>>>>
>>>>>>> #where br-lan = LAN
>>>>>>>       eth0.2 = WAN
>>>>>>>
>>>>>>> Could anyone help me to write the proper NAT rules so that able to
>>>>>>> access
>>>>>>> the internet.
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hello Guys,
>>>>>>>
>>>>>>>>
>>>>>>>> It's working. Thanks a lot to all of you :)
>>>>>>>>
>>>>>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>>>>>>>
>>>>>>>> The way to do this is to first forget about the factory reset
>>>>>>>> problem
>>>>>>>>
>>>>>>>>> and
>>>>>>>>> configure the AP to do what you want (including any encryption)
>>>>>>>>>
>>>>>>>>> then you can take the resulting file and put it into the build
>>>>>>>>> system so
>>>>>>>>> that it becomes the 'factory default' settings.
>>>>>>>>>
>>>>>>>>> Since you are not understanding how to configure the files from the
>>>>>>>>> documentation, configure them from the GUI and then look at the
>>>>>>>>> resulting
>>>>>>>>> files.
>>>>>>>>>
>>>>>>>>> David Lang
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>>>>>
>>>>>>>>> Hi All,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> I created separate files directory and added network and wireless
>>>>>>>>>> files
>>>>>>>>>> and
>>>>>>>>>> its working everything but still i am not able to use encryption
>>>>>>>>>> wpa2.
>>>>>>>>>> Below is the my script.
>>>>>>>>>> config wifi-device  wifi0
>>>>>>>>>>        option type     qcawifi
>>>>>>>>>>        option channel  auto
>>>>>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>>>>>        option hwmode   11ng
>>>>>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>>>>>        option disabled 0
>>>>>>>>>>
>>>>>>>>>> config wifi-iface
>>>>>>>>>>        option device   wifi0
>>>>>>>>>>        option network  lan
>>>>>>>>>>        option mode     ap
>>>>>>>>>>        option ssid     CD-1
>>>>>>>>>>        option encryption psk2
>>>>>>>>>>        option key      CD-1
>>>>>>>>>>
>>>>>>>>>> M I doing anything wrong?
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>>>>>>>
>>>>>>>>>> to make the config be there after a factory reset, you need to put
>>>>>>>>>> the
>>>>>>>>>>
>>>>>>>>>> changes into the image that you build.
>>>>>>>>>>>
>>>>>>>>>>> you already did this for /etc/config/network, do the same thing
>>>>>>>>>>> for
>>>>>>>>>>> /etc/config/wireless
>>>>>>>>>>>
>>>>>>>>>>> David Lang
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>>>>>> wireless
>>>>>>>>>>>> configuration with this changes, actually it should load when i
>>>>>>>>>>>> do
>>>>>>>>>>>> factory
>>>>>>>>>>>> reset.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>
>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com
>>>>>>>>>>>> >
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com
>>>>>>>>>>>>> >
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>>>>>> maillist
>>>>>>>>>>>>>> to
>>>>>>>>>>>>>> CC or just answer to CC, in each case I'll receive message but
>>>>>>>>>>>>>> also
>>>>>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user
>>>>>>>>>>>>>> John
>>>>>>>>>>>>>> kerry
>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Use index in prefix of filename to set order of execution, so
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> it'll
>>>>>>>>>>>>>> be
>>>>>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> #!/bin/sh
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights
>>>>>>>>>>>>>>> reserved.
>>>>>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> already
>>>>>>>>>>>>>> preconfiguration done and /etc/config/wireless already exists,
>>>>>>>>>>>>>> so
>>>>>>>>>>>>>> your
>>>>>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> exit 0
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> and compile the source code using make V=s but still not
>>>>>>>>>>>>>>> changed
>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <
>>>>>>>>>>>>>>> nickleiten at gmail.com
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose.
>>>>>>>>>>>>>>> Just
>>>>>>>>>>>>>>> put
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> script in base-files/etc/uci-defaults and set your
>>>>>>>>>>>>>>> preferrable
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end
>>>>>>>>>>>>>>>> of
>>>>>>>>>>>>>>>> script,
>>>>>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com
>>>>>>>>>>>>>>>> >:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the
>>>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>
>>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/bf9444bd/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Tue Aug  4 02:56:27 2015
From: david at lang.hm (David Lang)
Date: Mon, 3 Aug 2015 23:56:27 -0700 (PDT)
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBEhBJGscazcy_224ZN5Y0s-0ra6DVZ21LzGU0TO1=nFvw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <CAGUNxBEhBJGscazcy_224ZN5Y0s-0ra6DVZ21LzGU0TO1=nFvw@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508032351470.2262@nftneq.ynat.uz>

you can't create a new radio with a script, you have to have a second radio in 
the hardware.

wifi0 is one radio, wifi1 is the second. configure one as an AP, the other as a 
client (you probably want to make the client be part of the wan 
interface/firewall group if it's your connection to the Internet)

As I said before, since you don't understand how the configs work, I'd suggest 
using the GUI to configure them and then look at what the resulting file looks 
like. A lot of expertise went into making the GUI set the right config options 
to make pretty complex things happen.

David Lang

On Tue, 4 Aug 2015, John kerry wrote:

> Date: Tue, 4 Aug 2015 14:41:38 +0800
> From: John kerry <kerry9842 at gmail.com>
> To: David Lang <david at lang.hm>
> Cc: Weedy <weedy2887 at gmail.com>, N. Leiten <nickleiten at gmail.com>,
>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
> Subject: Re: [OpenWrt-Devel] Change OpenWrt Wifi default settings
> 
> Hi,
>
> Yes i configured the mode as AP. could you please guide how i can add
> script for another radio.
>
> presently my wireless script is as below:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *config wifi-device 'wifi0'        option type 'qcawifi'        option
> channel 'auto'        option macaddr '00:03:7f:42:06:61'        option
> hwmode '11ng'        option txpower '19'        option htmode 'HT20'config
> wifi-iface        option device 'wifi0'        option network 'lan'
> option mode 'ap'        option encryption 'psk2'        option ssid
> 'Test_ap_1'        option key **'Test_ap_1'*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *config wifi-device 'wifi1'        option type 'qcawifi'        option
> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
> hwmode '11na'        option txpower '23'        option htmode 'HT20'config
> wifi-iface        option device 'wifi1'        option network 'lan'
> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
> 'psk2'        option key 'test_ap_2'*
>
>
> *How i can change this to make it work.*
>
>
> *Thanks,*
>
> On Tue, Aug 4, 2015 at 2:26 PM, David Lang <david at lang.hm> wrote:
>
>> A given radio can be either an AP or a client, but not both at once.
>>
>> so if you use a radio to connect to another AP, you are making it a
>> client, and in client mode all it can do is connect to that other AP as
>> shows up as the SSID of that other AP.
>>
>> you can do this with one radio, while using the other radio (assuming you
>> have two) to act as an AP for local clients.
>>
>> David Lang
>>
>>  On Tue, 4 Aug 2015, John kerry wrote:
>>
>> Hi,
>>>
>>> Its working, i am able to access internet but there is one problem,
>>>
>>> When i scan the wireless devices, its gives the list of devices are there
>>> nearby, then i connect anyone device, it will connect but my board wifi0
>>> SSID name will change to that router which i connected. I mean LAN side
>>> SSID should not change after connecting to WAN SSID.
>>>
>>>
>>>
>>> On Tue, Aug 4, 2015 at 12:42 PM, John kerry <kerry9842 at gmail.com> wrote:
>>>
>>> Hi
>>>> This is my firewall file:
>>>>
>>>> config defaults
>>>>         option syn_flood '1'
>>>>         option input 'ACCEPT'
>>>>         option output 'ACCEPT'
>>>>         option forward 'REJECT'
>>>>
>>>> config zone
>>>>         option name 'lan'
>>>>         option network 'lan'
>>>>         option input 'ACCEPT'
>>>>         option output 'ACCEPT'
>>>>         option forward 'REJECT'
>>>>
>>>> config zone
>>>>         option name 'wan'
>>>>         option network 'wan'
>>>>         option input 'REJECT'
>>>>         option output 'ACCEPT'
>>>>         option forward 'REJECT'
>>>>         option masq '1'
>>>>         option mtu_fix '1'
>>>>
>>>> config forwarding
>>>>         option src 'lan'
>>>>         option dest 'wan'
>>>>
>>>> config rule
>>>>         option name 'Allow-DHCP-Renew'
>>>>         option src 'wan'
>>>>         option proto 'udp'
>>>>         option dest_port '68'
>>>>         option target 'ACCEPT'
>>>>         option family 'ipv4'
>>>>
>>>> config rule
>>>>         option name 'Allow-Ping'
>>>>         option src 'wan'
>>>>         option proto 'icmp'
>>>>         option icmp_type 'echo-request'
>>>>         option family 'ipv4'
>>>>         option target 'ACCEPT'
>>>>
>>>> config rule
>>>>         option name 'Allow-DHCPv6'
>>>>         option src 'wan'
>>>>         option proto 'udp'
>>>>         option src_ip 'fe80::/10'
>>>>         option src_port '547'
>>>>         option dest_ip 'fe80::/10'
>>>>         option dest_port '546'
>>>>         option family 'ipv6'
>>>>         option target 'ACCEPT'
>>>>
>>>> config rule
>>>>         option name 'Allow-ICMPv6-Input'
>>>>         option src 'wan'
>>>>         option proto 'icmp'
>>>>         list icmp_type 'echo-request'
>>>>         list icmp_type 'echo-reply'
>>>>         list icmp_type 'destination-unreachable'
>>>>         list icmp_type 'packet-too-big'
>>>>         list icmp_type 'time-exceeded'
>>>>         list icmp_type 'bad-header'
>>>>         list icmp_type 'unknown-header-type'
>>>>         list icmp_type 'router-solicitation'
>>>>         list icmp_type 'neighbour-solicitation'
>>>>         list icmp_type 'router-advertisement'
>>>>         list icmp_type 'neighbour-advertisement'
>>>>         option limit '1000/sec'
>>>>         option family 'ipv6'
>>>>         option target 'ACCEPT'
>>>>
>>>> config rule
>>>>         option name 'Allow-ICMPv6-Forward'
>>>>         option src 'wan'
>>>>         option dest '*'
>>>>         option proto 'icmp'
>>>>         list icmp_type 'echo-request'
>>>>         list icmp_type 'echo-reply'
>>>>         list icmp_type 'destination-unreachable'
>>>>         list icmp_type 'packet-too-big'
>>>>         list icmp_type 'time-exceeded'
>>>>         list icmp_type 'bad-header'
>>>>         list icmp_type 'unknown-header-type'
>>>>         option limit '1000/sec'
>>>>         option family 'ipv6'
>>>>         option target 'ACCEPT'
>>>>
>>>> config include
>>>>         option path '/etc/firewall.user'
>>>>
>>>> config include 'miniupnpd'
>>>>         option type 'script'
>>>>         option path '/usr/share/miniupnpd/firewall.include'
>>>>         option family 'IPv4'
>>>>         option reload '1'
>>>>
>>>> On Tue, Aug 4, 2015 at 12:38 PM, Weedy <weedy2887 at gmail.com> wrote:
>>>>
>>>> Is there something wrong with the default rules for your use case?
>>>>>
>>>>> Your WiFi interfaces are tagged LAN, things should just work.
>>>>> On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>>>
>>>>>> below is the /etc/config/network and /etc/config/wireless changes.
>>>>>>
>>>>>> */etc/config/network:*
>>>>>>
>>>>>> config interface 'loopback'
>>>>>>         option ifname 'lo'
>>>>>>         option proto 'static'
>>>>>>         option ipaddr '127.0.0.1'
>>>>>>         option netmask '255.0.0.0'
>>>>>>
>>>>>> config interface 'lan'
>>>>>>         option ifname 'eth0.1 eth1'
>>>>>>         option type 'bridge'
>>>>>>         option proto 'static'
>>>>>>         option ipaddr '192.168.1.5'
>>>>>>         option netmask '255.255.255.0'
>>>>>>
>>>>>> config interface 'wan'
>>>>>>         option ifname 'eth0.2'
>>>>>>         option proto 'dhcp'
>>>>>>
>>>>>> config switch
>>>>>>         option name 'eth0'
>>>>>>         option reset '1'
>>>>>>         option enable_vlan '1'
>>>>>>
>>>>>> config switch_vlan
>>>>>>         option device 'eth0'
>>>>>>         option vlan '1'
>>>>>>         option ports '0t 2 3 4 5'
>>>>>>
>>>>>> config switch_vlan
>>>>>>         option device 'eth0'
>>>>>>         option vlan '2'
>>>>>>         option ports '0t 1'
>>>>>>
>>>>>> config switch
>>>>>>         option name 'eth1'
>>>>>>         option reset '1'
>>>>>>         option enable_vlan '1'
>>>>>>
>>>>>> config switch_vlan
>>>>>>         option device 'eth1'
>>>>>>         option vlan '1'
>>>>>>         option ports '0 1 2 3 4 5'
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> */etc/config/wireless:config wifi-device 'wifi0'        option type
>>>>>> 'qcawifi'        option channel 'auto'        option macaddr
>>>>>> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
>>>>>> '19'        option htmode 'HT20'config wifi-iface        option device
>>>>>> 'wifi0'        option network 'lan'        option mode 'ap'
>>>>>> option
>>>>>> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
>>>>>> *'Test_ap_1'*
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *config wifi-device 'wifi1'        option type 'qcawifi'        option
>>>>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
>>>>>> hwmode '11na'        option txpower '23'        option htmode
>>>>>> 'HT20'config
>>>>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>>>>> option mode 'ap'        option ssid 'Test_ap_2'        option
>>>>>> encryption
>>>>>> 'psk2'        option key 'test_ap_2''*
>>>>>>
>>>>>>
>>>>>> *Thanks,*
>>>>>>
>>>>>>
>>>>>> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>>>>>>
>>>>>> can you connect via a wired port?
>>>>>>>
>>>>>>> given that you've been changing /etc/config/network and
>>>>>>> /etc/config/wireless, could you show us what you ended up with there?
>>>>>>>
>>>>>>> David Lang
>>>>>>>
>>>>>>>
>>>>>>> On Tue, 4 Aug 2015, John kerry wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>>
>>>>>>>> I am using ar71xx OpenWrt. I have connected internet connection to
>>>>>>>> WAN
>>>>>>>> port
>>>>>>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP i
>>>>>>>> am
>>>>>>>> able to open GUI and even my mobile i connected to Wifi AP and able
>>>>>>>> to
>>>>>>>> open
>>>>>>>> GUI in mobile. But I am not able to access internet on mobile which
>>>>>>>> is
>>>>>>>> connected to wifi0 AP.
>>>>>>>>
>>>>>>>> I have added below script under /etc/firewall.user file.
>>>>>>>> iptables ...flush
>>>>>>>> iptables --table nat --flush
>>>>>>>> iptables --delete-chain
>>>>>>>> iptables --table nat --delete-chain
>>>>>>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state
>>>>>>>> NEW
>>>>>>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>>>>>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>>>>>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>>>>>>
>>>>>>>> #where br-lan = LAN
>>>>>>>>       eth0.2 = WAN
>>>>>>>>
>>>>>>>> Could anyone help me to write the proper NAT rules so that able to
>>>>>>>> access
>>>>>>>> the internet.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hello Guys,
>>>>>>>>
>>>>>>>>>
>>>>>>>>> It's working. Thanks a lot to all of you :)
>>>>>>>>>
>>>>>>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm> wrote:
>>>>>>>>>
>>>>>>>>> The way to do this is to first forget about the factory reset
>>>>>>>>> problem
>>>>>>>>>
>>>>>>>>>> and
>>>>>>>>>> configure the AP to do what you want (including any encryption)
>>>>>>>>>>
>>>>>>>>>> then you can take the resulting file and put it into the build
>>>>>>>>>> system so
>>>>>>>>>> that it becomes the 'factory default' settings.
>>>>>>>>>>
>>>>>>>>>> Since you are not understanding how to configure the files from the
>>>>>>>>>> documentation, configure them from the GUI and then look at the
>>>>>>>>>> resulting
>>>>>>>>>> files.
>>>>>>>>>>
>>>>>>>>>> David Lang
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>>>>>>
>>>>>>>>>> Hi All,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> I created separate files directory and added network and wireless
>>>>>>>>>>> files
>>>>>>>>>>> and
>>>>>>>>>>> its working everything but still i am not able to use encryption
>>>>>>>>>>> wpa2.
>>>>>>>>>>> Below is the my script.
>>>>>>>>>>> config wifi-device  wifi0
>>>>>>>>>>>        option type     qcawifi
>>>>>>>>>>>        option channel  auto
>>>>>>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>>>>>>        option hwmode   11ng
>>>>>>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>>>>>>        option disabled 0
>>>>>>>>>>>
>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>        option device   wifi0
>>>>>>>>>>>        option network  lan
>>>>>>>>>>>        option mode     ap
>>>>>>>>>>>        option ssid     CD-1
>>>>>>>>>>>        option encryption psk2
>>>>>>>>>>>        option key      CD-1
>>>>>>>>>>>
>>>>>>>>>>> M I doing anything wrong?
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm> wrote:
>>>>>>>>>>>
>>>>>>>>>>> to make the config be there after a factory reset, you need to put
>>>>>>>>>>> the
>>>>>>>>>>>
>>>>>>>>>>> changes into the image that you build.
>>>>>>>>>>>>
>>>>>>>>>>>> you already did this for /etc/config/network, do the same thing
>>>>>>>>>>>> for
>>>>>>>>>>>> /etc/config/wireless
>>>>>>>>>>>>
>>>>>>>>>>>> David Lang
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>>>>>>> wireless
>>>>>>>>>>>>> configuration with this changes, actually it should load when i
>>>>>>>>>>>>> do
>>>>>>>>>>>>> factory
>>>>>>>>>>>>> reset.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <kerry9842 at gmail.com
>>>>>>>>>>>>>>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <nickleiten at gmail.com
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>>>>>>> maillist
>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>> CC or just answer to CC, in each case I'll receive message but
>>>>>>>>>>>>>>> also
>>>>>>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user
>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>> kerry
>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Use index in prefix of filename to set order of execution, so
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> it'll
>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> #!/bin/sh
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights
>>>>>>>>>>>>>>>> reserved.
>>>>>>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts there's
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> already
>>>>>>>>>>>>>>> preconfiguration done and /etc/config/wireless already exists,
>>>>>>>>>>>>>>> so
>>>>>>>>>>>>>>> your
>>>>>>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> exit 0
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> and compile the source code using make V=s but still not
>>>>>>>>>>>>>>>> changed
>>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <
>>>>>>>>>>>>>>>> nickleiten at gmail.com
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose.
>>>>>>>>>>>>>>>> Just
>>>>>>>>>>>>>>>> put
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> script in base-files/etc/uci-defaults and set your
>>>>>>>>>>>>>>>> preferrable
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end
>>>>>>>>>>>>>>>>> of
>>>>>>>>>>>>>>>>> script,
>>>>>>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining changes.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <kerry9842 at gmail.com
>>>>>>>>>>>>>>>>>> :
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default the
>>>>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the default
>>>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>
>>>>>>
>>>>
>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Tue Aug  4 04:13:10 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 4 Aug 2015 16:13:10 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <alpine.DEB.2.02.1508032351470.2262@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <CAGUNxBEhBJGscazcy_224ZN5Y0s-0ra6DVZ21LzGU0TO1=nFvw@mail.gmail.com>
 <alpine.DEB.2.02.1508032351470.2262@nftneq.ynat.uz>
Message-ID: <CAGUNxBECrq+hWrAC=QFFmRAJhMk4jv=RUr=+EbWR+OfWna5FzQ@mail.gmail.com>

Hi,

I have 2 radio's wifi0 and wifi1 but one is configured for 2.4GHz and
another one is configured for 5GHz as below:

[image: Inline image 1]

First one i configured as below:

[image: Inline image 2]

wifi1 configured as below:


[image: Inline image 3]
mode configured as client and Network is WAN.

Is this are correct?

I have one doubts, both should be configured either 2.4GHz or 5GHz but for
wifi1 in GUI there is no option to change to 2.4GHz.

Thanks,

On Tue, Aug 4, 2015 at 2:56 PM, David Lang <david at lang.hm> wrote:

> you can't create a new radio with a script, you have to have a second
> radio in the hardware.
>
> wifi0 is one radio, wifi1 is the second. configure one as an AP, the other
> as a client (you probably want to make the client be part of the wan
> interface/firewall group if it's your connection to the Internet)
>
> As I said before, since you don't understand how the configs work, I'd
> suggest using the GUI to configure them and then look at what the resulting
> file looks like. A lot of expertise went into making the GUI set the right
> config options to make pretty complex things happen.
>
> David Lang
>
> On Tue, 4 Aug 2015, John kerry wrote:
>
> Date: Tue, 4 Aug 2015 14:41:38 +0800
>> From: John kerry <kerry9842 at gmail.com>
>> To: David Lang <david at lang.hm>
>> Cc: Weedy <weedy2887 at gmail.com>, N. Leiten <nickleiten at gmail.com>,
>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>> Subject: Re: [OpenWrt-Devel] Change OpenWrt Wifi default settings
>>
>> Hi,
>>
>> Yes i configured the mode as AP. could you please guide how i can add
>> script for another radio.
>>
>> presently my wireless script is as below:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *config wifi-device 'wifi0'        option type 'qcawifi'        option
>> channel 'auto'        option macaddr '00:03:7f:42:06:61'        option
>> hwmode '11ng'        option txpower '19'        option htmode 'HT20'config
>> wifi-iface        option device 'wifi0'        option network 'lan'
>> option mode 'ap'        option encryption 'psk2'        option ssid
>> 'Test_ap_1'        option key **'Test_ap_1'*
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *config wifi-device 'wifi1'        option type 'qcawifi'        option
>> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
>> hwmode '11na'        option txpower '23'        option htmode 'HT20'config
>> wifi-iface        option device 'wifi1'        option network 'lan'
>> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
>> 'psk2'        option key 'test_ap_2'*
>>
>>
>> *How i can change this to make it work.*
>>
>>
>>
>> *Thanks,*
>>
>> On Tue, Aug 4, 2015 at 2:26 PM, David Lang <david at lang.hm> wrote:
>>
>> A given radio can be either an AP or a client, but not both at once.
>>>
>>> so if you use a radio to connect to another AP, you are making it a
>>> client, and in client mode all it can do is connect to that other AP as
>>> shows up as the SSID of that other AP.
>>>
>>> you can do this with one radio, while using the other radio (assuming you
>>> have two) to act as an AP for local clients.
>>>
>>> David Lang
>>>
>>>  On Tue, 4 Aug 2015, John kerry wrote:
>>>
>>> Hi,
>>>
>>>>
>>>> Its working, i am able to access internet but there is one problem,
>>>>
>>>> When i scan the wireless devices, its gives the list of devices are
>>>> there
>>>> nearby, then i connect anyone device, it will connect but my board wifi0
>>>> SSID name will change to that router which i connected. I mean LAN side
>>>> SSID should not change after connecting to WAN SSID.
>>>>
>>>>
>>>>
>>>> On Tue, Aug 4, 2015 at 12:42 PM, John kerry <kerry9842 at gmail.com>
>>>> wrote:
>>>>
>>>> Hi
>>>>
>>>>> This is my firewall file:
>>>>>
>>>>> config defaults
>>>>>         option syn_flood '1'
>>>>>         option input 'ACCEPT'
>>>>>         option output 'ACCEPT'
>>>>>         option forward 'REJECT'
>>>>>
>>>>> config zone
>>>>>         option name 'lan'
>>>>>         option network 'lan'
>>>>>         option input 'ACCEPT'
>>>>>         option output 'ACCEPT'
>>>>>         option forward 'REJECT'
>>>>>
>>>>> config zone
>>>>>         option name 'wan'
>>>>>         option network 'wan'
>>>>>         option input 'REJECT'
>>>>>         option output 'ACCEPT'
>>>>>         option forward 'REJECT'
>>>>>         option masq '1'
>>>>>         option mtu_fix '1'
>>>>>
>>>>> config forwarding
>>>>>         option src 'lan'
>>>>>         option dest 'wan'
>>>>>
>>>>> config rule
>>>>>         option name 'Allow-DHCP-Renew'
>>>>>         option src 'wan'
>>>>>         option proto 'udp'
>>>>>         option dest_port '68'
>>>>>         option target 'ACCEPT'
>>>>>         option family 'ipv4'
>>>>>
>>>>> config rule
>>>>>         option name 'Allow-Ping'
>>>>>         option src 'wan'
>>>>>         option proto 'icmp'
>>>>>         option icmp_type 'echo-request'
>>>>>         option family 'ipv4'
>>>>>         option target 'ACCEPT'
>>>>>
>>>>> config rule
>>>>>         option name 'Allow-DHCPv6'
>>>>>         option src 'wan'
>>>>>         option proto 'udp'
>>>>>         option src_ip 'fe80::/10'
>>>>>         option src_port '547'
>>>>>         option dest_ip 'fe80::/10'
>>>>>         option dest_port '546'
>>>>>         option family 'ipv6'
>>>>>         option target 'ACCEPT'
>>>>>
>>>>> config rule
>>>>>         option name 'Allow-ICMPv6-Input'
>>>>>         option src 'wan'
>>>>>         option proto 'icmp'
>>>>>         list icmp_type 'echo-request'
>>>>>         list icmp_type 'echo-reply'
>>>>>         list icmp_type 'destination-unreachable'
>>>>>         list icmp_type 'packet-too-big'
>>>>>         list icmp_type 'time-exceeded'
>>>>>         list icmp_type 'bad-header'
>>>>>         list icmp_type 'unknown-header-type'
>>>>>         list icmp_type 'router-solicitation'
>>>>>         list icmp_type 'neighbour-solicitation'
>>>>>         list icmp_type 'router-advertisement'
>>>>>         list icmp_type 'neighbour-advertisement'
>>>>>         option limit '1000/sec'
>>>>>         option family 'ipv6'
>>>>>         option target 'ACCEPT'
>>>>>
>>>>> config rule
>>>>>         option name 'Allow-ICMPv6-Forward'
>>>>>         option src 'wan'
>>>>>         option dest '*'
>>>>>         option proto 'icmp'
>>>>>         list icmp_type 'echo-request'
>>>>>         list icmp_type 'echo-reply'
>>>>>         list icmp_type 'destination-unreachable'
>>>>>         list icmp_type 'packet-too-big'
>>>>>         list icmp_type 'time-exceeded'
>>>>>         list icmp_type 'bad-header'
>>>>>         list icmp_type 'unknown-header-type'
>>>>>         option limit '1000/sec'
>>>>>         option family 'ipv6'
>>>>>         option target 'ACCEPT'
>>>>>
>>>>> config include
>>>>>         option path '/etc/firewall.user'
>>>>>
>>>>> config include 'miniupnpd'
>>>>>         option type 'script'
>>>>>         option path '/usr/share/miniupnpd/firewall.include'
>>>>>         option family 'IPv4'
>>>>>         option reload '1'
>>>>>
>>>>> On Tue, Aug 4, 2015 at 12:38 PM, Weedy <weedy2887 at gmail.com> wrote:
>>>>>
>>>>> Is there something wrong with the default rules for your use case?
>>>>>
>>>>>>
>>>>>> Your WiFi interfaces are tagged LAN, things should just work.
>>>>>> On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>>
>>>>>>> below is the /etc/config/network and /etc/config/wireless changes.
>>>>>>>
>>>>>>> */etc/config/network:*
>>>>>>>
>>>>>>> config interface 'loopback'
>>>>>>>         option ifname 'lo'
>>>>>>>         option proto 'static'
>>>>>>>         option ipaddr '127.0.0.1'
>>>>>>>         option netmask '255.0.0.0'
>>>>>>>
>>>>>>> config interface 'lan'
>>>>>>>         option ifname 'eth0.1 eth1'
>>>>>>>         option type 'bridge'
>>>>>>>         option proto 'static'
>>>>>>>         option ipaddr '192.168.1.5'
>>>>>>>         option netmask '255.255.255.0'
>>>>>>>
>>>>>>> config interface 'wan'
>>>>>>>         option ifname 'eth0.2'
>>>>>>>         option proto 'dhcp'
>>>>>>>
>>>>>>> config switch
>>>>>>>         option name 'eth0'
>>>>>>>         option reset '1'
>>>>>>>         option enable_vlan '1'
>>>>>>>
>>>>>>> config switch_vlan
>>>>>>>         option device 'eth0'
>>>>>>>         option vlan '1'
>>>>>>>         option ports '0t 2 3 4 5'
>>>>>>>
>>>>>>> config switch_vlan
>>>>>>>         option device 'eth0'
>>>>>>>         option vlan '2'
>>>>>>>         option ports '0t 1'
>>>>>>>
>>>>>>> config switch
>>>>>>>         option name 'eth1'
>>>>>>>         option reset '1'
>>>>>>>         option enable_vlan '1'
>>>>>>>
>>>>>>> config switch_vlan
>>>>>>>         option device 'eth1'
>>>>>>>         option vlan '1'
>>>>>>>         option ports '0 1 2 3 4 5'
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> */etc/config/wireless:config wifi-device 'wifi0'        option type
>>>>>>> 'qcawifi'        option channel 'auto'        option macaddr
>>>>>>> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
>>>>>>> '19'        option htmode 'HT20'config wifi-iface        option
>>>>>>> device
>>>>>>> 'wifi0'        option network 'lan'        option mode 'ap'
>>>>>>> option
>>>>>>> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
>>>>>>> *'Test_ap_1'*
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *config wifi-device 'wifi1'        option type 'qcawifi'
>>>>>>> option
>>>>>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'
>>>>>>> option
>>>>>>> hwmode '11na'        option txpower '23'        option htmode
>>>>>>> 'HT20'config
>>>>>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>>>>>> option mode 'ap'        option ssid 'Test_ap_2'        option
>>>>>>> encryption
>>>>>>> 'psk2'        option key 'test_ap_2''*
>>>>>>>
>>>>>>>
>>>>>>> *Thanks,*
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>>>>>>>
>>>>>>> can you connect via a wired port?
>>>>>>>
>>>>>>>>
>>>>>>>> given that you've been changing /etc/config/network and
>>>>>>>> /etc/config/wireless, could you show us what you ended up with
>>>>>>>> there?
>>>>>>>>
>>>>>>>> David Lang
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, 4 Aug 2015, John kerry wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>>
>>>>>>>>> I am using ar71xx OpenWrt. I have connected internet connection to
>>>>>>>>> WAN
>>>>>>>>> port
>>>>>>>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP
>>>>>>>>> i
>>>>>>>>> am
>>>>>>>>> able to open GUI and even my mobile i connected to Wifi AP and able
>>>>>>>>> to
>>>>>>>>> open
>>>>>>>>> GUI in mobile. But I am not able to access internet on mobile which
>>>>>>>>> is
>>>>>>>>> connected to wifi0 AP.
>>>>>>>>>
>>>>>>>>> I have added below script under /etc/firewall.user file.
>>>>>>>>> iptables ...flush
>>>>>>>>> iptables --table nat --flush
>>>>>>>>> iptables --delete-chain
>>>>>>>>> iptables --table nat --delete-chain
>>>>>>>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state
>>>>>>>>> NEW
>>>>>>>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>>>>>>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>>>>>>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>>>>>>>
>>>>>>>>> #where br-lan = LAN
>>>>>>>>>       eth0.2 = WAN
>>>>>>>>>
>>>>>>>>> Could anyone help me to write the proper NAT rules so that able to
>>>>>>>>> access
>>>>>>>>> the internet.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hello Guys,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> It's working. Thanks a lot to all of you :)
>>>>>>>>>>
>>>>>>>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> The way to do this is to first forget about the factory reset
>>>>>>>>>> problem
>>>>>>>>>>
>>>>>>>>>> and
>>>>>>>>>>> configure the AP to do what you want (including any encryption)
>>>>>>>>>>>
>>>>>>>>>>> then you can take the resulting file and put it into the build
>>>>>>>>>>> system so
>>>>>>>>>>> that it becomes the 'factory default' settings.
>>>>>>>>>>>
>>>>>>>>>>> Since you are not understanding how to configure the files from
>>>>>>>>>>> the
>>>>>>>>>>> documentation, configure them from the GUI and then look at the
>>>>>>>>>>> resulting
>>>>>>>>>>> files.
>>>>>>>>>>>
>>>>>>>>>>> David Lang
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi All,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> I created separate files directory and added network and wireless
>>>>>>>>>>>> files
>>>>>>>>>>>> and
>>>>>>>>>>>> its working everything but still i am not able to use encryption
>>>>>>>>>>>> wpa2.
>>>>>>>>>>>> Below is the my script.
>>>>>>>>>>>> config wifi-device  wifi0
>>>>>>>>>>>>        option type     qcawifi
>>>>>>>>>>>>        option channel  auto
>>>>>>>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>>>>>>>        option hwmode   11ng
>>>>>>>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>>>>>>>        option disabled 0
>>>>>>>>>>>>
>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>        option device   wifi0
>>>>>>>>>>>>        option network  lan
>>>>>>>>>>>>        option mode     ap
>>>>>>>>>>>>        option ssid     CD-1
>>>>>>>>>>>>        option encryption psk2
>>>>>>>>>>>>        option key      CD-1
>>>>>>>>>>>>
>>>>>>>>>>>> M I doing anything wrong?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> to make the config be there after a factory reset, you need to
>>>>>>>>>>>> put
>>>>>>>>>>>> the
>>>>>>>>>>>>
>>>>>>>>>>>> changes into the image that you build.
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> you already did this for /etc/config/network, do the same thing
>>>>>>>>>>>>> for
>>>>>>>>>>>>> /etc/config/wireless
>>>>>>>>>>>>>
>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>>>>>>>
>>>>>>>>>>>>>> wireless
>>>>>>>>>>>>>> configuration with this changes, actually it should load when
>>>>>>>>>>>>>> i
>>>>>>>>>>>>>> do
>>>>>>>>>>>>>> factory
>>>>>>>>>>>>>> reset.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <
>>>>>>>>>>>>>> kerry9842 at gmail.com
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <
>>>>>>>>>>>>>>> nickleiten at gmail.com
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> maillist
>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>> CC or just answer to CC, in each case I'll receive message
>>>>>>>>>>>>>>>> but
>>>>>>>>>>>>>>>> also
>>>>>>>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user
>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>> kerry
>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Use index in prefix of filename to set order of execution,
>>>>>>>>>>>>>>>>> so
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> it'll
>>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> #!/bin/sh
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights
>>>>>>>>>>>>>>>>> reserved.
>>>>>>>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts
>>>>>>>>>>>>>>>>> there's
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> already
>>>>>>>>>>>>>>>> preconfiguration done and /etc/config/wireless already
>>>>>>>>>>>>>>>> exists,
>>>>>>>>>>>>>>>> so
>>>>>>>>>>>>>>>> your
>>>>>>>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> exit 0
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> and compile the source code using make V=s but still not
>>>>>>>>>>>>>>>>> changed
>>>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <
>>>>>>>>>>>>>>>>> nickleiten at gmail.com
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose.
>>>>>>>>>>>>>>>>> Just
>>>>>>>>>>>>>>>>> put
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> script in base-files/etc/uci-defaults and set your
>>>>>>>>>>>>>>>>> preferrable
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end
>>>>>>>>>>>>>>>>>> of
>>>>>>>>>>>>>>>>>> script,
>>>>>>>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining
>>>>>>>>>>>>>>>>>> changes.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <
>>>>>>>>>>>>>>>>>> kerry9842 at gmail.com
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> :
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default
>>>>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the
>>>>>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>
>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/a5f05671/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 30644 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/a5f05671/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 23184 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/a5f05671/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 33862 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/a5f05671/attachment-0002.png>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Tue Aug  4 04:16:35 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 4 Aug 2015 16:16:35 +0800
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBECrq+hWrAC=QFFmRAJhMk4jv=RUr=+EbWR+OfWna5FzQ@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <CAGUNxBEhBJGscazcy_224ZN5Y0s-0ra6DVZ21LzGU0TO1=nFvw@mail.gmail.com>
 <alpine.DEB.2.02.1508032351470.2262@nftneq.ynat.uz>
 <CAGUNxBECrq+hWrAC=QFFmRAJhMk4jv=RUr=+EbWR+OfWna5FzQ@mail.gmail.com>
Message-ID: <CAGUNxBGy1730xP58JCy8j23buWouahCqkhbg6Lw+0s2mU6=CbA@mail.gmail.com>

Hi,


Using Script we can set both either 2.4GHz or 5Ghz using "*option hwmode
'11na*"

On Tue, Aug 4, 2015 at 4:13 PM, John kerry <kerry9842 at gmail.com> wrote:

> Hi,
>
> I have 2 radio's wifi0 and wifi1 but one is configured for 2.4GHz and
> another one is configured for 5GHz as below:
>
> [image: Inline image 1]
>
> First one i configured as below:
>
> [image: Inline image 2]
>
> wifi1 configured as below:
>
>
> [image: Inline image 3]
> mode configured as client and Network is WAN.
>
> Is this are correct?
>
> I have one doubts, both should be configured either 2.4GHz or 5GHz but for
> wifi1 in GUI there is no option to change to 2.4GHz.
>
> Thanks,
>
> On Tue, Aug 4, 2015 at 2:56 PM, David Lang <david at lang.hm> wrote:
>
>> you can't create a new radio with a script, you have to have a second
>> radio in the hardware.
>>
>> wifi0 is one radio, wifi1 is the second. configure one as an AP, the
>> other as a client (you probably want to make the client be part of the wan
>> interface/firewall group if it's your connection to the Internet)
>>
>> As I said before, since you don't understand how the configs work, I'd
>> suggest using the GUI to configure them and then look at what the resulting
>> file looks like. A lot of expertise went into making the GUI set the right
>> config options to make pretty complex things happen.
>>
>> David Lang
>>
>> On Tue, 4 Aug 2015, John kerry wrote:
>>
>> Date: Tue, 4 Aug 2015 14:41:38 +0800
>>> From: John kerry <kerry9842 at gmail.com>
>>> To: David Lang <david at lang.hm>
>>> Cc: Weedy <weedy2887 at gmail.com>, N. Leiten <nickleiten at gmail.com>,
>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>> Subject: Re: [OpenWrt-Devel] Change OpenWrt Wifi default settings
>>>
>>> Hi,
>>>
>>> Yes i configured the mode as AP. could you please guide how i can add
>>> script for another radio.
>>>
>>> presently my wireless script is as below:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *config wifi-device 'wifi0'        option type 'qcawifi'        option
>>> channel 'auto'        option macaddr '00:03:7f:42:06:61'        option
>>> hwmode '11ng'        option txpower '19'        option htmode
>>> 'HT20'config
>>> wifi-iface        option device 'wifi0'        option network 'lan'
>>> option mode 'ap'        option encryption 'psk2'        option ssid
>>> 'Test_ap_1'        option key **'Test_ap_1'*
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *config wifi-device 'wifi1'        option type 'qcawifi'        option
>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
>>> hwmode '11na'        option txpower '23'        option htmode
>>> 'HT20'config
>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
>>> 'psk2'        option key 'test_ap_2'*
>>>
>>>
>>> *How i can change this to make it work.*
>>>
>>>
>>>
>>> *Thanks,*
>>>
>>> On Tue, Aug 4, 2015 at 2:26 PM, David Lang <david at lang.hm> wrote:
>>>
>>> A given radio can be either an AP or a client, but not both at once.
>>>>
>>>> so if you use a radio to connect to another AP, you are making it a
>>>> client, and in client mode all it can do is connect to that other AP as
>>>> shows up as the SSID of that other AP.
>>>>
>>>> you can do this with one radio, while using the other radio (assuming
>>>> you
>>>> have two) to act as an AP for local clients.
>>>>
>>>> David Lang
>>>>
>>>>  On Tue, 4 Aug 2015, John kerry wrote:
>>>>
>>>> Hi,
>>>>
>>>>>
>>>>> Its working, i am able to access internet but there is one problem,
>>>>>
>>>>> When i scan the wireless devices, its gives the list of devices are
>>>>> there
>>>>> nearby, then i connect anyone device, it will connect but my board
>>>>> wifi0
>>>>> SSID name will change to that router which i connected. I mean LAN side
>>>>> SSID should not change after connecting to WAN SSID.
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Aug 4, 2015 at 12:42 PM, John kerry <kerry9842 at gmail.com>
>>>>> wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>>> This is my firewall file:
>>>>>>
>>>>>> config defaults
>>>>>>         option syn_flood '1'
>>>>>>         option input 'ACCEPT'
>>>>>>         option output 'ACCEPT'
>>>>>>         option forward 'REJECT'
>>>>>>
>>>>>> config zone
>>>>>>         option name 'lan'
>>>>>>         option network 'lan'
>>>>>>         option input 'ACCEPT'
>>>>>>         option output 'ACCEPT'
>>>>>>         option forward 'REJECT'
>>>>>>
>>>>>> config zone
>>>>>>         option name 'wan'
>>>>>>         option network 'wan'
>>>>>>         option input 'REJECT'
>>>>>>         option output 'ACCEPT'
>>>>>>         option forward 'REJECT'
>>>>>>         option masq '1'
>>>>>>         option mtu_fix '1'
>>>>>>
>>>>>> config forwarding
>>>>>>         option src 'lan'
>>>>>>         option dest 'wan'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-DHCP-Renew'
>>>>>>         option src 'wan'
>>>>>>         option proto 'udp'
>>>>>>         option dest_port '68'
>>>>>>         option target 'ACCEPT'
>>>>>>         option family 'ipv4'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-Ping'
>>>>>>         option src 'wan'
>>>>>>         option proto 'icmp'
>>>>>>         option icmp_type 'echo-request'
>>>>>>         option family 'ipv4'
>>>>>>         option target 'ACCEPT'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-DHCPv6'
>>>>>>         option src 'wan'
>>>>>>         option proto 'udp'
>>>>>>         option src_ip 'fe80::/10'
>>>>>>         option src_port '547'
>>>>>>         option dest_ip 'fe80::/10'
>>>>>>         option dest_port '546'
>>>>>>         option family 'ipv6'
>>>>>>         option target 'ACCEPT'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-ICMPv6-Input'
>>>>>>         option src 'wan'
>>>>>>         option proto 'icmp'
>>>>>>         list icmp_type 'echo-request'
>>>>>>         list icmp_type 'echo-reply'
>>>>>>         list icmp_type 'destination-unreachable'
>>>>>>         list icmp_type 'packet-too-big'
>>>>>>         list icmp_type 'time-exceeded'
>>>>>>         list icmp_type 'bad-header'
>>>>>>         list icmp_type 'unknown-header-type'
>>>>>>         list icmp_type 'router-solicitation'
>>>>>>         list icmp_type 'neighbour-solicitation'
>>>>>>         list icmp_type 'router-advertisement'
>>>>>>         list icmp_type 'neighbour-advertisement'
>>>>>>         option limit '1000/sec'
>>>>>>         option family 'ipv6'
>>>>>>         option target 'ACCEPT'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-ICMPv6-Forward'
>>>>>>         option src 'wan'
>>>>>>         option dest '*'
>>>>>>         option proto 'icmp'
>>>>>>         list icmp_type 'echo-request'
>>>>>>         list icmp_type 'echo-reply'
>>>>>>         list icmp_type 'destination-unreachable'
>>>>>>         list icmp_type 'packet-too-big'
>>>>>>         list icmp_type 'time-exceeded'
>>>>>>         list icmp_type 'bad-header'
>>>>>>         list icmp_type 'unknown-header-type'
>>>>>>         option limit '1000/sec'
>>>>>>         option family 'ipv6'
>>>>>>         option target 'ACCEPT'
>>>>>>
>>>>>> config include
>>>>>>         option path '/etc/firewall.user'
>>>>>>
>>>>>> config include 'miniupnpd'
>>>>>>         option type 'script'
>>>>>>         option path '/usr/share/miniupnpd/firewall.include'
>>>>>>         option family 'IPv4'
>>>>>>         option reload '1'
>>>>>>
>>>>>> On Tue, Aug 4, 2015 at 12:38 PM, Weedy <weedy2887 at gmail.com> wrote:
>>>>>>
>>>>>> Is there something wrong with the default rules for your use case?
>>>>>>
>>>>>>>
>>>>>>> Your WiFi interfaces are tagged LAN, things should just work.
>>>>>>> On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>>
>>>>>>>> below is the /etc/config/network and /etc/config/wireless changes.
>>>>>>>>
>>>>>>>> */etc/config/network:*
>>>>>>>>
>>>>>>>> config interface 'loopback'
>>>>>>>>         option ifname 'lo'
>>>>>>>>         option proto 'static'
>>>>>>>>         option ipaddr '127.0.0.1'
>>>>>>>>         option netmask '255.0.0.0'
>>>>>>>>
>>>>>>>> config interface 'lan'
>>>>>>>>         option ifname 'eth0.1 eth1'
>>>>>>>>         option type 'bridge'
>>>>>>>>         option proto 'static'
>>>>>>>>         option ipaddr '192.168.1.5'
>>>>>>>>         option netmask '255.255.255.0'
>>>>>>>>
>>>>>>>> config interface 'wan'
>>>>>>>>         option ifname 'eth0.2'
>>>>>>>>         option proto 'dhcp'
>>>>>>>>
>>>>>>>> config switch
>>>>>>>>         option name 'eth0'
>>>>>>>>         option reset '1'
>>>>>>>>         option enable_vlan '1'
>>>>>>>>
>>>>>>>> config switch_vlan
>>>>>>>>         option device 'eth0'
>>>>>>>>         option vlan '1'
>>>>>>>>         option ports '0t 2 3 4 5'
>>>>>>>>
>>>>>>>> config switch_vlan
>>>>>>>>         option device 'eth0'
>>>>>>>>         option vlan '2'
>>>>>>>>         option ports '0t 1'
>>>>>>>>
>>>>>>>> config switch
>>>>>>>>         option name 'eth1'
>>>>>>>>         option reset '1'
>>>>>>>>         option enable_vlan '1'
>>>>>>>>
>>>>>>>> config switch_vlan
>>>>>>>>         option device 'eth1'
>>>>>>>>         option vlan '1'
>>>>>>>>         option ports '0 1 2 3 4 5'
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> */etc/config/wireless:config wifi-device 'wifi0'        option type
>>>>>>>> 'qcawifi'        option channel 'auto'        option macaddr
>>>>>>>> '00:03:7f:42:06:61'        option hwmode '11ng'        option
>>>>>>>> txpower
>>>>>>>> '19'        option htmode 'HT20'config wifi-iface        option
>>>>>>>> device
>>>>>>>> 'wifi0'        option network 'lan'        option mode 'ap'
>>>>>>>> option
>>>>>>>> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
>>>>>>>> *'Test_ap_1'*
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *config wifi-device 'wifi1'        option type 'qcawifi'
>>>>>>>> option
>>>>>>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'
>>>>>>>> option
>>>>>>>> hwmode '11na'        option txpower '23'        option htmode
>>>>>>>> 'HT20'config
>>>>>>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>>>>>>> option mode 'ap'        option ssid 'Test_ap_2'        option
>>>>>>>> encryption
>>>>>>>> 'psk2'        option key 'test_ap_2''*
>>>>>>>>
>>>>>>>>
>>>>>>>> *Thanks,*
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>>>>>>>>
>>>>>>>> can you connect via a wired port?
>>>>>>>>
>>>>>>>>>
>>>>>>>>> given that you've been changing /etc/config/network and
>>>>>>>>> /etc/config/wireless, could you show us what you ended up with
>>>>>>>>> there?
>>>>>>>>>
>>>>>>>>> David Lang
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, 4 Aug 2015, John kerry wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> I am using ar71xx OpenWrt. I have connected internet connection to
>>>>>>>>>> WAN
>>>>>>>>>> port
>>>>>>>>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static
>>>>>>>>>> IP i
>>>>>>>>>> am
>>>>>>>>>> able to open GUI and even my mobile i connected to Wifi AP and
>>>>>>>>>> able
>>>>>>>>>> to
>>>>>>>>>> open
>>>>>>>>>> GUI in mobile. But I am not able to access internet on mobile
>>>>>>>>>> which
>>>>>>>>>> is
>>>>>>>>>> connected to wifi0 AP.
>>>>>>>>>>
>>>>>>>>>> I have added below script under /etc/firewall.user file.
>>>>>>>>>> iptables ...flush
>>>>>>>>>> iptables --table nat --flush
>>>>>>>>>> iptables --delete-chain
>>>>>>>>>> iptables --table nat --delete-chain
>>>>>>>>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state
>>>>>>>>>> NEW
>>>>>>>>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j
>>>>>>>>>> ACCEPT
>>>>>>>>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>>>>>>>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>>>>>>>>
>>>>>>>>>> #where br-lan = LAN
>>>>>>>>>>       eth0.2 = WAN
>>>>>>>>>>
>>>>>>>>>> Could anyone help me to write the proper NAT rules so that able to
>>>>>>>>>> access
>>>>>>>>>> the internet.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hello Guys,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> It's working. Thanks a lot to all of you :)
>>>>>>>>>>>
>>>>>>>>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> The way to do this is to first forget about the factory reset
>>>>>>>>>>> problem
>>>>>>>>>>>
>>>>>>>>>>> and
>>>>>>>>>>>> configure the AP to do what you want (including any encryption)
>>>>>>>>>>>>
>>>>>>>>>>>> then you can take the resulting file and put it into the build
>>>>>>>>>>>> system so
>>>>>>>>>>>> that it becomes the 'factory default' settings.
>>>>>>>>>>>>
>>>>>>>>>>>> Since you are not understanding how to configure the files from
>>>>>>>>>>>> the
>>>>>>>>>>>> documentation, configure them from the GUI and then look at the
>>>>>>>>>>>> resulting
>>>>>>>>>>>> files.
>>>>>>>>>>>>
>>>>>>>>>>>> David Lang
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi All,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I created separate files directory and added network and
>>>>>>>>>>>>> wireless
>>>>>>>>>>>>> files
>>>>>>>>>>>>> and
>>>>>>>>>>>>> its working everything but still i am not able to use
>>>>>>>>>>>>> encryption
>>>>>>>>>>>>> wpa2.
>>>>>>>>>>>>> Below is the my script.
>>>>>>>>>>>>> config wifi-device  wifi0
>>>>>>>>>>>>>        option type     qcawifi
>>>>>>>>>>>>>        option channel  auto
>>>>>>>>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>>>>>>>>        option hwmode   11ng
>>>>>>>>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>>>>>>>>        option disabled 0
>>>>>>>>>>>>>
>>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>>        option device   wifi0
>>>>>>>>>>>>>        option network  lan
>>>>>>>>>>>>>        option mode     ap
>>>>>>>>>>>>>        option ssid     CD-1
>>>>>>>>>>>>>        option encryption psk2
>>>>>>>>>>>>>        option key      CD-1
>>>>>>>>>>>>>
>>>>>>>>>>>>> M I doing anything wrong?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> to make the config be there after a factory reset, you need to
>>>>>>>>>>>>> put
>>>>>>>>>>>>> the
>>>>>>>>>>>>>
>>>>>>>>>>>>> changes into the image that you build.
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> you already did this for /etc/config/network, do the same
>>>>>>>>>>>>>> thing
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> /etc/config/wireless
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> wireless
>>>>>>>>>>>>>>> configuration with this changes, actually it should load
>>>>>>>>>>>>>>> when i
>>>>>>>>>>>>>>> do
>>>>>>>>>>>>>>> factory
>>>>>>>>>>>>>>> reset.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <
>>>>>>>>>>>>>>> kerry9842 at gmail.com
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <
>>>>>>>>>>>>>>>> nickleiten at gmail.com
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Don't answer to my e-mail only, you need to add
>>>>>>>>>>>>>>>> openwrt-devel
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> maillist
>>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>>> CC or just answer to CC, in each case I'll receive message
>>>>>>>>>>>>>>>>> but
>>>>>>>>>>>>>>>>> also
>>>>>>>>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user
>>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>>> kerry
>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>>>>>>>>> vi
>>>>>>>>>>>>>>>>>> target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Use index in prefix of filename to set order of
>>>>>>>>>>>>>>>>>> execution, so
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> it'll
>>>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> #!/bin/sh
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights
>>>>>>>>>>>>>>>>>> reserved.
>>>>>>>>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts
>>>>>>>>>>>>>>>>>> there's
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> already
>>>>>>>>>>>>>>>>> preconfiguration done and /etc/config/wireless already
>>>>>>>>>>>>>>>>> exists,
>>>>>>>>>>>>>>>>> so
>>>>>>>>>>>>>>>>> your
>>>>>>>>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> exit 0
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> and compile the source code using make V=s but still not
>>>>>>>>>>>>>>>>>> changed
>>>>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <
>>>>>>>>>>>>>>>>>> nickleiten at gmail.com
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose.
>>>>>>>>>>>>>>>>>> Just
>>>>>>>>>>>>>>>>>> put
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> script in base-files/etc/uci-defaults and set your
>>>>>>>>>>>>>>>>>> preferrable
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the
>>>>>>>>>>>>>>>>>>> end
>>>>>>>>>>>>>>>>>>> of
>>>>>>>>>>>>>>>>>>> script,
>>>>>>>>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining
>>>>>>>>>>>>>>>>>>> changes.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <
>>>>>>>>>>>>>>>>>>> kerry9842 at gmail.com
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> :
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default
>>>>>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the
>>>>>>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>
>>>>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/3a840d58/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 30644 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/3a840d58/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 33862 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/3a840d58/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 23184 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/3a840d58/attachment-0002.png>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Tue Aug  4 04:24:22 2015
From: david at lang.hm (David Lang)
Date: Tue, 4 Aug 2015 01:24:22 -0700 (PDT)
Subject: [OpenWrt-Devel] Change OpenWrt Wifi default settings
In-Reply-To: <CAGUNxBECrq+hWrAC=QFFmRAJhMk4jv=RUr=+EbWR+OfWna5FzQ@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <CAGUNxBEhBJGscazcy_224ZN5Y0s-0ra6DVZ21LzGU0TO1=nFvw@mail.gmail.com>
 <alpine.DEB.2.02.1508032351470.2262@nftneq.ynat.uz>
 <CAGUNxBECrq+hWrAC=QFFmRAJhMk4jv=RUr=+EbWR+OfWna5FzQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508040119140.5197@nftneq.ynat.uz>

On Tue, 4 Aug 2015, John kerry wrote:

> I have one doubts, both should be configured either 2.4GHz or 5GHz but for
> wifi1 in GUI there is no option to change to 2.4GHz.

no, one radio is only able to operate on the 2.4GHz band and the other is only 
able to operate on the 5GHz band. this isn't a configuration item, this is teh 
physical/electrical properties of the radios.

without some rather complicated (and expensive) setup you can't have two radios 
on te 2.4GHz band in one AP, when one transmits it would defen (if not actually 
damage) the other

you can use one as a client to a remote AP (say the 5GHz band) and then use the 
other (the 2.4GHz band) to provide service to nearby equipment. I actually just 
finished setting up this exact configuration to extend service into a nearby 
building across a parking lot.

David Lang

> Thanks,
>
> On Tue, Aug 4, 2015 at 2:56 PM, David Lang <david at lang.hm> wrote:
>
>> you can't create a new radio with a script, you have to have a second
>> radio in the hardware.
>>
>> wifi0 is one radio, wifi1 is the second. configure one as an AP, the other
>> as a client (you probably want to make the client be part of the wan
>> interface/firewall group if it's your connection to the Internet)
>>
>> As I said before, since you don't understand how the configs work, I'd
>> suggest using the GUI to configure them and then look at what the resulting
>> file looks like. A lot of expertise went into making the GUI set the right
>> config options to make pretty complex things happen.
>>
>> David Lang
>>
>> On Tue, 4 Aug 2015, John kerry wrote:
>>
>> Date: Tue, 4 Aug 2015 14:41:38 +0800
>>> From: John kerry <kerry9842 at gmail.com>
>>> To: David Lang <david at lang.hm>
>>> Cc: Weedy <weedy2887 at gmail.com>, N. Leiten <nickleiten at gmail.com>,
>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>> Subject: Re: [OpenWrt-Devel] Change OpenWrt Wifi default settings
>>>
>>> Hi,
>>>
>>> Yes i configured the mode as AP. could you please guide how i can add
>>> script for another radio.
>>>
>>> presently my wireless script is as below:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *config wifi-device 'wifi0'        option type 'qcawifi'        option
>>> channel 'auto'        option macaddr '00:03:7f:42:06:61'        option
>>> hwmode '11ng'        option txpower '19'        option htmode 'HT20'config
>>> wifi-iface        option device 'wifi0'        option network 'lan'
>>> option mode 'ap'        option encryption 'psk2'        option ssid
>>> 'Test_ap_1'        option key **'Test_ap_1'*
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *config wifi-device 'wifi1'        option type 'qcawifi'        option
>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'        option
>>> hwmode '11na'        option txpower '23'        option htmode 'HT20'config
>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>> option mode 'ap'        option ssid 'Test_ap_2'        option encryption
>>> 'psk2'        option key 'test_ap_2'*
>>>
>>>
>>> *How i can change this to make it work.*
>>>
>>>
>>>
>>> *Thanks,*
>>>
>>> On Tue, Aug 4, 2015 at 2:26 PM, David Lang <david at lang.hm> wrote:
>>>
>>> A given radio can be either an AP or a client, but not both at once.
>>>>
>>>> so if you use a radio to connect to another AP, you are making it a
>>>> client, and in client mode all it can do is connect to that other AP as
>>>> shows up as the SSID of that other AP.
>>>>
>>>> you can do this with one radio, while using the other radio (assuming you
>>>> have two) to act as an AP for local clients.
>>>>
>>>> David Lang
>>>>
>>>>  On Tue, 4 Aug 2015, John kerry wrote:
>>>>
>>>> Hi,
>>>>
>>>>>
>>>>> Its working, i am able to access internet but there is one problem,
>>>>>
>>>>> When i scan the wireless devices, its gives the list of devices are
>>>>> there
>>>>> nearby, then i connect anyone device, it will connect but my board wifi0
>>>>> SSID name will change to that router which i connected. I mean LAN side
>>>>> SSID should not change after connecting to WAN SSID.
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Aug 4, 2015 at 12:42 PM, John kerry <kerry9842 at gmail.com>
>>>>> wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>>> This is my firewall file:
>>>>>>
>>>>>> config defaults
>>>>>>         option syn_flood '1'
>>>>>>         option input 'ACCEPT'
>>>>>>         option output 'ACCEPT'
>>>>>>         option forward 'REJECT'
>>>>>>
>>>>>> config zone
>>>>>>         option name 'lan'
>>>>>>         option network 'lan'
>>>>>>         option input 'ACCEPT'
>>>>>>         option output 'ACCEPT'
>>>>>>         option forward 'REJECT'
>>>>>>
>>>>>> config zone
>>>>>>         option name 'wan'
>>>>>>         option network 'wan'
>>>>>>         option input 'REJECT'
>>>>>>         option output 'ACCEPT'
>>>>>>         option forward 'REJECT'
>>>>>>         option masq '1'
>>>>>>         option mtu_fix '1'
>>>>>>
>>>>>> config forwarding
>>>>>>         option src 'lan'
>>>>>>         option dest 'wan'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-DHCP-Renew'
>>>>>>         option src 'wan'
>>>>>>         option proto 'udp'
>>>>>>         option dest_port '68'
>>>>>>         option target 'ACCEPT'
>>>>>>         option family 'ipv4'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-Ping'
>>>>>>         option src 'wan'
>>>>>>         option proto 'icmp'
>>>>>>         option icmp_type 'echo-request'
>>>>>>         option family 'ipv4'
>>>>>>         option target 'ACCEPT'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-DHCPv6'
>>>>>>         option src 'wan'
>>>>>>         option proto 'udp'
>>>>>>         option src_ip 'fe80::/10'
>>>>>>         option src_port '547'
>>>>>>         option dest_ip 'fe80::/10'
>>>>>>         option dest_port '546'
>>>>>>         option family 'ipv6'
>>>>>>         option target 'ACCEPT'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-ICMPv6-Input'
>>>>>>         option src 'wan'
>>>>>>         option proto 'icmp'
>>>>>>         list icmp_type 'echo-request'
>>>>>>         list icmp_type 'echo-reply'
>>>>>>         list icmp_type 'destination-unreachable'
>>>>>>         list icmp_type 'packet-too-big'
>>>>>>         list icmp_type 'time-exceeded'
>>>>>>         list icmp_type 'bad-header'
>>>>>>         list icmp_type 'unknown-header-type'
>>>>>>         list icmp_type 'router-solicitation'
>>>>>>         list icmp_type 'neighbour-solicitation'
>>>>>>         list icmp_type 'router-advertisement'
>>>>>>         list icmp_type 'neighbour-advertisement'
>>>>>>         option limit '1000/sec'
>>>>>>         option family 'ipv6'
>>>>>>         option target 'ACCEPT'
>>>>>>
>>>>>> config rule
>>>>>>         option name 'Allow-ICMPv6-Forward'
>>>>>>         option src 'wan'
>>>>>>         option dest '*'
>>>>>>         option proto 'icmp'
>>>>>>         list icmp_type 'echo-request'
>>>>>>         list icmp_type 'echo-reply'
>>>>>>         list icmp_type 'destination-unreachable'
>>>>>>         list icmp_type 'packet-too-big'
>>>>>>         list icmp_type 'time-exceeded'
>>>>>>         list icmp_type 'bad-header'
>>>>>>         list icmp_type 'unknown-header-type'
>>>>>>         option limit '1000/sec'
>>>>>>         option family 'ipv6'
>>>>>>         option target 'ACCEPT'
>>>>>>
>>>>>> config include
>>>>>>         option path '/etc/firewall.user'
>>>>>>
>>>>>> config include 'miniupnpd'
>>>>>>         option type 'script'
>>>>>>         option path '/usr/share/miniupnpd/firewall.include'
>>>>>>         option family 'IPv4'
>>>>>>         option reload '1'
>>>>>>
>>>>>> On Tue, Aug 4, 2015 at 12:38 PM, Weedy <weedy2887 at gmail.com> wrote:
>>>>>>
>>>>>> Is there something wrong with the default rules for your use case?
>>>>>>
>>>>>>>
>>>>>>> Your WiFi interfaces are tagged LAN, things should just work.
>>>>>>> On 4 Aug 2015 00:07, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>>
>>>>>>>> below is the /etc/config/network and /etc/config/wireless changes.
>>>>>>>>
>>>>>>>> */etc/config/network:*
>>>>>>>>
>>>>>>>> config interface 'loopback'
>>>>>>>>         option ifname 'lo'
>>>>>>>>         option proto 'static'
>>>>>>>>         option ipaddr '127.0.0.1'
>>>>>>>>         option netmask '255.0.0.0'
>>>>>>>>
>>>>>>>> config interface 'lan'
>>>>>>>>         option ifname 'eth0.1 eth1'
>>>>>>>>         option type 'bridge'
>>>>>>>>         option proto 'static'
>>>>>>>>         option ipaddr '192.168.1.5'
>>>>>>>>         option netmask '255.255.255.0'
>>>>>>>>
>>>>>>>> config interface 'wan'
>>>>>>>>         option ifname 'eth0.2'
>>>>>>>>         option proto 'dhcp'
>>>>>>>>
>>>>>>>> config switch
>>>>>>>>         option name 'eth0'
>>>>>>>>         option reset '1'
>>>>>>>>         option enable_vlan '1'
>>>>>>>>
>>>>>>>> config switch_vlan
>>>>>>>>         option device 'eth0'
>>>>>>>>         option vlan '1'
>>>>>>>>         option ports '0t 2 3 4 5'
>>>>>>>>
>>>>>>>> config switch_vlan
>>>>>>>>         option device 'eth0'
>>>>>>>>         option vlan '2'
>>>>>>>>         option ports '0t 1'
>>>>>>>>
>>>>>>>> config switch
>>>>>>>>         option name 'eth1'
>>>>>>>>         option reset '1'
>>>>>>>>         option enable_vlan '1'
>>>>>>>>
>>>>>>>> config switch_vlan
>>>>>>>>         option device 'eth1'
>>>>>>>>         option vlan '1'
>>>>>>>>         option ports '0 1 2 3 4 5'
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> */etc/config/wireless:config wifi-device 'wifi0'        option type
>>>>>>>> 'qcawifi'        option channel 'auto'        option macaddr
>>>>>>>> '00:03:7f:42:06:61'        option hwmode '11ng'        option txpower
>>>>>>>> '19'        option htmode 'HT20'config wifi-iface        option
>>>>>>>> device
>>>>>>>> 'wifi0'        option network 'lan'        option mode 'ap'
>>>>>>>> option
>>>>>>>> encryption 'psk2'        option ssid 'Test_ap_1'        option key *
>>>>>>>> *'Test_ap_1'*
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *config wifi-device 'wifi1'        option type 'qcawifi'
>>>>>>>> option
>>>>>>>> channel 'auto'        option macaddr '00:03:7f:42:06:62'
>>>>>>>> option
>>>>>>>> hwmode '11na'        option txpower '23'        option htmode
>>>>>>>> 'HT20'config
>>>>>>>> wifi-iface        option device 'wifi1'        option network 'lan'
>>>>>>>> option mode 'ap'        option ssid 'Test_ap_2'        option
>>>>>>>> encryption
>>>>>>>> 'psk2'        option key 'test_ap_2''*
>>>>>>>>
>>>>>>>>
>>>>>>>> *Thanks,*
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Aug 4, 2015 at 11:56 AM, David Lang <david at lang.hm> wrote:
>>>>>>>>
>>>>>>>> can you connect via a wired port?
>>>>>>>>
>>>>>>>>>
>>>>>>>>> given that you've been changing /etc/config/network and
>>>>>>>>> /etc/config/wireless, could you show us what you ended up with
>>>>>>>>> there?
>>>>>>>>>
>>>>>>>>> David Lang
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, 4 Aug 2015, John kerry wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> I am using ar71xx OpenWrt. I have connected internet connection to
>>>>>>>>>> WAN
>>>>>>>>>> port
>>>>>>>>>> and my PC to LAN. I have enabled the WiFi0. The LAN port static IP
>>>>>>>>>> i
>>>>>>>>>> am
>>>>>>>>>> able to open GUI and even my mobile i connected to Wifi AP and able
>>>>>>>>>> to
>>>>>>>>>> open
>>>>>>>>>> GUI in mobile. But I am not able to access internet on mobile which
>>>>>>>>>> is
>>>>>>>>>> connected to wifi0 AP.
>>>>>>>>>>
>>>>>>>>>> I have added below script under /etc/firewall.user file.
>>>>>>>>>> iptables ...flush
>>>>>>>>>> iptables --table nat --flush
>>>>>>>>>> iptables --delete-chain
>>>>>>>>>> iptables --table nat --delete-chain
>>>>>>>>>> iptables -A FORWARD -j ACCEPT -i br-lan -o eth0.2 -m state --state
>>>>>>>>>> NEW
>>>>>>>>>> iptables -A FORWARD -m state --state ESTABLISHED,RELATED  -j ACCEPT
>>>>>>>>>> iptables -A POSTROUTING -t nat -o eth0.2 -j MASQUERADE
>>>>>>>>>> echo 1 >  /proc/sys/net/ipv4/ip_forward
>>>>>>>>>>
>>>>>>>>>> #where br-lan = LAN
>>>>>>>>>>       eth0.2 = WAN
>>>>>>>>>>
>>>>>>>>>> Could anyone help me to write the proper NAT rules so that able to
>>>>>>>>>> access
>>>>>>>>>> the internet.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> On Mon, Aug 3, 2015 at 11:29 AM, John kerry <kerry9842 at gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hello Guys,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> It's working. Thanks a lot to all of you :)
>>>>>>>>>>>
>>>>>>>>>>> On Mon, Aug 3, 2015 at 10:43 AM, David Lang <david at lang.hm>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> The way to do this is to first forget about the factory reset
>>>>>>>>>>> problem
>>>>>>>>>>>
>>>>>>>>>>> and
>>>>>>>>>>>> configure the AP to do what you want (including any encryption)
>>>>>>>>>>>>
>>>>>>>>>>>> then you can take the resulting file and put it into the build
>>>>>>>>>>>> system so
>>>>>>>>>>>> that it becomes the 'factory default' settings.
>>>>>>>>>>>>
>>>>>>>>>>>> Since you are not understanding how to configure the files from
>>>>>>>>>>>> the
>>>>>>>>>>>> documentation, configure them from the GUI and then look at the
>>>>>>>>>>>> resulting
>>>>>>>>>>>> files.
>>>>>>>>>>>>
>>>>>>>>>>>> David Lang
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, 3 Aug 2015, John kerry wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi All,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I created separate files directory and added network and wireless
>>>>>>>>>>>>> files
>>>>>>>>>>>>> and
>>>>>>>>>>>>> its working everything but still i am not able to use encryption
>>>>>>>>>>>>> wpa2.
>>>>>>>>>>>>> Below is the my script.
>>>>>>>>>>>>> config wifi-device  wifi0
>>>>>>>>>>>>>        option type     qcawifi
>>>>>>>>>>>>>        option channel  auto
>>>>>>>>>>>>>        option macaddr  00:03:7f:42:06:61
>>>>>>>>>>>>>        option hwmode   11ng
>>>>>>>>>>>>>        # REMOVE THIS LINE TO ENABLE WIFI:
>>>>>>>>>>>>>        option disabled 0
>>>>>>>>>>>>>
>>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>>        option device   wifi0
>>>>>>>>>>>>>        option network  lan
>>>>>>>>>>>>>        option mode     ap
>>>>>>>>>>>>>        option ssid     CD-1
>>>>>>>>>>>>>        option encryption psk2
>>>>>>>>>>>>>        option key      CD-1
>>>>>>>>>>>>>
>>>>>>>>>>>>> M I doing anything wrong?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Mon, Aug 3, 2015 at 6:40 AM, David Lang <david at lang.hm>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> to make the config be there after a factory reset, you need to
>>>>>>>>>>>>> put
>>>>>>>>>>>>> the
>>>>>>>>>>>>>
>>>>>>>>>>>>> changes into the image that you build.
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> you already did this for /etc/config/network, do the same thing
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> /etc/config/wireless
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Sun, 2 Aug 2015, John kerry wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I have one issue, after upgrading this firmware it will load
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> wireless
>>>>>>>>>>>>>>> configuration with this changes, actually it should load when
>>>>>>>>>>>>>>> i
>>>>>>>>>>>>>>> do
>>>>>>>>>>>>>>> factory
>>>>>>>>>>>>>>> reset.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:45 PM, John kerry <
>>>>>>>>>>>>>>> kerry9842 at gmail.com
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thank you so much, Its working :)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Sun, Aug 2, 2015 at 3:12 PM, N.Leiten <
>>>>>>>>>>>>>>>> nickleiten at gmail.com
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Don't answer to my e-mail only, you need to add openwrt-devel
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> maillist
>>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>>> CC or just answer to CC, in each case I'll receive message
>>>>>>>>>>>>>>>>> but
>>>>>>>>>>>>>>>>> also
>>>>>>>>>>>>>>>>> everyone could see all discussion.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> In email dated ??????????? - 02 ??????? 2015 12:54:32 user
>>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>>> kerry
>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Hi Leiten,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I have added new files under and written below :
>>>>>>>>>>>>>>>>>> vi target/linux/ar71xx/base-files/etc/uci-defaults/wireless
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Use index in prefix of filename to set order of execution,
>>>>>>>>>>>>>>>>>> so
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> it'll
>>>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>>> like '99-wireless'.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> #!/bin/sh
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> # Copyright (c) 2013 The Linux Foundation. All rights
>>>>>>>>>>>>>>>>>> reserved.
>>>>>>>>>>>>>>>>>> # Copyright (C) 2011 OpenWrt.org
>>>>>>>>>>>>>>>>>> #
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> [ -e /etc/config/wireless ] && exit 0
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Here is the problem. When uci-defaults invoke scripts
>>>>>>>>>>>>>>>>>> there's
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> already
>>>>>>>>>>>>>>>>> preconfiguration done and /etc/config/wireless already
>>>>>>>>>>>>>>>>> exists,
>>>>>>>>>>>>>>>>> so
>>>>>>>>>>>>>>>>> your
>>>>>>>>>>>>>>>>> script just exit at this point. Remove this line.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> touch /etc/config/wireless
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> uci set wireless. at wifi-device[0].disabled=0;
>>>>>>>>>>>>>>>>>> uci set system. at system[0].hostname=test_ap
>>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].mode=ap
>>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].ssid=CD-2.4D
>>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].encryption=none
>>>>>>>>>>>>>>>>>> uci set wireless. at wifi-iface[0].wds=1
>>>>>>>>>>>>>>>>>> uci set wireless.radio0.disabled=0
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> uci commit wireless
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> exit 0
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> and compile the source code using make V=s but still not
>>>>>>>>>>>>>>>>>> changed
>>>>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Please help me to make it works.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On Sat, Aug 1, 2015 at 4:38 PM, N.Leiten <
>>>>>>>>>>>>>>>>>> nickleiten at gmail.com
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> You can also use uci-defaults mechanism for your purpose.
>>>>>>>>>>>>>>>>>> Just
>>>>>>>>>>>>>>>>>> put
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> script in base-files/etc/uci-defaults and set your
>>>>>>>>>>>>>>>>>> preferrable
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> parameters with uci and don't forget to 'exit 0' at the end
>>>>>>>>>>>>>>>>>>> of
>>>>>>>>>>>>>>>>>>> script,
>>>>>>>>>>>>>>>>>>> in elsecase it'll be run every time at boot ruining
>>>>>>>>>>>>>>>>>>> changes.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> 2015-07-31 12:08 GMT+03:00 John kerry <
>>>>>>>>>>>>>>>>>>> kerry9842 at gmail.com
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> :
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> I am working on Ar71xx openWRT Luci project. By default
>>>>>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>>>>>>> disabled and SSID is OpenWrt. I need to change the
>>>>>>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>>>>>>> settings.
>>>>>>>>>>>>>>>>>>>> Could anyone help me to change the default settings.
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>
>>>>>>
>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From florian.siebertz at inf.h-brs.de  Tue Aug  4 05:43:20 2015
From: florian.siebertz at inf.h-brs.de (Florian Siebertz)
Date: Tue, 04 Aug 2015 11:43:20 +0200
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
Message-ID: <55C08938.6030507@inf.h-brs.de>

Hi,

i noticed that the openvswitch package is not available in trunk at the
moment. It is not in the precompiled snapshots, neither can it be
choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
[update|install] -a).

Does anyone know why and when it will be back?

Thanks!

Florian Siebertz
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Tue Aug  4 06:37:11 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Tue, 4 Aug 2015 13:37:11 +0300
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
In-Reply-To: <55C08938.6030507@inf.h-brs.de>
References: <55C08938.6030507@inf.h-brs.de>
Message-ID: <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>

Well, OpenVSwitch is a bit behind on kernel support.
It's at 3.18 currently.
OpenWRT is at 4.1

We'd need to do an upgrade of OVS to get it up to speed.




On Tue, Aug 4, 2015 at 12:43 PM, Florian Siebertz <
florian.siebertz at inf.h-brs.de> wrote:

> Hi,
>
> i noticed that the openvswitch package is not available in trunk at the
> moment. It is not in the precompiled snapshots, neither can it be
> choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
> [update|install] -a).
>
> Does anyone know why and when it will be back?
>
> Thanks!
>
> Florian Siebertz
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/0a08a592/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From cb at shoutrlabs.com  Tue Aug  4 08:40:24 2015
From: cb at shoutrlabs.com (Christian Beier)
Date: Tue,  4 Aug 2015 14:40:24 +0200
Subject: [OpenWrt-Devel] [PATCH] CC: ar71xx: Enable ath10k calibration data
	loading for EnGenius ESR1750 and EPG500.
Message-ID: <1438692024-4142-1-git-send-email-cb@shoutrlabs.com>

Kinda-backport of r46415, though this patch uses the old-style calibration data loading.

Signed-off-by: Christian Beier <cb at shoutrlabs.com>
---
 .../linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata  | 4 ++++
 1 file changed, 4 insertions(+)

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 c827e31..dd3f546 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
@@ -39,6 +39,10 @@ case "$FIRMWARE" in
 	dlan-pro-1200-ac)
 		ath10kcal_from_file $(find_mtd_part "art") 20480 $ath10kcal_tmp
 		;;
+	esr1750 | \
+	epg5000)
+		ath10kcal_from_file $(find_mtd_part "caldata") 20480 $ath10kcal_tmp
+		;;
 	esac
 	;;
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Tue Aug  4 10:08:42 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Tue, 4 Aug 2015 17:08:42 +0300
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
In-Reply-To: <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>
References: <55C08938.6030507@inf.h-brs.de>
 <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>
Message-ID: <CA+U=Dsony4dUX2zK3cM07v7v=saskAcW8qh8GswZBRcrXDVKfg@mail.gmail.com>

Took some 20-30 minutes to upgrade OVS and test it (with kernel 4.1).
Seems to work fine so far.

Please monitor this PR; after it's merged it should appear.

On Tue, Aug 4, 2015 at 1:37 PM, Alexandru Ardelean <ardeleanalex at gmail.com>
wrote:

> Well, OpenVSwitch is a bit behind on kernel support.
> It's at 3.18 currently.
> OpenWRT is at 4.1
>
> We'd need to do an upgrade of OVS to get it up to speed.
>
>
>
>
> On Tue, Aug 4, 2015 at 12:43 PM, Florian Siebertz <
> florian.siebertz at inf.h-brs.de> wrote:
>
>> Hi,
>>
>> i noticed that the openvswitch package is not available in trunk at the
>> moment. It is not in the precompiled snapshots, neither can it be
>> choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
>> [update|install] -a).
>>
>> Does anyone know why and when it will be back?
>>
>> Thanks!
>>
>> Florian Siebertz
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150804/8def42a0/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From dedeckeh at gmail.com  Tue Aug  4 10:22:42 2015
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Tue,  4 Aug 2015 16:22:42 +0200
Subject: [OpenWrt-Devel] [PATCH 1/4] netifd: Fix SEG fault when device
	cannot be allocated
Message-ID: <1438698165-19447-1-git-send-email-dedeckeh@gmail.com>

Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/device.c b/device.c
index b5bee11..6f31e36 100644
--- a/device.c
+++ b/device.c
@@ -741,6 +741,9 @@ device_reset_old(void)
 			continue;
 
 		ndev = device_create_default(dev->ifname, dev->external);
+		if (!ndev)
+			continue;
+
 		device_replace(ndev, dev);
 	}
 }
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dedeckeh at gmail.com  Tue Aug  4 10:22:43 2015
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Tue,  4 Aug 2015 16:22:43 +0200
Subject: [OpenWrt-Devel] [PATCH 2/4] netifd: Fix device usage after free
In-Reply-To: <1438698165-19447-1-git-send-email-dedeckeh@gmail.com>
References: <1438698165-19447-1-git-send-email-dedeckeh@gmail.com>
Message-ID: <1438698165-19447-2-git-send-email-dedeckeh@gmail.com>

Prevent new device from being freed in device_replace when
device_unlock is called along the function chain triggered
by setting the old device as not present

Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/device.c b/device.c
index 6f31e36..59a57f4 100644
--- a/device.c
+++ b/device.c
@@ -704,6 +704,7 @@ device_replace(struct device *dev, struct device *odev)
 	struct device_user *dep, *tmp;
 	bool present = odev->present;
 
+	__devlock++;
 	if (present)
 		device_set_present(odev, false);
 
@@ -713,6 +714,8 @@ device_replace(struct device *dev, struct device *odev)
 		safe_list_add(&dep->list, &dev->users);
 		dep->dev = dev;
 	}
+	__devlock--;
+
 	device_free(odev);
 
 	if (present)
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dedeckeh at gmail.com  Tue Aug  4 10:22:44 2015
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Tue,  4 Aug 2015 16:22:44 +0200
Subject: [OpenWrt-Devel] [PATCH 3/4] netifd: Remove obsolete
	device_set_present in device_replace
In-Reply-To: <1438698165-19447-1-git-send-email-dedeckeh@gmail.com>
References: <1438698165-19447-1-git-send-email-dedeckeh@gmail.com>
Message-ID: <1438698165-19447-3-git-send-email-dedeckeh@gmail.com>

New device does not need to be set present as device_check_state called via device_init
sets the device present after probing the kernel device

Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 device.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/device.c b/device.c
index 59a57f4..1636611 100644
--- a/device.c
+++ b/device.c
@@ -702,10 +702,9 @@ static void
 device_replace(struct device *dev, struct device *odev)
 {
 	struct device_user *dep, *tmp;
-	bool present = odev->present;
 
 	__devlock++;
-	if (present)
+	if (odev->present)
 		device_set_present(odev, false);
 
 	list_for_each_entry_safe(dep, tmp, &odev->users.list, list.list) {
@@ -717,9 +716,6 @@ device_replace(struct device *dev, struct device *odev)
 	__devlock--;
 
 	device_free(odev);
-
-	if (present)
-		device_set_present(dev, true);
 }
 
 void
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dedeckeh at gmail.com  Tue Aug  4 10:22:45 2015
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Tue,  4 Aug 2015 16:22:45 +0200
Subject: [OpenWrt-Devel] [PATCH 4/4] netifd: Spawn device events when
	registering dependency in device_replace
In-Reply-To: <1438698165-19447-1-git-send-email-dedeckeh@gmail.com>
References: <1438698165-19447-1-git-send-email-dedeckeh@gmail.com>
Message-ID: <1438698165-19447-4-git-send-email-dedeckeh@gmail.com>

Spawn device events when adding dependency in device_replace so the dependency installer gets
the actual device status

Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 device.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/device.c b/device.c
index 1636611..66eb6d4 100644
--- a/device.c
+++ b/device.c
@@ -534,19 +534,11 @@ static int device_refcount(struct device *dev)
 	return count;
 }
 
-void device_add_user(struct device_user *dep, struct device *dev)
+static void
+__device_add_user(struct device_user *dep, struct device *dev)
 {
 	struct safe_list *head;
 
-	if (dep->dev == dev)
-		return;
-
-	if (dep->dev)
-		device_remove_user(dep);
-
-	if (!dev)
-		return;
-
 	dep->dev = dev;
 
 	if (dep->alias)
@@ -567,6 +559,20 @@ void device_add_user(struct device_user *dep, struct device *dev)
 	}
 }
 
+void device_add_user(struct device_user *dep, struct device *dev)
+{
+	if (dep->dev == dev)
+		return;
+
+	if (dep->dev)
+		device_remove_user(dep);
+
+	if (!dev)
+		return;
+
+	__device_add_user(dep, dev);
+}
+
 void
 device_free(struct device *dev)
 {
@@ -710,8 +716,7 @@ device_replace(struct device *dev, struct device *odev)
 	list_for_each_entry_safe(dep, tmp, &odev->users.list, list.list) {
 		device_release(dep);
 		safe_list_del(&dep->list);
-		safe_list_add(&dep->list, &dev->users);
-		dep->dev = dev;
+		__device_add_user(dep, dev);
 	}
 	__devlock--;
 
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jrosen at harvestai.com  Tue Aug  4 10:58:42 2015
From: jrosen at harvestai.com (Joshua Judson Rosen)
Date: Tue, 04 Aug 2015 10:58:42 -0400
Subject: [OpenWrt-Devel] Multiple Wi-Fi client/AP interfaces on one
 radio (was: Change OpenWrt Wifi default settings)
In-Reply-To: <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
Message-ID: <55C0D322.6090008@harvestai.com>

On 2015-08-04 02:26, David Lang wrote:
> A given radio can be either an AP or a client, but not both at once.
> 
> so if you use a radio to connect to another AP, you are making it a client, and
> in client mode all it can do is connect to that other AP as shows up as the SSID
> of that other AP.
> 
> you can do this with one radio, while using the other radio (assuming you have
> two) to act as an AP for local clients.


This is not necessarily true: with at least some hardware/drivers, it's
possible to create multiple virtual interfaces on top of a single radio--
and separate virtual interfaces can in fact operate in different modes
(e.g.: one in STA mode, two in AP mode, one in mesh mode...).

Assuming that your hardware/driver is capable of supporting multiple
virtual interfaces on top of the single physical radio,
you can create these interfaces by adding "wifi-iface" stanzas
in /etc/config/wireless, e.g:

	config wifi-device 'radio0'
		option type 'mac80211'
		option channel '11'
		option hwmode '11g'
		option path 'platform/ar933x_wmac'
		option htmode 'HT20'
		option country 'US'
		option txpower '20'
	
	config wifi-iface 'ap1'
		option device 'radio0'
		option mode 'ap'
		option wds '1'
		option ssid 'my AP'
		option network 'lan'
	
	config wifi-iface 'mesh1'
		option device 'radio0'
		option mode 'mesh'
		option mesh_id 'my mesh'
		option network 'lan'


That creates two virtual interfaces using the same physical radio,
and bridges them together onto the OpenWrt "lan network"
(which is itself defined in /etc/config/network).


I believe you could also have an interface with "mode 'sta'", but note
that it would also need to use the same channel as the other interfaces--
which means that the external AP to which you connect it would also
need to use that same channel (11, in the example above).
That's where having multiple *radios* helps: you can run them on
different frequencies (either completely different bands [2.4 GHz vs. 5 GHz],
or on different channels within the same band [e.g. 2.427 GHz = channel 4
vs. 2.472 GHz = channel 13]) to increase efficiency by multiplexing
less data over a single radio, or to increase compatibility with other
APs outside of your control that you might want to connect to.

Also note that, if you want to bridge a STA interface onto anything else,
it'll need to be in "WDS" mode _and_ the the AP to which it's connecting
will also need to be in "WDS" mode (note the "option wds '1'",
in my example above), because the standard "3-address mode" of Wi-Fi
isn't bridgeable (and note that WDS "4-address mode" is bridgeable,
but not standardised across different platforms--so you're probably
OK so long as all of your equipment is running Linux and using
the same Wi-Fi driver, but don't expect to bridge a STA interface
that's connected non-Linux Wi-Fi router).

At least, I've seen this work with Atheros chips. There are some
notes in the wiki about how Broadcom chips have their own, different
solution implemented in hardware; and about how some drivers
don't support this stuff at all....

-- 
"Don't be afraid to ask (?f.((?x.xx) (?r.f(rr))))."
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From leroi.lists at gmail.com  Tue Aug  4 13:56:24 2015
From: leroi.lists at gmail.com (Roman Yeryomin)
Date: Tue, 4 Aug 2015 20:56:24 +0300
Subject: [OpenWrt-Devel] [PATCH] Restore AP scan patch
In-Reply-To: <55BF5A66.7070300@couprie.net>
References: <20150731120138.ff56e86ba0d52db03316a717@ubnt.com>
 <55BF5A66.7070300@couprie.net>
Message-ID: <CACiydbK-=Ec3QO0w7e+Z3BZKBbj9+K+3yqGbLLo02M6XZwcnxw@mail.gmail.com>

On 3 August 2015 at 15:11, openwrt-devel at couprie.net
<openwrt-devel at couprie.net> wrote:
> Hi Dimitry,
>
> Does this patch, fix the problem that when a router is a wifi access client
> and access point.
> The local access point does not work when de wifi access client is not
> connected ?
>

This patch only fixes scanning when in AP mode.
The problem you are referring to is different and I'm not sure it can
be fixed in the "right" way.
Try using 4address mode (aka WDS in hostapd terms).

Regards,
Roman
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From leroi.lists at gmail.com  Tue Aug  4 14:14:28 2015
From: leroi.lists at gmail.com (Roman Yeryomin)
Date: Tue, 4 Aug 2015 21:14:28 +0300
Subject: [OpenWrt-Devel] Multiple Wi-Fi client/AP interfaces on one
 radio (was: Change OpenWrt Wifi default settings)
In-Reply-To: <55C0D322.6090008@harvestai.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <2367757.IMc5zkIGE4@nl-ubook>
 <CAGUNxBFmk6=G3BxZFGB9bqN97FqZxF2Msr3egAgzeVv_GF6jHA@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
Message-ID: <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>

On 4 August 2015 at 17:58, Joshua Judson Rosen <jrosen at harvestai.com> wrote:
> On 2015-08-04 02:26, David Lang wrote:
>> A given radio can be either an AP or a client, but not both at once.
>>
>> so if you use a radio to connect to another AP, you are making it a client, and
>> in client mode all it can do is connect to that other AP as shows up as the SSID
>> of that other AP.
>>
>> you can do this with one radio, while using the other radio (assuming you have
>> two) to act as an AP for local clients.
>
>
> This is not necessarily true: with at least some hardware/drivers, it's
> possible to create multiple virtual interfaces on top of a single radio--
> and separate virtual interfaces can in fact operate in different modes
> (e.g.: one in STA mode, two in AP mode, one in mesh mode...).
>
> Assuming that your hardware/driver is capable of supporting multiple
> virtual interfaces on top of the single physical radio,
> you can create these interfaces by adding "wifi-iface" stanzas
> in /etc/config/wireless, e.g:
>
>         config wifi-device 'radio0'
>                 option type 'mac80211'
>                 option channel '11'
>                 option hwmode '11g'
>                 option path 'platform/ar933x_wmac'
>                 option htmode 'HT20'
>                 option country 'US'
>                 option txpower '20'
>
>         config wifi-iface 'ap1'
>                 option device 'radio0'
>                 option mode 'ap'
>                 option wds '1'
>                 option ssid 'my AP'
>                 option network 'lan'
>
>         config wifi-iface 'mesh1'
>                 option device 'radio0'
>                 option mode 'mesh'
>                 option mesh_id 'my mesh'
>                 option network 'lan'
>
>
> That creates two virtual interfaces using the same physical radio,
> and bridges them together onto the OpenWrt "lan network"
> (which is itself defined in /etc/config/network).
>
>
> I believe you could also have an interface with "mode 'sta'", but note
> that it would also need to use the same channel as the other interfaces--
> which means that the external AP to which you connect it would also
> need to use that same channel (11, in the example above).
> That's where having multiple *radios* helps: you can run them on
> different frequencies (either completely different bands [2.4 GHz vs. 5 GHz],
> or on different channels within the same band [e.g. 2.427 GHz = channel 4
> vs. 2.472 GHz = channel 13]) to increase efficiency by multiplexing
> less data over a single radio, or to increase compatibility with other
> APs outside of your control that you might want to connect to.
>
> Also note that, if you want to bridge a STA interface onto anything else,
> it'll need to be in "WDS" mode _and_ the the AP to which it's connecting
> will also need to be in "WDS" mode (note the "option wds '1'",
> in my example above), because the standard "3-address mode" of Wi-Fi
> isn't bridgeable (and note that WDS "4-address mode" is bridgeable,
> but not standardised across different platforms--so you're probably
> OK so long as all of your equipment is running Linux and using
> the same Wi-Fi driver, but don't expect to bridge a STA interface
> that's connected non-Linux Wi-Fi router).
>
> At least, I've seen this work with Atheros chips. There are some
> notes in the wiki about how Broadcom chips have their own, different
> solution implemented in hardware; and about how some drivers
> don't support this stuff at all....

Actually 3-address mode bridging is possible with the help of relayd
and it even works quite good.
But there is an issue (also mentioned in a parallel thread): when
client interface cannot connect then AP interface doesn't come up
also. Which may not be a problem unless you want to bridge ethernet
there also.
On the other hand you may not be able to switch the main AP into
4-address mode so relayd is a way out.

Regards,
Roman
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jrosen at harvestai.com  Tue Aug  4 16:24:23 2015
From: jrosen at harvestai.com (Joshua Judson Rosen)
Date: Tue, 04 Aug 2015 16:24:23 -0400
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>	<CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>	<alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>	<CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>	<alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>	<CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>	<CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>	<alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>	<CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>	<CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>	<CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>	<CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>	<alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>	<55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
Message-ID: <55C11F77.6050809@harvestai.com>

On 2015-08-04 14:14, Roman Yeryomin wrote:
> On 4 August 2015 at 17:58, Joshua Judson Rosen <jrosen at harvestai.com> wrote:
>> On 2015-08-04 02:26, David Lang wrote:
>>> A given radio can be either an AP or a client, but not both at once.
>>>
>>> so if you use a radio to connect to another AP, you are making it a client, and
>>> in client mode all it can do is connect to that other AP as shows up as the SSID
>>> of that other AP.
>>>
>>> you can do this with one radio, while using the other radio (assuming you have
>>> two) to act as an AP for local clients.
>>
>>
>> This is not necessarily true: with at least some hardware/drivers, it's
>> possible to create multiple virtual interfaces on top of a single radio--
>> and separate virtual interfaces can in fact operate in different modes
>> (e.g.: one in STA mode, two in AP mode, one in mesh mode...).
>>
>> Assuming that your hardware/driver is capable of supporting multiple
>> virtual interfaces on top of the single physical radio,
>> you can create these interfaces by adding "wifi-iface" stanzas
>> in /etc/config/wireless, e.g:
>>
>>         config wifi-device 'radio0'
>>                 option type 'mac80211'
>>                 option channel '11'
>>                 option hwmode '11g'
>>                 option path 'platform/ar933x_wmac'
>>                 option htmode 'HT20'
>>                 option country 'US'
>>                 option txpower '20'
>>
>>         config wifi-iface 'ap1'
>>                 option device 'radio0'
>>                 option mode 'ap'
>>                 option wds '1'
>>                 option ssid 'my AP'
>>                 option network 'lan'
>>
>>         config wifi-iface 'mesh1'
>>                 option device 'radio0'
>>                 option mode 'mesh'
>>                 option mesh_id 'my mesh'
>>                 option network 'lan'
>>
>>
>> That creates two virtual interfaces using the same physical radio,
>> and bridges them together onto the OpenWrt "lan network"
>> (which is itself defined in /etc/config/network).
>>
>>
>> I believe you could also have an interface with "mode 'sta'", but note
>> that it would also need to use the same channel as the other interfaces--
>> which means that the external AP to which you connect it would also
>> need to use that same channel (11, in the example above).
>> That's where having multiple *radios* helps: you can run them on
>> different frequencies (either completely different bands [2.4 GHz vs. 5 GHz],
>> or on different channels within the same band [e.g. 2.427 GHz = channel 4
>> vs. 2.472 GHz = channel 13]) to increase efficiency by multiplexing
>> less data over a single radio, or to increase compatibility with other
>> APs outside of your control that you might want to connect to.
>>
>> Also note that, if you want to bridge a STA interface onto anything else,
>> it'll need to be in "WDS" mode _and_ the the AP to which it's connecting
>> will also need to be in "WDS" mode (note the "option wds '1'",
>> in my example above), because the standard "3-address mode" of Wi-Fi
>> isn't bridgeable (and note that WDS "4-address mode" is bridgeable,
>> but not standardised across different platforms--so you're probably
>> OK so long as all of your equipment is running Linux and using
>> the same Wi-Fi driver, but don't expect to bridge a STA interface
>> that's connected non-Linux Wi-Fi router).
>>
>> At least, I've seen this work with Atheros chips. There are some
>> notes in the wiki about how Broadcom chips have their own, different
>> solution implemented in hardware; and about how some drivers
>> don't support this stuff at all....
> 
> Actually 3-address mode bridging is possible with the help of relayd

That's not actually "3-address mode bridging", though--
it's relaying (done entirely through a userspace daemon,
which AFAICT actually relays only IPv4, ARP, and DHCP packets).

> and it even works quite good.
> But there is an issue (also mentioned in a parallel thread): when
> client interface cannot connect then AP interface doesn't come up
> also. Which may not be a problem unless you want to bridge ethernet
> there also.
> On the other hand you may not be able to switch the main AP into
> 4-address mode so relayd is a way out.

It may be a solution.

When I tried it a few months back (in Barrier Breaker),
relayd wasn't really working for me....

I know that's a terrible (non-)description; I don't specifically
remember what seemed to be going wrong, except that there was
a lot of traffic not reliably getting through to where it was supposed to,
and that it was confusing, and that I was able to slightly improve
the situation by fiddling with some of the options that the init-script
passed to relayd (IIRC, I had some success using "-I" on only one interface
and "-i" on the other), but I didn't have time to dig in and actually
understand what wasn't working--just switching to 4-address mode and having
OpenWrt set up a kernel-level bridge w/ brctl was a more expedient
path for me to get something working reliably at the time.

Actually, if anyone can offer guesses as to what my issues
with relayd might have actually been, I'd be glad to hear them :)

I'm not specifically aware of a reason why IPv4+ARP+DHCP relaying
should have been insufficient for what I was doing (I wasn't
running any weird non-IP protocols...).

Maybe someone can point me to a basic explanation of what
sort of "ARP cache and host route management" the "-I" option
is actually doing--and why I might need to disable it on one
of my interfaces?

-- 
"Don't be afraid to ask (?f.((?x.xx) (?r.f(rr))))."
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From mathieu at codeaurora.org  Tue Aug  4 17:55:29 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Tue,  4 Aug 2015 14:55:29 -0700
Subject: [OpenWrt-Devel] [PATCH 1/4] ipq806x: update bleeding-edge kernel
	from 4.0 to 4.1
Message-ID: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>

Default kernel doesn't change and stays on 3.18 for now.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/config-4.0                    | 424 ------------
 target/linux/ipq806x/config-4.1                    | 437 ++++++++++++
 .../001-spi-qup-Add-DMA-capabilities.patch         | 522 --------------
 ...-v3-spi-qup-Fix-incorrect-block-transfers.patch | 376 ----------
 .../003-spi-qup-Ensure-done-detection.patch        |  56 --
 ...atchdog-qcom-use-timer-devicetree-binding.patch |  67 --
 ...m-add-description-of-KPSS-WDT-for-IPQ8064.patch |  48 --
 ...-watchdog-entries-to-DT-timer-binding-doc.patch |  50 --
 .../patches-4.0/020-add-ap148-bootargs.patch       |  46 --
 .../patches-4.0/021-add-ap148-partitions.patch     |  35 -
 .../ipq806x/patches-4.0/022-add-db149-dts.patch    | 160 -----
 ...M-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch |  53 --
 ...CI-qcom-Document-PCIe-devicetree-bindings.patch | 263 -------
 ...-qcom-Add-Qualcomm-PCIe-controller-driver.patch | 753 ---------------------
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 260 -------
 ...tomatically-select-PCI_DOMAINS-if-PCI-is-.patch |  29 -
 .../121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch |  71 --
 ...etree-qcom_rpm-Document-IPQ8064-resources.patch |  42 --
 .../patches-4.0/126-add-rpm-to-ipq8064-dts.patch   |  87 ---
 ...-Add-Krait-L2-register-accessor-functions.patch | 144 ----
 ...ux-Split-out-register-accessors-for-reuse.patch | 192 ------
 ...ates-to-downstream-clocks-during-set_rate.patch | 130 ----
 .../patches-4.0/136-clk-Add-safe-switch-hook.patch | 164 -----
 ...dd-support-for-High-Frequency-PLLs-HFPLLs.patch | 351 ----------
 .../138-clk-qcom-Add-HFPLL-driver.patch            | 206 ------
 .../139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch        | 127 ----
 ...140-clk-qcom-Add-support-for-Krait-clocks.patch | 271 --------
 .../141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch     | 205 ------
 ...lk-qcom-Add-Krait-clock-controller-driver.patch | 435 ------------
 ...-module-to-register-cpufreq-on-Krait-CPUs.patch | 304 ---------
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch | 100 ---
 ...ufreq-Add-a-cpufreq-krait-based-on-cpufre.patch | 461 -------------
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch |  62 --
 ...dd-support-for-NSS-GMAC-clocks-and-resets.patch | 733 --------------------
 ...-phy-handle-support-to-the-platform-layer.patch | 105 ---
 ...-error-path-at-the-end-of-stmmac_probe_co.patch |  65 --
 ...stmmac-add-fixed-link-device-tree-support.patch |  64 --
 .../704-stmmac-add-ipq806x-glue-layer.patch        | 407 -----------
 ...mac-ipq806x-document-device-tree-bindings.patch |  52 --
 ...mac-create-one-debugfs-dir-per-net-device.patch | 175 -----
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch | 145 ----
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch | 210 ------
 .../patches-4.1/020-add-ap148-bootargs.patch       |  46 ++
 .../patches-4.1/021-add-ap148-partitions.patch     |  35 +
 .../ipq806x/patches-4.1/022-add-db149-dts.patch    | 160 +++++
 ...M-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch |  53 ++
 ...CI-qcom-Document-PCIe-devicetree-bindings.patch | 263 +++++++
 ...-qcom-Add-Qualcomm-PCIe-controller-driver.patch | 753 +++++++++++++++++++++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 260 +++++++
 ...tomatically-select-PCI_DOMAINS-if-PCI-is-.patch |  29 +
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |  87 +++
 ...-Add-Krait-L2-register-accessor-functions.patch | 144 ++++
 ...ux-Split-out-register-accessors-for-reuse.patch | 192 ++++++
 ...ates-to-downstream-clocks-during-set_rate.patch | 130 ++++
 .../patches-4.1/136-clk-Add-safe-switch-hook.patch | 164 +++++
 ...dd-support-for-High-Frequency-PLLs-HFPLLs.patch | 351 ++++++++++
 .../138-clk-qcom-Add-HFPLL-driver.patch            | 206 ++++++
 .../139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch        | 127 ++++
 ...140-clk-qcom-Add-support-for-Krait-clocks.patch | 271 ++++++++
 .../141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch     | 205 ++++++
 ...lk-qcom-Add-Krait-clock-controller-driver.patch | 435 ++++++++++++
 ...-module-to-register-cpufreq-on-Krait-CPUs.patch | 304 +++++++++
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch | 100 +++
 ...ufreq-Add-a-cpufreq-krait-based-on-cpufre.patch | 461 +++++++++++++
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch |  62 ++
 ...dd-support-for-NSS-GMAC-clocks-and-resets.patch | 734 ++++++++++++++++++++
 ...-phy-handle-support-to-the-platform-layer.patch | 105 +++
 ...-error-path-at-the-end-of-stmmac_probe_co.patch |  65 ++
 ...stmmac-add-fixed-link-device-tree-support.patch |  64 ++
 .../704-stmmac-add-ipq806x-glue-layer.patch        | 407 +++++++++++
 ...mac-ipq806x-document-device-tree-bindings.patch |  52 ++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch | 145 ++++
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch | 210 ++++++
 73 files changed, 7057 insertions(+), 8450 deletions(-)
 delete mode 100644 target/linux/ipq806x/config-4.0
 create mode 100644 target/linux/ipq806x/config-4.1
 delete mode 100644 target/linux/ipq806x/patches-4.0/001-spi-qup-Add-DMA-capabilities.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/002-v3-spi-qup-Fix-incorrect-block-transfers.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/003-spi-qup-Ensure-done-detection.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/011-watchdog-qcom-use-timer-devicetree-binding.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/013-ARM-msm-add-watchdog-entries-to-DT-timer-binding-doc.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/020-add-ap148-bootargs.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/021-add-ap148-partitions.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/022-add-db149-dts.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/123-mfd-devicetree-qcom_rpm-Document-IPQ8064-resources.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/126-add-rpm-to-ipq8064-dts.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/133-ARM-Add-Krait-L2-register-accessor-functions.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/134-clk-mux-Split-out-register-accessors-for-reuse.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/136-clk-Add-safe-switch-hook.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/138-clk-qcom-Add-HFPLL-driver.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/140-clk-qcom-Add-support-for-Krait-clocks.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/142-clk-qcom-Add-Krait-clock-controller-driver.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/703-stmmac-add-fixed-link-device-tree-support.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/704-stmmac-add-ipq806x-glue-layer.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/705-net-stmmac-ipq806x-document-device-tree-bindings.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/706-net-stmmac-create-one-debugfs-dir-per-net-device.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
 delete mode 100644 target/linux/ipq806x/patches-4.0/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/020-add-ap148-bootargs.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/022-add-db149-dts.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/133-ARM-Add-Krait-L2-register-accessor-functions.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/134-clk-mux-Split-out-register-accessors-for-reuse.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/136-clk-Add-safe-switch-hook.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/138-clk-qcom-Add-HFPLL-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/140-clk-qcom-Add-support-for-Krait-clocks.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/142-clk-qcom-Add-Krait-clock-controller-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/703-stmmac-add-fixed-link-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/704-stmmac-add-ipq806x-glue-layer.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/705-net-stmmac-ipq806x-document-device-tree-bindings.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch

diff --git a/target/linux/ipq806x/config-4.0 b/target/linux/ipq806x/config-4.0
deleted file mode 100644
index 7ec3963..0000000
--- a/target/linux/ipq806x/config-4.0
+++ /dev/null
@@ -1,424 +0,0 @@
-CONFIG_ALIGNMENT_TRAP=y
-# CONFIG_AMBA_PL08X is not set
-# CONFIG_APM_EMULATION is not set
-CONFIG_APQ_GCC_8084=y
-CONFIG_APQ_MMCC_8084=y
-CONFIG_AR8216_PHY=y
-CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
-CONFIG_ARCH_HAS_SG_CHAIN=y
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_MSM8960=y
-CONFIG_ARCH_MSM8974=y
-CONFIG_ARCH_MSM8X60=y
-CONFIG_ARCH_MULTIPLATFORM=y
-# CONFIG_ARCH_MULTI_CPU_AUTO is not set
-CONFIG_ARCH_MULTI_V6_V7=y
-CONFIG_ARCH_MULTI_V7=y
-CONFIG_ARCH_NR_GPIO=0
-CONFIG_ARCH_QCOM=y
-# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
-CONFIG_ARM=y
-CONFIG_ARM_AMBA=y
-CONFIG_ARM_APPENDED_DTB=y
-CONFIG_ARM_ARCH_TIMER=y
-CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
-# CONFIG_ARM_ATAG_DTB_COMPAT is not set
-CONFIG_ARM_CPU_SUSPEND=y
-CONFIG_ARM_GIC=y
-CONFIG_ARM_HAS_SG_CHAIN=y
-# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
-CONFIG_ARM_L1_CACHE_SHIFT=6
-CONFIG_ARM_L1_CACHE_SHIFT_6=y
-# CONFIG_ARM_LPAE is not set
-CONFIG_ARM_PATCH_PHYS_VIRT=y
-CONFIG_ARM_QCOM_CPUFREQ=y
-# CONFIG_ARM_SMMU is not set
-# CONFIG_ARM_SP805_WATCHDOG is not set
-CONFIG_ARM_THUMB=y
-# CONFIG_ARM_THUMBEE is not set
-CONFIG_ARM_UNWIND=y
-CONFIG_ARM_VIRT_EXT=y
-CONFIG_AT803X_PHY=y
-# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
-CONFIG_BOUNCE=y
-CONFIG_BUILD_BIN2C=y
-# CONFIG_CACHE_L2X0 is not set
-CONFIG_CLEANCACHE=y
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_QCOM=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_COMMON_CLK=y
-CONFIG_COMMON_CLK_QCOM=y
-CONFIG_COMPACTION=y
-CONFIG_COREDUMP=y
-# CONFIG_CPUFREQ_DT is not set
-CONFIG_CPU_32v6K=y
-CONFIG_CPU_32v7=y
-CONFIG_CPU_ABRT_EV7=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-# CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_CPU_CACHE_V7=y
-CONFIG_CPU_CACHE_VIPT=y
-CONFIG_CPU_COPY_V6=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-CONFIG_CPU_FREQ=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
-CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
-# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
-# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
-CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
-# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
-# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
-CONFIG_CPU_FREQ_STAT=y
-# CONFIG_CPU_FREQ_STAT_DETAILS is not set
-CONFIG_CPU_HAS_ASID=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-CONFIG_CPU_IDLE=y
-CONFIG_CPU_IDLE_GOV_LADDER=y
-CONFIG_CPU_IDLE_GOV_MENU=y
-CONFIG_CPU_PABRT_V7=y
-CONFIG_CPU_PM=y
-CONFIG_CPU_RMAP=y
-# CONFIG_CPU_THERMAL is not set
-CONFIG_CPU_TLB_V7=y
-CONFIG_CPU_V7=y
-CONFIG_CRC16=y
-# CONFIG_CRC32_SARWATE is not set
-CONFIG_CRC32_SLICEBY8=y
-CONFIG_CROSS_MEMORY_ATTACH=y
-# CONFIG_CRYPTO_SHA1_ARM_NEON is not set
-# CONFIG_CRYPTO_SHA512_ARM_NEON is not set
-CONFIG_CRYPTO_XZ=y
-CONFIG_DCACHE_WORD_ACCESS=y
-CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_GPIO=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
-CONFIG_DEBUG_PREEMPT=y
-# CONFIG_DEBUG_UART_8250 is not set
-# CONFIG_DEBUG_USER is not set
-CONFIG_DECOMPRESS_GZIP=y
-CONFIG_DEVMEM=y
-CONFIG_DMADEVICES=y
-CONFIG_DMA_ENGINE=y
-CONFIG_DMA_OF=y
-CONFIG_DMA_VIRTUAL_CHANNELS=y
-CONFIG_DTC=y
-# CONFIG_DW_DMAC_CORE is not set
-# CONFIG_DW_DMAC_PCI is not set
-CONFIG_DYNAMIC_DEBUG=y
-CONFIG_ETHERNET_PACKET_MANGLE=y
-CONFIG_FIXED_PHY=y
-CONFIG_FREEZER=y
-CONFIG_GENERIC_ALLOCATOR=y
-CONFIG_GENERIC_BUG=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_CPUFREQ_KRAIT=y
-CONFIG_GENERIC_IDLE_POLL_SETUP=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_MSI_IRQ=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_PHY=y
-CONFIG_GENERIC_PINCONF=y
-CONFIG_GENERIC_SCHED_CLOCK=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GENERIC_STRNCPY_FROM_USER=y
-CONFIG_GENERIC_STRNLEN_USER=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIOLIB_IRQCHIP=y
-CONFIG_GPIO_DEVRES=y
-# CONFIG_GPIO_MSM_V2 is not set
-CONFIG_GPIO_SYSFS=y
-CONFIG_HANDLE_DOMAIN_IRQ=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-CONFIG_HAVE_ARCH_AUDITSYSCALL=y
-CONFIG_HAVE_ARCH_BITREVERSE=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_PFN_VALID=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ARM_ARCH_TIMER=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_HW_BREAKPOINT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_OPTPROBES=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PERF_REGS=y
-CONFIG_HAVE_PERF_USER_STACK_DUMP=y
-CONFIG_HAVE_PROC_CPU=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_SMP=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_UID16=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
-CONFIG_HIGHMEM=y
-CONFIG_HIGHPTE=y
-CONFIG_HOTPLUG_CPU=y
-CONFIG_HWMON=y
-CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_MSM=y
-CONFIG_HZ_FIXED=0
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_COMPAT=y
-CONFIG_I2C_HELPER_AUTO=y
-CONFIG_I2C_QUP=y
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IOMMU_HELPER=y
-# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set
-CONFIG_IOMMU_SUPPORT=y
-CONFIG_IPQ_GCC_806X=y
-# CONFIG_IPQ_LCC_806X is not set
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_DOMAIN_HIERARCHY=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_WORK=y
-CONFIG_KPSS_XCC=y
-CONFIG_KRAITCC=y
-CONFIG_KRAIT_CLOCKS=y
-CONFIG_KRAIT_L2_ACCESSORS=y
-# CONFIG_LEDS_REGULATOR is not set
-CONFIG_LIBFDT=y
-CONFIG_LOCKUP_DETECTOR=y
-CONFIG_LOCK_SPIN_ON_OWNER=y
-# CONFIG_LZ4_COMPRESS is not set
-# CONFIG_LZ4_DECOMPRESS is not set
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_MDIO_BITBANG=y
-CONFIG_MDIO_BOARDINFO=y
-CONFIG_MDIO_GPIO=y
-CONFIG_MFD_QCOM_RPM=y
-# CONFIG_MFD_SPMI_PMIC is not set
-CONFIG_MFD_SYSCON=y
-CONFIG_MIGHT_HAVE_CACHE_L2X0=y
-CONFIG_MIGHT_HAVE_PCI=y
-CONFIG_MIGRATION=y
-CONFIG_MODULES_USE_ELF_REL=y
-CONFIG_MSM_GCC_8660=y
-CONFIG_MSM_GCC_8960=y
-CONFIG_MSM_GCC_8974=y
-# CONFIG_MSM_LCC_8960 is not set
-CONFIG_MSM_MMCC_8960=y
-CONFIG_MSM_MMCC_8974=y
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_SPI_NOR=y
-CONFIG_MTD_SPLIT_FIRMWARE=y
-CONFIG_MTD_SPLIT_FIT_FW=y
-CONFIG_MULTI_IRQ_HANDLER=y
-CONFIG_MUTEX_SPIN_ON_OWNER=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEON=y
-CONFIG_NET_FLOW_LIMIT=y
-CONFIG_NET_VENDOR_WIZNET=y
-CONFIG_NO_BOOTMEM=y
-CONFIG_NO_HZ=y
-CONFIG_NO_HZ_COMMON=y
-CONFIG_NO_HZ_IDLE=y
-CONFIG_NR_CPUS=4
-CONFIG_OF=y
-CONFIG_OF_ADDRESS=y
-CONFIG_OF_ADDRESS_PCI=y
-CONFIG_OF_EARLY_FLATTREE=y
-CONFIG_OF_FLATTREE=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_IRQ=y
-CONFIG_OF_MDIO=y
-CONFIG_OF_MTD=y
-CONFIG_OF_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_OF_RESERVED_MEM=y
-CONFIG_OLD_SIGACTION=y
-CONFIG_OLD_SIGSUSPEND3=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_PAGE_OFFSET=0xC0000000
-CONFIG_PCI=y
-CONFIG_PCIEAER=y
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_DW=y
-CONFIG_PCIE_PME=y
-CONFIG_PCIE_QCOM=y
-CONFIG_PCI_DEBUG=y
-CONFIG_PCI_DOMAINS=y
-CONFIG_PCI_DOMAINS_GENERIC=y
-CONFIG_PCI_MSI=y
-CONFIG_PERF_EVENTS=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PHYLIB=y
-# CONFIG_PHY_QCOM_APQ8064_SATA is not set
-CONFIG_PHY_QCOM_IPQ806X_SATA=y
-CONFIG_PINCTRL=y
-CONFIG_PINCTRL_APQ8064=y
-# CONFIG_PINCTRL_APQ8084 is not set
-CONFIG_PINCTRL_IPQ8064=y
-CONFIG_PINCTRL_MSM=y
-# CONFIG_PINCTRL_MSM8916 is not set
-# CONFIG_PINCTRL_MSM8960 is not set
-CONFIG_PINCTRL_MSM8X74=y
-# CONFIG_PINCTRL_QCOM_SPMI_PMIC is not set
-# CONFIG_PL330_DMA is not set
-CONFIG_PM=y
-CONFIG_PM_CLK=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_OPP=y
-CONFIG_PM_SLEEP=y
-CONFIG_PM_SLEEP_SMP=y
-CONFIG_POWER_RESET=y
-# CONFIG_POWER_RESET_BRCMSTB is not set
-# CONFIG_POWER_RESET_GPIO is not set
-# CONFIG_POWER_RESET_GPIO_RESTART is not set
-# CONFIG_POWER_RESET_LTC2952 is not set
-CONFIG_POWER_RESET_MSM=y
-# CONFIG_POWER_RESET_SYSCON is not set
-CONFIG_POWER_SUPPLY=y
-CONFIG_PREEMPT=y
-CONFIG_PREEMPT_COUNT=y
-# CONFIG_PREEMPT_NONE is not set
-CONFIG_PREEMPT_RCU=y
-CONFIG_PRINTK_TIME=y
-CONFIG_PROC_PAGE_MONITOR=y
-CONFIG_QCOM_BAM_DMA=y
-CONFIG_QCOM_GSBI=y
-CONFIG_QCOM_HFPLL=y
-CONFIG_QCOM_SCM=y
-CONFIG_QCOM_WDT=y
-CONFIG_RAS=y
-# CONFIG_RCU_BOOST is not set
-CONFIG_RCU_CPU_STALL_TIMEOUT=21
-CONFIG_RCU_STALL_COMMON=y
-CONFIG_RD_GZIP=y
-CONFIG_REGMAP=y
-CONFIG_REGMAP_MMIO=y
-CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
-CONFIG_REGULATOR_QCOM_RPM=y
-# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
-CONFIG_RESET_CONTROLLER=y
-CONFIG_RFS_ACCEL=y
-CONFIG_RPS=y
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_DRV_CMOS is not set
-CONFIG_RWSEM_SPIN_ON_OWNER=y
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-CONFIG_SCHED_HRTICK=y
-# CONFIG_SCSI_DMA is not set
-# CONFIG_SERIAL_AMBA_PL010 is not set
-# CONFIG_SERIAL_AMBA_PL011 is not set
-CONFIG_SERIAL_MSM=y
-CONFIG_SERIAL_MSM_CONSOLE=y
-# CONFIG_SLAB is not set
-CONFIG_SLUB=y
-CONFIG_SLUB_CPU_PARTIAL=y
-CONFIG_SMP=y
-CONFIG_SMP_ON_UP=y
-CONFIG_SPARSE_IRQ=y
-CONFIG_SPI=y
-CONFIG_SPI_MASTER=y
-CONFIG_SPI_QUP=y
-CONFIG_SPMI=y
-CONFIG_SPMI_MSM_PMIC_ARB=y
-CONFIG_SRCU=y
-CONFIG_STOP_MACHINE=y
-# CONFIG_STRIP_ASM_SYMS is not set
-CONFIG_SUSPEND=y
-CONFIG_SUSPEND_FREEZER=y
-CONFIG_SWCONFIG=y
-CONFIG_SWIOTLB=y
-CONFIG_SWP_EMULATE=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_THERMAL=y
-# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
-CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
-# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
-# CONFIG_THERMAL_EMULATION is not set
-# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
-CONFIG_THERMAL_GOV_STEP_WISE=y
-# CONFIG_THERMAL_GOV_USER_SPACE is not set
-CONFIG_THERMAL_HWMON=y
-CONFIG_THERMAL_OF=y
-# CONFIG_THUMB2_KERNEL is not set
-CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_TIMER_STATS=y
-CONFIG_UEVENT_HELPER_PATH=""
-CONFIG_UID16=y
-CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
-CONFIG_UNINLINE_SPIN_UNLOCK=y
-CONFIG_USB_SUPPORT=y
-CONFIG_USE_OF=y
-CONFIG_VECTORS_BASE=0xffff0000
-CONFIG_VFP=y
-CONFIG_VFPv3=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_WATCHDOG_CORE=y
-# CONFIG_WIZNET_W5100 is not set
-# CONFIG_WIZNET_W5300 is not set
-# CONFIG_WL_TI is not set
-# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
-# CONFIG_XEN is not set
-CONFIG_XPS=y
-CONFIG_XZ_DEC_ARM=y
-CONFIG_XZ_DEC_BCJ=y
-CONFIG_ZBOOT_ROM_BSS=0
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
new file mode 100644
index 0000000..e80b632
--- /dev/null
+++ b/target/linux/ipq806x/config-4.1
@@ -0,0 +1,437 @@
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_AMBA_PL08X is not set
+# CONFIG_APM_EMULATION is not set
+CONFIG_APQ_GCC_8084=y
+CONFIG_APQ_MMCC_8084=y
+CONFIG_AR8216_PHY=y
+# CONFIG_ARCH_ALPINE is not set
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_TICK_BROADCAST=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MSM8960=y
+CONFIG_ARCH_MSM8974=y
+CONFIG_ARCH_MSM8X60=y
+CONFIG_ARCH_MULTIPLATFORM=y
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_QCOM=y
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+CONFIG_ARM=y
+CONFIG_ARM_AMBA=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+# CONFIG_ARM_ATAG_DTB_COMPAT is not set
+CONFIG_ARM_CCI=y
+CONFIG_ARM_CCI400_COMMON=y
+CONFIG_ARM_CCI400_PMU=y
+# CONFIG_ARM_CPUIDLE is not set
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+# CONFIG_ARM_LPAE is not set
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_ARM_QCOM_CPUFREQ=y
+# CONFIG_ARM_SMMU is not set
+# CONFIG_ARM_SP805_WATCHDOG is not set
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_UNWIND=y
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_AT803X_PHY=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+CONFIG_BOUNCE=y
+CONFIG_BUILD_BIN2C=y
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_CLEANCACHE=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_QCOM=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_COMMON_CLK=y
+CONFIG_COMMON_CLK_QCOM=y
+CONFIG_COMPACTION=y
+CONFIG_COREDUMP=y
+# CONFIG_CPUFREQ_DT is not set
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_HAS_ASID=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_PM=y
+CONFIG_CPU_RMAP=y
+# CONFIG_CPU_THERMAL is not set
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_V7=y
+CONFIG_CRC16=y
+# CONFIG_CRC32_SARWATE is not set
+CONFIG_CRC32_SLICEBY8=y
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_CRYPTO_XZ=y
+CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_GPIO=y
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_UART_8250 is not set
+# CONFIG_DEBUG_USER is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DEVMEM=y
+CONFIG_DMADEVICES=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_OF=y
+CONFIG_DMA_VIRTUAL_CHANNELS=y
+CONFIG_DTC=y
+# CONFIG_DW_DMAC_PCI is not set
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_ETHERNET_PACKET_MANGLE=y
+CONFIG_FIXED_PHY=y
+CONFIG_FREEZER=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_CPUFREQ_KRAIT=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_MSI_IRQ=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_PHY=y
+CONFIG_GENERIC_PINCONF=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIOLIB_IRQCHIP=y
+CONFIG_GPIO_DEVRES=y
+# CONFIG_GPIO_MSM_V2 is not set
+CONFIG_GPIO_SYSFS=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_PFN_VALID=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_BPF_JIT=y
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_HW_BREAKPOINT=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZ4=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_SMP=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_UID16=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HIGHMEM=y
+CONFIG_HIGHPTE=y
+CONFIG_HOTPLUG_CPU=y
+# CONFIG_HSU_DMA_PCI is not set
+CONFIG_HWMON=y
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_MSM=y
+CONFIG_HZ_FIXED=0
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_QUP=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_IOMMU_HELPER=y
+# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set
+CONFIG_IOMMU_SUPPORT=y
+CONFIG_IPQ_GCC_806X=y
+# CONFIG_IPQ_LCC_806X is not set
+CONFIG_IRQCHIP=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+CONFIG_KPSS_XCC=y
+CONFIG_KRAITCC=y
+CONFIG_KRAIT_CLOCKS=y
+CONFIG_KRAIT_L2_ACCESSORS=y
+# CONFIG_LEDS_REGULATOR is not set
+CONFIG_LIBFDT=y
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_LOCK_SPIN_ON_OWNER=y
+# CONFIG_LZ4_COMPRESS is not set
+# CONFIG_LZ4_DECOMPRESS is not set
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_MDIO_BITBANG=y
+CONFIG_MDIO_BOARDINFO=y
+CONFIG_MDIO_GPIO=y
+CONFIG_MFD_QCOM_RPM=y
+# CONFIG_MFD_SPMI_PMIC is not set
+CONFIG_MFD_SYSCON=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_MIGRATION=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MSM_GCC_8660=y
+# CONFIG_MSM_GCC_8916 is not set
+CONFIG_MSM_GCC_8960=y
+CONFIG_MSM_GCC_8974=y
+# CONFIG_MSM_LCC_8960 is not set
+CONFIG_MSM_MMCC_8960=y
+CONFIG_MSM_MMCC_8974=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIT_FW=y
+CONFIG_MULTI_IRQ_HANDLER=y
+CONFIG_MUTEX_SPIN_ON_OWNER=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEON=y
+CONFIG_NET_FLOW_LIMIT=y
+CONFIG_NET_VENDOR_WIZNET=y
+CONFIG_NO_BOOTMEM=y
+CONFIG_NO_HZ=y
+CONFIG_NO_HZ_COMMON=y
+CONFIG_NO_HZ_IDLE=y
+CONFIG_NR_CPUS=4
+CONFIG_OF=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_ADDRESS_PCI=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_GPIO=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_MDIO=y
+CONFIG_OF_MTD=y
+CONFIG_OF_NET=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
+CONFIG_OF_RESERVED_MEM=y
+CONFIG_OLD_SIGACTION=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PCI=y
+CONFIG_PCIEAER=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIE_DW=y
+# CONFIG_PCIE_IPROC is not set
+CONFIG_PCIE_PME=y
+CONFIG_PCIE_QCOM=y
+CONFIG_PCI_DEBUG=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_DOMAINS_GENERIC=y
+CONFIG_PCI_MSI=y
+CONFIG_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+# CONFIG_PHY_QCOM_APQ8064_SATA is not set
+CONFIG_PHY_QCOM_IPQ806X_SATA=y
+# CONFIG_PHY_QCOM_UFS is not set
+CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AMD is not set
+CONFIG_PINCTRL_APQ8064=y
+# CONFIG_PINCTRL_APQ8084 is not set
+CONFIG_PINCTRL_IPQ8064=y
+CONFIG_PINCTRL_MSM=y
+# CONFIG_PINCTRL_MSM8916 is not set
+# CONFIG_PINCTRL_MSM8960 is not set
+CONFIG_PINCTRL_MSM8X74=y
+# CONFIG_PINCTRL_QCOM_SPMI_PMIC is not set
+# CONFIG_PL330_DMA is not set
+CONFIG_PM=y
+CONFIG_PM_CLK=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_OPP=y
+CONFIG_PM_SLEEP=y
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_POWER_RESET=y
+# CONFIG_POWER_RESET_BRCMSTB is not set
+# CONFIG_POWER_RESET_GPIO is not set
+# CONFIG_POWER_RESET_GPIO_RESTART is not set
+# CONFIG_POWER_RESET_LTC2952 is not set
+CONFIG_POWER_RESET_MSM=y
+# CONFIG_POWER_RESET_SYSCON is not set
+# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
+CONFIG_POWER_SUPPLY=y
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_COUNT=y
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_RCU=y
+CONFIG_PRINTK_TIME=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_QCOM_BAM_DMA=y
+CONFIG_QCOM_GSBI=y
+CONFIG_QCOM_HFPLL=y
+CONFIG_QCOM_SCM=y
+CONFIG_QCOM_WDT=y
+# CONFIG_QORIQ_CPUFREQ is not set
+CONFIG_RAS=y
+# CONFIG_RCU_BOOST is not set
+CONFIG_RCU_CPU_STALL_TIMEOUT=21
+# CONFIG_RCU_EXPEDITE_BOOT is not set
+CONFIG_RCU_STALL_COMMON=y
+CONFIG_RD_GZIP=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_MMIO=y
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+CONFIG_REGULATOR_QCOM_RPM=y
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+CONFIG_RESET_CONTROLLER=y
+CONFIG_RFS_ACCEL=y
+CONFIG_RPS=y
+CONFIG_RTC_CLASS=y
+# CONFIG_RTC_DRV_CMOS is not set
+CONFIG_RWSEM_SPIN_ON_OWNER=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_SCHED_HRTICK=y
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SERIAL_AMBA_PL010 is not set
+# CONFIG_SERIAL_AMBA_PL011 is not set
+CONFIG_SERIAL_MSM=y
+CONFIG_SERIAL_MSM_CONSOLE=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+CONFIG_SLUB_CPU_PARTIAL=y
+CONFIG_SMP=y
+CONFIG_SMP_ON_UP=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+CONFIG_SPI_QUP=y
+CONFIG_SPMI=y
+CONFIG_SPMI_MSM_PMIC_ARB=y
+CONFIG_SRCU=y
+CONFIG_STOP_MACHINE=y
+# CONFIG_STRIP_ASM_SYMS is not set
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_SWCONFIG=y
+CONFIG_SWIOTLB=y
+CONFIG_SWP_EMULATE=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_THERMAL=y
+# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
+CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
+# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
+# CONFIG_THERMAL_EMULATION is not set
+# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
+CONFIG_THERMAL_GOV_STEP_WISE=y
+# CONFIG_THERMAL_GOV_USER_SPACE is not set
+CONFIG_THERMAL_HWMON=y
+CONFIG_THERMAL_OF=y
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TIMER_STATS=y
+CONFIG_UEVENT_HELPER_PATH=""
+CONFIG_UID16=y
+CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+CONFIG_UNINLINE_SPIN_UNLOCK=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USE_OF=y
+CONFIG_VDSO=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_WATCHDOG_CORE=y
+# CONFIG_WIZNET_W5100 is not set
+# CONFIG_WIZNET_W5300 is not set
+# CONFIG_WL_TI is not set
+# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
+# CONFIG_XEN is not set
+CONFIG_XPS=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_BCJ=y
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ipq806x/patches-4.0/001-spi-qup-Add-DMA-capabilities.patch b/target/linux/ipq806x/patches-4.0/001-spi-qup-Add-DMA-capabilities.patch
deleted file mode 100644
index a500c67..0000000
--- a/target/linux/ipq806x/patches-4.0/001-spi-qup-Add-DMA-capabilities.patch
+++ /dev/null
@@ -1,522 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: spi: qup: Add DMA capabilities
-From: Andy Gross <agross at codeaurora.org>
-X-Patchwork-Id: 4432401
-Message-Id: <1403816781-31008-1-git-send-email-agross at codeaurora.org>
-To: Mark Brown <broonie at kernel.org>
-Cc: linux-spi at vger.kernel.org, Sagar Dharia <sdharia at codeaurora.org>,
-	Daniel Sneddon <dsneddon at codeaurora.org>,
-	Bjorn Andersson <bjorn.andersson at sonymobile.com>,
-	"Ivan T. Ivanov" <iivanov at mm-sol.com>,
-	linux-kernel at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	linux-arm-msm at vger.kernel.org, Andy Gross <agross at codeaurora.org>
-Date: Thu, 26 Jun 2014 16:06:21 -0500
-
-This patch adds DMA capabilities to the spi-qup driver.  If DMA channels are
-present, the QUP will use DMA instead of block mode for transfers to/from SPI
-peripherals for transactions larger than the length of a block.
-
-Signed-off-by: Andy Gross <agross at codeaurora.org>
-
----
-.../devicetree/bindings/spi/qcom,spi-qup.txt       |   10 +
- drivers/spi/spi-qup.c                              |  361 ++++++++++++++++++--
- 2 files changed, 350 insertions(+), 21 deletions(-)
-
---- a/Documentation/devicetree/bindings/spi/qcom,spi-qup.txt
-+++ b/Documentation/devicetree/bindings/spi/qcom,spi-qup.txt
-@@ -27,6 +27,11 @@ Optional properties:
- - spi-max-frequency: Specifies maximum SPI clock frequency,
-                      Units - Hz. Definition as per
-                      Documentation/devicetree/bindings/spi/spi-bus.txt
-+- dmas :             Two DMA channel specifiers following the convention outlined
-+                     in bindings/dma/dma.txt
-+- dma-names:         Names for the dma channels, if present. There must be at
-+                     least one channel named "tx" for transmit and named "rx" for
-+                     receive.
- - num-cs:	total number of chipselects
- - cs-gpios:	should specify GPIOs used for chipselects.
- 		The gpios will be referred to as reg = <index> in the SPI child
-@@ -51,6 +56,10 @@ Example:
- 		clocks = <&gcc GCC_BLSP2_QUP2_SPI_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
- 		clock-names = "core", "iface";
- 
-+		dmas = <&blsp2_bam 2>,
-+			<&blsp2_bam 3>;
-+		dma-names = "rx", "tx";
-+
- 		pinctrl-names = "default";
- 		pinctrl-0 = <&spi8_default>;
- 
---- a/drivers/spi/spi-qup.c
-+++ b/drivers/spi/spi-qup.c
-@@ -22,6 +22,8 @@
- #include <linux/platform_device.h>
- #include <linux/pm_runtime.h>
- #include <linux/spi/spi.h>
-+#include <linux/dmaengine.h>
-+#include <linux/dma-mapping.h>
- 
- #define QUP_CONFIG			0x0000
- #define QUP_STATE			0x0004
-@@ -116,6 +118,8 @@
- 
- #define SPI_NUM_CHIPSELECTS		4
- 
-+#define SPI_MAX_XFER			(SZ_64K - 64)
-+
- /* high speed mode is when bus rate is greater then 26MHz */
- #define SPI_HS_MIN_RATE			26000000
- #define SPI_MAX_RATE			50000000
-@@ -143,6 +147,17 @@ struct spi_qup {
- 	int			tx_bytes;
- 	int			rx_bytes;
- 	int			qup_v1;
-+
-+	int			use_dma;
-+
-+	struct dma_chan		*rx_chan;
-+	struct dma_slave_config	rx_conf;
-+	struct dma_chan		*tx_chan;
-+	struct dma_slave_config tx_conf;
-+	dma_addr_t		rx_dma;
-+	dma_addr_t		tx_dma;
-+	void			*dummy;
-+	atomic_t		dma_outstanding;
- };
- 
- 
-@@ -266,6 +281,221 @@ static void spi_qup_fifo_write(struct sp
- 	}
- }
- 
-+static void qup_dma_callback(void *data)
-+{
-+	struct spi_qup *controller = data;
-+
-+	if (atomic_dec_and_test(&controller->dma_outstanding))
-+		complete(&controller->done);
-+}
-+
-+static int spi_qup_do_dma(struct spi_qup *controller, struct spi_transfer *xfer)
-+{
-+	struct dma_async_tx_descriptor *rxd, *txd;
-+	dma_cookie_t rx_cookie, tx_cookie;
-+	u32 xfer_len, rx_align = 0, tx_align = 0, n_words;
-+	struct scatterlist tx_sg[2], rx_sg[2];
-+	int ret = 0;
-+	u32 bytes_to_xfer = xfer->len;
-+	u32 offset = 0;
-+	u32 rx_nents = 0, tx_nents = 0;
-+	dma_addr_t rx_dma = 0, tx_dma = 0, rx_dummy_dma = 0, tx_dummy_dma = 0;
-+
-+
-+	if (xfer->rx_buf) {
-+		rx_dma = dma_map_single(controller->dev, xfer->rx_buf,
-+			xfer->len, DMA_FROM_DEVICE);
-+
-+		if (dma_mapping_error(controller->dev, rx_dma)) {
-+			ret = -ENOMEM;
-+			return ret;
-+		}
-+
-+		/* check to see if we need dummy buffer for leftover bytes */
-+		rx_align = xfer->len % controller->in_blk_sz;
-+		if (rx_align) {
-+			rx_dummy_dma = dma_map_single(controller->dev,
-+				controller->dummy, controller->in_fifo_sz,
-+				DMA_FROM_DEVICE);
-+
-+			if (dma_mapping_error(controller->dev, rx_dummy_dma)) {
-+				ret = -ENOMEM;
-+				goto err_map_rx_dummy;
-+			}
-+		}
-+	}
-+
-+	if (xfer->tx_buf) {
-+		tx_dma = dma_map_single(controller->dev,
-+			(void *)xfer->tx_buf, xfer->len, DMA_TO_DEVICE);
-+
-+		if (dma_mapping_error(controller->dev, tx_dma)) {
-+			ret = -ENOMEM;
-+			goto err_map_tx;
-+		}
-+
-+		/* check to see if we need dummy buffer for leftover bytes */
-+		tx_align = xfer->len % controller->out_blk_sz;
-+		if (tx_align) {
-+			memcpy(controller->dummy + SZ_1K,
-+				xfer->tx_buf + xfer->len - tx_align,
-+				tx_align);
-+			memset(controller->dummy + SZ_1K + tx_align, 0,
-+				controller->out_blk_sz - tx_align);
-+
-+			tx_dummy_dma = dma_map_single(controller->dev,
-+				controller->dummy + SZ_1K,
-+				controller->out_blk_sz, DMA_TO_DEVICE);
-+
-+			if (dma_mapping_error(controller->dev, tx_dummy_dma)) {
-+				ret = -ENOMEM;
-+				goto err_map_tx_dummy;
-+			}
-+		}
-+	}
-+
-+	atomic_set(&controller->dma_outstanding, 0);
-+
-+	while (bytes_to_xfer > 0) {
-+		xfer_len = min_t(u32, bytes_to_xfer, SPI_MAX_XFER);
-+		n_words = DIV_ROUND_UP(xfer_len, controller->w_size);
-+
-+		/* write out current word count to controller */
-+		writel_relaxed(n_words, controller->base + QUP_MX_INPUT_CNT);
-+		writel_relaxed(n_words, controller->base + QUP_MX_OUTPUT_CNT);
-+
-+		reinit_completion(&controller->done);
-+
-+		if (xfer->tx_buf) {
-+			/* recalc align for each transaction */
-+			tx_align = xfer_len % controller->out_blk_sz;
-+
-+			if (tx_align)
-+				tx_nents = 2;
-+			else
-+				tx_nents = 1;
-+
-+			/* initialize scatterlists */
-+			sg_init_table(tx_sg, tx_nents);
-+			sg_dma_len(&tx_sg[0]) = xfer_len - tx_align;
-+			sg_dma_address(&tx_sg[0]) = tx_dma + offset;
-+
-+			/* account for non block size transfer */
-+			if (tx_align) {
-+				sg_dma_len(&tx_sg[1]) = controller->out_blk_sz;
-+				sg_dma_address(&tx_sg[1]) = tx_dummy_dma;
-+			}
-+
-+			txd = dmaengine_prep_slave_sg(controller->tx_chan,
-+					tx_sg, tx_nents, DMA_MEM_TO_DEV, 0);
-+			if (!txd) {
-+				ret = -ENOMEM;
-+				goto err_unmap;
-+			}
-+
-+			atomic_inc(&controller->dma_outstanding);
-+
-+			txd->callback = qup_dma_callback;
-+			txd->callback_param = controller;
-+
-+			tx_cookie = dmaengine_submit(txd);
-+
-+			dma_async_issue_pending(controller->tx_chan);
-+		}
-+
-+		if (xfer->rx_buf) {
-+			/* recalc align for each transaction */
-+			rx_align = xfer_len % controller->in_blk_sz;
-+
-+			if (rx_align)
-+				rx_nents = 2;
-+			else
-+				rx_nents = 1;
-+
-+			/* initialize scatterlists */
-+			sg_init_table(rx_sg, rx_nents);
-+			sg_dma_address(&rx_sg[0]) = rx_dma + offset;
-+			sg_dma_len(&rx_sg[0]) = xfer_len - rx_align;
-+
-+			/* account for non block size transfer */
-+			if (rx_align) {
-+				sg_dma_len(&rx_sg[1]) = controller->in_blk_sz;
-+				sg_dma_address(&rx_sg[1]) = rx_dummy_dma;
-+			}
-+
-+			rxd = dmaengine_prep_slave_sg(controller->rx_chan,
-+					rx_sg, rx_nents, DMA_DEV_TO_MEM, 0);
-+			if (!rxd) {
-+				ret = -ENOMEM;
-+				goto err_unmap;
-+			}
-+
-+			atomic_inc(&controller->dma_outstanding);
-+
-+			rxd->callback = qup_dma_callback;
-+			rxd->callback_param = controller;
-+
-+			rx_cookie = dmaengine_submit(rxd);
-+
-+			dma_async_issue_pending(controller->rx_chan);
-+		}
-+
-+		if (spi_qup_set_state(controller, QUP_STATE_RUN)) {
-+			dev_warn(controller->dev, "cannot set EXECUTE state\n");
-+			goto err_unmap;
-+		}
-+
-+		if (!wait_for_completion_timeout(&controller->done,
-+			msecs_to_jiffies(1000))) {
-+			ret = -ETIMEDOUT;
-+
-+			/* clear out all the DMA transactions */
-+			if (xfer->tx_buf)
-+				dmaengine_terminate_all(controller->tx_chan);
-+			if (xfer->rx_buf)
-+				dmaengine_terminate_all(controller->rx_chan);
-+
-+			goto err_unmap;
-+		}
-+
-+		if (rx_align)
-+			memcpy(xfer->rx_buf + offset + xfer->len - rx_align,
-+				controller->dummy, rx_align);
-+
-+		/* adjust remaining bytes to transfer */
-+		bytes_to_xfer -= xfer_len;
-+		offset += xfer_len;
-+
-+
-+		/* reset mini-core state so we can program next transaction */
-+		if (spi_qup_set_state(controller, QUP_STATE_RESET)) {
-+			dev_err(controller->dev, "cannot set RESET state\n");
-+			goto err_unmap;
-+		}
-+	}
-+
-+	ret = 0;
-+
-+err_unmap:
-+	if (tx_align)
-+		dma_unmap_single(controller->dev, tx_dummy_dma,
-+			controller->out_fifo_sz, DMA_TO_DEVICE);
-+err_map_tx_dummy:
-+	if (xfer->tx_buf)
-+		dma_unmap_single(controller->dev, tx_dma, xfer->len,
-+			DMA_TO_DEVICE);
-+err_map_tx:
-+	if (rx_align)
-+		dma_unmap_single(controller->dev, rx_dummy_dma,
-+			controller->in_fifo_sz, DMA_FROM_DEVICE);
-+err_map_rx_dummy:
-+	if (xfer->rx_buf)
-+		dma_unmap_single(controller->dev, rx_dma, xfer->len,
-+			DMA_FROM_DEVICE);
-+
-+	return ret;
-+}
-+
- static irqreturn_t spi_qup_qup_irq(int irq, void *dev_id)
- {
- 	struct spi_qup *controller = dev_id;
-@@ -315,11 +545,13 @@ static irqreturn_t spi_qup_qup_irq(int i
- 		error = -EIO;
- 	}
- 
--	if (opflags & QUP_OP_IN_SERVICE_FLAG)
--		spi_qup_fifo_read(controller, xfer);
-+	if (!controller->use_dma) {
-+		if (opflags & QUP_OP_IN_SERVICE_FLAG)
-+			spi_qup_fifo_read(controller, xfer);
- 
--	if (opflags & QUP_OP_OUT_SERVICE_FLAG)
--		spi_qup_fifo_write(controller, xfer);
-+		if (opflags & QUP_OP_OUT_SERVICE_FLAG)
-+			spi_qup_fifo_write(controller, xfer);
-+	}
- 
- 	spin_lock_irqsave(&controller->lock, flags);
- 	controller->error = error;
-@@ -339,6 +571,8 @@ static int spi_qup_io_config(struct spi_
- 	struct spi_qup *controller = spi_master_get_devdata(spi->master);
- 	u32 config, iomode, mode, control;
- 	int ret, n_words, w_size;
-+	size_t dma_align = dma_get_cache_alignment();
-+	u32 dma_available = 0;
- 
- 	if (spi->mode & SPI_LOOP && xfer->len > controller->in_fifo_sz) {
- 		dev_err(controller->dev, "too big size for loopback %d > %d\n",
-@@ -367,6 +601,11 @@ static int spi_qup_io_config(struct spi_
- 	n_words = xfer->len / w_size;
- 	controller->w_size = w_size;
- 
-+	if (controller->rx_chan &&
-+		IS_ALIGNED((size_t)xfer->tx_buf, dma_align) &&
-+		IS_ALIGNED((size_t)xfer->rx_buf, dma_align))
-+		dma_available = 1;
-+
- 	if (n_words <= (controller->in_fifo_sz / sizeof(u32))) {
- 		mode = QUP_IO_M_MODE_FIFO;
- 		writel_relaxed(n_words, controller->base + QUP_MX_READ_CNT);
-@@ -374,19 +613,31 @@ static int spi_qup_io_config(struct spi_
- 		/* must be zero for FIFO */
- 		writel_relaxed(0, controller->base + QUP_MX_INPUT_CNT);
- 		writel_relaxed(0, controller->base + QUP_MX_OUTPUT_CNT);
--	} else {
-+		controller->use_dma = 0;
-+	} else if (!dma_available) {
- 		mode = QUP_IO_M_MODE_BLOCK;
- 		writel_relaxed(n_words, controller->base + QUP_MX_INPUT_CNT);
- 		writel_relaxed(n_words, controller->base + QUP_MX_OUTPUT_CNT);
- 		/* must be zero for BLOCK and BAM */
- 		writel_relaxed(0, controller->base + QUP_MX_READ_CNT);
- 		writel_relaxed(0, controller->base + QUP_MX_WRITE_CNT);
-+		controller->use_dma = 0;
-+	} else {
-+		mode = QUP_IO_M_MODE_DMOV;
-+		writel_relaxed(0, controller->base + QUP_MX_READ_CNT);
-+		writel_relaxed(0, controller->base + QUP_MX_WRITE_CNT);
-+		controller->use_dma = 1;
- 	}
- 
- 	iomode = readl_relaxed(controller->base + QUP_IO_M_MODES);
- 	/* Set input and output transfer mode */
- 	iomode &= ~(QUP_IO_M_INPUT_MODE_MASK | QUP_IO_M_OUTPUT_MODE_MASK);
--	iomode &= ~(QUP_IO_M_PACK_EN | QUP_IO_M_UNPACK_EN);
-+
-+	if (!controller->use_dma)
-+		iomode &= ~(QUP_IO_M_PACK_EN | QUP_IO_M_UNPACK_EN);
-+	else
-+		iomode |= QUP_IO_M_PACK_EN | QUP_IO_M_UNPACK_EN;
-+
- 	iomode |= (mode << QUP_IO_M_OUTPUT_MODE_MASK_SHIFT);
- 	iomode |= (mode << QUP_IO_M_INPUT_MODE_MASK_SHIFT);
- 
-@@ -428,6 +679,14 @@ static int spi_qup_io_config(struct spi_
- 	config &= ~(QUP_CONFIG_NO_INPUT | QUP_CONFIG_NO_OUTPUT | QUP_CONFIG_N);
- 	config |= xfer->bits_per_word - 1;
- 	config |= QUP_CONFIG_SPI_MODE;
-+
-+	if (controller->use_dma) {
-+		if (!xfer->tx_buf)
-+			config |= QUP_CONFIG_NO_OUTPUT;
-+		if (!xfer->rx_buf)
-+			config |= QUP_CONFIG_NO_INPUT;
-+	}
-+
- 	writel_relaxed(config, controller->base + QUP_CONFIG);
- 
- 	/* only write to OPERATIONAL_MASK when register is present */
-@@ -461,25 +720,29 @@ static int spi_qup_transfer_one(struct s
- 	controller->tx_bytes = 0;
- 	spin_unlock_irqrestore(&controller->lock, flags);
- 
--	if (spi_qup_set_state(controller, QUP_STATE_RUN)) {
--		dev_warn(controller->dev, "cannot set RUN state\n");
--		goto exit;
--	}
-+	if (controller->use_dma) {
-+		ret = spi_qup_do_dma(controller, xfer);
-+	} else {
-+		if (spi_qup_set_state(controller, QUP_STATE_RUN)) {
-+			dev_warn(controller->dev, "cannot set RUN state\n");
-+			goto exit;
-+		}
- 
--	if (spi_qup_set_state(controller, QUP_STATE_PAUSE)) {
--		dev_warn(controller->dev, "cannot set PAUSE state\n");
--		goto exit;
--	}
-+		if (spi_qup_set_state(controller, QUP_STATE_PAUSE)) {
-+			dev_warn(controller->dev, "cannot set PAUSE state\n");
-+			goto exit;
-+		}
- 
--	spi_qup_fifo_write(controller, xfer);
-+		spi_qup_fifo_write(controller, xfer);
- 
--	if (spi_qup_set_state(controller, QUP_STATE_RUN)) {
--		dev_warn(controller->dev, "cannot set EXECUTE state\n");
--		goto exit;
--	}
-+		if (spi_qup_set_state(controller, QUP_STATE_RUN)) {
-+			dev_warn(controller->dev, "cannot set EXECUTE state\n");
-+			goto exit;
-+		}
- 
--	if (!wait_for_completion_timeout(&controller->done, timeout))
--		ret = -ETIMEDOUT;
-+		if (!wait_for_completion_timeout(&controller->done, timeout))
-+			ret = -ETIMEDOUT;
-+	}
- exit:
- 	spi_qup_set_state(controller, QUP_STATE_RESET);
- 	spin_lock_irqsave(&controller->lock, flags);
-@@ -563,6 +826,7 @@ static int spi_qup_probe(struct platform
- 	master->transfer_one = spi_qup_transfer_one;
- 	master->dev.of_node = pdev->dev.of_node;
- 	master->auto_runtime_pm = true;
-+	master->dma_alignment = dma_get_cache_alignment();
- 
- 	platform_set_drvdata(pdev, master);
- 
-@@ -628,6 +892,56 @@ static int spi_qup_probe(struct platform
- 			QUP_ERROR_INPUT_UNDER_RUN | QUP_ERROR_OUTPUT_UNDER_RUN,
- 			base + QUP_ERROR_FLAGS_EN);
- 
-+	/* allocate dma resources, if available */
-+	controller->rx_chan = dma_request_slave_channel(&pdev->dev, "rx");
-+	if (controller->rx_chan) {
-+		controller->tx_chan =
-+			dma_request_slave_channel(&pdev->dev, "tx");
-+
-+		if (!controller->tx_chan) {
-+			dev_err(&pdev->dev, "Failed to allocate dma tx chan");
-+			dma_release_channel(controller->rx_chan);
-+		}
-+
-+		/* set DMA parameters */
-+		controller->rx_conf.device_fc = 1;
-+		controller->rx_conf.src_addr = res->start + QUP_INPUT_FIFO;
-+		controller->rx_conf.src_maxburst = controller->in_blk_sz;
-+
-+		controller->tx_conf.device_fc = 1;
-+		controller->tx_conf.dst_addr = res->start + QUP_OUTPUT_FIFO;
-+		controller->tx_conf.dst_maxburst = controller->out_blk_sz;
-+
-+		if (dmaengine_slave_config(controller->rx_chan,
-+				&controller->rx_conf)) {
-+			dev_err(&pdev->dev, "failed to configure RX channel\n");
-+
-+			dma_release_channel(controller->rx_chan);
-+			dma_release_channel(controller->tx_chan);
-+			controller->tx_chan = NULL;
-+			controller->rx_chan = NULL;
-+		} else if (dmaengine_slave_config(controller->tx_chan,
-+				&controller->tx_conf)) {
-+			dev_err(&pdev->dev, "failed to configure TX channel\n");
-+
-+			dma_release_channel(controller->rx_chan);
-+			dma_release_channel(controller->tx_chan);
-+			controller->tx_chan = NULL;
-+			controller->rx_chan = NULL;
-+		}
-+
-+		controller->dummy = devm_kmalloc(controller->dev, PAGE_SIZE,
-+			GFP_KERNEL);
-+
-+		if (!controller->dummy) {
-+			dma_release_channel(controller->rx_chan);
-+			dma_release_channel(controller->tx_chan);
-+			controller->tx_chan = NULL;
-+			controller->rx_chan = NULL;
-+		}
-+	}
-+
-+
- 	writel_relaxed(0, base + SPI_CONFIG);
- 	writel_relaxed(SPI_IO_C_NO_TRI_STATE, base + SPI_IO_CONTROL);
- 
-@@ -740,6 +1054,11 @@ static int spi_qup_remove(struct platfor
- 	if (ret)
- 		return ret;
- 
-+	if (controller->rx_chan)
-+		dma_release_channel(controller->rx_chan);
-+	if (controller->tx_chan)
-+		dma_release_channel(controller->tx_chan);
-+
- 	clk_disable_unprepare(controller->cclk);
- 	clk_disable_unprepare(controller->iclk);
- 
diff --git a/target/linux/ipq806x/patches-4.0/002-v3-spi-qup-Fix-incorrect-block-transfers.patch b/target/linux/ipq806x/patches-4.0/002-v3-spi-qup-Fix-incorrect-block-transfers.patch
deleted file mode 100644
index c8c6e4f..0000000
--- a/target/linux/ipq806x/patches-4.0/002-v3-spi-qup-Fix-incorrect-block-transfers.patch
+++ /dev/null
@@ -1,376 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3] spi: qup: Fix incorrect block transfers
-From: Andy Gross <agross at codeaurora.org>
-X-Patchwork-Id: 5007321
-Message-Id: <1412112088-25928-1-git-send-email-agross at codeaurora.org>
-To: Mark Brown <broonie at kernel.org>
-Cc: linux-spi at vger.kernel.org, linux-kernel at vger.kernel.org,
-	linux-arm-kernel at lists.infradead.org, linux-arm-msm at vger.kernel.org,
-	"Ivan T. Ivanov" <iivanov at mm-sol.com>,
-	Bjorn Andersson <bjorn.andersson at sonymobile.com>,
-	Kumar Gala <galak at codeaurora.org>, Andy Gross <agross at codeaurora.org>
-Date: Tue, 30 Sep 2014 16:21:28 -0500
-
-This patch fixes a number of errors with the QUP block transfer mode.  Errors
-manifested themselves as input underruns, output overruns, and timed out
-transactions.
-
-The block mode does not require the priming that occurs in FIFO mode.  At the
-moment that the QUP is placed into the RUN state, the QUP will immediately raise
-an interrupt if the request is a write.  Therefore, there is no need to prime
-the pump.
-
-In addition, the block transfers require that whole blocks of data are
-read/written at a time.  The last block of data that completes a transaction may
-contain less than a full blocks worth of data.
-
-Each block of data results in an input/output service interrupt accompanied with
-a input/output block flag set.  Additional block reads/writes require clearing
-of the service flag.  It is ok to check for additional blocks of data in the
-ISR, but you have to ack every block you transfer.  Imbalanced acks result in
-early return from complete transactions with pending interrupts that still have
-to be ack'd.  The next transaction can be affected by these interrupts.
-Transactions are deemed complete when the MAX_INPUT or MAX_OUTPUT flag are set.
-
-Changes from v2:
-- Added in additional completion check so that transaction done is not
-  prematurely signaled.
-- Fixed various review comments.
-
-Changes from v1:
-- Split out read/write block function.
-- Removed extraneous checks for transfer length
-
-Signed-off-by: Andy Gross <agross at codeaurora.org>
-
----
-drivers/spi/spi-qup.c |  201 ++++++++++++++++++++++++++++++++++++-------------
- 1 file changed, 148 insertions(+), 53 deletions(-)
-
---- a/drivers/spi/spi-qup.c
-+++ b/drivers/spi/spi-qup.c
-@@ -82,6 +82,8 @@
- #define QUP_IO_M_MODE_BAM		3
- 
- /* QUP_OPERATIONAL fields */
-+#define QUP_OP_IN_BLOCK_READ_REQ	BIT(13)
-+#define QUP_OP_OUT_BLOCK_WRITE_REQ	BIT(12)
- #define QUP_OP_MAX_INPUT_DONE_FLAG	BIT(11)
- #define QUP_OP_MAX_OUTPUT_DONE_FLAG	BIT(10)
- #define QUP_OP_IN_SERVICE_FLAG		BIT(9)
-@@ -147,6 +149,7 @@ struct spi_qup {
- 	int			tx_bytes;
- 	int			rx_bytes;
- 	int			qup_v1;
-+	int			mode;
- 
- 	int			use_dma;
- 
-@@ -213,30 +216,14 @@ static int spi_qup_set_state(struct spi_
- 	return 0;
- }
- 
--
--static void spi_qup_fifo_read(struct spi_qup *controller,
--			    struct spi_transfer *xfer)
-+static void spi_qup_fill_read_buffer(struct spi_qup *controller,
-+	struct spi_transfer *xfer, u32 data)
- {
- 	u8 *rx_buf = xfer->rx_buf;
--	u32 word, state;
--	int idx, shift, w_size;
--
--	w_size = controller->w_size;
--
--	while (controller->rx_bytes < xfer->len) {
--
--		state = readl_relaxed(controller->base + QUP_OPERATIONAL);
--		if (0 == (state & QUP_OP_IN_FIFO_NOT_EMPTY))
--			break;
--
--		word = readl_relaxed(controller->base + QUP_INPUT_FIFO);
--
--		if (!rx_buf) {
--			controller->rx_bytes += w_size;
--			continue;
--		}
-+	int idx, shift;
- 
--		for (idx = 0; idx < w_size; idx++, controller->rx_bytes++) {
-+	if (rx_buf)
-+		for (idx = 0; idx < controller->w_size; idx++) {
- 			/*
- 			 * The data format depends on bytes per SPI word:
- 			 *  4 bytes: 0x12345678
-@@ -244,41 +231,139 @@ static void spi_qup_fifo_read(struct spi
- 			 *  1 byte : 0x00000012
- 			 */
- 			shift = BITS_PER_BYTE;
--			shift *= (w_size - idx - 1);
--			rx_buf[controller->rx_bytes] = word >> shift;
-+			shift *= (controller->w_size - idx - 1);
-+			rx_buf[controller->rx_bytes + idx] = data >> shift;
-+		}
-+
-+	controller->rx_bytes += controller->w_size;
-+}
-+
-+static void spi_qup_prepare_write_data(struct spi_qup *controller,
-+	struct spi_transfer *xfer, u32 *data)
-+{
-+	const u8 *tx_buf = xfer->tx_buf;
-+	u32 val;
-+	int idx;
-+
-+	*data = 0;
-+
-+	if (tx_buf)
-+		for (idx = 0; idx < controller->w_size; idx++) {
-+			val = tx_buf[controller->tx_bytes + idx];
-+			*data |= val << (BITS_PER_BYTE * (3 - idx));
- 		}
-+
-+	controller->tx_bytes += controller->w_size;
-+}
-+
-+static void spi_qup_fifo_read(struct spi_qup *controller,
-+			    struct spi_transfer *xfer)
-+{
-+	u32 data;
-+
-+	/* clear service request */
-+	writel_relaxed(QUP_OP_IN_SERVICE_FLAG,
-+			controller->base + QUP_OPERATIONAL);
-+
-+	while (controller->rx_bytes < xfer->len) {
-+		if (!(readl_relaxed(controller->base + QUP_OPERATIONAL) &
-+		    QUP_OP_IN_FIFO_NOT_EMPTY))
-+			break;
-+
-+		data = readl_relaxed(controller->base + QUP_INPUT_FIFO);
-+
-+		spi_qup_fill_read_buffer(controller, xfer, data);
- 	}
- }
- 
- static void spi_qup_fifo_write(struct spi_qup *controller,
--			    struct spi_transfer *xfer)
-+	struct spi_transfer *xfer)
- {
--	const u8 *tx_buf = xfer->tx_buf;
--	u32 word, state, data;
--	int idx, w_size;
-+	u32 data;
- 
--	w_size = controller->w_size;
-+	/* clear service request */
-+	writel_relaxed(QUP_OP_OUT_SERVICE_FLAG,
-+		controller->base + QUP_OPERATIONAL);
- 
- 	while (controller->tx_bytes < xfer->len) {
- 
--		state = readl_relaxed(controller->base + QUP_OPERATIONAL);
--		if (state & QUP_OP_OUT_FIFO_FULL)
-+		if (readl_relaxed(controller->base + QUP_OPERATIONAL) &
-+				QUP_OP_OUT_FIFO_FULL)
- 			break;
- 
--		word = 0;
--		for (idx = 0; idx < w_size; idx++, controller->tx_bytes++) {
-+		spi_qup_prepare_write_data(controller, xfer, &data);
-+		writel_relaxed(data, controller->base + QUP_OUTPUT_FIFO);
- 
--			if (!tx_buf) {
--				controller->tx_bytes += w_size;
--				break;
--			}
-+	}
-+}
- 
--			data = tx_buf[controller->tx_bytes];
--			word |= data << (BITS_PER_BYTE * (3 - idx));
--		}
-+static void spi_qup_block_read(struct spi_qup *controller,
-+	struct spi_transfer *xfer)
-+{
-+	u32 data;
-+	u32 reads_per_blk = controller->in_blk_sz >> 2;
-+	u32 num_words = (xfer->len - controller->rx_bytes) / controller->w_size;
-+	int i;
-+
-+	do {
-+		/* ACK by clearing service flag */
-+		writel_relaxed(QUP_OP_IN_SERVICE_FLAG,
-+			controller->base + QUP_OPERATIONAL);
-+
-+		/* transfer up to a block size of data in a single pass */
-+		for (i = 0; num_words && i < reads_per_blk; i++, num_words--) {
-+
-+			/* read data and fill up rx buffer */
-+			data = readl_relaxed(controller->base + QUP_INPUT_FIFO);
-+			spi_qup_fill_read_buffer(controller, xfer, data);
-+		}
-+
-+		/* check to see if next block is ready */
-+		if (!(readl_relaxed(controller->base + QUP_OPERATIONAL) &
-+			QUP_OP_IN_BLOCK_READ_REQ))
-+			break;
- 
--		writel_relaxed(word, controller->base + QUP_OUTPUT_FIFO);
--	}
-+	} while (num_words);
-+
-+	/*
-+	 * Due to extra stickiness of the QUP_OP_IN_SERVICE_FLAG during block
-+	 * reads, it has to be cleared again at the very end
-+	 */
-+	if (readl_relaxed(controller->base + QUP_OPERATIONAL) &
-+		QUP_OP_MAX_INPUT_DONE_FLAG)
-+		writel_relaxed(QUP_OP_IN_SERVICE_FLAG,
-+			controller->base + QUP_OPERATIONAL);
-+
-+}
-+
-+static void spi_qup_block_write(struct spi_qup *controller,
-+	struct spi_transfer *xfer)
-+{
-+	u32 data;
-+	u32 writes_per_blk = controller->out_blk_sz >> 2;
-+	u32 num_words = (xfer->len - controller->tx_bytes) / controller->w_size;
-+	int i;
-+
-+	do {
-+		/* ACK by clearing service flag */
-+		writel_relaxed(QUP_OP_OUT_SERVICE_FLAG,
-+			controller->base + QUP_OPERATIONAL);
-+
-+		/* transfer up to a block size of data in a single pass */
-+		for (i = 0; num_words && i < writes_per_blk; i++, num_words--) {
-+
-+			/* swizzle the bytes for output and write out */
-+			spi_qup_prepare_write_data(controller, xfer, &data);
-+			writel_relaxed(data,
-+				controller->base + QUP_OUTPUT_FIFO);
-+		}
-+
-+		/* check to see if next block is ready */
-+		if (!(readl_relaxed(controller->base + QUP_OPERATIONAL) &
-+			QUP_OP_OUT_BLOCK_WRITE_REQ))
-+			break;
-+
-+	} while (num_words);
- }
- 
- static void qup_dma_callback(void *data)
-@@ -515,9 +600,9 @@ static irqreturn_t spi_qup_qup_irq(int i
- 
- 	writel_relaxed(qup_err, controller->base + QUP_ERROR_FLAGS);
- 	writel_relaxed(spi_err, controller->base + SPI_ERROR_FLAGS);
--	writel_relaxed(opflags, controller->base + QUP_OPERATIONAL);
- 
- 	if (!xfer) {
-+		writel_relaxed(opflags, controller->base + QUP_OPERATIONAL);
- 		dev_err_ratelimited(controller->dev, "unexpected irq %08x %08x %08x\n",
- 				    qup_err, spi_err, opflags);
- 		return IRQ_HANDLED;
-@@ -546,11 +631,19 @@ static irqreturn_t spi_qup_qup_irq(int i
- 	}
- 
- 	if (!controller->use_dma) {
--		if (opflags & QUP_OP_IN_SERVICE_FLAG)
--			spi_qup_fifo_read(controller, xfer);
-+		if (opflags & QUP_OP_IN_SERVICE_FLAG) {
-+			if (opflags & QUP_OP_IN_BLOCK_READ_REQ)
-+				spi_qup_block_read(controller, xfer);
-+			else
-+				spi_qup_fifo_read(controller, xfer);
-+		}
- 
--		if (opflags & QUP_OP_OUT_SERVICE_FLAG)
--			spi_qup_fifo_write(controller, xfer);
-+		if (opflags & QUP_OP_OUT_SERVICE_FLAG) {
-+			if (opflags & QUP_OP_OUT_BLOCK_WRITE_REQ)
-+				spi_qup_block_write(controller, xfer);
-+			else
-+				spi_qup_fifo_write(controller, xfer);
-+		}
- 	}
- 
- 	spin_lock_irqsave(&controller->lock, flags);
-@@ -558,7 +651,8 @@ static irqreturn_t spi_qup_qup_irq(int i
- 	controller->xfer = xfer;
- 	spin_unlock_irqrestore(&controller->lock, flags);
- 
--	if (controller->rx_bytes == xfer->len || error)
-+	if ((controller->rx_bytes == xfer->len &&
-+		(opflags & QUP_OP_MAX_INPUT_DONE_FLAG)) || error)
- 		complete(&controller->done);
- 
- 	return IRQ_HANDLED;
-@@ -569,7 +663,7 @@ static irqreturn_t spi_qup_qup_irq(int i
- static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer)
- {
- 	struct spi_qup *controller = spi_master_get_devdata(spi->master);
--	u32 config, iomode, mode, control;
-+	u32 config, iomode, control;
- 	int ret, n_words, w_size;
- 	size_t dma_align = dma_get_cache_alignment();
- 	u32 dma_available = 0;
-@@ -607,7 +701,7 @@ static int spi_qup_io_config(struct spi_
- 		dma_available = 1;
- 
- 	if (n_words <= (controller->in_fifo_sz / sizeof(u32))) {
--		mode = QUP_IO_M_MODE_FIFO;
-+		controller->mode = QUP_IO_M_MODE_FIFO;
- 		writel_relaxed(n_words, controller->base + QUP_MX_READ_CNT);
- 		writel_relaxed(n_words, controller->base + QUP_MX_WRITE_CNT);
- 		/* must be zero for FIFO */
-@@ -615,7 +709,7 @@ static int spi_qup_io_config(struct spi_
- 		writel_relaxed(0, controller->base + QUP_MX_OUTPUT_CNT);
- 		controller->use_dma = 0;
- 	} else if (!dma_available) {
--		mode = QUP_IO_M_MODE_BLOCK;
-+		controller->mode = QUP_IO_M_MODE_BLOCK;
- 		writel_relaxed(n_words, controller->base + QUP_MX_INPUT_CNT);
- 		writel_relaxed(n_words, controller->base + QUP_MX_OUTPUT_CNT);
- 		/* must be zero for BLOCK and BAM */
-@@ -623,7 +717,7 @@ static int spi_qup_io_config(struct spi_
- 		writel_relaxed(0, controller->base + QUP_MX_WRITE_CNT);
- 		controller->use_dma = 0;
- 	} else {
--		mode = QUP_IO_M_MODE_DMOV;
-+		controller->mode = QUP_IO_M_MODE_DMOV;
- 		writel_relaxed(0, controller->base + QUP_MX_READ_CNT);
- 		writel_relaxed(0, controller->base + QUP_MX_WRITE_CNT);
- 		controller->use_dma = 1;
-@@ -638,8 +732,8 @@ static int spi_qup_io_config(struct spi_
- 	else
- 		iomode |= QUP_IO_M_PACK_EN | QUP_IO_M_UNPACK_EN;
- 
--	iomode |= (mode << QUP_IO_M_OUTPUT_MODE_MASK_SHIFT);
--	iomode |= (mode << QUP_IO_M_INPUT_MODE_MASK_SHIFT);
-+	iomode |= (controller->mode << QUP_IO_M_OUTPUT_MODE_MASK_SHIFT);
-+	iomode |= (controller->mode << QUP_IO_M_INPUT_MODE_MASK_SHIFT);
- 
- 	writel_relaxed(iomode, controller->base + QUP_IO_M_MODES);
- 
-@@ -733,7 +827,8 @@ static int spi_qup_transfer_one(struct s
- 			goto exit;
- 		}
- 
--		spi_qup_fifo_write(controller, xfer);
-+		if (controller->mode == QUP_IO_M_MODE_FIFO)
-+			spi_qup_fifo_write(controller, xfer);
- 
- 		if (spi_qup_set_state(controller, QUP_STATE_RUN)) {
- 			dev_warn(controller->dev, "cannot set EXECUTE state\n");
-@@ -750,6 +845,7 @@ exit:
- 	if (!ret)
- 		ret = controller->error;
- 	spin_unlock_irqrestore(&controller->lock, flags);
-+
- 	return ret;
- }
- 
diff --git a/target/linux/ipq806x/patches-4.0/003-spi-qup-Ensure-done-detection.patch b/target/linux/ipq806x/patches-4.0/003-spi-qup-Ensure-done-detection.patch
deleted file mode 100644
index 7052227..0000000
--- a/target/linux/ipq806x/patches-4.0/003-spi-qup-Ensure-done-detection.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 4faba89e3ffbb1c5f6232651375b9b3212b50f02 Mon Sep 17 00:00:00 2001
-From: Andy Gross <agross at codeaurora.org>
-Date: Thu, 15 Jan 2015 17:56:02 -0800
-Subject: [PATCH] spi: qup: Ensure done detection
-
-This patch fixes an issue where a SPI transaction has completed, but the done
-condition is missed.  This occurs because at the time of interrupt the
-MAX_INPUT_DONE_FLAG is not asserted.  However, in the process of reading blocks
-of data from the FIFO, the last portion of data comes in.
-
-The opflags read at the beginning of the irq handler no longer matches the
-current opflag state.  To get around this condition, the block read function
-should update the opflags so that done detection is correct after the return.
-
-Change-Id: If109e0eeb432f96000d765c4b34dbb2269f8093f
-Signed-off-by: Andy Gross <agross at codeaurora.org>
----
- drivers/spi/spi-qup.c | 12 +++++++-----
- 1 file changed, 7 insertions(+), 5 deletions(-)
-
---- a/drivers/spi/spi-qup.c
-+++ b/drivers/spi/spi-qup.c
-@@ -298,7 +298,7 @@ static void spi_qup_fifo_write(struct sp
- }
- 
- static void spi_qup_block_read(struct spi_qup *controller,
--	struct spi_transfer *xfer)
-+	struct spi_transfer *xfer, u32 *opflags)
- {
- 	u32 data;
- 	u32 reads_per_blk = controller->in_blk_sz >> 2;
-@@ -327,10 +327,12 @@ static void spi_qup_block_read(struct sp
- 
- 	/*
- 	 * Due to extra stickiness of the QUP_OP_IN_SERVICE_FLAG during block
--	 * reads, it has to be cleared again at the very end
-+	 * reads, it has to be cleared again at the very end.  However, be sure
-+	 * to refresh opflags value because MAX_INPUT_DONE_FLAG may now be
-+	 * present and this is used to determine if transaction is complete
- 	 */
--	if (readl_relaxed(controller->base + QUP_OPERATIONAL) &
--		QUP_OP_MAX_INPUT_DONE_FLAG)
-+	*opflags = readl_relaxed(controller->base + QUP_OPERATIONAL);
-+	if (*opflags & QUP_OP_MAX_INPUT_DONE_FLAG)
- 		writel_relaxed(QUP_OP_IN_SERVICE_FLAG,
- 			controller->base + QUP_OPERATIONAL);
- 
-@@ -633,7 +635,7 @@ static irqreturn_t spi_qup_qup_irq(int i
- 	if (!controller->use_dma) {
- 		if (opflags & QUP_OP_IN_SERVICE_FLAG) {
- 			if (opflags & QUP_OP_IN_BLOCK_READ_REQ)
--				spi_qup_block_read(controller, xfer);
-+				spi_qup_block_read(controller, xfer, &opflags);
- 			else
- 				spi_qup_fifo_read(controller, xfer);
- 		}
diff --git a/target/linux/ipq806x/patches-4.0/011-watchdog-qcom-use-timer-devicetree-binding.patch b/target/linux/ipq806x/patches-4.0/011-watchdog-qcom-use-timer-devicetree-binding.patch
deleted file mode 100644
index 68489a8..0000000
--- a/target/linux/ipq806x/patches-4.0/011-watchdog-qcom-use-timer-devicetree-binding.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From fded70251b1b58f68de1d3757ece9965f0b75452 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Thu, 19 Feb 2015 20:19:30 -0800
-Subject: [PATCH 1/3] watchdog: qcom: use timer devicetree binding
-
-MSM watchdog configuration happens in the same register block as the
-timer, so we'll use the same binding as the existing timer.
-
-The qcom-wdt will now be probed when devicetree has an entry compatible
-with "qcom,kpss-timer" or "qcom-scss-timer".
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- drivers/watchdog/qcom-wdt.c | 21 +++++++++++++++------
- 1 file changed, 15 insertions(+), 6 deletions(-)
-
---- a/drivers/watchdog/qcom-wdt.c
-+++ b/drivers/watchdog/qcom-wdt.c
-@@ -20,9 +20,9 @@
- #include <linux/reboot.h>
- #include <linux/watchdog.h>
- 
--#define WDT_RST		0x0
--#define WDT_EN		0x8
--#define WDT_BITE_TIME	0x24
-+#define WDT_RST		0x38
-+#define WDT_EN		0x40
-+#define WDT_BITE_TIME	0x5C
- 
- struct qcom_wdt {
- 	struct watchdog_device	wdd;
-@@ -117,6 +117,8 @@ static int qcom_wdt_probe(struct platfor
- {
- 	struct qcom_wdt *wdt;
- 	struct resource *res;
-+	struct device_node *np = pdev->dev.of_node;
-+	u32 percpu_offset;
- 	int ret;
- 
- 	wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
-@@ -124,6 +126,14 @@ static int qcom_wdt_probe(struct platfor
- 		return -ENOMEM;
- 
- 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+
-+	/* We use CPU0's DGT for the watchdog */
-+	if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
-+		percpu_offset = 0;
-+
-+	res->start += percpu_offset;
-+	res->end += percpu_offset;
-+
- 	wdt->base = devm_ioremap_resource(&pdev->dev, res);
- 	if (IS_ERR(wdt->base))
- 		return PTR_ERR(wdt->base);
-@@ -203,9 +213,8 @@ static int qcom_wdt_remove(struct platfo
- }
- 
- static const struct of_device_id qcom_wdt_of_table[] = {
--	{ .compatible = "qcom,kpss-wdt-msm8960", },
--	{ .compatible = "qcom,kpss-wdt-apq8064", },
--	{ .compatible = "qcom,kpss-wdt-ipq8064", },
-+	{ .compatible = "qcom,kpss-timer" },
-+	{ .compatible = "qcom,scss-timer" },
- 	{ },
- };
- MODULE_DEVICE_TABLE(of, qcom_wdt_of_table);
diff --git a/target/linux/ipq806x/patches-4.0/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch b/target/linux/ipq806x/patches-4.0/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
deleted file mode 100644
index ae96776..0000000
--- a/target/linux/ipq806x/patches-4.0/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 297cf8136ecd6a56520888fd28948393766b8ee7 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Thu, 19 Feb 2015 20:27:39 -0800
-Subject: [PATCH 2/3] ARM: qcom: add description of KPSS WDT for IPQ8064
-
-Add the watchdog related entries to the Krait Processor Sub-system
-(KPSS) timer IPQ8064 devicetree section. Also, add a fixed-clock
-description of SLEEP_CLK, which will do for now.
-
-Signed-off-by: Josh Cartwright <joshc at codeaurora.org>
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- arch/arm/boot/dts/qcom-ipq8064.dtsi | 14 +++++++++++++-
- 1 file changed, 13 insertions(+), 1 deletion(-)
-
---- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
-+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -60,6 +60,14 @@
- 		};
- 	};
- 
-+	clocks {
-+		sleep_clk: sleep_clk {
-+			compatible = "fixed-clock";
-+			clock-frequency = <32768>;
-+			#clock-cells = <0>;
-+		};
-+	};
-+
- 	soc: soc {
- 		#address-cells = <1>;
- 		#size-cells = <1>;
-@@ -89,10 +97,14 @@
- 			compatible = "qcom,kpss-timer", "qcom,msm-timer";
- 			interrupts = <1 1 0x301>,
- 				     <1 2 0x301>,
--				     <1 3 0x301>;
-+				     <1 3 0x301>,
-+				     <1 4 0x301>,
-+				     <1 5 0x301>;
- 			reg = <0x0200a000 0x100>;
- 			clock-frequency = <25000000>,
- 					  <32768>;
-+			clocks = <&sleep_clk>;
-+			clock-names = "sleep";
- 			cpu-offset = <0x80000>;
- 		};
- 
diff --git a/target/linux/ipq806x/patches-4.0/013-ARM-msm-add-watchdog-entries-to-DT-timer-binding-doc.patch b/target/linux/ipq806x/patches-4.0/013-ARM-msm-add-watchdog-entries-to-DT-timer-binding-doc.patch
deleted file mode 100644
index e775f12..0000000
--- a/target/linux/ipq806x/patches-4.0/013-ARM-msm-add-watchdog-entries-to-DT-timer-binding-doc.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From e535f01dffb6dd9e09934fa219be52af3437a8f6 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Thu, 19 Feb 2015 20:36:27 -0800
-Subject: [PATCH 3/3] ARM: msm: add watchdog entries to DT timer binding doc
-
-The watchdog has been reworked to use the same DT node as the timer.
-This change is updating the device tree doc accordingly.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- Documentation/devicetree/bindings/arm/msm/timer.txt | 16 +++++++++++++---
- 1 file changed, 13 insertions(+), 3 deletions(-)
-
---- a/Documentation/devicetree/bindings/arm/msm/timer.txt
-+++ b/Documentation/devicetree/bindings/arm/msm/timer.txt
-@@ -9,11 +9,17 @@ Properties:
-                "qcom,scss-timer" - scorpion subsystem
- 
- - interrupts : Interrupts for the debug timer, the first general purpose
--               timer, and optionally a second general purpose timer in that
--               order.
-+               timer, and optionally a second general purpose timer, and
-+               optionally as well, 2 watchdog interrupts, in that order.
- 
- - reg : Specifies the base address of the timer registers.
- 
-+- clocks: Reference to the parent clocks, one per output clock. The parents
-+          must appear in the same order as the clock names.
-+
-+- clock-names: The name of the clocks as free-form strings. They should be in
-+               the same order as the clocks.
-+
- - clock-frequency : The frequency of the debug timer and the general purpose
-                     timer(s) in Hz in that order.
- 
-@@ -29,9 +35,13 @@ Example:
-                compatible = "qcom,scss-timer", "qcom,msm-timer";
-                interrupts = <1 1 0x301>,
-                             <1 2 0x301>,
--                            <1 3 0x301>;
-+                            <1 3 0x301>,
-+                            <1 4 0x301>,
-+                            <1 5 0x301>;
-                reg = <0x0200a000 0x100>;
-                clock-frequency = <19200000>,
-                                  <32768>;
-+               clocks = <&sleep_clk>;
-+               clock-names = "sleep";
-                cpu-offset = <0x40000>;
-        };
diff --git a/target/linux/ipq806x/patches-4.0/020-add-ap148-bootargs.patch b/target/linux/ipq806x/patches-4.0/020-add-ap148-bootargs.patch
deleted file mode 100644
index a61481e..0000000
--- a/target/linux/ipq806x/patches-4.0/020-add-ap148-bootargs.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -14,6 +14,14 @@
- 		};
- 	};
- 
-+	alias {
-+		serial0 = &uart4;
-+	};
-+
-+	chosen {
-+		linux,stdout-path = "serial0:115200n8";
-+	};
-+
- 	soc {
- 		pinmux at 800000 {
- 			i2c4_pins: i2c4_pinmux {
---- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
-+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -140,7 +140,7 @@
- 			ranges;
- 			status = "disabled";
- 
--			serial at 12490000 {
-+			uart2: serial at 12490000 {
- 				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
- 				reg = <0x12490000 0x1000>,
- 				      <0x12480000 0x1000>;
-@@ -175,7 +175,7 @@
- 			ranges;
- 			status = "disabled";
- 
--			serial at 16340000 {
-+			uart4: serial at 16340000 {
- 				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
- 				reg = <0x16340000 0x1000>,
- 				      <0x16300000 0x1000>;
-@@ -209,7 +209,7 @@
- 			ranges;
- 			status = "disabled";
- 
--			serial at 1a240000 {
-+			uart5: serial at 1a240000 {
- 				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
- 				reg = <0x1a240000 0x1000>,
- 				      <0x1a200000 0x1000>;
diff --git a/target/linux/ipq806x/patches-4.0/021-add-ap148-partitions.patch b/target/linux/ipq806x/patches-4.0/021-add-ap148-partitions.patch
deleted file mode 100644
index 34eb9c0..0000000
--- a/target/linux/ipq806x/patches-4.0/021-add-ap148-partitions.patch
+++ /dev/null
@@ -1,35 +0,0 @@
---- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -78,13 +78,28 @@
- 					reg = <0>;
- 
- 					partition at 0 {
--						label = "rootfs";
--						reg = <0x0 0x1000000>;
-+						label = "lowlevel_init";
-+						reg = <0x0 0x1b0000>;
- 					};
- 
- 					partition at 1 {
--						label = "scratch";
--						reg = <0x1000000 0x1000000>;
-+						label = "u-boot";
-+						reg = <0x1b0000 0x80000>;
-+					};
-+
-+					partition at 2 {
-+						label = "u-boot-env";
-+						reg = <0x230000 0x40000>;
-+					};
-+
-+					partition at 3 {
-+						label = "caldata";
-+						reg = <0x270000 0x40000>;
-+					};
-+
-+					partition at 4 {
-+						label = "firmware";
-+						reg = <0x2b0000 0x1d50000>;
- 					};
- 				};
- 			};
diff --git a/target/linux/ipq806x/patches-4.0/022-add-db149-dts.patch b/target/linux/ipq806x/patches-4.0/022-add-db149-dts.patch
deleted file mode 100644
index 29631b2..0000000
--- a/target/linux/ipq806x/patches-4.0/022-add-db149-dts.patch
+++ /dev/null
@@ -1,160 +0,0 @@
-From f26cc3733bdd697bd81ae505fc133fa7c9b6ea19 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Tue, 7 Apr 2015 19:58:58 -0700
-Subject: [PATCH] ARM: dts: qcom: add initial DB149 device-tree
-
-Add basic DB149 (IPQ806x based platform) device-tree. It supports UART,
-SATA, USB2, USB3 and NOR flash.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- arch/arm/boot/dts/Makefile               |   1 +
- arch/arm/boot/dts/qcom-ipq8064-db149.dts | 132 +++++++++++++++++++++++++++++++
- 2 files changed, 133 insertions(+)
- create mode 100644 arch/arm/boot/dts/qcom-ipq8064-db149.dts
-
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -438,6 +438,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
- 	qcom-apq8084-ifc6540.dtb \
- 	qcom-apq8084-mtp.dtb \
- 	qcom-ipq8064-ap148.dtb \
-+	qcom-ipq8064-db149.dtb \
- 	qcom-msm8660-surf.dtb \
- 	qcom-msm8960-cdp.dtb \
- 	qcom-msm8974-sony-xperia-honami.dtb
---- /dev/null
-+++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -0,0 +1,132 @@
-+#include "qcom-ipq8064-v1.0.dtsi"
-+
-+/ {
-+	model = "Qualcomm IPQ8064/DB149";
-+	compatible = "qcom,ipq8064-db149", "qcom,ipq8064";
-+
-+	reserved-memory {
-+		#address-cells = <1>;
-+		#size-cells = <1>;
-+		ranges;
-+		rsvd at 41200000 {
-+			reg = <0x41200000 0x300000>;
-+			no-map;
-+		};
-+	};
-+
-+	alias {
-+		serial0 = &uart2;
-+	};
-+
-+	chosen {
-+		linux,stdout-path = "serial0:115200n8";
-+	};
-+
-+	soc {
-+		pinmux at 800000 {
-+			i2c4_pins: i2c4_pinmux {
-+				pins = "gpio12", "gpio13";
-+				function = "gsbi4";
-+				bias-disable;
-+			};
-+
-+			spi_pins: spi_pins {
-+				mux {
-+					pins = "gpio18", "gpio19", "gpio21";
-+					function = "gsbi5";
-+					drive-strength = <10>;
-+					bias-none;
-+				};
-+			};
-+		};
-+
-+		gsbi2: gsbi at 12480000 {
-+			qcom,mode = <GSBI_PROT_I2C_UART>;
-+			status = "ok";
-+			uart2: serial at 12490000 {
-+				status = "ok";
-+			};
-+		};
-+
-+		gsbi5: gsbi at 1a200000 {
-+			qcom,mode = <GSBI_PROT_SPI>;
-+			status = "ok";
-+
-+			spi4: spi at 1a280000 {
-+				status = "ok";
-+				spi-max-frequency = <50000000>;
-+
-+				pinctrl-0 = <&spi_pins>;
-+				pinctrl-names = "default";
-+
-+				cs-gpios = <&qcom_pinmux 20 0>;
-+
-+				flash: m25p80 at 0 {
-+					compatible = "s25fl256s1";
-+					#address-cells = <1>;
-+					#size-cells = <1>;
-+					spi-max-frequency = <50000000>;
-+					reg = <0>;
-+					m25p,fast-read;
-+
-+					partition at 0 {
-+						label = "lowlevel_init";
-+						reg = <0x0 0x1b0000>;
-+					};
-+
-+					partition at 1 {
-+						label = "u-boot";
-+						reg = <0x1b0000 0x80000>;
-+					};
-+
-+					partition at 2 {
-+						label = "u-boot-env";
-+						reg = <0x230000 0x40000>;
-+					};
-+
-+					partition at 3 {
-+						label = "caldata";
-+						reg = <0x270000 0x40000>;
-+					};
-+
-+					partition at 4 {
-+						label = "firmware";
-+						reg = <0x2b0000 0x1d50000>;
-+					};
-+				};
-+			};
-+		};
-+
-+		sata-phy at 1b400000 {
-+			status = "ok";
-+		};
-+
-+		sata at 29000000 {
-+			status = "ok";
-+		};
-+
-+		phy at 100f8800 {		/* USB3 port 1 HS phy */
-+			status = "ok";
-+		};
-+
-+		phy at 100f8830 {		/* USB3 port 1 SS phy */
-+			status = "ok";
-+		};
-+
-+		phy at 110f8800 {		/* USB3 port 0 HS phy */
-+			status = "ok";
-+		};
-+
-+		phy at 110f8830 {		/* USB3 port 0 SS phy */
-+			status = "ok";
-+		};
-+
-+		usb30 at 0 {
-+			status = "ok";
-+		};
-+
-+		usb30 at 1 {
-+			status = "ok";
-+		};
-+	};
-+};
diff --git a/target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch b/target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
deleted file mode 100644
index 75595ca..0000000
--- a/target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
+++ /dev/null
@@ -1,53 +0,0 @@
---- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -46,15 +46,12 @@
- 			serial at 16340000 {
- 				status = "ok";
- 			};
--
--			i2c4: i2c at 16380000 {
--				status = "ok";
--
--				clock-frequency = <200000>;
--
--				pinctrl-0 = <&i2c4_pins>;
--				pinctrl-names = "default";
--			};
-+			/*
-+			 * The i2c device on gsbi4 should not be enabled.
-+			 * On ipq806x designs gsbi4 i2c is meant for exclusive
-+			 * RPM usage. Turning this on in kernel manifests as
-+			 * i2c failure for the RPM.
-+			 */
- 		};
- 
- 		gsbi5: gsbi at 1a200000 {
---- a/drivers/clk/qcom/gcc-ipq806x.c
-+++ b/drivers/clk/qcom/gcc-ipq806x.c
-@@ -805,7 +805,7 @@ static struct clk_rcg gsbi7_qup_src = {
- 			.parent_names = gcc_pxo_pll8,
- 			.num_parents = 2,
- 			.ops = &clk_rcg_ops,
--			.flags = CLK_SET_PARENT_GATE,
-+			.flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED,
- 		},
- 	},
- };
-@@ -821,7 +821,7 @@ static struct clk_branch gsbi7_qup_clk =
- 			.parent_names = (const char *[]){ "gsbi7_qup_src" },
- 			.num_parents = 1,
- 			.ops = &clk_branch_ops,
--			.flags = CLK_SET_RATE_PARENT,
-+			.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
- 		},
- 	},
- };
-@@ -869,7 +869,7 @@ static struct clk_branch gsbi4_h_clk = {
- 		.hw.init = &(struct clk_init_data){
- 			.name = "gsbi4_h_clk",
- 			.ops = &clk_branch_ops,
--			.flags = CLK_IS_ROOT,
-+			.flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED,
- 		},
- 	},
- };
diff --git a/target/linux/ipq806x/patches-4.0/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch b/target/linux/ipq806x/patches-4.0/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
deleted file mode 100644
index 41f91fa..0000000
--- a/target/linux/ipq806x/patches-4.0/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
+++ /dev/null
@@ -1,263 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v2,3/5] DT: PCI: qcom: Document PCIe devicetree bindings
-From: Stanimir Varbanov <svarbanov at mm-sol.com>
-X-Patchwork-Id: 6326181
-Message-Id: <1430743338-10441-4-git-send-email-svarbanov at mm-sol.com>
-To: Rob Herring <robh+dt at kernel.org>, Kumar Gala <galak at codeaurora.org>,
-	Mark Rutland <mark.rutland at arm.com>,
-	Grant Likely <grant.likely at linaro.org>,
-	Bjorn Helgaas <bhelgaas at google.com>,
-	Kishon Vijay Abraham I <kishon at ti.com>,
-	Russell King <linux at arm.linux.org.uk>, Arnd Bergmann <arnd at arndb.de>
-Cc: linux-arm-msm at vger.kernel.org, linux-kernel at vger.kernel.org,
-	linux-arm-kernel at lists.infradead.org, devicetree at vger.kernel.org,
-	linux-pci at vger.kernel.org, Mathieu Olivari <mathieu at codeaurora.org>,
-	Srinivas Kandagatla <srinivas.kandagatla at linaro.org>,
-	Stanimir Varbanov <svarbanov at mm-sol.com>
-Date: Mon,  4 May 2015 15:42:16 +0300
-
-Document Qualcomm PCIe driver devicetree bindings.
-
-Signed-off-by: Stanimir Varbanov <svarbanov at mm-sol.com>
-
----
-.../devicetree/bindings/pci/qcom,pcie.txt          |  231 ++++++++++++++++++++
- 1 files changed, 231 insertions(+), 0 deletions(-)
- create mode 100644 Documentation/devicetree/bindings/pci/qcom,pcie.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/pci/qcom,pcie.txt
-@@ -0,0 +1,231 @@
-+* Qualcomm PCI express root complex
-+
-+- compatible:
-+	Usage: required
-+	Value type: <stringlist>
-+	Definition: Value shall include
-+		    - "qcom,pcie-v0" for apq/ipq8064
-+		    - "qcom,pcie-v1" for apq8084
-+
-+- reg:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: Register ranges as listed in the reg-names property
-+
-+- reg-names:
-+	Usage: required
-+	Value type: <stringlist>
-+	Definition: Must include the following entries
-+		    - "parf"   Qualcomm specific registers
-+		    - "dbi"    Designware PCIe registers
-+		    - "elbi"   External local bus interface registers
-+		    - "config" PCIe configuration space
-+
-+- device_type:
-+	Usage: required
-+	Value type: <string>
-+	Definition: Should be "pci". As specified in designware-pcie.txt
-+
-+- #address-cells:
-+	Usage: required
-+	Value type: <u32>
-+	Definition: Should be set to 3. As specified in designware-pcie.txt
-+
-+- #size-cells:
-+	Usage: required
-+	Value type: <u32>
-+	Definition: Should be set 2. As specified in designware-pcie.txt
-+
-+- ranges:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: As specified in designware-pcie.txt
-+
-+- interrupts:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: MSI interrupt
-+
-+- interrupt-names:
-+	Usage: required
-+	Value type: <stringlist>
-+	Definition: Should contain "msi"
-+
-+- #interrupt-cells:
-+	Usage: required
-+	Value type: <u32>
-+	Definition: Should be 1. As specified in designware-pcie.txt
-+
-+- interrupt-map-mask:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: As specified in designware-pcie.txt
-+
-+- interrupt-map:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: As specified in designware-pcie.txt
-+
-+- clocks:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: List of phandle and clock specifier pairs as listed
-+		    in clock-names property
-+
-+- clock-names:
-+	Usage: required
-+	Value type: <stringlist>
-+	Definition: Should contain the following entries
-+		    * should be populated for v0 and v1
-+		    	- "iface"      Configuration AHB clock
-+
-+		    * should be populated for v0
-+		    	- "core"       Clocks the pcie hw block
-+		    	- "phy"        Clocks the pcie PHY block
-+
-+		    * should be populated for v1
-+			- "aux"        Auxiliary (AUX) clock
-+		    	- "bus_master" Master AXI clock
-+		    	- "bus_slave"  Slave AXI clock
-+
-+- resets:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: List of phandle and reset specifier pairs as listed
-+		    in reset-names property
-+
-+- reset-names:
-+	Usage: required
-+	Value type: <stringlist>
-+	Definition: Should contain the following entries
-+		    * should be populated for v0
-+			- "axi"  AXI reset
-+			- "ahb"  AHB reset
-+			- "por"  POR reset
-+			- "pci"  PCI reset
-+			- "phy"  PHY reset
-+
-+		    * should be populated for v1
-+			- "core" Core reset
-+
-+- power-domains:
-+	Usage: required (for v1 only)
-+	Value type: <prop-encoded-array>
-+	Definition: A phandle and power domain specifier pair to the
-+		    power domain which is responsible for collapsing
-+		    and restoring power to the peripheral
-+
-+- <name>-supply:
-+	Usage: required
-+	Value type: <phandle>
-+	Definition: List of phandles to the power supply regulator(s)
-+		    * should be populated for v0 and v1
-+			- "vdda"        core analog power supply
-+
-+		    * should be populated for v0
-+			- "vdda_phy"    analog power supply for PHY
-+			- "vdda_refclk" analog power supply for IC which generate
-+					reference clock
-+
-+- phys:
-+	Usage: required (for v1 only)
-+	Value type: <phandle>
-+	Definition: List of phandle(s) as listed in phy-names property
-+
-+- phy-names:
-+	Usage: required (for v1 only)
-+	Value type: <stringlist>
-+	Definition: Should contain "pciephy"
-+
-+- <name>-gpio:
-+	Usage: optional
-+	Value type: <prop-encoded-array>
-+	Definition: List of phandle and gpio specifier pairs. Should contain
-+		    - "perst"  PCIe endpoint reset signal line
-+		    - "pewake" PCIe endpoint wake signal line
-+
-+- pinctrl-0:
-+	Usage: required
-+	Value type: <phandle>
-+	Definition: List of phandles pointing at a pin(s) configuration
-+
-+- pinctrl-names
-+	Usage: required
-+	Value type: <stringlist>
-+	Definition: List of names of pinctrl-0 state
-+
-+* Example for v0
-+	pcie0: pci at 1b500000 {
-+		compatible = "qcom,pcie-v0";
-+		reg = <0x1b500000 0x1000
-+		       0x1b502000 0x80
-+		       0x1b600000 0x100
-+		       0x0ff00000 0x100000>;
-+		reg-names = "dbi", "elbi", "parf", "config";
-+		device_type = "pci";
-+		linux,pci-domain = <0>;
-+		bus-range = <0x00 0xff>;
-+		num-lanes = <1>;
-+		#address-cells = <3>;
-+		#size-cells = <2>;
-+		ranges = <0x81000000 0 0	  0x0fe00000 0 0x00100000   /* I/O */
-+			  0x82000000 0 0x00000000 0x08000000 0 0x07e00000>; /* memory */
-+		interrupts = <GIC_SPI 35 IRQ_TYPE_NONE>;
-+		interrupt-names = "msi";
-+		#interrupt-cells = <1>;
-+		interrupt-map-mask = <0 0 0 0x7>;
-+		interrupt-map = <0 0 0 1 &intc 0 36 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
-+				<0 0 0 2 &intc 0 37 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
-+				<0 0 0 3 &intc 0 38 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
-+				<0 0 0 4 &intc 0 39 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
-+		clocks = <&gcc PCIE_A_CLK>,
-+			 <&gcc PCIE_H_CLK>,
-+			 <&gcc PCIE_PHY_CLK>;
-+		clock-names = "core", "iface", "phy";
-+		resets = <&gcc PCIE_ACLK_RESET>,
-+			 <&gcc PCIE_HCLK_RESET>,
-+			 <&gcc PCIE_POR_RESET>,
-+			 <&gcc PCIE_PCI_RESET>,
-+			 <&gcc PCIE_PHY_RESET>;
-+		reset-names = "axi", "ahb", "por", "pci", "phy";
-+	};
-+
-+* Example for v1
-+	pcie0 at fc520000 {
-+		compatible = "qcom,pcie-v1";
-+		reg = <0xfc520000 0x2000>,
-+		      <0xff000000 0x1000>,
-+		      <0xff001000 0x1000>,
-+		      <0xff002000 0x2000>;
-+		reg-names = "parf", "dbi", "elbi", "config";
-+		device_type = "pci";
-+		linux,pci-domain = <0>;
-+		bus-range = <0x00 0xff>;
-+		num-lanes = <1>;
-+		#address-cells = <3>;
-+		#size-cells = <2>;
-+		ranges = <0x81000000 0 0          0xff200000 0 0x00100000   /* I/O */
-+			  0x82000000 0 0x00300000 0xff300000 0 0x00d00000>; /* memory */
-+		interrupts = <GIC_SPI 243 IRQ_TYPE_NONE>;
-+		interrupt-names = "msi";
-+		#interrupt-cells = <1>;
-+		interrupt-map-mask = <0 0 0 0x7>;
-+		interrupt-map = <0 0 0 1 &intc 0 244 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
-+				<0 0 0 2 &intc 0 245 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
-+				<0 0 0 3 &intc 0 247 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
-+				<0 0 0 4 &intc 0 248 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
-+		clocks = <&gcc GCC_PCIE_0_CFG_AHB_CLK>,
-+			 <&gcc GCC_PCIE_0_MSTR_AXI_CLK>,
-+			 <&gcc GCC_PCIE_0_SLV_AXI_CLK>,
-+			 <&gcc GCC_PCIE_0_AUX_CLK>;
-+		clock-names = "iface", "master_bus", "slave_bus", "aux";
-+		resets = <&gcc GCC_PCIE_0_BCR>;
-+		reset-names = "core";
-+		power-domains = <&gcc PCIE0_GDSC>;
-+		vdda-supply = <&pma8084_l3>;
-+		phys = <&pciephy0>;
-+		phy-names = "pciephy";
-+		perst-gpio = <&tlmm 70 GPIO_ACTIVE_LOW>;
-+		pinctrl-0 = <&pcie0_pins_default>;
-+		pinctrl-names = "default";
-+	};
diff --git a/target/linux/ipq806x/patches-4.0/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch b/target/linux/ipq806x/patches-4.0/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
deleted file mode 100644
index b64b759..0000000
--- a/target/linux/ipq806x/patches-4.0/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
+++ /dev/null
@@ -1,753 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v2,4/5] PCI: qcom: Add Qualcomm PCIe controller driver
-From: Stanimir Varbanov <svarbanov at mm-sol.com>
-X-Patchwork-Id: 6326161
-Message-Id: <1430743338-10441-5-git-send-email-svarbanov at mm-sol.com>
-To: Rob Herring <robh+dt at kernel.org>, Kumar Gala <galak at codeaurora.org>,
-	Mark Rutland <mark.rutland at arm.com>,
-	Grant Likely <grant.likely at linaro.org>,
-	Bjorn Helgaas <bhelgaas at google.com>,
-	Kishon Vijay Abraham I <kishon at ti.com>,
-	Russell King <linux at arm.linux.org.uk>, Arnd Bergmann <arnd at arndb.de>
-Cc: linux-arm-msm at vger.kernel.org, linux-kernel at vger.kernel.org,
-	linux-arm-kernel at lists.infradead.org, devicetree at vger.kernel.org,
-	linux-pci at vger.kernel.org, Mathieu Olivari <mathieu at codeaurora.org>,
-	Srinivas Kandagatla <srinivas.kandagatla at linaro.org>,
-	Stanimir Varbanov <svarbanov at mm-sol.com>
-Date: Mon,  4 May 2015 15:42:17 +0300
-
-The PCIe driver reuse the Designware common code for host
-and MSI initialization, and also program the Qualcomm
-application specific registers.
-
-Signed-off-by: Stanimir Varbanov <svarbanov at mm-sol.com>
-
----
-MAINTAINERS                  |    7 +
- drivers/pci/host/Kconfig     |    9 +
- drivers/pci/host/Makefile    |    1 +
- drivers/pci/host/pcie-qcom.c |  677 ++++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 694 insertions(+), 0 deletions(-)
- create mode 100644 drivers/pci/host/pcie-qcom.c
-
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -7511,6 +7511,13 @@ L:	linux-pci at vger.kernel.org
- S:	Maintained
- F:	drivers/pci/host/*spear*
- 
-+PCIE DRIVER FOR QUALCOMM MSM
-+M:	Stanimir Varbanov <svarbanov at mm-sol.com>
-+L:	linux-pci at vger.kernel.org
-+L:	linux-arm-msm at vger.kernel.org
-+S:	Maintained
-+F:	drivers/pci/host/*qcom*
-+
- PCMCIA SUBSYSTEM
- P:	Linux PCMCIA Team
- L:	linux-pcmcia at lists.infradead.org
---- a/drivers/pci/host/Kconfig
-+++ b/drivers/pci/host/Kconfig
-@@ -106,4 +106,13 @@ config PCI_VERSATILE
- 	bool "ARM Versatile PB PCI controller"
- 	depends on ARCH_VERSATILE
- 
-+config PCIE_QCOM
-+	bool "Qualcomm PCIe controller"
-+	depends on ARCH_QCOM && OF || (ARM && COMPILE_TEST)
-+	select PCIE_DW
-+	select PCIEPORTBUS
-+	help
-+	  Say Y here to enable PCIe controller support on Qualcomm SoCs. The
-+	  PCIe controller use Designware core plus Qualcomm specific hardware
-+	  wrappers.
- endmenu
---- /dev/null
-+++ b/drivers/pci/host/pcie-qcom.c
-@@ -0,0 +1,677 @@
-+/*
-+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/clk.h>
-+#include <linux/delay.h>
-+#include <linux/gpio.h>
-+#include <linux/interrupt.h>
-+#include <linux/io.h>
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/of_gpio.h>
-+#include <linux/pci.h>
-+#include <linux/platform_device.h>
-+#include <linux/phy/phy.h>
-+#include <linux/regulator/consumer.h>
-+#include <linux/reset.h>
-+#include <linux/slab.h>
-+#include <linux/types.h>
-+
-+#include "pcie-designware.h"
-+
-+#define PCIE20_PARF_PHY_CTRL			0x40
-+#define PCIE20_PARF_PHY_REFCLK			0x4C
-+#define PCIE20_PARF_DBI_BASE_ADDR		0x168
-+#define PCIE20_PARF_SLV_ADDR_SPACE_SIZE		0x16c
-+#define PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT	0x178
-+
-+#define PCIE20_ELBI_SYS_CTRL			0x04
-+#define PCIE20_ELBI_SYS_STTS			0x08
-+#define XMLH_LINK_UP				BIT(10)
-+
-+#define PCIE20_CAP				0x70
-+#define PCIE20_CAP_LINKCTRLSTATUS		(PCIE20_CAP + 0x10)
-+
-+#define PERST_DELAY_MIN_US			1000
-+#define PERST_DELAY_MAX_US			1005
-+
-+#define LINKUP_DELAY_MIN_US			5000
-+#define LINKUP_DELAY_MAX_US			5100
-+#define LINKUP_RETRIES_COUNT			20
-+
-+#define PCIE_V0					0	/* apq8064 */
-+#define PCIE_V1					1	/* apq8084 */
-+
-+struct qcom_pcie_resources_v0 {
-+	struct clk *iface_clk;
-+	struct clk *core_clk;
-+	struct clk *phy_clk;
-+	struct reset_control *pci_reset;
-+	struct reset_control *axi_reset;
-+	struct reset_control *ahb_reset;
-+	struct reset_control *por_reset;
-+	struct reset_control *phy_reset;
-+	struct regulator *vdda;
-+	struct regulator *vdda_phy;
-+	struct regulator *vdda_refclk;
-+};
-+
-+struct qcom_pcie_resources_v1 {
-+	struct clk *iface;
-+	struct clk *aux;
-+	struct clk *master_bus;
-+	struct clk *slave_bus;
-+	struct reset_control *core;
-+	struct regulator *vdda;
-+};
-+
-+union pcie_resources {
-+	struct qcom_pcie_resources_v0 v0;
-+	struct qcom_pcie_resources_v1 v1;
-+};
-+
-+struct qcom_pcie {
-+	struct pcie_port pp;
-+	struct device *dev;
-+	union pcie_resources res;
-+	void __iomem *parf;
-+	void __iomem *dbi;
-+	void __iomem *elbi;
-+	struct phy *phy;
-+	struct gpio_desc *reset;
-+	unsigned int version;
-+};
-+
-+#define to_qcom_pcie(x)		container_of(x, struct qcom_pcie, pp)
-+
-+static inline void
-+writel_masked(void __iomem *addr, u32 clear_mask, u32 set_mask)
-+{
-+	u32 val = readl(addr);
-+
-+	val &= ~clear_mask;
-+	val |= set_mask;
-+	writel(val, addr);
-+}
-+
-+static void qcom_ep_reset_assert_deassert(struct qcom_pcie *pcie, int assert)
-+{
-+	int val, active_low;
-+
-+	if (IS_ERR_OR_NULL(pcie->reset))
-+		return;
-+
-+	active_low = gpiod_is_active_low(pcie->reset);
-+
-+	if (assert)
-+		val = !!active_low;
-+	else
-+		val = !active_low;
-+
-+	gpiod_set_value(pcie->reset, val);
-+
-+	usleep_range(PERST_DELAY_MIN_US, PERST_DELAY_MAX_US);
-+}
-+
-+static void qcom_ep_reset_assert(struct qcom_pcie *pcie)
-+{
-+	qcom_ep_reset_assert_deassert(pcie, 1);
-+}
-+
-+static void qcom_ep_reset_deassert(struct qcom_pcie *pcie)
-+{
-+	qcom_ep_reset_assert_deassert(pcie, 0);
-+}
-+
-+static irqreturn_t qcom_pcie_msi_irq_handler(int irq, void *arg)
-+{
-+	struct pcie_port *pp = arg;
-+
-+	return dw_handle_msi_irq(pp);
-+}
-+
-+static int qcom_pcie_link_up(struct pcie_port *pp)
-+{
-+	struct qcom_pcie *pcie = to_qcom_pcie(pp);
-+	u32 val = readl(pcie->dbi + PCIE20_CAP_LINKCTRLSTATUS);
-+
-+	return val & BIT(29) ? 1 : 0;
-+}
-+
-+static void qcom_pcie_disable_resources_v0(struct qcom_pcie *pcie)
-+{
-+	struct qcom_pcie_resources_v0 *res = &pcie->res.v0;
-+
-+	reset_control_assert(res->pci_reset);
-+	reset_control_assert(res->axi_reset);
-+	reset_control_assert(res->ahb_reset);
-+	reset_control_assert(res->por_reset);
-+	reset_control_assert(res->pci_reset);
-+	clk_disable_unprepare(res->iface_clk);
-+	clk_disable_unprepare(res->core_clk);
-+	clk_disable_unprepare(res->phy_clk);
-+	regulator_disable(res->vdda);
-+	regulator_disable(res->vdda_phy);
-+	regulator_disable(res->vdda_refclk);
-+}
-+
-+static void qcom_pcie_disable_resources_v1(struct qcom_pcie *pcie)
-+{
-+	struct qcom_pcie_resources_v1 *res = &pcie->res.v1;
-+
-+	reset_control_assert(res->core);
-+	clk_disable_unprepare(res->slave_bus);
-+	clk_disable_unprepare(res->master_bus);
-+	clk_disable_unprepare(res->iface);
-+	clk_disable_unprepare(res->aux);
-+	regulator_disable(res->vdda);
-+}
-+
-+static int qcom_pcie_enable_resources_v0(struct qcom_pcie *pcie)
-+{
-+	struct qcom_pcie_resources_v0 *res = &pcie->res.v0;
-+	struct device *dev = pcie->dev;
-+	int ret;
-+
-+	ret = regulator_enable(res->vdda);
-+	if (ret) {
-+		dev_err(dev, "cannot enable vdda regulator\n");
-+		return ret;
-+	}
-+
-+	ret = regulator_enable(res->vdda_refclk);
-+	if (ret) {
-+		dev_err(dev, "cannot enable vdda_refclk regulator\n");
-+		goto err_refclk;
-+	}
-+
-+	ret = regulator_enable(res->vdda_phy);
-+	if (ret) {
-+		dev_err(dev, "cannot enable vdda_phy regulator\n");
-+		goto err_vdda_phy;
-+	}
-+
-+	ret = clk_prepare_enable(res->iface_clk);
-+	if (ret) {
-+		dev_err(dev, "cannot prepare/enable iface clock\n");
-+		goto err_iface;
-+	}
-+
-+	ret = clk_prepare_enable(res->core_clk);
-+	if (ret) {
-+		dev_err(dev, "cannot prepare/enable core clock\n");
-+		goto err_clk_core;
-+	}
-+
-+	ret = clk_prepare_enable(res->phy_clk);
-+	if (ret) {
-+		dev_err(dev, "cannot prepare/enable phy clock\n");
-+		goto err_clk_phy;
-+	}
-+
-+	ret = reset_control_deassert(res->ahb_reset);
-+	if (ret) {
-+		dev_err(dev, "cannot deassert ahb reset\n");
-+		goto err_reset_ahb;
-+	}
-+
-+	return 0;
-+
-+err_reset_ahb:
-+	clk_disable_unprepare(res->phy_clk);
-+err_clk_phy:
-+	clk_disable_unprepare(res->core_clk);
-+err_clk_core:
-+	clk_disable_unprepare(res->iface_clk);
-+err_iface:
-+	regulator_disable(res->vdda_phy);
-+err_vdda_phy:
-+	regulator_disable(res->vdda_refclk);
-+err_refclk:
-+	regulator_disable(res->vdda);
-+	return ret;
-+}
-+
-+static int qcom_pcie_enable_resources_v1(struct qcom_pcie *pcie)
-+{
-+	struct qcom_pcie_resources_v1 *res = &pcie->res.v1;
-+	struct device *dev = pcie->dev;
-+	int ret;
-+
-+	ret = reset_control_deassert(res->core);
-+	if (ret) {
-+		dev_err(dev, "cannot deassert core reset\n");
-+		return ret;
-+	}
-+
-+	ret = clk_prepare_enable(res->aux);
-+	if (ret) {
-+		dev_err(dev, "cannot prepare/enable aux clock\n");
-+		goto err_res;
-+	}
-+
-+	ret = clk_prepare_enable(res->iface);
-+	if (ret) {
-+		dev_err(dev, "cannot prepare/enable iface clock\n");
-+		goto err_aux;
-+	}
-+
-+	ret = clk_prepare_enable(res->master_bus);
-+	if (ret) {
-+		dev_err(dev, "cannot prepare/enable master_bus clock\n");
-+		goto err_iface;
-+	}
-+
-+	ret = clk_prepare_enable(res->slave_bus);
-+	if (ret) {
-+		dev_err(dev, "cannot prepare/enable slave_bus clock\n");
-+		goto err_master;
-+	}
-+
-+	ret = regulator_enable(res->vdda);
-+	if (ret) {
-+		dev_err(dev, "cannot enable vdda regulator\n");
-+		goto err_slave;
-+	}
-+
-+	return 0;
-+
-+err_slave:
-+	clk_disable_unprepare(res->slave_bus);
-+err_master:
-+	clk_disable_unprepare(res->master_bus);
-+err_iface:
-+	clk_disable_unprepare(res->iface);
-+err_aux:
-+	clk_disable_unprepare(res->aux);
-+err_res:
-+	reset_control_assert(res->core);
-+
-+	return ret;
-+}
-+
-+static int qcom_pcie_get_resources_v0(struct qcom_pcie *pcie)
-+{
-+	struct qcom_pcie_resources_v0 *res = &pcie->res.v0;
-+	struct device *dev = pcie->dev;
-+
-+	res->vdda = devm_regulator_get(dev, "vdda");
-+	if (IS_ERR(res->vdda))
-+		return PTR_ERR(res->vdda);
-+
-+	res->vdda_phy = devm_regulator_get(dev, "vdda_phy");
-+	if (IS_ERR(res->vdda_phy))
-+		return PTR_ERR(res->vdda_phy);
-+
-+	res->vdda_refclk = devm_regulator_get(dev, "vdda_refclk");
-+	if (IS_ERR(res->vdda_refclk))
-+		return PTR_ERR(res->vdda_refclk);
-+
-+	res->iface_clk = devm_clk_get(dev, "iface");
-+	if (IS_ERR(res->iface_clk))
-+		return PTR_ERR(res->iface_clk);
-+
-+	res->core_clk = devm_clk_get(dev, "core");
-+	if (IS_ERR(res->core_clk))
-+		return PTR_ERR(res->core_clk);
-+
-+	res->phy_clk = devm_clk_get(dev, "phy");
-+	if (IS_ERR(res->phy_clk))
-+		return PTR_ERR(res->phy_clk);
-+
-+	res->pci_reset = devm_reset_control_get(dev, "pci");
-+	if (IS_ERR(res->pci_reset))
-+		return PTR_ERR(res->pci_reset);
-+
-+	res->axi_reset = devm_reset_control_get(dev, "axi");
-+	if (IS_ERR(res->axi_reset))
-+		return PTR_ERR(res->axi_reset);
-+
-+	res->ahb_reset = devm_reset_control_get(dev, "ahb");
-+	if (IS_ERR(res->ahb_reset))
-+		return PTR_ERR(res->ahb_reset);
-+
-+	res->por_reset = devm_reset_control_get(dev, "por");
-+	if (IS_ERR(res->por_reset))
-+		return PTR_ERR(res->por_reset);
-+
-+	res->phy_reset = devm_reset_control_get(dev, "phy");
-+	if (IS_ERR(res->phy_reset))
-+		return PTR_ERR(res->phy_reset);
-+
-+	return 0;
-+}
-+
-+static int qcom_pcie_get_resources_v1(struct qcom_pcie *pcie)
-+{
-+	struct qcom_pcie_resources_v1 *res = &pcie->res.v1;
-+	struct device *dev = pcie->dev;
-+
-+	res->vdda = devm_regulator_get(dev, "vdda");
-+	if (IS_ERR(res->vdda))
-+		return PTR_ERR(res->vdda);
-+
-+	res->iface = devm_clk_get(dev, "iface");
-+	if (IS_ERR(res->iface))
-+		return PTR_ERR(res->iface);
-+
-+	res->aux = devm_clk_get(dev, "aux");
-+	if (IS_ERR(res->aux) && PTR_ERR(res->aux) == -EPROBE_DEFER)
-+		return -EPROBE_DEFER;
-+	else if (IS_ERR(res->aux))
-+		res->aux = NULL;
-+
-+	res->master_bus = devm_clk_get(dev, "master_bus");
-+	if (IS_ERR(res->master_bus))
-+		return PTR_ERR(res->master_bus);
-+
-+	res->slave_bus = devm_clk_get(dev, "slave_bus");
-+	if (IS_ERR(res->slave_bus))
-+		return PTR_ERR(res->slave_bus);
-+
-+	res->core = devm_reset_control_get(dev, "core");
-+	if (IS_ERR(res->core))
-+		return PTR_ERR(res->core);
-+
-+	return 0;
-+}
-+
-+static int qcom_pcie_enable_link_training(struct pcie_port *pp)
-+{
-+	struct qcom_pcie *pcie = to_qcom_pcie(pp);
-+	struct device *dev = pp->dev;
-+	int retries;
-+	u32 val;
-+
-+	/* enable link training */
-+	writel_masked(pcie->elbi + PCIE20_ELBI_SYS_CTRL, 0, BIT(0));
-+
-+	/* wait for up to 100ms for the link to come up */
-+	retries = LINKUP_RETRIES_COUNT;
-+	do {
-+		val = readl(pcie->elbi + PCIE20_ELBI_SYS_STTS);
-+		if (val & XMLH_LINK_UP)
-+			break;
-+		usleep_range(LINKUP_DELAY_MIN_US, LINKUP_DELAY_MAX_US);
-+	} while (retries--);
-+
-+	if (retries < 0 || !dw_pcie_link_up(pp)) {
-+		dev_err(dev, "link initialization failed\n");
-+		return -ENXIO;
-+	}
-+
-+	return 0;
-+}
-+
-+static void qcom_pcie_host_init_v1(struct pcie_port *pp)
-+{
-+	struct qcom_pcie *pcie = to_qcom_pcie(pp);
-+	int ret;
-+
-+	qcom_ep_reset_assert(pcie);
-+
-+	ret = qcom_pcie_enable_resources_v1(pcie);
-+	if (ret)
-+		return;
-+
-+	/* change DBI base address */
-+	writel(0, pcie->parf + PCIE20_PARF_DBI_BASE_ADDR);
-+
-+	if (IS_ENABLED(CONFIG_PCI_MSI))
-+		writel_masked(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT,
-+			      0, BIT(31));
-+
-+	ret = phy_init(pcie->phy);
-+	if (ret)
-+		goto err_res;
-+
-+	ret = phy_power_on(pcie->phy);
-+	if (ret)
-+		goto err_phy;
-+
-+	dw_pcie_setup_rc(pp);
-+
-+	if (IS_ENABLED(CONFIG_PCI_MSI))
-+		dw_pcie_msi_init(pp);
-+
-+	qcom_ep_reset_deassert(pcie);
-+
-+	ret = qcom_pcie_enable_link_training(pp);
-+	if (ret)
-+		goto err;
-+
-+	return;
-+
-+err:
-+	qcom_ep_reset_assert(pcie);
-+	phy_power_off(pcie->phy);
-+err_phy:
-+	phy_exit(pcie->phy);
-+err_res:
-+	qcom_pcie_disable_resources_v1(pcie);
-+}
-+
-+static void qcom_pcie_host_init_v0(struct pcie_port *pp)
-+{
-+	struct qcom_pcie *pcie = to_qcom_pcie(pp);
-+	struct qcom_pcie_resources_v0 *res = &pcie->res.v0;
-+	struct device *dev = pcie->dev;
-+	int ret;
-+
-+	qcom_ep_reset_assert(pcie);
-+
-+	ret = qcom_pcie_enable_resources_v0(pcie);
-+	if (ret)
-+		return;
-+
-+	writel_masked(pcie->parf + PCIE20_PARF_PHY_CTRL, BIT(0), 0);
-+
-+	/* enable external reference clock */
-+	writel_masked(pcie->parf + PCIE20_PARF_PHY_REFCLK, 0, BIT(16));
-+
-+	ret = reset_control_deassert(res->phy_reset);
-+	if (ret) {
-+		dev_err(dev, "cannot deassert phy reset\n");
-+		return;
-+	}
-+
-+	ret = reset_control_deassert(res->pci_reset);
-+	if (ret) {
-+		dev_err(dev, "cannot deassert pci reset\n");
-+		return;
-+	}
-+
-+	ret = reset_control_deassert(res->por_reset);
-+	if (ret) {
-+		dev_err(dev, "cannot deassert por reset\n");
-+		return;
-+	}
-+
-+	ret = reset_control_deassert(res->axi_reset);
-+	if (ret) {
-+		dev_err(dev, "cannot deassert axi reset\n");
-+		return;
-+	}
-+
-+	/* wait 150ms for clock acquisition */
-+	usleep_range(10000, 15000);
-+
-+	dw_pcie_setup_rc(pp);
-+
-+	if (IS_ENABLED(CONFIG_PCI_MSI))
-+		dw_pcie_msi_init(pp);
-+
-+	qcom_ep_reset_deassert(pcie);
-+
-+	ret = qcom_pcie_enable_link_training(pp);
-+	if (ret)
-+		goto err;
-+
-+	return;
-+err:
-+	qcom_ep_reset_assert(pcie);
-+	qcom_pcie_disable_resources_v0(pcie);
-+}
-+
-+static void qcom_pcie_host_init(struct pcie_port *pp)
-+{
-+	struct qcom_pcie *pcie = to_qcom_pcie(pp);
-+
-+	if (pcie->version == PCIE_V0)
-+		return qcom_pcie_host_init_v0(pp);
-+	else
-+		return qcom_pcie_host_init_v1(pp);
-+}
-+
-+static int
-+qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, u32 *val)
-+{
-+	/* the device class is not reported correctly from the register */
-+	if (where == PCI_CLASS_REVISION && size == 4) {
-+		*val = readl(pp->dbi_base + PCI_CLASS_REVISION);
-+		*val &= ~(0xffff << 16);
-+		*val |= PCI_CLASS_BRIDGE_PCI << 16;
-+		return PCIBIOS_SUCCESSFUL;
-+	}
-+
-+	return dw_pcie_cfg_read(pp->dbi_base + (where & ~0x3), where,
-+				size, val);
-+}
-+
-+static struct pcie_host_ops qcom_pcie_ops = {
-+	.link_up = qcom_pcie_link_up,
-+	.host_init = qcom_pcie_host_init,
-+	.rd_own_conf = qcom_pcie_rd_own_conf,
-+};
-+
-+static const struct of_device_id qcom_pcie_match[] = {
-+	{ .compatible = "qcom,pcie-v0", .data = (void *)PCIE_V0 },
-+	{ .compatible = "qcom,pcie-v1", .data = (void *)PCIE_V1 },
-+	{ }
-+};
-+
-+static int qcom_pcie_probe(struct platform_device *pdev)
-+{
-+	struct device *dev = &pdev->dev;
-+	const struct of_device_id *match;
-+	struct resource *res;
-+	struct qcom_pcie *pcie;
-+	struct pcie_port *pp;
-+	int ret;
-+
-+	match = of_match_node(qcom_pcie_match, dev->of_node);
-+	if (!match)
-+		return -ENXIO;
-+
-+	pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
-+	if (!pcie)
-+		return -ENOMEM;
-+
-+	pcie->version = (unsigned int)match->data;
-+
-+	pcie->reset = devm_gpiod_get_optional(dev, "perst");
-+	if (IS_ERR(pcie->reset) && PTR_ERR(pcie->reset) == -EPROBE_DEFER)
-+		return PTR_ERR(pcie->reset);
-+
-+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "parf");
-+	pcie->parf = devm_ioremap_resource(dev, res);
-+	if (IS_ERR(pcie->parf))
-+		return PTR_ERR(pcie->parf);
-+
-+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbi");
-+	pcie->dbi = devm_ioremap_resource(dev, res);
-+	if (IS_ERR(pcie->dbi))
-+		return PTR_ERR(pcie->dbi);
-+
-+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "elbi");
-+	pcie->elbi = devm_ioremap_resource(dev, res);
-+	if (IS_ERR(pcie->elbi))
-+		return PTR_ERR(pcie->elbi);
-+
-+	pcie->phy = devm_phy_optional_get(dev, "pciephy");
-+	if (IS_ERR(pcie->phy))
-+		return PTR_ERR(pcie->phy);
-+
-+	pcie->dev = dev;
-+
-+	if (pcie->version == PCIE_V0)
-+		ret = qcom_pcie_get_resources_v0(pcie);
-+	else
-+		ret = qcom_pcie_get_resources_v1(pcie);
-+
-+	if (ret)
-+		return ret;
-+
-+	pp = &pcie->pp;
-+	pp->dev = dev;
-+	pp->dbi_base = pcie->dbi;
-+	pp->root_bus_nr = -1;
-+	pp->ops = &qcom_pcie_ops;
-+
-+	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-+		pp->msi_irq = platform_get_irq_byname(pdev, "msi");
-+		if (pp->msi_irq < 0) {
-+			dev_err(dev, "cannot get msi irq\n");
-+			return pp->msi_irq;
-+		}
-+
-+		ret = devm_request_irq(dev, pp->msi_irq,
-+				       qcom_pcie_msi_irq_handler,
-+				       IRQF_SHARED, "qcom-pcie-msi", pp);
-+		if (ret) {
-+			dev_err(dev, "cannot request msi irq\n");
-+			return ret;
-+		}
-+	}
-+
-+	ret = dw_pcie_host_init(pp);
-+	if (ret) {
-+		dev_err(dev, "cannot initialize host\n");
-+		return ret;
-+	}
-+
-+	platform_set_drvdata(pdev, pcie);
-+
-+	return 0;
-+}
-+
-+static int qcom_pcie_remove(struct platform_device *pdev)
-+{
-+	struct qcom_pcie *pcie = platform_get_drvdata(pdev);
-+
-+	qcom_ep_reset_assert(pcie);
-+	phy_power_off(pcie->phy);
-+	phy_exit(pcie->phy);
-+	if (pcie->version == PCIE_V0)
-+		qcom_pcie_disable_resources_v0(pcie);
-+	else
-+		qcom_pcie_disable_resources_v1(pcie);
-+
-+	return 0;
-+}
-+
-+static struct platform_driver qcom_pcie_driver = {
-+	.probe = qcom_pcie_probe,
-+	.remove = qcom_pcie_remove,
-+	.driver = {
-+		.name = "qcom-pcie",
-+		.of_match_table = qcom_pcie_match,
-+	},
-+};
-+
-+module_platform_driver(qcom_pcie_driver);
-+
-+MODULE_AUTHOR("Stanimir Varbanov <svarbanov at mm-sol.com>");
-+MODULE_DESCRIPTION("Qualcomm PCIe root complex driver");
-+MODULE_LICENSE("GPL v2");
-+MODULE_ALIAS("platform:qcom-pcie");
---- a/drivers/pci/host/Makefile
-+++ b/drivers/pci/host/Makefile
-@@ -13,3 +13,4 @@ obj-$(CONFIG_PCIE_XILINX) += pcie-xilinx
- obj-$(CONFIG_PCI_XGENE) += pci-xgene.o
- obj-$(CONFIG_PCI_LAYERSCAPE) += pci-layerscape.o
- obj-$(CONFIG_PCI_VERSATILE) += pci-versatile.o
-+obj-$(CONFIG_PCIE_QCOM) += pcie-qcom.o
diff --git a/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
deleted file mode 100644
index 957b054..0000000
--- a/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ /dev/null
@@ -1,260 +0,0 @@
-From 5b40516b2f5fb9b2a7d6d3e2e924f12ec9d183a8 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Tue, 21 Apr 2015 19:01:42 -0700
-Subject: [PATCH 8/9] ARM: dts: qcom: add pcie nodes to ipq806x platforms
-
-qcom-pcie driver now supports version 0 of the controller. This change
-adds the corresponding entries to the IPQ806x dtsi file and
-corresponding platform (AP148).
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- arch/arm/boot/dts/qcom-ipq8064-ap148.dts |  30 ++++++++
- arch/arm/boot/dts/qcom-ipq8064.dtsi      | 124 +++++++++++++++++++++++++++++++
- 2 files changed, 154 insertions(+)
-
---- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -30,6 +30,22 @@
- 				bias-disable;
- 			};
- 
-+			pcie1_pins: pcie1_pinmux {
-+				mux {
-+					pins = "gpio3";
-+					drive-strength = <2>;
-+					bias-disable;
-+				};
-+			};
-+
-+			pcie2_pins: pcie2_pinmux {
-+				mux {
-+					pins = "gpio48";
-+					drive-strength = <2>;
-+					bias-disable;
-+				};
-+			};
-+
- 			spi_pins: spi_pins {
- 				mux {
- 					pins = "gpio18", "gpio19", "gpio21";
-@@ -109,5 +125,19 @@
- 		sata at 29000000 {
- 			status = "ok";
- 		};
-+
-+		pcie0: pci at 1b500000 {
-+			status = "ok";
-+			reset-gpio = <&qcom_pinmux 3 0>;
-+			pinctrl-0 = <&pcie1_pins>;
-+			pinctrl-names = "default";
-+		};
-+
-+		pcie1: pci at 1b700000 {
-+			status = "ok";
-+			reset-gpio = <&qcom_pinmux 48 0>;
-+			pinctrl-0 = <&pcie2_pins>;
-+			pinctrl-names = "default";
-+		};
- 	};
- };
---- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -30,6 +30,30 @@
- 				bias-disable;
- 			};
- 
-+			pcie1_pins: pcie1_pinmux {
-+				mux {
-+					pins = "gpio3";
-+					drive-strength = <2>;
-+					bias-disable;
-+				};
-+			};
-+
-+			pcie2_pins: pcie2_pinmux {
-+				mux {
-+					pins = "gpio48";
-+					drive-strength = <2>;
-+					bias-disable;
-+				};
-+			};
-+
-+			pcie3_pins: pcie3_pinmux {
-+				mux {
-+					pins = "gpio63";
-+					drive-strength = <2>;
-+					bias-disable;
-+				};
-+			};
-+
- 			spi_pins: spi_pins {
- 				mux {
- 					pins = "gpio18", "gpio19", "gpio21";
-@@ -128,5 +152,26 @@
- 		usb30 at 1 {
- 			status = "ok";
- 		};
-+
-+		pcie0: pci at 1b500000 {
-+			status = "ok";
-+			reset-gpio = <&qcom_pinmux 3 0>;
-+			pinctrl-0 = <&pcie1_pins>;
-+			pinctrl-names = "default";
-+		};
-+
-+		pcie1: pci at 1b700000 {
-+			status = "ok";
-+			reset-gpio = <&qcom_pinmux 48 0>;
-+			pinctrl-0 = <&pcie2_pins>;
-+			pinctrl-names = "default";
-+		};
-+
-+		pcie2: pci at 1b900000 {
-+			status = "ok";
-+			reset-gpio = <&qcom_pinmux 63 0>;
-+			pinctrl-0 = <&pcie3_pins>;
-+			pinctrl-names = "default";
-+		};
- 	};
- };
---- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
-+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -3,6 +3,8 @@
- #include "skeleton.dtsi"
- #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
- #include <dt-bindings/soc/qcom,gsbi.h>
-+#include <dt-bindings/reset/qcom,gcc-ipq806x.h>
-+#include <include/dt-bindings/interrupt-controller/arm-gic.h>
- 
- / {
- 	model = "Qualcomm IPQ8064";
-@@ -291,5 +293,128 @@
- 			#clock-cells = <1>;
- 			#reset-cells = <1>;
- 		};
-+
-+		pcie0: pci at 1b500000 {
-+			compatible = "qcom,pcie-v0";
-+			reg = <0x1b500000 0x1000
-+			       0x1b502000 0x80
-+			       0x1b600000 0x100
-+			       0x0ff00000 0x100000>;
-+			reg-names = "dbi", "elbi", "parf", "config";
-+			device_type = "pci";
-+			linux,pci-domain = <0>;
-+			bus-range = <0x00 0xff>;
-+			num-lanes = <1>;
-+			#address-cells = <3>;
-+			#size-cells = <2>;
-+
-+			ranges = <0x81000000 0 0	  0x0fe00000 0 0x00100000   /* downstream I/O */
-+				  0x82000000 0 0x00000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */
-+
-+			interrupts = <GIC_SPI 35 IRQ_TYPE_NONE>;
-+			interrupt-names = "msi";
-+			#interrupt-cells = <1>;
-+			interrupt-map-mask = <0 0 0 0x7>;
-+			interrupt-map = <0 0 0 1 &intc 0 36 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
-+					<0 0 0 2 &intc 0 37 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
-+					<0 0 0 3 &intc 0 38 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
-+					<0 0 0 4 &intc 0 39 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
-+
-+			clocks = <&gcc PCIE_A_CLK>,
-+				 <&gcc PCIE_H_CLK>,
-+				 <&gcc PCIE_PHY_CLK>;
-+			clock-names = "core", "iface", "phy";
-+
-+			resets = <&gcc PCIE_ACLK_RESET>,
-+				 <&gcc PCIE_HCLK_RESET>,
-+				 <&gcc PCIE_POR_RESET>,
-+				 <&gcc PCIE_PCI_RESET>,
-+				 <&gcc PCIE_PHY_RESET>;
-+			reset-names = "axi", "ahb", "por", "pci", "phy";
-+
-+			status = "disabled";
-+		};
-+
-+		pcie1: pci at 1b700000 {
-+			compatible = "qcom,pcie-v0";
-+			reg = <0x1b700000 0x1000
-+			       0x1b702000 0x80
-+			       0x1b800000 0x100
-+			       0x31f00000 0x100000>;
-+			reg-names = "dbi", "elbi", "parf", "config";
-+			device_type = "pci";
-+			linux,pci-domain = <1>;
-+			bus-range = <0x00 0xff>;
-+			num-lanes = <1>;
-+			#address-cells = <3>;
-+			#size-cells = <2>;
-+
-+			ranges = <0x81000000 0 0	  0x31e00000 0 0x00100000   /* downstream I/O */
-+				  0x82000000 0 0x00000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */
-+
-+			interrupts = <GIC_SPI 57 IRQ_TYPE_NONE>;
-+			interrupt-names = "msi";
-+			#interrupt-cells = <1>;
-+			interrupt-map-mask = <0 0 0 0x7>;
-+			interrupt-map = <0 0 0 1 &intc 0 58 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
-+					<0 0 0 2 &intc 0 59 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
-+					<0 0 0 3 &intc 0 60 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
-+					<0 0 0 4 &intc 0 61 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
-+
-+			clocks = <&gcc PCIE_1_A_CLK>,
-+				 <&gcc PCIE_1_H_CLK>,
-+				 <&gcc PCIE_1_PHY_CLK>;
-+			clock-names = "core", "iface", "phy";
-+
-+			resets = <&gcc PCIE_1_ACLK_RESET>,
-+				 <&gcc PCIE_1_HCLK_RESET>,
-+				 <&gcc PCIE_1_POR_RESET>,
-+				 <&gcc PCIE_1_PCI_RESET>,
-+				 <&gcc PCIE_1_PHY_RESET>;
-+			reset-names = "axi", "ahb", "por", "pci", "phy";
-+
-+			status = "disabled";
-+		};
-+
-+		pcie2: pci at 1b900000 {
-+			compatible = "qcom,pcie-v0";
-+			reg = <0x1b900000 0x1000
-+			       0x1b902000 0x80
-+			       0x1ba00000 0x100
-+			       0x35f00000 0x100000>;
-+			reg-names = "dbi", "elbi", "parf", "config";
-+			device_type = "pci";
-+			linux,pci-domain = <2>;
-+			bus-range = <0x00 0xff>;
-+			num-lanes = <1>;
-+			#address-cells = <3>;
-+			#size-cells = <2>;
-+
-+			ranges = <0x81000000 0 0	  0x35e00000 0 0x00100000   /* downstream I/O */
-+				  0x82000000 0 0x00000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */
-+
-+			interrupts = <GIC_SPI 71 IRQ_TYPE_NONE>;
-+			interrupt-names = "msi";
-+			#interrupt-cells = <1>;
-+			interrupt-map-mask = <0 0 0 0x7>;
-+			interrupt-map = <0 0 0 1 &intc 0 72 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
-+					<0 0 0 2 &intc 0 73 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
-+					<0 0 0 3 &intc 0 74 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
-+					<0 0 0 4 &intc 0 75 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
-+
-+			clocks = <&gcc PCIE_2_A_CLK>,
-+				 <&gcc PCIE_2_H_CLK>,
-+				 <&gcc PCIE_2_PHY_CLK>;
-+			clock-names = "core", "iface", "phy";
-+
-+			resets = <&gcc PCIE_2_ACLK_RESET>,
-+				 <&gcc PCIE_2_HCLK_RESET>,
-+				 <&gcc PCIE_2_POR_RESET>,
-+				 <&gcc PCIE_2_PCI_RESET>,
-+				 <&gcc PCIE_2_PHY_RESET>;
-+			reset-names = "axi", "ahb", "por", "pci", "phy";
-+
-+			status = "disabled";
-+		};
- 	};
- };
diff --git a/target/linux/ipq806x/patches-4.0/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch b/target/linux/ipq806x/patches-4.0/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
deleted file mode 100644
index e2d3135..0000000
--- a/target/linux/ipq806x/patches-4.0/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From f004aa1dec6e2e206be025de15b115d60f2b21e3 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Tue, 21 Apr 2015 19:09:07 -0700
-Subject: [PATCH 9/9] ARM: qcom: automatically select PCI_DOMAINS if PCI is
- enabled
-
-If multiple PCIe devices are present in the system, the kernel will
-panic at boot time when trying to scan the PCI buses. This happens on
-IPQ806x based platforms, which has 3 PCIe ports.
-
-Enabling this option allows the kernel to assign the pci-domains
-according to the device-tree content. This allows multiple PCIe
-controllers to coexist in the system.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- arch/arm/mach-qcom/Kconfig | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/arch/arm/mach-qcom/Kconfig
-+++ b/arch/arm/mach-qcom/Kconfig
-@@ -5,6 +5,7 @@ menuconfig ARCH_QCOM
- 	select ARM_AMBA
- 	select PINCTRL
- 	select QCOM_SCM if SMP
-+	select PCI_DOMAINS if PCI
- 	help
- 	  Support for Qualcomm's devicetree based systems.
- 
diff --git a/target/linux/ipq806x/patches-4.0/121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch b/target/linux/ipq806x/patches-4.0/121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch
deleted file mode 100644
index e5e9e4e..0000000
--- a/target/linux/ipq806x/patches-4.0/121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 4d54b0adfa67476e6509bc8646b9dbac642e8a29 Mon Sep 17 00:00:00 2001
-From: Josh Cartwright <joshc at codeaurora.org>
-Date: Thu, 26 Mar 2015 11:29:26 -0700
-Subject: [PATCH] mfd: qcom_rpm: Add support for IPQ8064
-
-The IPQ8064 also includes an RPM following the same message structure as
-other chips.  In addition, it supports a few new resource types to
-support the NSS fabric clocks and the SMB208/SMB209 regulators found on
-the reference boards.
-
-Signed-off-by: Josh Cartwright <joshc at codeaurora.org>
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-Signed-off-by: Lee Jones <lee.jones at linaro.org>
----
- drivers/mfd/qcom_rpm.c | 41 +++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 41 insertions(+)
-
---- a/drivers/mfd/qcom_rpm.c
-+++ b/drivers/mfd/qcom_rpm.c
-@@ -323,10 +323,51 @@ static const struct qcom_rpm_data msm896
- 	.n_resources = ARRAY_SIZE(msm8960_rpm_resource_table),
- };
- 
-+static const struct qcom_rpm_resource ipq806x_rpm_resource_table[] = {
-+	[QCOM_RPM_CXO_CLK] =			{ 25, 9, 5, 1 },
-+	[QCOM_RPM_PXO_CLK] =			{ 26, 10, 6, 1 },
-+	[QCOM_RPM_APPS_FABRIC_CLK] =		{ 27, 11, 8, 1 },
-+	[QCOM_RPM_SYS_FABRIC_CLK] =		{ 28, 12, 9, 1 },
-+	[QCOM_RPM_NSS_FABRIC_0_CLK] =		{ 29, 13, 10, 1 },
-+	[QCOM_RPM_DAYTONA_FABRIC_CLK] =		{ 30, 14, 11, 1 },
-+	[QCOM_RPM_SFPB_CLK] =			{ 31, 15, 12, 1 },
-+	[QCOM_RPM_CFPB_CLK] =			{ 32, 16, 13, 1 },
-+	[QCOM_RPM_NSS_FABRIC_1_CLK] =		{ 33, 17, 14, 1 },
-+	[QCOM_RPM_EBI1_CLK] =			{ 34, 18, 16, 1 },
-+	[QCOM_RPM_APPS_FABRIC_HALT] =		{ 35, 19, 18, 2 },
-+	[QCOM_RPM_APPS_FABRIC_MODE] =		{ 37, 20, 19, 3 },
-+	[QCOM_RPM_APPS_FABRIC_IOCTL] =		{ 40, 21, 20, 1 },
-+	[QCOM_RPM_APPS_FABRIC_ARB] =		{ 41, 22, 21, 12 },
-+	[QCOM_RPM_SYS_FABRIC_HALT] =		{ 53, 23, 22, 2 },
-+	[QCOM_RPM_SYS_FABRIC_MODE] =		{ 55, 24, 23, 3 },
-+	[QCOM_RPM_SYS_FABRIC_IOCTL] =		{ 58, 25, 24, 1 },
-+	[QCOM_RPM_SYS_FABRIC_ARB] =		{ 59, 26, 25, 30 },
-+	[QCOM_RPM_MM_FABRIC_HALT] =		{ 89, 27, 26, 2 },
-+	[QCOM_RPM_MM_FABRIC_MODE] =		{ 91, 28, 27, 3 },
-+	[QCOM_RPM_MM_FABRIC_IOCTL] =		{ 94, 29, 28, 1 },
-+	[QCOM_RPM_MM_FABRIC_ARB] =		{ 95, 30, 29, 2 },
-+	[QCOM_RPM_CXO_BUFFERS] =		{ 209, 33, 31, 1 },
-+	[QCOM_RPM_USB_OTG_SWITCH] =		{ 210, 34, 32, 1 },
-+	[QCOM_RPM_HDMI_SWITCH] =		{ 211, 35, 33, 1 },
-+	[QCOM_RPM_DDR_DMM] =			{ 212, 36, 34, 2 },
-+	[QCOM_RPM_VDDMIN_GPIO] =		{ 215, 40, 39, 1 },
-+	[QCOM_RPM_SMB208_S1a] =			{ 216, 41, 90, 2 },
-+	[QCOM_RPM_SMB208_S1b] =			{ 218, 43, 91, 2 },
-+	[QCOM_RPM_SMB208_S2a] =			{ 220, 45, 92, 2 },
-+	[QCOM_RPM_SMB208_S2b] =			{ 222, 47, 93, 2 },
-+};
-+
-+static const struct qcom_rpm_data ipq806x_template = {
-+	.version = 3,
-+	.resource_table = ipq806x_rpm_resource_table,
-+	.n_resources = ARRAY_SIZE(ipq806x_rpm_resource_table),
-+};
-+
- static const struct of_device_id qcom_rpm_of_match[] = {
- 	{ .compatible = "qcom,rpm-apq8064", .data = &apq8064_template },
- 	{ .compatible = "qcom,rpm-msm8660", .data = &msm8660_template },
- 	{ .compatible = "qcom,rpm-msm8960", .data = &msm8960_template },
-+	{ .compatible = "qcom,rpm-ipq8064", .data = &ipq806x_template },
- 	{ }
- };
- MODULE_DEVICE_TABLE(of, qcom_rpm_of_match);
diff --git a/target/linux/ipq806x/patches-4.0/123-mfd-devicetree-qcom_rpm-Document-IPQ8064-resources.patch b/target/linux/ipq806x/patches-4.0/123-mfd-devicetree-qcom_rpm-Document-IPQ8064-resources.patch
deleted file mode 100644
index c8a9f3f..0000000
--- a/target/linux/ipq806x/patches-4.0/123-mfd-devicetree-qcom_rpm-Document-IPQ8064-resources.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 30bc3aa5c4ed3072bdff7d915772df1b91307ed4 Mon Sep 17 00:00:00 2001
-From: Josh Cartwright <joshc at codeaurora.org>
-Date: Thu, 26 Mar 2015 11:29:25 -0700
-Subject: [PATCH] mfd: devicetree: qcom_rpm: Document IPQ8064 resources
-
-The IPQ8064 SoC has several RPM-controlled resources, an NSS fabrick
-clock and four regulator resources.  Provide definitions for them.
-
-Signed-off-by: Josh Cartwright <joshc at codeaurora.org>
-[sboyd at codeaurora.org: Drop regulator part of binding]
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-Signed-off-by: Lee Jones <lee.jones at linaro.org>
----
- Documentation/devicetree/bindings/mfd/qcom-rpm.txt | 1 +
- include/dt-bindings/mfd/qcom-rpm.h                 | 6 ++++++
- 2 files changed, 7 insertions(+)
-
---- a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
-+++ b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
-@@ -12,6 +12,7 @@ frequencies.
- 		    "qcom,rpm-apq8064"
- 		    "qcom,rpm-msm8660"
- 		    "qcom,rpm-msm8960"
-+		    "qcom,rpm-ipq8064"
- 
- - reg:
- 	Usage: required
---- a/include/dt-bindings/mfd/qcom-rpm.h
-+++ b/include/dt-bindings/mfd/qcom-rpm.h
-@@ -141,6 +141,12 @@
- #define QCOM_RPM_SYS_FABRIC_MODE		131
- #define QCOM_RPM_USB_OTG_SWITCH			132
- #define QCOM_RPM_VDDMIN_GPIO			133
-+#define QCOM_RPM_NSS_FABRIC_0_CLK		134
-+#define QCOM_RPM_NSS_FABRIC_1_CLK		135
-+#define QCOM_RPM_SMB208_S1a			136
-+#define QCOM_RPM_SMB208_S1b			137
-+#define QCOM_RPM_SMB208_S2a			138
-+#define QCOM_RPM_SMB208_S2b			139
- 
- /*
-  * Constants used to select force mode for regulators.
diff --git a/target/linux/ipq806x/patches-4.0/126-add-rpm-to-ipq8064-dts.patch b/target/linux/ipq806x/patches-4.0/126-add-rpm-to-ipq8064-dts.patch
deleted file mode 100644
index 4fb62dd..0000000
--- a/target/linux/ipq806x/patches-4.0/126-add-rpm-to-ipq8064-dts.patch
+++ /dev/null
@@ -1,87 +0,0 @@
---- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
-+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -2,6 +2,7 @@
- 
- #include "skeleton.dtsi"
- #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
-+#include <dt-bindings/mfd/qcom-rpm.h>
- #include <dt-bindings/soc/qcom,gsbi.h>
- #include <dt-bindings/reset/qcom,gcc-ipq806x.h>
- #include <include/dt-bindings/interrupt-controller/arm-gic.h>
-@@ -76,6 +77,63 @@
- 		ranges;
- 		compatible = "simple-bus";
- 
-+		rpm at 108000 {
-+			compatible = "qcom,rpm-ipq8064";
-+			reg = <0x108000 0x1000>;
-+			qcom,ipc = <&l2cc 0x8 2>;
-+
-+			interrupts = <0 19 0>,
-+				     <0 21 0>,
-+				     <0 22 0>;
-+			interrupt-names = "ack",
-+					  "err",
-+					  "wakeup";
-+
-+			#address-cells = <1>;
-+			#size-cells = <0>;
-+
-+			smb208_s1a: smb208-s1a {
-+				compatible = "qcom,rpm-smb208";
-+				reg = <QCOM_RPM_SMB208_S1a>;
-+
-+				regulator-min-microvolt = <1050000>;
-+				regulator-max-microvolt = <1150000>;
-+
-+				qcom,switch-mode-frequency = <1200000>;
-+
-+			};
-+
-+			smb208_s1b: smb208-s1b {
-+				compatible = "qcom,rpm-smb208";
-+				reg = <QCOM_RPM_SMB208_S1b>;
-+
-+				regulator-min-microvolt = <1050000>;
-+				regulator-max-microvolt = <1150000>;
-+
-+				qcom,switch-mode-frequency = <1200000>;
-+			};
-+
-+			smb208_s2a: smb208-s2a {
-+				compatible = "qcom,rpm-smb208";
-+				reg = <QCOM_RPM_SMB208_S2a>;
-+
-+				regulator-min-microvolt = < 800000>;
-+				regulator-max-microvolt = <1250000>;
-+
-+				qcom,switch-mode-frequency = <1200000>;
-+			};
-+
-+			smb208_s2b: smb208-s2b {
-+				compatible = "qcom,rpm-smb208";
-+				reg = <QCOM_RPM_SMB208_S2b>;
-+
-+				regulator-min-microvolt = < 800000>;
-+				regulator-max-microvolt = <1250000>;
-+
-+				qcom,switch-mode-frequency = <1200000>;
-+			};
-+		};
-+
- 		qcom_pinmux: pinmux at 800000 {
- 			compatible = "qcom,ipq8064-pinctrl";
- 			reg = <0x800000 0x4000>;
-@@ -120,6 +178,12 @@
- 			reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
- 		};
- 
-+		l2cc: clock-controller at 2011000 {
-+			compatible = "qcom,kpss-gcc", "syscon";
-+			reg = <0x2011000 0x1000>;
-+			clock-output-names = "acpu_l2_aux";
-+ 		};
-+ 
- 		saw0: regulator at 2089000 {
- 			compatible = "qcom,saw2";
- 			reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
diff --git a/target/linux/ipq806x/patches-4.0/133-ARM-Add-Krait-L2-register-accessor-functions.patch b/target/linux/ipq806x/patches-4.0/133-ARM-Add-Krait-L2-register-accessor-functions.patch
deleted file mode 100644
index 36a92c8..0000000
--- a/target/linux/ipq806x/patches-4.0/133-ARM-Add-Krait-L2-register-accessor-functions.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,01/13] ARM: Add Krait L2 register accessor functions
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063051
-Message-Id: <1426920332-9340-2-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>,
-	Mark Rutland <mark.rutland at arm.com>, Russell King <linux at arm.linux.org.uk>,
-	Courtney Cavin <courtney.cavin at sonymobile.com>
-Date: Fri, 20 Mar 2015 23:45:20 -0700
-
-Krait CPUs have a handful of L2 cache controller registers that
-live behind a cp15 based indirection register. First you program
-the indirection register (l2cpselr) to point the L2 'window'
-register (l2cpdr) at what you want to read/write.  Then you
-read/write the 'window' register to do what you want. The
-l2cpselr register is not banked per-cpu so we must lock around
-accesses to it to prevent other CPUs from re-pointing l2cpdr
-underneath us.
-
-Cc: Mark Rutland <mark.rutland at arm.com>
-Cc: Russell King <linux at arm.linux.org.uk>
-Cc: Courtney Cavin <courtney.cavin at sonymobile.com>
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-arch/arm/common/Kconfig                   |  3 ++
- arch/arm/common/Makefile                  |  1 +
- arch/arm/common/krait-l2-accessors.c      | 58 +++++++++++++++++++++++++++++++
- arch/arm/include/asm/krait-l2-accessors.h | 20 +++++++++++
- 4 files changed, 82 insertions(+)
- create mode 100644 arch/arm/common/krait-l2-accessors.c
- create mode 100644 arch/arm/include/asm/krait-l2-accessors.h
-
---- a/arch/arm/common/Kconfig
-+++ b/arch/arm/common/Kconfig
-@@ -9,6 +9,9 @@ config DMABOUNCE
- 	bool
- 	select ZONE_DMA
- 
-+config KRAIT_L2_ACCESSORS
-+	bool
-+
- config SHARP_LOCOMO
- 	bool
- 
---- a/arch/arm/common/Makefile
-+++ b/arch/arm/common/Makefile
-@@ -7,6 +7,7 @@ obj-y				+= firmware.o
- obj-$(CONFIG_ICST)		+= icst.o
- obj-$(CONFIG_SA1111)		+= sa1111.o
- obj-$(CONFIG_DMABOUNCE)		+= dmabounce.o
-+obj-$(CONFIG_KRAIT_L2_ACCESSORS) += krait-l2-accessors.o
- obj-$(CONFIG_SHARP_LOCOMO)	+= locomo.o
- obj-$(CONFIG_SHARP_PARAM)	+= sharpsl_param.o
- obj-$(CONFIG_SHARP_SCOOP)	+= scoop.o
---- /dev/null
-+++ b/arch/arm/common/krait-l2-accessors.c
-@@ -0,0 +1,58 @@
-+/*
-+ * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/spinlock.h>
-+#include <linux/export.h>
-+
-+#include <asm/barrier.h>
-+#include <asm/krait-l2-accessors.h>
-+
-+static DEFINE_RAW_SPINLOCK(krait_l2_lock);
-+
-+void krait_set_l2_indirect_reg(u32 addr, u32 val)
-+{
-+	unsigned long flags;
-+
-+	raw_spin_lock_irqsave(&krait_l2_lock, flags);
-+	/*
-+	 * Select the L2 window by poking l2cpselr, then write to the window
-+	 * via l2cpdr.
-+	 */
-+	asm volatile ("mcr p15, 3, %0, c15, c0, 6 @ l2cpselr" : : "r" (addr));
-+	isb();
-+	asm volatile ("mcr p15, 3, %0, c15, c0, 7 @ l2cpdr" : : "r" (val));
-+	isb();
-+
-+	raw_spin_unlock_irqrestore(&krait_l2_lock, flags);
-+}
-+EXPORT_SYMBOL(krait_set_l2_indirect_reg);
-+
-+u32 krait_get_l2_indirect_reg(u32 addr)
-+{
-+	u32 val;
-+	unsigned long flags;
-+
-+	raw_spin_lock_irqsave(&krait_l2_lock, flags);
-+	/*
-+	 * Select the L2 window by poking l2cpselr, then read from the window
-+	 * via l2cpdr.
-+	 */
-+	asm volatile ("mcr p15, 3, %0, c15, c0, 6 @ l2cpselr" : : "r" (addr));
-+	isb();
-+	asm volatile ("mrc p15, 3, %0, c15, c0, 7 @ l2cpdr" : "=r" (val));
-+
-+	raw_spin_unlock_irqrestore(&krait_l2_lock, flags);
-+
-+	return val;
-+}
-+EXPORT_SYMBOL(krait_get_l2_indirect_reg);
---- /dev/null
-+++ b/arch/arm/include/asm/krait-l2-accessors.h
-@@ -0,0 +1,20 @@
-+/*
-+ * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#ifndef __ASMARM_KRAIT_L2_ACCESSORS_H
-+#define __ASMARM_KRAIT_L2_ACCESSORS_H
-+
-+extern void krait_set_l2_indirect_reg(u32 addr, u32 val);
-+extern u32 krait_get_l2_indirect_reg(u32 addr);
-+
-+#endif
diff --git a/target/linux/ipq806x/patches-4.0/134-clk-mux-Split-out-register-accessors-for-reuse.patch b/target/linux/ipq806x/patches-4.0/134-clk-mux-Split-out-register-accessors-for-reuse.patch
deleted file mode 100644
index 3a475fb..0000000
--- a/target/linux/ipq806x/patches-4.0/134-clk-mux-Split-out-register-accessors-for-reuse.patch
+++ /dev/null
@@ -1,192 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,02/13] clk: mux: Split out register accessors for reuse
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063111
-Message-Id: <1426920332-9340-3-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>
-Date: Fri, 20 Mar 2015 23:45:21 -0700
-
-We want to reuse the logic in clk-mux.c for other clock drivers
-that don't use readl as register accessors. Fortunately, there
-really isn't much to the mux code besides the table indirection
-and quirk flags if you assume any bit shifting and masking has
-been done already. Pull that logic out into reusable functions
-that operate on an optional table and some flags so that other
-drivers can use the same logic.
-
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-drivers/clk/clk-mux.c        | 76 +++++++++++++++++++++++++++-----------------
- include/linux/clk-provider.h |  9 ++++--
- 2 files changed, 54 insertions(+), 31 deletions(-)
-
---- a/drivers/clk/clk-mux.c
-+++ b/drivers/clk/clk-mux.c
-@@ -29,35 +29,24 @@
- 
- #define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
- 
--static u8 clk_mux_get_parent(struct clk_hw *hw)
-+unsigned int clk_mux_get_parent(struct clk_hw *hw, unsigned int val,
-+				unsigned int *table, unsigned long flags)
- {
--	struct clk_mux *mux = to_clk_mux(hw);
- 	int num_parents = __clk_get_num_parents(hw->clk);
--	u32 val;
- 
--	/*
--	 * FIXME need a mux-specific flag to determine if val is bitwise or numeric
--	 * e.g. sys_clkin_ck's clksel field is 3 bits wide, but ranges from 0x1
--	 * to 0x7 (index starts at one)
--	 * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so
--	 * val = 0x4 really means "bit 2, index starts at bit 0"
--	 */
--	val = clk_readl(mux->reg) >> mux->shift;
--	val &= mux->mask;
--
--	if (mux->table) {
-+	if (table) {
- 		int i;
- 
- 		for (i = 0; i < num_parents; i++)
--			if (mux->table[i] == val)
-+			if (table[i] == val)
- 				return i;
- 		return -EINVAL;
- 	}
- 
--	if (val && (mux->flags & CLK_MUX_INDEX_BIT))
-+	if (val && (flags & CLK_MUX_INDEX_BIT))
- 		val = ffs(val) - 1;
- 
--	if (val && (mux->flags & CLK_MUX_INDEX_ONE))
-+	if (val && (flags & CLK_MUX_INDEX_ONE))
- 		val--;
- 
- 	if (val >= num_parents)
-@@ -65,24 +54,53 @@ static u8 clk_mux_get_parent(struct clk_
- 
- 	return val;
- }
-+EXPORT_SYMBOL_GPL(clk_mux_get_parent);
- 
--static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
-+static u8 _clk_mux_get_parent(struct clk_hw *hw)
- {
- 	struct clk_mux *mux = to_clk_mux(hw);
- 	u32 val;
--	unsigned long flags = 0;
- 
--	if (mux->table)
--		index = mux->table[index];
-+	/*
-+	 * FIXME need a mux-specific flag to determine if val is bitwise or numeric
-+	 * e.g. sys_clkin_ck's clksel field is 3 bits wide, but ranges from 0x1
-+	 * to 0x7 (index starts at one)
-+	 * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so
-+	 * val = 0x4 really means "bit 2, index starts at bit 0"
-+	 */
-+	val = clk_readl(mux->reg) >> mux->shift;
-+	val &= mux->mask;
-+
-+	return clk_mux_get_parent(hw, val, mux->table, mux->flags);
-+}
- 
--	else {
--		if (mux->flags & CLK_MUX_INDEX_BIT)
--			index = 1 << index;
-+unsigned int clk_mux_reindex(u8 index, unsigned int *table,
-+			     unsigned long flags)
-+{
-+	unsigned int val = index;
- 
--		if (mux->flags & CLK_MUX_INDEX_ONE)
--			index++;
-+	if (table) {
-+		val = table[val];
-+	} else {
-+		if (flags & CLK_MUX_INDEX_BIT)
-+			val = 1 << index;
-+
-+		if (flags & CLK_MUX_INDEX_ONE)
-+			val++;
- 	}
- 
-+	return val;
-+}
-+EXPORT_SYMBOL_GPL(clk_mux_reindex);
-+
-+static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
-+{
-+	struct clk_mux *mux = to_clk_mux(hw);
-+	u32 val;
-+	unsigned long flags = 0;
-+
-+	index = clk_mux_reindex(index, mux->table, mux->flags);
-+
- 	if (mux->lock)
- 		spin_lock_irqsave(mux->lock, flags);
- 
-@@ -102,21 +120,21 @@ static int clk_mux_set_parent(struct clk
- }
- 
- const struct clk_ops clk_mux_ops = {
--	.get_parent = clk_mux_get_parent,
-+	.get_parent = _clk_mux_get_parent,
- 	.set_parent = clk_mux_set_parent,
- 	.determine_rate = __clk_mux_determine_rate,
- };
- EXPORT_SYMBOL_GPL(clk_mux_ops);
- 
- const struct clk_ops clk_mux_ro_ops = {
--	.get_parent = clk_mux_get_parent,
-+	.get_parent = _clk_mux_get_parent,
- };
- EXPORT_SYMBOL_GPL(clk_mux_ro_ops);
- 
- struct clk *clk_register_mux_table(struct device *dev, const char *name,
- 		const char **parent_names, u8 num_parents, unsigned long flags,
- 		void __iomem *reg, u8 shift, u32 mask,
--		u8 clk_mux_flags, u32 *table, spinlock_t *lock)
-+		u8 clk_mux_flags, unsigned int *table, spinlock_t *lock)
- {
- 	struct clk_mux *mux;
- 	struct clk *clk;
---- a/include/linux/clk-provider.h
-+++ b/include/linux/clk-provider.h
-@@ -409,7 +409,7 @@ void clk_unregister_divider(struct clk *
- struct clk_mux {
- 	struct clk_hw	hw;
- 	void __iomem	*reg;
--	u32		*table;
-+	unsigned int	*table;
- 	u32		mask;
- 	u8		shift;
- 	u8		flags;
-@@ -425,6 +425,11 @@ struct clk_mux {
- extern const struct clk_ops clk_mux_ops;
- extern const struct clk_ops clk_mux_ro_ops;
- 
-+unsigned int clk_mux_get_parent(struct clk_hw *hw, unsigned int val,
-+				unsigned int *table, unsigned long flags);
-+unsigned int clk_mux_reindex(u8 index, unsigned int *table,
-+			     unsigned long flags);
-+
- struct clk *clk_register_mux(struct device *dev, const char *name,
- 		const char **parent_names, u8 num_parents, unsigned long flags,
- 		void __iomem *reg, u8 shift, u8 width,
-@@ -433,7 +438,7 @@ struct clk *clk_register_mux(struct devi
- struct clk *clk_register_mux_table(struct device *dev, const char *name,
- 		const char **parent_names, u8 num_parents, unsigned long flags,
- 		void __iomem *reg, u8 shift, u32 mask,
--		u8 clk_mux_flags, u32 *table, spinlock_t *lock);
-+		u8 clk_mux_flags, unsigned int *table, spinlock_t *lock);
- 
- void clk_unregister_mux(struct clk *clk);
- 
diff --git a/target/linux/ipq806x/patches-4.0/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch b/target/linux/ipq806x/patches-4.0/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch
deleted file mode 100644
index 52af413..0000000
--- a/target/linux/ipq806x/patches-4.0/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3, 03/13] clk: Avoid sending high rates to downstream clocks during
-	set_rate
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063271
-Message-Id: <1426920332-9340-4-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>
-Date: Fri, 20 Mar 2015 23:45:22 -0700
-
-If a clock is on and we call clk_set_rate() on it we may get into
-a situation where the clock temporarily increases in rate
-dramatically while we walk the tree and call .set_rate() ops. For
-example, consider a case where a PLL feeds into a divider.
-Initially the divider is set to divide by 1 and the PLL is
-running fairly slow (100MHz). The downstream consumer of the
-divider output can only handle rates =< 400 MHz, but the divider
-can only choose between divisors of 1 and 4.
-
- +-----+   +----------------+
- | PLL |-->| div 1 or div 4 |---> consumer device
- +-----+   +----------------+
-
-To achieve a rate of 400MHz on the output of the divider, we
-would have to set the rate of the PLL to 1.6 GHz and then divide
-it by 4. The current code would set the PLL to 1.6GHz first while
-the divider is still set to 1, thus causing the downstream
-consumer of the clock to receive a few clock cycles of 1.6GHz
-clock (far beyond it's maximum acceptable rate). We should be
-changing the divider first before increasing the PLL rate to
-avoid this problem.
-
-Therefore, set the rate of any child clocks that are increasing
-in rate from their current rate so that they can increase their
-dividers if necessary. We assume that there isn't such a thing as
-minimum rate requirements.
-
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-drivers/clk/clk.c | 34 ++++++++++++++++++++++------------
- 1 file changed, 22 insertions(+), 12 deletions(-)
-
---- a/drivers/clk/clk.c
-+++ b/drivers/clk/clk.c
-@@ -1696,21 +1696,24 @@ static struct clk_core *clk_propagate_ra
-  * walk down a subtree and set the new rates notifying the rate
-  * change on the way
-  */
--static void clk_change_rate(struct clk_core *clk)
-+static void
-+clk_change_rate(struct clk_core *clk, unsigned long best_parent_rate)
- {
- 	struct clk_core *child;
- 	struct hlist_node *tmp;
- 	unsigned long old_rate;
--	unsigned long best_parent_rate = 0;
- 	bool skip_set_rate = false;
- 	struct clk_core *old_parent;
- 
--	old_rate = clk->rate;
-+	hlist_for_each_entry(child, &clk->children, child_node) {
-+		/* Skip children who will be reparented to another clock */
-+		if (child->new_parent && child->new_parent != clk)
-+			continue;
-+		if (child->new_rate > child->rate)
-+			clk_change_rate(child, clk->new_rate);
-+	}
- 
--	if (clk->new_parent)
--		best_parent_rate = clk->new_parent->rate;
--	else if (clk->parent)
--		best_parent_rate = clk->parent->rate;
-+	old_rate = clk->rate;
- 
- 	if (clk->new_parent && clk->new_parent != clk->parent) {
- 		old_parent = __clk_set_parent_before(clk, clk->new_parent);
-@@ -1730,7 +1733,7 @@ static void clk_change_rate(struct clk_c
- 	if (!skip_set_rate && clk->ops->set_rate)
- 		clk->ops->set_rate(clk->hw, clk->new_rate, best_parent_rate);
- 
--	clk->rate = clk_recalc(clk, best_parent_rate);
-+	clk->rate = clk->new_rate;
- 
- 	if (clk->notifier_count && old_rate != clk->rate)
- 		__clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);
-@@ -1743,12 +1746,13 @@ static void clk_change_rate(struct clk_c
- 		/* Skip children who will be reparented to another clock */
- 		if (child->new_parent && child->new_parent != clk)
- 			continue;
--		clk_change_rate(child);
-+		if (child->new_rate != child->rate)
-+			clk_change_rate(child, clk->new_rate);
- 	}
- 
- 	/* handle the new child who might not be in clk->children yet */
--	if (clk->new_child)
--		clk_change_rate(clk->new_child);
-+	if (clk->new_child && clk->new_child->new_rate != clk->new_child->rate)
-+		clk_change_rate(clk->new_child, clk->new_rate);
- }
- 
- static int clk_core_set_rate_nolock(struct clk_core *clk,
-@@ -1757,6 +1761,7 @@ static int clk_core_set_rate_nolock(stru
- 	struct clk_core *top, *fail_clk;
- 	unsigned long rate = req_rate;
- 	int ret = 0;
-+	unsigned long parent_rate;
- 
- 	if (!clk)
- 		return 0;
-@@ -1782,8 +1787,13 @@ static int clk_core_set_rate_nolock(stru
- 		return -EBUSY;
- 	}
- 
-+	if (top->parent)
-+		parent_rate = top->parent->rate;
-+	else
-+		parent_rate = 0;
-+
- 	/* change the rates */
--	clk_change_rate(top);
-+	clk_change_rate(top, parent_rate);
- 
- 	clk->req_rate = req_rate;
- 
diff --git a/target/linux/ipq806x/patches-4.0/136-clk-Add-safe-switch-hook.patch b/target/linux/ipq806x/patches-4.0/136-clk-Add-safe-switch-hook.patch
deleted file mode 100644
index a5d9c41..0000000
--- a/target/linux/ipq806x/patches-4.0/136-clk-Add-safe-switch-hook.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,04/13] clk: Add safe switch hook
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063211
-Message-Id: <1426920332-9340-5-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>
-Date: Fri, 20 Mar 2015 23:45:23 -0700
-
-Sometimes clocks can't accept their parent source turning off
-while the source is reprogrammed to a different rate. Most
-notably CPU clocks require a way to switch away from the current
-PLL they're running on, reprogram that PLL to a new rate, and
-then switch back to the PLL with the new rate once they're done.
-Add a hook that drivers can implement allowing them to return a
-'safe parent' that they can switch their parent to while the
-upstream source is reprogrammed to support this.
-
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-This patch is good enough for Krait, but soon I'll need to 
-support a "safe rate" where we ask a clock what rate it needs to be running
-at to be sure it's within voltage constraints. Right now safe parent
-handles that problem on Krait, but on other platforms it won't work.
-
- drivers/clk/clk.c            | 61 ++++++++++++++++++++++++++++++++++++++------
- include/linux/clk-provider.h |  1 +
- 2 files changed, 54 insertions(+), 8 deletions(-)
-
---- a/drivers/clk/clk.c
-+++ b/drivers/clk/clk.c
-@@ -56,9 +56,12 @@ struct clk_core {
- 	struct clk_core		**parents;
- 	u8			num_parents;
- 	u8			new_parent_index;
-+	u8			safe_parent_index;
- 	unsigned long		rate;
- 	unsigned long		req_rate;
-+	unsigned long		old_rate;
- 	unsigned long		new_rate;
-+	struct clk_core		*safe_parent;
- 	struct clk_core		*new_parent;
- 	struct clk_core		*new_child;
- 	unsigned long		flags;
-@@ -1557,7 +1560,8 @@ out:
- static void clk_calc_subtree(struct clk_core *clk, unsigned long new_rate,
- 			     struct clk_core *new_parent, u8 p_index)
- {
--	struct clk_core *child;
-+	struct clk_core *child, *parent;
-+	struct clk_hw *parent_hw;
- 
- 	clk->new_rate = new_rate;
- 	clk->new_parent = new_parent;
-@@ -1567,6 +1571,18 @@ static void clk_calc_subtree(struct clk_
- 	if (new_parent && new_parent != clk->parent)
- 		new_parent->new_child = clk;
- 
-+	if (clk->ops->get_safe_parent) {
-+		parent_hw = clk->ops->get_safe_parent(clk->hw);
-+		if (parent_hw) {
-+			parent = parent_hw->core;
-+			p_index = clk_fetch_parent_index(clk, parent);
-+			clk->safe_parent_index = p_index;
-+			clk->safe_parent = parent;
-+		}
-+	} else {
-+		clk->safe_parent = NULL;
-+	}
-+
- 	hlist_for_each_entry(child, &clk->children, child_node) {
- 		child->new_rate = clk_recalc(child, new_rate);
- 		clk_calc_subtree(child, child->new_rate, NULL, 0);
-@@ -1662,14 +1678,43 @@ static struct clk_core *clk_propagate_ra
- 						  unsigned long event)
- {
- 	struct clk_core *child, *tmp_clk, *fail_clk = NULL;
-+	struct clk_core *old_parent;
- 	int ret = NOTIFY_DONE;
- 
--	if (clk->rate == clk->new_rate)
-+	if (clk->rate == clk->new_rate && event != POST_RATE_CHANGE)
- 		return NULL;
- 
-+	switch (event) {
-+	case PRE_RATE_CHANGE:
-+		if (clk->safe_parent)
-+			clk->ops->set_parent(clk->hw, clk->safe_parent_index);
-+		clk->old_rate = clk->rate;
-+		break;
-+	case POST_RATE_CHANGE:
-+		if (clk->safe_parent) {
-+			old_parent = __clk_set_parent_before(clk,
-+							     clk->new_parent);
-+			if (clk->ops->set_rate_and_parent) {
-+				clk->ops->set_rate_and_parent(clk->hw,
-+						clk->new_rate,
-+						clk->new_parent ?
-+						clk->new_parent->rate : 0,
-+						clk->new_parent_index);
-+			} else if (clk->ops->set_parent) {
-+				clk->ops->set_parent(clk->hw,
-+						clk->new_parent_index);
-+			}
-+			__clk_set_parent_after(clk, clk->new_parent,
-+					       old_parent);
-+		}
-+		break;
-+	}
-+
- 	if (clk->notifier_count) {
--		ret = __clk_notify(clk, event, clk->rate, clk->new_rate);
--		if (ret & NOTIFY_STOP_MASK)
-+		if (event != POST_RATE_CHANGE || clk->old_rate != clk->rate)
-+			ret = __clk_notify(clk, event, clk->old_rate,
-+					   clk->new_rate);
-+		if (ret & NOTIFY_STOP_MASK && event != POST_RATE_CHANGE)
- 			fail_clk = clk;
- 	}
- 
-@@ -1715,7 +1760,8 @@ clk_change_rate(struct clk_core *clk, un
- 
- 	old_rate = clk->rate;
- 
--	if (clk->new_parent && clk->new_parent != clk->parent) {
-+	if (clk->new_parent && clk->new_parent != clk->parent &&
-+			!clk->safe_parent) {
- 		old_parent = __clk_set_parent_before(clk, clk->new_parent);
- 
- 		if (clk->ops->set_rate_and_parent) {
-@@ -1735,9 +1781,6 @@ clk_change_rate(struct clk_core *clk, un
- 
- 	clk->rate = clk->new_rate;
- 
--	if (clk->notifier_count && old_rate != clk->rate)
--		__clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);
--
- 	/*
- 	 * Use safe iteration, as change_rate can actually swap parents
- 	 * for certain clock types.
-@@ -1797,6 +1840,8 @@ static int clk_core_set_rate_nolock(stru
- 
- 	clk->req_rate = req_rate;
- 
-+	clk_propagate_rate_change(top, POST_RATE_CHANGE);
-+
- 	return ret;
- }
- 
---- a/include/linux/clk-provider.h
-+++ b/include/linux/clk-provider.h
-@@ -183,6 +183,7 @@ struct clk_ops {
- 					  struct clk_hw **best_parent_hw);
- 	int		(*set_parent)(struct clk_hw *hw, u8 index);
- 	u8		(*get_parent)(struct clk_hw *hw);
-+	struct clk_hw	*(*get_safe_parent)(struct clk_hw *hw);
- 	int		(*set_rate)(struct clk_hw *hw, unsigned long rate,
- 				    unsigned long parent_rate);
- 	int		(*set_rate_and_parent)(struct clk_hw *hw,
diff --git a/target/linux/ipq806x/patches-4.0/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch b/target/linux/ipq806x/patches-4.0/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
deleted file mode 100644
index 6fad6e8..0000000
--- a/target/linux/ipq806x/patches-4.0/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
+++ /dev/null
@@ -1,351 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,05/13] clk: qcom: Add support for High-Frequency PLLs (HFPLLs)
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063261
-Message-Id: <1426920332-9340-6-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>
-Date: Fri, 20 Mar 2015 23:45:24 -0700
-
-HFPLLs are the main frequency source for Krait CPU clocks. Add
-support for changing the rate of these PLLs.
-
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-I'd really like to get rid of __clk_hfpll_init_once() if possible...
-
- drivers/clk/qcom/Makefile    |   1 +
- drivers/clk/qcom/clk-hfpll.c | 253 +++++++++++++++++++++++++++++++++++++++++++
- drivers/clk/qcom/clk-hfpll.h |  54 +++++++++
- 3 files changed, 308 insertions(+)
- create mode 100644 drivers/clk/qcom/clk-hfpll.c
- create mode 100644 drivers/clk/qcom/clk-hfpll.h
-
---- a/drivers/clk/qcom/Makefile
-+++ b/drivers/clk/qcom/Makefile
-@@ -8,6 +8,7 @@ clk-qcom-y += clk-rcg2.o
- clk-qcom-y += clk-branch.o
- clk-qcom-y += clk-regmap-divider.o
- clk-qcom-y += clk-regmap-mux.o
-+clk-qcom-y += clk-hfpll.o
- clk-qcom-y += reset.o
- 
- obj-$(CONFIG_APQ_GCC_8084) += gcc-apq8084.o
---- /dev/null
-+++ b/drivers/clk/qcom/clk-hfpll.c
-@@ -0,0 +1,253 @@
-+/*
-+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+#include <linux/kernel.h>
-+#include <linux/export.h>
-+#include <linux/regmap.h>
-+#include <linux/delay.h>
-+#include <linux/err.h>
-+#include <linux/clk-provider.h>
-+#include <linux/spinlock.h>
-+
-+#include "clk-regmap.h"
-+#include "clk-hfpll.h"
-+
-+#define PLL_OUTCTRL	BIT(0)
-+#define PLL_BYPASSNL	BIT(1)
-+#define PLL_RESET_N	BIT(2)
-+
-+/* Initialize a HFPLL at a given rate and enable it. */
-+static void __clk_hfpll_init_once(struct clk_hw *hw)
-+{
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	struct hfpll_data const *hd = h->d;
-+	struct regmap *regmap = h->clkr.regmap;
-+
-+	if (likely(h->init_done))
-+		return;
-+
-+	/* Configure PLL parameters for integer mode. */
-+	if (hd->config_val)
-+		regmap_write(regmap, hd->config_reg, hd->config_val);
-+	regmap_write(regmap, hd->m_reg, 0);
-+	regmap_write(regmap, hd->n_reg, 1);
-+
-+	if (hd->user_reg) {
-+		u32 regval = hd->user_val;
-+		unsigned long rate;
-+
-+		rate = __clk_get_rate(hw->clk);
-+
-+		/* Pick the right VCO. */
-+		if (hd->user_vco_mask && rate > hd->low_vco_max_rate)
-+			regval |= hd->user_vco_mask;
-+		regmap_write(regmap, hd->user_reg, regval);
-+	}
-+
-+	if (hd->droop_reg)
-+		regmap_write(regmap, hd->droop_reg, hd->droop_val);
-+
-+	h->init_done = true;
-+}
-+
-+static void __clk_hfpll_enable(struct clk_hw *hw)
-+{
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	struct hfpll_data const *hd = h->d;
-+	struct regmap *regmap = h->clkr.regmap;
-+	u32 val;
-+
-+	__clk_hfpll_init_once(hw);
-+
-+	/* Disable PLL bypass mode. */
-+	regmap_update_bits(regmap, hd->mode_reg, PLL_BYPASSNL, PLL_BYPASSNL);
-+
-+	/*
-+	 * H/W requires a 5us delay between disabling the bypass and
-+	 * de-asserting the reset. Delay 10us just to be safe.
-+	 */
-+	udelay(10);
-+
-+	/* De-assert active-low PLL reset. */
-+	regmap_update_bits(regmap, hd->mode_reg, PLL_RESET_N, PLL_RESET_N);
-+
-+	/* Wait for PLL to lock. */
-+	if (hd->status_reg) {
-+		do {
-+			regmap_read(regmap, hd->status_reg, &val);
-+		} while (!(val & BIT(hd->lock_bit)));
-+	} else {
-+		udelay(60);
-+	}
-+
-+	/* Enable PLL output. */
-+	regmap_update_bits(regmap, hd->mode_reg, PLL_OUTCTRL, PLL_OUTCTRL);
-+}
-+
-+/* Enable an already-configured HFPLL. */
-+static int clk_hfpll_enable(struct clk_hw *hw)
-+{
-+	unsigned long flags;
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	struct hfpll_data const *hd = h->d;
-+	struct regmap *regmap = h->clkr.regmap;
-+	u32 mode;
-+
-+	spin_lock_irqsave(&h->lock, flags);
-+	regmap_read(regmap, hd->mode_reg, &mode);
-+	if (!(mode & (PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL)))
-+		__clk_hfpll_enable(hw);
-+	spin_unlock_irqrestore(&h->lock, flags);
-+
-+	return 0;
-+}
-+
-+static void __clk_hfpll_disable(struct clk_hfpll *h)
-+{
-+	struct hfpll_data const *hd = h->d;
-+	struct regmap *regmap = h->clkr.regmap;
-+
-+	/*
-+	 * Disable the PLL output, disable test mode, enable the bypass mode,
-+	 * and assert the reset.
-+	 */
-+	regmap_update_bits(regmap, hd->mode_reg,
-+			PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL, 0);
-+}
-+
-+static void clk_hfpll_disable(struct clk_hw *hw)
-+{
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	unsigned long flags;
-+
-+	spin_lock_irqsave(&h->lock, flags);
-+	__clk_hfpll_disable(h);
-+	spin_unlock_irqrestore(&h->lock, flags);
-+}
-+
-+static long clk_hfpll_round_rate(struct clk_hw *hw, unsigned long rate,
-+				 unsigned long *parent_rate)
-+{
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	struct hfpll_data const *hd = h->d;
-+	unsigned long rrate;
-+
-+	rate = clamp(rate, hd->min_rate, hd->max_rate);
-+
-+	rrate = DIV_ROUND_UP(rate, *parent_rate) * *parent_rate;
-+	if (rrate > hd->max_rate)
-+		rrate -= *parent_rate;
-+
-+	return rrate;
-+}
-+
-+/*
-+ * For optimization reasons, assumes no downstream clocks are actively using
-+ * it.
-+ */
-+static int clk_hfpll_set_rate(struct clk_hw *hw, unsigned long rate,
-+			      unsigned long parent_rate)
-+{
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	struct hfpll_data const *hd = h->d;
-+	struct regmap *regmap = h->clkr.regmap;
-+	unsigned long flags;
-+	u32 l_val, val;
-+	bool enabled;
-+
-+	l_val = rate / parent_rate;
-+
-+	spin_lock_irqsave(&h->lock, flags);
-+
-+	enabled = __clk_is_enabled(hw->clk);
-+	if (enabled)
-+		__clk_hfpll_disable(h);
-+
-+	/* Pick the right VCO. */
-+	if (hd->user_reg && hd->user_vco_mask) {
-+		regmap_read(regmap, hd->user_reg, &val);
-+		if (rate <= hd->low_vco_max_rate)
-+			val &= ~hd->user_vco_mask;
-+		else
-+			val |= hd->user_vco_mask;
-+		regmap_write(regmap, hd->user_reg, val);
-+	}
-+
-+	regmap_write(regmap, hd->l_reg, l_val);
-+
-+	if (enabled)
-+		__clk_hfpll_enable(hw);
-+
-+	spin_unlock_irqrestore(&h->lock, flags);
-+
-+	return 0;
-+}
-+
-+static unsigned long clk_hfpll_recalc_rate(struct clk_hw *hw,
-+					   unsigned long parent_rate)
-+{
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	struct hfpll_data const *hd = h->d;
-+	struct regmap *regmap = h->clkr.regmap;
-+	u32 l_val;
-+
-+	regmap_read(regmap, hd->l_reg, &l_val);
-+
-+	return l_val * parent_rate;
-+}
-+
-+static void clk_hfpll_init(struct clk_hw *hw)
-+{
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	struct hfpll_data const *hd = h->d;
-+	struct regmap *regmap = h->clkr.regmap;
-+	u32 mode, status;
-+
-+	regmap_read(regmap, hd->mode_reg, &mode);
-+	if (mode != (PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL)) {
-+		__clk_hfpll_init_once(hw);
-+		return;
-+	}
-+
-+	if (hd->status_reg) {
-+		regmap_read(regmap, hd->status_reg, &status);
-+		if (!(status & BIT(hd->lock_bit))) {
-+			WARN(1, "HFPLL %s is ON, but not locked!\n",
-+					__clk_get_name(hw->clk));
-+			clk_hfpll_disable(hw);
-+			__clk_hfpll_init_once(hw);
-+		}
-+	}
-+}
-+
-+static int hfpll_is_enabled(struct clk_hw *hw)
-+{
-+	struct clk_hfpll *h = to_clk_hfpll(hw);
-+	struct hfpll_data const *hd = h->d;
-+	struct regmap *regmap = h->clkr.regmap;
-+	u32 mode;
-+
-+	regmap_read(regmap, hd->mode_reg, &mode);
-+	mode &= 0x7;
-+	return mode == (PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL);
-+}
-+
-+const struct clk_ops clk_ops_hfpll = {
-+	.enable = clk_hfpll_enable,
-+	.disable = clk_hfpll_disable,
-+	.is_enabled = hfpll_is_enabled,
-+	.round_rate = clk_hfpll_round_rate,
-+	.set_rate = clk_hfpll_set_rate,
-+	.recalc_rate = clk_hfpll_recalc_rate,
-+	.init = clk_hfpll_init,
-+};
-+EXPORT_SYMBOL_GPL(clk_ops_hfpll);
---- /dev/null
-+++ b/drivers/clk/qcom/clk-hfpll.h
-@@ -0,0 +1,54 @@
-+/*
-+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+#ifndef __QCOM_CLK_HFPLL_H__
-+#define __QCOM_CLK_HFPLL_H__
-+
-+#include <linux/clk-provider.h>
-+#include <linux/spinlock.h>
-+#include "clk-regmap.h"
-+
-+struct hfpll_data {
-+	u32 mode_reg;
-+	u32 l_reg;
-+	u32 m_reg;
-+	u32 n_reg;
-+	u32 user_reg;
-+	u32 droop_reg;
-+	u32 config_reg;
-+	u32 status_reg;
-+	u8  lock_bit;
-+
-+	u32 droop_val;
-+	u32 config_val;
-+	u32 user_val;
-+	u32 user_vco_mask;
-+	unsigned long low_vco_max_rate;
-+
-+	unsigned long min_rate;
-+	unsigned long max_rate;
-+};
-+
-+struct clk_hfpll {
-+	struct hfpll_data const *d;
-+	int init_done;
-+
-+	struct clk_regmap clkr;
-+	spinlock_t lock;
-+};
-+
-+#define to_clk_hfpll(_hw) \
-+	container_of(to_clk_regmap(_hw), struct clk_hfpll, clkr)
-+
-+extern const struct clk_ops clk_ops_hfpll;
-+
-+#endif
diff --git a/target/linux/ipq806x/patches-4.0/138-clk-qcom-Add-HFPLL-driver.patch b/target/linux/ipq806x/patches-4.0/138-clk-qcom-Add-HFPLL-driver.patch
deleted file mode 100644
index b1f870a..0000000
--- a/target/linux/ipq806x/patches-4.0/138-clk-qcom-Add-HFPLL-driver.patch
+++ /dev/null
@@ -1,206 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,06/13] clk: qcom: Add HFPLL driver
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063231
-Message-Id: <1426920332-9340-7-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>, <devicetree at vger.kernel.org>
-Date: Fri, 20 Mar 2015 23:45:25 -0700
-
-On some devices (MSM8974 for example), the HFPLLs are
-instantiated within the Krait processor subsystem as separate
-register regions. Add a driver for these PLLs so that we can
-provide HFPLL clocks for use by the system.
-
-Cc: <devicetree at vger.kernel.org>
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-.../devicetree/bindings/clock/qcom,hfpll.txt       |  40 ++++++++
- drivers/clk/qcom/Kconfig                           |   8 ++
- drivers/clk/qcom/Makefile                          |   1 +
- drivers/clk/qcom/hfpll.c                           | 109 +++++++++++++++++++++
- 4 files changed, 158 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/clock/qcom,hfpll.txt
- create mode 100644 drivers/clk/qcom/hfpll.c
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/clock/qcom,hfpll.txt
-@@ -0,0 +1,40 @@
-+High-Frequency PLL (HFPLL)
-+
-+PROPERTIES
-+
-+- compatible:
-+	Usage: required
-+	Value type: <string>
-+	Definition: must be "qcom,hfpll"
-+
-+- reg:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: address and size of HPLL registers. An optional second
-+		    element specifies the address and size of the alias
-+		    register region.
-+
-+- clock-output-names:
-+	Usage: required
-+	Value type: <string>
-+	Definition: Name of the PLL. Typically hfpllX where X is a CPU number
-+		    starting at 0. Otherwise hfpll_Y where Y is more specific
-+		    such as "l2".
-+
-+Example:
-+
-+1) An HFPLL for the L2 cache.
-+
-+	clock-controller at f9016000 {
-+		compatible = "qcom,hfpll";
-+		reg = <0xf9016000 0x30>;
-+		clock-output-names = "hfpll_l2";
-+	};
-+
-+2) An HFPLL for CPU0. This HFPLL has the alias register region.
-+
-+	clock-controller at f908a000 {
-+		compatible = "qcom,hfpll";
-+		reg = <0xf908a000 0x30>, <0xf900a000 0x30>;
-+		clock-output-names = "hfpll0";
-+	};
---- a/drivers/clk/qcom/Kconfig
-+++ b/drivers/clk/qcom/Kconfig
-@@ -88,3 +88,11 @@ config MSM_MMCC_8974
- 	  Support for the multimedia clock controller on msm8974 devices.
- 	  Say Y if you want to support multimedia devices such as display,
- 	  graphics, video encode/decode, camera, etc.
-+
-+config QCOM_HFPLL
-+	tristate "High-Frequency PLL (HFPLL) Clock Controller"
-+	depends on COMMON_CLK_QCOM
-+	help
-+	  Support for the high-frequency PLLs present on Qualcomm devices.
-+	  Say Y if you want to support CPU frequency scaling on devices
-+	  such as MSM8974, APQ8084, etc.
---- a/drivers/clk/qcom/Makefile
-+++ b/drivers/clk/qcom/Makefile
-@@ -21,3 +21,4 @@ obj-$(CONFIG_MSM_LCC_8960) += lcc-msm896
- obj-$(CONFIG_MSM_GCC_8974) += gcc-msm8974.o
- obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
- obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
-+obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
---- /dev/null
-+++ b/drivers/clk/qcom/hfpll.c
-@@ -0,0 +1,109 @@
-+/*
-+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/of.h>
-+#include <linux/clk.h>
-+#include <linux/clk-provider.h>
-+#include <linux/regmap.h>
-+
-+#include "clk-regmap.h"
-+#include "clk-hfpll.h"
-+
-+static const struct hfpll_data hdata = {
-+	.mode_reg = 0x00,
-+	.l_reg = 0x04,
-+	.m_reg = 0x08,
-+	.n_reg = 0x0c,
-+	.user_reg = 0x10,
-+	.config_reg = 0x14,
-+	.config_val = 0x430405d,
-+	.status_reg = 0x1c,
-+	.lock_bit = 16,
-+
-+	.user_val = 0x8,
-+	.user_vco_mask = 0x100000,
-+	.low_vco_max_rate = 1248000000,
-+	.min_rate = 537600000UL,
-+	.max_rate = 2900000000UL,
-+};
-+
-+static const struct of_device_id qcom_hfpll_match_table[] = {
-+	{ .compatible = "qcom,hfpll" },
-+	{ }
-+};
-+MODULE_DEVICE_TABLE(of, qcom_hfpll_match_table);
-+
-+static const struct regmap_config hfpll_regmap_config = {
-+	.reg_bits	= 32,
-+	.reg_stride	= 4,
-+	.val_bits	= 32,
-+	.max_register	= 0x30,
-+	.fast_io	= true,
-+};
-+
-+static int qcom_hfpll_probe(struct platform_device *pdev)
-+{
-+	struct clk *clk;
-+	struct resource *res;
-+	struct device *dev = &pdev->dev;
-+	void __iomem *base;
-+	struct regmap *regmap;
-+	struct clk_hfpll *h;
-+	struct clk_init_data init = {
-+		.parent_names = (const char *[]){ "xo" },
-+		.num_parents = 1,
-+		.ops = &clk_ops_hfpll,
-+	};
-+
-+	h = devm_kzalloc(dev, sizeof(*h), GFP_KERNEL);
-+	if (!h)
-+		return -ENOMEM;
-+
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	base = devm_ioremap_resource(dev, res);
-+	if (IS_ERR(base))
-+		return PTR_ERR(base);
-+
-+	regmap = devm_regmap_init_mmio(&pdev->dev, base, &hfpll_regmap_config);
-+	if (IS_ERR(regmap))
-+		return PTR_ERR(regmap);
-+
-+	if (of_property_read_string_index(dev->of_node, "clock-output-names",
-+						  0, &init.name))
-+		return -ENODEV;
-+
-+	h->d = &hdata;
-+	h->clkr.hw.init = &init;
-+	spin_lock_init(&h->lock);
-+
-+	clk = devm_clk_register_regmap(&pdev->dev, &h->clkr);
-+
-+	return PTR_ERR_OR_ZERO(clk);
-+}
-+
-+static struct platform_driver qcom_hfpll_driver = {
-+	.probe		= qcom_hfpll_probe,
-+	.driver		= {
-+		.name	= "qcom-hfpll",
-+		.of_match_table = qcom_hfpll_match_table,
-+	},
-+};
-+module_platform_driver(qcom_hfpll_driver);
-+
-+MODULE_DESCRIPTION("QCOM HFPLL Clock Driver");
-+MODULE_LICENSE("GPL v2");
-+MODULE_ALIAS("platform:qcom-hfpll");
diff --git a/target/linux/ipq806x/patches-4.0/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch b/target/linux/ipq806x/patches-4.0/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
deleted file mode 100644
index d341006..0000000
--- a/target/linux/ipq806x/patches-4.0/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,08/13] clk: qcom: Add IPQ806X's HFPLLs
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063241
-Message-Id: <1426920332-9340-9-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>
-Date: Fri, 20 Mar 2015 23:45:27 -0700
-
-Describe the HFPLLs present on IPQ806X devices.
-
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-drivers/clk/qcom/gcc-ipq806x.c | 83 ++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 83 insertions(+)
-
---- a/drivers/clk/qcom/gcc-ipq806x.c
-+++ b/drivers/clk/qcom/gcc-ipq806x.c
-@@ -30,6 +30,7 @@
- #include "clk-pll.h"
- #include "clk-rcg.h"
- #include "clk-branch.h"
-+#include "clk-hfpll.h"
- #include "reset.h"
- 
- static struct clk_pll pll0 = {
-@@ -113,6 +114,85 @@ static struct clk_regmap pll8_vote = {
- 	},
- };
- 
-+static struct hfpll_data hfpll0_data = {
-+	.mode_reg = 0x3200,
-+	.l_reg = 0x3208,
-+	.m_reg = 0x320c,
-+	.n_reg = 0x3210,
-+	.config_reg = 0x3204,
-+	.status_reg = 0x321c,
-+	.config_val = 0x7845c665,
-+	.droop_reg = 0x3214,
-+	.droop_val = 0x0108c000,
-+	.min_rate = 600000000UL,
-+	.max_rate = 1800000000UL,
-+};
-+
-+static struct clk_hfpll hfpll0 = {
-+	.d = &hfpll0_data,
-+	.clkr.hw.init = &(struct clk_init_data){
-+		.parent_names = (const char *[]){ "pxo" },
-+		.num_parents = 1,
-+		.name = "hfpll0",
-+		.ops = &clk_ops_hfpll,
-+		.flags = CLK_IGNORE_UNUSED,
-+	},
-+	.lock = __SPIN_LOCK_UNLOCKED(hfpll0.lock),
-+};
-+
-+static struct hfpll_data hfpll1_data = {
-+	.mode_reg = 0x3240,
-+	.l_reg = 0x3248,
-+	.m_reg = 0x324c,
-+	.n_reg = 0x3250,
-+	.config_reg = 0x3244,
-+	.status_reg = 0x325c,
-+	.config_val = 0x7845c665,
-+	.droop_reg = 0x3314,
-+	.droop_val = 0x0108c000,
-+	.min_rate = 600000000UL,
-+	.max_rate = 1800000000UL,
-+};
-+
-+static struct clk_hfpll hfpll1 = {
-+	.d = &hfpll1_data,
-+	.clkr.hw.init = &(struct clk_init_data){
-+		.parent_names = (const char *[]){ "pxo" },
-+		.num_parents = 1,
-+		.name = "hfpll1",
-+		.ops = &clk_ops_hfpll,
-+		.flags = CLK_IGNORE_UNUSED,
-+	},
-+	.lock = __SPIN_LOCK_UNLOCKED(hfpll1.lock),
-+};
-+
-+static struct hfpll_data hfpll_l2_data = {
-+	.mode_reg = 0x3300,
-+	.l_reg = 0x3308,
-+	.m_reg = 0x330c,
-+	.n_reg = 0x3310,
-+	.config_reg = 0x3304,
-+	.status_reg = 0x331c,
-+	.config_val = 0x7845c665,
-+	.droop_reg = 0x3314,
-+	.droop_val = 0x0108c000,
-+	.min_rate = 600000000UL,
-+	.max_rate = 1800000000UL,
-+};
-+
-+static struct clk_hfpll hfpll_l2 = {
-+	.d = &hfpll_l2_data,
-+	.clkr.hw.init = &(struct clk_init_data){
-+		.parent_names = (const char *[]){ "pxo" },
-+		.num_parents = 1,
-+		.name = "hfpll_l2",
-+		.ops = &clk_ops_hfpll,
-+		.flags = CLK_IGNORE_UNUSED,
-+	},
-+	.lock = __SPIN_LOCK_UNLOCKED(hfpll_l2.lock),
-+};
-+
-+
- static struct clk_pll pll14 = {
- 	.l_reg = 0x31c4,
- 	.m_reg = 0x31c8,
-@@ -2273,6 +2353,9 @@ static struct clk_regmap *gcc_ipq806x_cl
- 	[USB_FS1_XCVR_SRC] = &usb_fs1_xcvr_clk_src.clkr,
- 	[USB_FS1_XCVR_CLK] = &usb_fs1_xcvr_clk.clkr,
- 	[USB_FS1_SYSTEM_CLK] = &usb_fs1_sys_clk.clkr,
-+	[PLL9] = &hfpll0.clkr,
-+	[PLL10] = &hfpll1.clkr,
-+	[PLL12] = &hfpll_l2.clkr,
- };
- 
- static const struct qcom_reset_map gcc_ipq806x_resets[] = {
diff --git a/target/linux/ipq806x/patches-4.0/140-clk-qcom-Add-support-for-Krait-clocks.patch b/target/linux/ipq806x/patches-4.0/140-clk-qcom-Add-support-for-Krait-clocks.patch
deleted file mode 100644
index cef33c8..0000000
--- a/target/linux/ipq806x/patches-4.0/140-clk-qcom-Add-support-for-Krait-clocks.patch
+++ /dev/null
@@ -1,271 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,09/13] clk: qcom: Add support for Krait clocks
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063251
-Message-Id: <1426920332-9340-10-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>
-Date: Fri, 20 Mar 2015 23:45:28 -0700
-
-The Krait clocks are made up of a series of muxes and a divider
-that choose between a fixed rate clock and dedicated HFPLLs for
-each CPU. Instead of using mmio accesses to remux parents, the
-Krait implementation exposes the remux control via cp15
-registers. Support these clocks.
-
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-drivers/clk/qcom/Kconfig     |   4 ++
- drivers/clk/qcom/Makefile    |   1 +
- drivers/clk/qcom/clk-krait.c | 166 +++++++++++++++++++++++++++++++++++++++++++
- drivers/clk/qcom/clk-krait.h |  49 +++++++++++++
- 4 files changed, 220 insertions(+)
- create mode 100644 drivers/clk/qcom/clk-krait.c
- create mode 100644 drivers/clk/qcom/clk-krait.h
-
---- a/drivers/clk/qcom/Kconfig
-+++ b/drivers/clk/qcom/Kconfig
-@@ -96,3 +96,7 @@ config QCOM_HFPLL
- 	  Support for the high-frequency PLLs present on Qualcomm devices.
- 	  Say Y if you want to support CPU frequency scaling on devices
- 	  such as MSM8974, APQ8084, etc.
-+
-+config KRAIT_CLOCKS
-+	bool
-+	select KRAIT_L2_ACCESSORS
---- a/drivers/clk/qcom/Makefile
-+++ b/drivers/clk/qcom/Makefile
-@@ -8,6 +8,7 @@ clk-qcom-y += clk-rcg2.o
- clk-qcom-y += clk-branch.o
- clk-qcom-y += clk-regmap-divider.o
- clk-qcom-y += clk-regmap-mux.o
-+clk-qcom-$(CONFIG_KRAIT_CLOCKS) += clk-krait.o
- clk-qcom-y += clk-hfpll.o
- clk-qcom-y += reset.o
- 
---- /dev/null
-+++ b/drivers/clk/qcom/clk-krait.c
-@@ -0,0 +1,166 @@
-+/*
-+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/io.h>
-+#include <linux/delay.h>
-+#include <linux/err.h>
-+#include <linux/clk-provider.h>
-+#include <linux/spinlock.h>
-+
-+#include <asm/krait-l2-accessors.h>
-+
-+#include "clk-krait.h"
-+
-+/* Secondary and primary muxes share the same cp15 register */
-+static DEFINE_SPINLOCK(krait_clock_reg_lock);
-+
-+#define LPL_SHIFT	8
-+static void __krait_mux_set_sel(struct krait_mux_clk *mux, int sel)
-+{
-+	unsigned long flags;
-+	u32 regval;
-+
-+	spin_lock_irqsave(&krait_clock_reg_lock, flags);
-+	regval = krait_get_l2_indirect_reg(mux->offset);
-+	regval &= ~(mux->mask << mux->shift);
-+	regval |= (sel & mux->mask) << mux->shift;
-+	if (mux->lpl) {
-+		regval &= ~(mux->mask << (mux->shift + LPL_SHIFT));
-+		regval |= (sel & mux->mask) << (mux->shift + LPL_SHIFT);
-+	}
-+	krait_set_l2_indirect_reg(mux->offset, regval);
-+	spin_unlock_irqrestore(&krait_clock_reg_lock, flags);
-+
-+	/* Wait for switch to complete. */
-+	mb();
-+	udelay(1);
-+}
-+
-+static int krait_mux_set_parent(struct clk_hw *hw, u8 index)
-+{
-+	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
-+	u32 sel;
-+
-+	sel = clk_mux_reindex(index, mux->parent_map, 0);
-+	mux->en_mask = sel;
-+	/* Don't touch mux if CPU is off as it won't work */
-+	if (__clk_is_enabled(hw->clk))
-+		__krait_mux_set_sel(mux, sel);
-+	return 0;
-+}
-+
-+static u8 krait_mux_get_parent(struct clk_hw *hw)
-+{
-+	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
-+	u32 sel;
-+
-+	sel = krait_get_l2_indirect_reg(mux->offset);
-+	sel >>= mux->shift;
-+	sel &= mux->mask;
-+	mux->en_mask = sel;
-+
-+	return clk_mux_get_parent(hw, sel, mux->parent_map, 0);
-+}
-+
-+static struct clk_hw *krait_mux_get_safe_parent(struct clk_hw *hw)
-+{
-+	int i;
-+	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
-+	int num_parents = __clk_get_num_parents(hw->clk);
-+
-+	i = mux->safe_sel;
-+	for (i = 0; i < num_parents; i++)
-+		if (mux->safe_sel == mux->parent_map[i])
-+			break;
-+
-+	return __clk_get_hw(clk_get_parent_by_index(hw->clk, i));
-+}
-+
-+static int krait_mux_enable(struct clk_hw *hw)
-+{
-+	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
-+
-+	__krait_mux_set_sel(mux, mux->en_mask);
-+
-+	return 0;
-+}
-+
-+static void krait_mux_disable(struct clk_hw *hw)
-+{
-+	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
-+
-+	__krait_mux_set_sel(mux, mux->safe_sel);
-+}
-+
-+const struct clk_ops krait_mux_clk_ops = {
-+	.enable = krait_mux_enable,
-+	.disable = krait_mux_disable,
-+	.set_parent = krait_mux_set_parent,
-+	.get_parent = krait_mux_get_parent,
-+	.determine_rate = __clk_mux_determine_rate_closest,
-+	.get_safe_parent = krait_mux_get_safe_parent,
-+};
-+EXPORT_SYMBOL_GPL(krait_mux_clk_ops);
-+
-+/* The divider can divide by 2, 4, 6 and 8. But we only really need div-2. */
-+static long krait_div2_round_rate(struct clk_hw *hw, unsigned long rate,
-+				  unsigned long *parent_rate)
-+{
-+	*parent_rate = __clk_round_rate(__clk_get_parent(hw->clk), rate * 2);
-+	return DIV_ROUND_UP(*parent_rate, 2);
-+}
-+
-+static int krait_div2_set_rate(struct clk_hw *hw, unsigned long rate,
-+			unsigned long parent_rate)
-+{
-+	struct krait_div2_clk *d = to_krait_div2_clk(hw);
-+	unsigned long flags;
-+	u32 val;
-+	u32 mask = BIT(d->width) - 1;
-+
-+	if (d->lpl)
-+		mask = mask << (d->shift + LPL_SHIFT) | mask << d->shift;
-+
-+	spin_lock_irqsave(&krait_clock_reg_lock, flags);
-+	val = krait_get_l2_indirect_reg(d->offset);
-+	val &= ~mask;
-+	krait_set_l2_indirect_reg(d->offset, val);
-+	spin_unlock_irqrestore(&krait_clock_reg_lock, flags);
-+
-+	return 0;
-+}
-+
-+static unsigned long
-+krait_div2_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
-+{
-+	struct krait_div2_clk *d = to_krait_div2_clk(hw);
-+	u32 mask = BIT(d->width) - 1;
-+	u32 div;
-+
-+	div = krait_get_l2_indirect_reg(d->offset);
-+	div >>= d->shift;
-+	div &= mask;
-+	div = (div + 1) * 2;
-+
-+	return DIV_ROUND_UP(parent_rate, div);
-+}
-+
-+const struct clk_ops krait_div2_clk_ops = {
-+	.round_rate = krait_div2_round_rate,
-+	.set_rate = krait_div2_set_rate,
-+	.recalc_rate = krait_div2_recalc_rate,
-+};
-+EXPORT_SYMBOL_GPL(krait_div2_clk_ops);
---- /dev/null
-+++ b/drivers/clk/qcom/clk-krait.h
-@@ -0,0 +1,49 @@
-+/*
-+ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#ifndef __QCOM_CLK_KRAIT_H
-+#define __QCOM_CLK_KRAIT_H
-+
-+#include <linux/clk-provider.h>
-+
-+struct krait_mux_clk {
-+	unsigned int	*parent_map;
-+	bool		has_safe_parent;
-+	u8		safe_sel;
-+	u32		offset;
-+	u32		mask;
-+	u32		shift;
-+	u32		en_mask;
-+	bool		lpl;
-+
-+	struct clk_hw	hw;
-+};
-+
-+#define to_krait_mux_clk(_hw) container_of(_hw, struct krait_mux_clk, hw)
-+
-+extern const struct clk_ops krait_mux_clk_ops;
-+
-+struct krait_div2_clk {
-+	u32		offset;
-+	u8		width;
-+	u32		shift;
-+	bool		lpl;
-+
-+	struct clk_hw	hw;
-+};
-+
-+#define to_krait_div2_clk(_hw) container_of(_hw, struct krait_div2_clk, hw)
-+
-+extern const struct clk_ops krait_div2_clk_ops;
-+
-+#endif
diff --git a/target/linux/ipq806x/patches-4.0/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch b/target/linux/ipq806x/patches-4.0/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
deleted file mode 100644
index 12f24b7..0000000
--- a/target/linux/ipq806x/patches-4.0/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,10/13] clk: qcom: Add KPSS ACC/GCC driver
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063201
-Message-Id: <1426920332-9340-11-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>, <devicetree at vger.kernel.org>
-Date: Fri, 20 Mar 2015 23:45:29 -0700
-
-The ACC and GCC regions present in KPSSv1 contain registers to
-control clocks and power to each Krait CPU and L2. For CPUfreq
-purposes probe these devices and expose a mux clock that chooses
-between PXO and PLL8.
-
-Cc: <devicetree at vger.kernel.org>
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-.../devicetree/bindings/arm/msm/qcom,kpss-acc.txt  |  7 ++
- .../devicetree/bindings/arm/msm/qcom,kpss-gcc.txt  | 28 +++++++
- drivers/clk/qcom/Kconfig                           |  8 ++
- drivers/clk/qcom/Makefile                          |  1 +
- drivers/clk/qcom/kpss-xcc.c                        | 95 ++++++++++++++++++++++
- 5 files changed, 139 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
- create mode 100644 drivers/clk/qcom/kpss-xcc.c
-
---- a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
-+++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
-@@ -21,10 +21,17 @@ PROPERTIES
- 		    the register region. An optional second element specifies
- 		    the base address and size of the alias register region.
- 
-+- clock-output-names:
-+	Usage: optional
-+	Value type: <string>
-+	Definition: Name of the output clock. Typically acpuX_aux where X is a
-+		    CPU number starting at 0.
-+
- Example:
- 
- 	clock-controller at 2088000 {
- 		compatible = "qcom,kpss-acc-v2";
- 		reg = <0x02088000 0x1000>,
- 		      <0x02008000 0x1000>;
-+		clock-output-names = "acpu0_aux";
- 	};
---- /dev/null
-+++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
-@@ -0,0 +1,28 @@
-+Krait Processor Sub-system (KPSS) Global Clock Controller (GCC)
-+
-+PROPERTIES
-+
-+- compatible:
-+	Usage: required
-+	Value type: <string>
-+	Definition: should be one of:
-+			"qcom,kpss-gcc"
-+
-+- reg:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: base address and size of the register region
-+
-+- clock-output-names:
-+	Usage: required
-+	Value type: <string>
-+	Definition: Name of the output clock. Typically acpu_l2_aux indicating
-+		    an L2 cache auxiliary clock.
-+
-+Example:
-+
-+	l2cc: clock-controller at 2011000 {
-+		compatible = "qcom,kpss-gcc";
-+		reg = <0x2011000 0x1000>;
-+		clock-output-names = "acpu_l2_aux";
-+	};
---- a/drivers/clk/qcom/Kconfig
-+++ b/drivers/clk/qcom/Kconfig
-@@ -97,6 +97,14 @@ config QCOM_HFPLL
- 	  Say Y if you want to support CPU frequency scaling on devices
- 	  such as MSM8974, APQ8084, etc.
- 
-+config KPSS_XCC
-+	tristate "KPSS Clock Controller"
-+	depends on COMMON_CLK_QCOM
-+	help
-+	  Support for the Krait ACC and GCC clock controllers. Say Y
-+	  if you want to support CPU frequency scaling on devices such
-+	  as MSM8960, APQ8064, etc.
-+
- config KRAIT_CLOCKS
- 	bool
- 	select KRAIT_L2_ACCESSORS
---- a/drivers/clk/qcom/Makefile
-+++ b/drivers/clk/qcom/Makefile
-@@ -22,4 +22,5 @@ obj-$(CONFIG_MSM_LCC_8960) += lcc-msm896
- obj-$(CONFIG_MSM_GCC_8974) += gcc-msm8974.o
- obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
- obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
-+obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o
- obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
---- /dev/null
-+++ b/drivers/clk/qcom/kpss-xcc.c
-@@ -0,0 +1,95 @@
-+/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/err.h>
-+#include <linux/io.h>
-+#include <linux/of.h>
-+#include <linux/of_device.h>
-+#include <linux/clk.h>
-+#include <linux/clk-provider.h>
-+
-+static const char *aux_parents[] = {
-+	"pll8_vote",
-+	"pxo",
-+};
-+
-+static unsigned int aux_parent_map[] = {
-+	3,
-+	0,
-+};
-+
-+static const struct of_device_id kpss_xcc_match_table[] = {
-+	{ .compatible = "qcom,kpss-acc-v1", .data = (void *)1UL },
-+	{ .compatible = "qcom,kpss-gcc" },
-+	{}
-+};
-+MODULE_DEVICE_TABLE(of, kpss_xcc_match_table);
-+
-+static int kpss_xcc_driver_probe(struct platform_device *pdev)
-+{
-+	const struct of_device_id *id;
-+	struct clk *clk;
-+	struct resource *res;
-+	void __iomem *base;
-+	const char *name;
-+
-+	id = of_match_device(kpss_xcc_match_table, &pdev->dev);
-+	if (!id)
-+		return -ENODEV;
-+
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	base = devm_ioremap_resource(&pdev->dev, res);
-+	if (IS_ERR(base))
-+		return PTR_ERR(base);
-+
-+	if (id->data) {
-+		if (of_property_read_string_index(pdev->dev.of_node,
-+					"clock-output-names", 0, &name))
-+			return -ENODEV;
-+		base += 0x14;
-+	} else {
-+		name = "acpu_l2_aux";
-+		base += 0x28;
-+	}
-+
-+	clk = clk_register_mux_table(&pdev->dev, name, aux_parents,
-+				     ARRAY_SIZE(aux_parents), 0, base, 0, 0x3,
-+				     0, aux_parent_map, NULL);
-+
-+	platform_set_drvdata(pdev, clk);
-+
-+	return PTR_ERR_OR_ZERO(clk);
-+}
-+
-+static int kpss_xcc_driver_remove(struct platform_device *pdev)
-+{
-+	clk_unregister_mux(platform_get_drvdata(pdev));
-+	return 0;
-+}
-+
-+static struct platform_driver kpss_xcc_driver = {
-+	.probe = kpss_xcc_driver_probe,
-+	.remove = kpss_xcc_driver_remove,
-+	.driver = {
-+		.name = "kpss-xcc",
-+		.of_match_table = kpss_xcc_match_table,
-+	},
-+};
-+module_platform_driver(kpss_xcc_driver);
-+
-+MODULE_DESCRIPTION("Krait Processor Sub System (KPSS) Clock Driver");
-+MODULE_LICENSE("GPL v2");
-+MODULE_ALIAS("platform:kpss-xcc");
diff --git a/target/linux/ipq806x/patches-4.0/142-clk-qcom-Add-Krait-clock-controller-driver.patch b/target/linux/ipq806x/patches-4.0/142-clk-qcom-Add-Krait-clock-controller-driver.patch
deleted file mode 100644
index 159facd..0000000
--- a/target/linux/ipq806x/patches-4.0/142-clk-qcom-Add-Krait-clock-controller-driver.patch
+++ /dev/null
@@ -1,435 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,11/13] clk: qcom: Add Krait clock controller driver
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063121
-Message-Id: <1426920332-9340-12-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>, <devicetree at vger.kernel.org>
-Date: Fri, 20 Mar 2015 23:45:30 -0700
-
-The Krait CPU clocks are made up of a primary mux and secondary
-mux for each CPU and the L2, controlled via cp15 accessors. For
-Kraits within KPSSv1 each secondary mux accepts a different aux
-source, but on KPSSv2 each secondary mux accepts the same aux
-source.
-
-Cc: <devicetree at vger.kernel.org>
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-.../devicetree/bindings/clock/qcom,krait-cc.txt    |  22 ++
- drivers/clk/qcom/Kconfig                           |   8 +
- drivers/clk/qcom/Makefile                          |   1 +
- drivers/clk/qcom/krait-cc.c                        | 352 +++++++++++++++++++++
- 4 files changed, 383 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
- create mode 100644 drivers/clk/qcom/krait-cc.c
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
-@@ -0,0 +1,22 @@
-+Krait Clock Controller
-+
-+PROPERTIES
-+
-+- compatible:
-+	Usage: required
-+	Value type: <string>
-+	Definition: must be one of:
-+			"qcom,krait-cc-v1"
-+			"qcom,krait-cc-v2"
-+
-+- #clock-cells:
-+	Usage: required
-+	Value type: <u32>
-+	Definition: must be 1
-+
-+Example:
-+
-+	kraitcc: clock-controller {
-+		compatible = "qcom,krait-cc-v1";
-+		#clock-cells = <1>;
-+	};
---- a/drivers/clk/qcom/Kconfig
-+++ b/drivers/clk/qcom/Kconfig
-@@ -105,6 +105,14 @@ config KPSS_XCC
- 	  if you want to support CPU frequency scaling on devices such
- 	  as MSM8960, APQ8064, etc.
- 
-+config KRAITCC
-+	tristate "Krait Clock Controller"
-+	depends on COMMON_CLK_QCOM && ARM
-+	select KRAIT_CLOCKS
-+	help
-+	  Support for the Krait CPU clocks on Qualcomm devices.
-+	  Say Y if you want to support CPU frequency scaling.
-+
- config KRAIT_CLOCKS
- 	bool
- 	select KRAIT_L2_ACCESSORS
---- a/drivers/clk/qcom/Makefile
-+++ b/drivers/clk/qcom/Makefile
-@@ -24,3 +24,4 @@ obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8
- obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
- obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o
- obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
-+obj-$(CONFIG_KRAITCC) += krait-cc.o
---- /dev/null
-+++ b/drivers/clk/qcom/krait-cc.c
-@@ -0,0 +1,352 @@
-+/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/err.h>
-+#include <linux/io.h>
-+#include <linux/of.h>
-+#include <linux/of_device.h>
-+#include <linux/clk.h>
-+#include <linux/clk-provider.h>
-+#include <linux/slab.h>
-+
-+#include "clk-krait.h"
-+
-+static unsigned int sec_mux_map[] = {
-+	2,
-+	0,
-+};
-+
-+static unsigned int pri_mux_map[] = {
-+	1,
-+	2,
-+	0,
-+};
-+
-+static int
-+krait_add_div(struct device *dev, int id, const char *s, unsigned offset)
-+{
-+	struct krait_div2_clk *div;
-+	struct clk_init_data init = {
-+		.num_parents = 1,
-+		.ops = &krait_div2_clk_ops,
-+		.flags = CLK_SET_RATE_PARENT,
-+	};
-+	const char *p_names[1];
-+	struct clk *clk;
-+
-+	div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL);
-+	if (!div)
-+		return -ENOMEM;
-+
-+	div->width = 2;
-+	div->shift = 6;
-+	div->lpl = id >= 0;
-+	div->offset = offset;
-+	div->hw.init = &init;
-+
-+	init.name = kasprintf(GFP_KERNEL, "hfpll%s_div", s);
-+	if (!init.name)
-+		return -ENOMEM;
-+
-+	init.parent_names = p_names;
-+	p_names[0] = kasprintf(GFP_KERNEL, "hfpll%s", s);
-+	if (!p_names[0]) {
-+		kfree(init.name);
-+		return -ENOMEM;
-+	}
-+
-+	clk = devm_clk_register(dev, &div->hw);
-+	kfree(p_names[0]);
-+	kfree(init.name);
-+
-+	return PTR_ERR_OR_ZERO(clk);
-+}
-+
-+static int
-+krait_add_sec_mux(struct device *dev, int id, const char *s, unsigned offset,
-+		  bool unique_aux)
-+{
-+	struct krait_mux_clk *mux;
-+	static const char *sec_mux_list[] = {
-+		"acpu_aux",
-+		"qsb",
-+	};
-+	struct clk_init_data init = {
-+		.parent_names = sec_mux_list,
-+		.num_parents = ARRAY_SIZE(sec_mux_list),
-+		.ops = &krait_mux_clk_ops,
-+		.flags = CLK_SET_RATE_PARENT,
-+	};
-+	struct clk *clk;
-+
-+	mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL);
-+	if (!mux)
-+		return -ENOMEM;
-+
-+	mux->offset = offset;
-+	mux->lpl = id >= 0;
-+	mux->has_safe_parent = true;
-+	mux->safe_sel = 2;
-+	mux->mask = 0x3;
-+	mux->shift = 2;
-+	mux->parent_map = sec_mux_map;
-+	mux->hw.init = &init;
-+
-+	init.name = kasprintf(GFP_KERNEL, "krait%s_sec_mux", s);
-+	if (!init.name)
-+		return -ENOMEM;
-+
-+	if (unique_aux) {
-+		sec_mux_list[0] = kasprintf(GFP_KERNEL, "acpu%s_aux", s);
-+		if (!sec_mux_list[0]) {
-+			clk = ERR_PTR(-ENOMEM);
-+			goto err_aux;
-+		}
-+	}
-+
-+	clk = devm_clk_register(dev, &mux->hw);
-+
-+	if (unique_aux)
-+		kfree(sec_mux_list[0]);
-+err_aux:
-+	kfree(init.name);
-+	return PTR_ERR_OR_ZERO(clk);
-+}
-+
-+static struct clk *
-+krait_add_pri_mux(struct device *dev, int id, const char *s, unsigned offset)
-+{
-+	struct krait_mux_clk *mux;
-+	const char *p_names[3];
-+	struct clk_init_data init = {
-+		.parent_names = p_names,
-+		.num_parents = ARRAY_SIZE(p_names),
-+		.ops = &krait_mux_clk_ops,
-+		.flags = CLK_SET_RATE_PARENT,
-+	};
-+	struct clk *clk;
-+
-+	mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL);
-+	if (!mux)
-+		return ERR_PTR(-ENOMEM);
-+
-+	mux->has_safe_parent = true;
-+	mux->safe_sel = 0;
-+	mux->mask = 0x3;
-+	mux->shift = 0;
-+	mux->offset = offset;
-+	mux->lpl = id >= 0;
-+	mux->parent_map = pri_mux_map;
-+	mux->hw.init = &init;
-+
-+	init.name = kasprintf(GFP_KERNEL, "krait%s_pri_mux", s);
-+	if (!init.name)
-+		return ERR_PTR(-ENOMEM);
-+
-+	p_names[0] = kasprintf(GFP_KERNEL, "hfpll%s", s);
-+	if (!p_names[0]) {
-+		clk = ERR_PTR(-ENOMEM);
-+		goto err_p0;
-+	}
-+
-+	p_names[1] = kasprintf(GFP_KERNEL, "hfpll%s_div", s);
-+	if (!p_names[1]) {
-+		clk = ERR_PTR(-ENOMEM);
-+		goto err_p1;
-+	}
-+
-+	p_names[2] = kasprintf(GFP_KERNEL, "krait%s_sec_mux", s);
-+	if (!p_names[2]) {
-+		clk = ERR_PTR(-ENOMEM);
-+		goto err_p2;
-+	}
-+
-+	clk = devm_clk_register(dev, &mux->hw);
-+
-+	kfree(p_names[2]);
-+err_p2:
-+	kfree(p_names[1]);
-+err_p1:
-+	kfree(p_names[0]);
-+err_p0:
-+	kfree(init.name);
-+	return clk;
-+}
-+
-+/* id < 0 for L2, otherwise id == physical CPU number */
-+static struct clk *krait_add_clks(struct device *dev, int id, bool unique_aux)
-+{
-+	int ret;
-+	unsigned offset;
-+	void *p = NULL;
-+	const char *s;
-+	struct clk *clk;
-+
-+	if (id >= 0) {
-+		offset = 0x4501 + (0x1000 * id);
-+		s = p = kasprintf(GFP_KERNEL, "%d", id);
-+		if (!s)
-+			return ERR_PTR(-ENOMEM);
-+	} else {
-+		offset = 0x500;
-+		s = "_l2";
-+	}
-+
-+	ret = krait_add_div(dev, id, s, offset);
-+	if (ret) {
-+		clk = ERR_PTR(ret);
-+		goto err;
-+	}
-+
-+	ret = krait_add_sec_mux(dev, id, s, offset, unique_aux);
-+	if (ret) {
-+		clk = ERR_PTR(ret);
-+		goto err;
-+	}
-+
-+	clk = krait_add_pri_mux(dev, id, s, offset);
-+err:
-+	kfree(p);
-+	return clk;
-+}
-+
-+static struct clk *krait_of_get(struct of_phandle_args *clkspec, void *data)
-+{
-+	unsigned int idx = clkspec->args[0];
-+	struct clk **clks = data;
-+
-+	if (idx >= 5) {
-+		pr_err("%s: invalid clock index %d\n", __func__, idx);
-+		return ERR_PTR(-EINVAL);
-+	}
-+
-+	return clks[idx] ? : ERR_PTR(-ENODEV);
-+}
-+
-+static const struct of_device_id krait_cc_match_table[] = {
-+	{ .compatible = "qcom,krait-cc-v1", (void *)1UL },
-+	{ .compatible = "qcom,krait-cc-v2" },
-+	{}
-+};
-+MODULE_DEVICE_TABLE(of, krait_cc_match_table);
-+
-+static int krait_cc_probe(struct platform_device *pdev)
-+{
-+	struct device *dev = &pdev->dev;
-+	const struct of_device_id *id;
-+	unsigned long cur_rate, aux_rate;
-+	int cpu;
-+	struct clk *clk;
-+	struct clk **clks;
-+	struct clk *l2_pri_mux_clk;
-+
-+	id = of_match_device(krait_cc_match_table, dev);
-+	if (!id)
-+		return -ENODEV;
-+
-+	/* Rate is 1 because 0 causes problems for __clk_mux_determine_rate */
-+	clk = clk_register_fixed_rate(dev, "qsb", NULL, CLK_IS_ROOT, 1);
-+	if (IS_ERR(clk))
-+		return PTR_ERR(clk);
-+
-+	if (!id->data) {
-+		clk = clk_register_fixed_factor(dev, "acpu_aux",
-+						"gpll0_vote", 0, 1, 2);
-+		if (IS_ERR(clk))
-+			return PTR_ERR(clk);
-+	}
-+
-+	/* Krait configurations have at most 4 CPUs and one L2 */
-+	clks = devm_kcalloc(dev, 5, sizeof(*clks), GFP_KERNEL);
-+	if (!clks)
-+		return -ENOMEM;
-+
-+	for_each_possible_cpu(cpu) {
-+		clk = krait_add_clks(dev, cpu, id->data);
-+		if (IS_ERR(clk))
-+			return PTR_ERR(clk);
-+		clks[cpu] = clk;
-+	}
-+
-+	l2_pri_mux_clk = krait_add_clks(dev, -1, id->data);
-+	if (IS_ERR(l2_pri_mux_clk))
-+		return PTR_ERR(l2_pri_mux_clk);
-+	clks[4] = l2_pri_mux_clk;
-+
-+	/*
-+	 * We don't want the CPU or L2 clocks to be turned off at late init
-+	 * if CPUFREQ or HOTPLUG configs are disabled. So, bump up the
-+	 * refcount of these clocks. Any cpufreq/hotplug manager can assume
-+	 * that the clocks have already been prepared and enabled by the time
-+	 * they take over.
-+	 */
-+	for_each_online_cpu(cpu) {
-+		clk_prepare_enable(l2_pri_mux_clk);
-+		WARN(clk_prepare_enable(clks[cpu]),
-+			"Unable to turn on CPU%d clock", cpu);
-+	}
-+
-+	/*
-+	 * Force reinit of HFPLLs and muxes to overwrite any potential
-+	 * incorrect configuration of HFPLLs and muxes by the bootloader.
-+	 * While at it, also make sure the cores are running at known rates
-+	 * and print the current rate.
-+	 *
-+	 * The clocks are set to aux clock rate first to make sure the
-+	 * secondary mux is not sourcing off of QSB. The rate is then set to
-+	 * two different rates to force a HFPLL reinit under all
-+	 * circumstances.
-+	 */
-+	cur_rate = clk_get_rate(l2_pri_mux_clk);
-+	aux_rate = 384000000;
-+	if (cur_rate == 1) {
-+		pr_info("L2 @ QSB rate. Forcing new rate.\n");
-+		cur_rate = aux_rate;
-+	}
-+	clk_set_rate(l2_pri_mux_clk, aux_rate);
-+	clk_set_rate(l2_pri_mux_clk, 2);
-+	clk_set_rate(l2_pri_mux_clk, cur_rate);
-+	pr_info("L2 @ %lu KHz\n", clk_get_rate(l2_pri_mux_clk) / 1000);
-+	for_each_possible_cpu(cpu) {
-+		clk = clks[cpu];
-+		cur_rate = clk_get_rate(clk);
-+		if (cur_rate == 1) {
-+			pr_info("CPU%d @ QSB rate. Forcing new rate.\n", cpu);
-+			cur_rate = aux_rate;
-+		}
-+		clk_set_rate(clk, aux_rate);
-+		clk_set_rate(clk, 2);
-+		clk_set_rate(clk, cur_rate);
-+		pr_info("CPU%d @ %lu KHz\n", cpu, clk_get_rate(clk) / 1000);
-+	}
-+
-+	of_clk_add_provider(dev->of_node, krait_of_get, clks);
-+
-+	return 0;
-+}
-+
-+static struct platform_driver krait_cc_driver = {
-+	.probe = krait_cc_probe,
-+	.driver = {
-+		.name = "krait-cc",
-+		.of_match_table = krait_cc_match_table,
-+	},
-+};
-+module_platform_driver(krait_cc_driver);
-+
-+MODULE_DESCRIPTION("Krait CPU Clock Driver");
-+MODULE_LICENSE("GPL v2");
-+MODULE_ALIAS("platform:krait-cc");
diff --git a/target/linux/ipq806x/patches-4.0/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch b/target/linux/ipq806x/patches-4.0/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
deleted file mode 100644
index 57d4afe..0000000
--- a/target/linux/ipq806x/patches-4.0/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
+++ /dev/null
@@ -1,304 +0,0 @@
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [v3,12/13] cpufreq: Add module to register cpufreq on Krait CPUs
-From: Stephen Boyd <sboyd at codeaurora.org>
-X-Patchwork-Id: 6063191
-Message-Id: <1426920332-9340-13-git-send-email-sboyd at codeaurora.org>
-To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
-Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
-	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
-	Viresh Kumar <viresh.kumar at linaro.org>, <devicetree at vger.kernel.org>
-Date: Fri, 20 Mar 2015 23:45:31 -0700
-
-Register a cpufreq-generic device whenever we detect that a
-"qcom,krait" compatible CPU is present in DT.
-
-Cc: <devicetree at vger.kernel.org>
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
-.../devicetree/bindings/arm/msm/qcom,pvs.txt       |  38 ++++
- drivers/cpufreq/Kconfig.arm                        |   9 +
- drivers/cpufreq/Makefile                           |   1 +
- drivers/cpufreq/qcom-cpufreq.c                     | 204 +++++++++++++++++++++
- 4 files changed, 252 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,pvs.txt
- create mode 100644 drivers/cpufreq/qcom-cpufreq.c
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/arm/msm/qcom,pvs.txt
-@@ -0,0 +1,38 @@
-+Qualcomm Process Voltage Scaling Tables
-+
-+The node name is required to be "qcom,pvs". There shall only be one
-+such node present in the root of the tree.
-+
-+PROPERTIES
-+
-+- qcom,pvs-format-a or qcom,pvs-format-b:
-+	Usage: required
-+	Value type: <empty>
-+	Definition: Indicates the format of qcom,speedX-pvsY-bin-vZ properties.
-+		    If qcom,pvs-format-a is used the table is two columns
-+		    (frequency and voltage in that order). If qcom,pvs-format-b 		    is used the table is three columns (frequency, voltage,
-+		    and current in that order).
-+
-+- qcom,speedX-pvsY-bin-vZ:
-+	Usage: required
-+	Value type: <prop-encoded-array>
-+	Definition: The PVS table corresponding to the speed bin X, pvs bin Y,
-+		    and version Z.
-+Example:
-+
-+	qcom,pvs {
-+		qcom,pvs-format-a;
-+		qcom,speed0-pvs0-bin-v0 =
-+			<  384000000  950000 >,
-+			<  486000000  975000 >,
-+			<  594000000 1000000 >,
-+			<  702000000 1025000 >,
-+			<  810000000 1075000 >,
-+			<  918000000 1100000 >,
-+			< 1026000000 1125000 >,
-+			< 1134000000 1175000 >,
-+			< 1242000000 1200000 >,
-+			< 1350000000 1225000 >,
-+			< 1458000000 1237500 >,
-+			< 1512000000 1250000 >;
-+	};
---- a/drivers/cpufreq/Kconfig.arm
-+++ b/drivers/cpufreq/Kconfig.arm
-@@ -137,6 +137,15 @@ config ARM_OMAP2PLUS_CPUFREQ
- 	depends on ARCH_OMAP2PLUS
- 	default ARCH_OMAP2PLUS
- 
-+config ARM_QCOM_CPUFREQ
-+	tristate "Qualcomm based"
-+	depends on ARCH_QCOM
-+	select PM_OPP
-+	help
-+	  This adds the CPUFreq driver for Qualcomm SoC based boards.
-+
-+	  If in doubt, say N.
-+
- config ARM_S3C_CPUFREQ
- 	bool
- 	help
---- a/drivers/cpufreq/Makefile
-+++ b/drivers/cpufreq/Makefile
-@@ -65,6 +65,7 @@ obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ)	+= ki
- obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ)	+= omap-cpufreq.o
- obj-$(CONFIG_ARM_PXA2xx_CPUFREQ)	+= pxa2xx-cpufreq.o
- obj-$(CONFIG_PXA3xx)			+= pxa3xx-cpufreq.o
-+obj-$(CONFIG_ARM_QCOM_CPUFREQ)		+= qcom-cpufreq.o
- obj-$(CONFIG_ARM_S3C24XX_CPUFREQ)	+= s3c24xx-cpufreq.o
- obj-$(CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS) += s3c24xx-cpufreq-debugfs.o
- obj-$(CONFIG_ARM_S3C2410_CPUFREQ)	+= s3c2410-cpufreq.o
---- /dev/null
-+++ b/drivers/cpufreq/qcom-cpufreq.c
-@@ -0,0 +1,204 @@
-+/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 and
-+ * only version 2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <linux/cpu.h>
-+#include <linux/err.h>
-+#include <linux/init.h>
-+#include <linux/io.h>
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/of.h>
-+#include <linux/platform_device.h>
-+#include <linux/pm_opp.h>
-+#include <linux/slab.h>
-+#include <linux/cpufreq-dt.h>
-+
-+static void __init get_krait_bin_format_a(int *speed, int *pvs, int *pvs_ver)
-+{
-+	void __iomem *base;
-+	u32 pte_efuse;
-+
-+	*speed = *pvs = *pvs_ver = 0;
-+
-+	base = ioremap(0x007000c0, 4);
-+	if (!base) {
-+		pr_warn("Unable to read efuse data. Defaulting to 0!\n");
-+		return;
-+	}
-+
-+	pte_efuse = readl_relaxed(base);
-+	iounmap(base);
-+
-+	*speed = pte_efuse & 0xf;
-+	if (*speed == 0xf)
-+		*speed = (pte_efuse >> 4) & 0xf;
-+
-+	if (*speed == 0xf) {
-+		*speed = 0;
-+		pr_warn("Speed bin: Defaulting to %d\n", *speed);
-+	} else {
-+		pr_info("Speed bin: %d\n", *speed);
-+	}
-+
-+	*pvs = (pte_efuse >> 10) & 0x7;
-+	if (*pvs == 0x7)
-+		*pvs = (pte_efuse >> 13) & 0x7;
-+
-+	if (*pvs == 0x7) {
-+		*pvs = 0;
-+		pr_warn("PVS bin: Defaulting to %d\n", *pvs);
-+	} else {
-+		pr_info("PVS bin: %d\n", *pvs);
-+	}
-+}
-+
-+static void __init get_krait_bin_format_b(int *speed, int *pvs, int *pvs_ver)
-+{
-+	u32 pte_efuse, redundant_sel;
-+	void __iomem *base;
-+
-+	*speed = 0;
-+	*pvs = 0;
-+	*pvs_ver = 0;
-+
-+	base = ioremap(0xfc4b80b0, 8);
-+	if (!base) {
-+		pr_warn("Unable to read efuse data. Defaulting to 0!\n");
-+		return;
-+	}
-+
-+	pte_efuse = readl_relaxed(base);
-+	redundant_sel = (pte_efuse >> 24) & 0x7;
-+	*speed = pte_efuse & 0x7;
-+	/* 4 bits of PVS are in efuse register bits 31, 8-6. */
-+	*pvs = ((pte_efuse >> 28) & 0x8) | ((pte_efuse >> 6) & 0x7);
-+	*pvs_ver = (pte_efuse >> 4) & 0x3;
-+
-+	switch (redundant_sel) {
-+	case 1:
-+		*speed = (pte_efuse >> 27) & 0xf;
-+		break;
-+	case 2:
-+		*pvs = (pte_efuse >> 27) & 0xf;
-+		break;
-+	}
-+
-+	/* Check SPEED_BIN_BLOW_STATUS */
-+	if (pte_efuse & BIT(3)) {
-+		pr_info("Speed bin: %d\n", *speed);
-+	} else {
-+		pr_warn("Speed bin not set. Defaulting to 0!\n");
-+		*speed = 0;
-+	}
-+
-+	/* Check PVS_BLOW_STATUS */
-+	pte_efuse = readl_relaxed(base + 0x4) & BIT(21);
-+	if (pte_efuse) {
-+		pr_info("PVS bin: %d\n", *pvs);
-+	} else {
-+		pr_warn("PVS bin not set. Defaulting to 0!\n");
-+		*pvs = 0;
-+	}
-+
-+	pr_info("PVS version: %d\n", *pvs_ver);
-+	iounmap(base);
-+}
-+
-+static int __init qcom_cpufreq_populate_opps(void)
-+{
-+	int len, rows, cols, i, k, speed, pvs, pvs_ver;
-+	char table_name[] = "qcom,speedXX-pvsXX-bin-vXX";
-+	struct device_node *np;
-+	struct device *dev;
-+	int cpu = 0;
-+
-+	np = of_find_node_by_name(NULL, "qcom,pvs");
-+	if (!np)
-+		return -ENODEV;
-+
-+	if (of_property_read_bool(np, "qcom,pvs-format-a")) {
-+		get_krait_bin_format_a(&speed, &pvs, &pvs_ver);
-+		cols = 2;
-+	} else if (of_property_read_bool(np, "qcom,pvs-format-b")) {
-+		get_krait_bin_format_b(&speed, &pvs, &pvs_ver);
-+		cols = 3;
-+	} else {
-+		return -ENODEV;
-+	}
-+
-+	snprintf(table_name, sizeof(table_name),
-+			"qcom,speed%d-pvs%d-bin-v%d", speed, pvs, pvs_ver);
-+
-+	if (!of_find_property(np, table_name, &len))
-+		return -EINVAL;
-+
-+	len /= sizeof(u32);
-+	if (len % cols || len == 0)
-+		return -EINVAL;
-+
-+	rows = len / cols;
-+
-+	for (i = 0, k = 0; i < rows; i++) {
-+		u32 freq, volt;
-+
-+		of_property_read_u32_index(np, table_name, k++, &freq);
-+		of_property_read_u32_index(np, table_name, k++, &volt);
-+		while (k % cols)
-+			k++; /* Skip uA entries if present */
-+		for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
-+			dev = get_cpu_device(cpu);
-+			if (!dev)
-+				return -ENODEV;
-+			if (dev_pm_opp_add(dev, freq, volt))
-+				pr_warn("failed to add OPP %u\n", freq);
-+		}
-+	}
-+
-+	return 0;
-+}
-+
-+static int __init qcom_cpufreq_driver_init(void)
-+{
-+	struct cpufreq_dt_platform_data pdata = { .independent_clocks = true };
-+	struct platform_device_info devinfo = {
-+		.name = "cpufreq-dt",
-+		.data = &pdata,
-+		.size_data = sizeof(pdata),
-+	};
-+	struct device *cpu_dev;
-+	struct device_node *np;
-+	int ret;
-+
-+	cpu_dev = get_cpu_device(0);
-+	if (!cpu_dev)
-+		return -ENODEV;
-+
-+	np = of_node_get(cpu_dev->of_node);
-+	if (!np)
-+		return -ENOENT;
-+
-+	if (!of_device_is_compatible(np, "qcom,krait")) {
-+		of_node_put(np);
-+		return -ENODEV;
-+	}
-+	of_node_put(np);
-+
-+	ret = qcom_cpufreq_populate_opps();
-+	if (ret)
-+		return ret;
-+
-+	return PTR_ERR_OR_ZERO(platform_device_register_full(&devinfo));
-+}
-+module_init(qcom_cpufreq_driver_init);
-+
-+MODULE_DESCRIPTION("Qualcomm CPUfreq driver");
-+MODULE_LICENSE("GPL v2");
diff --git a/target/linux/ipq806x/patches-4.0/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch b/target/linux/ipq806x/patches-4.0/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
deleted file mode 100644
index a3c3bbf..0000000
--- a/target/linux/ipq806x/patches-4.0/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
+++ /dev/null
@@ -1,100 +0,0 @@
---- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
-+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -24,6 +24,11 @@
- 			next-level-cache = <&L2>;
- 			qcom,acc = <&acc0>;
- 			qcom,saw = <&saw0>;
-+			clocks = <&kraitcc 0>;
-+			clock-names = "cpu";
-+			clock-latency = <100000>;
-+			core-supply = <&smb208_s2a>;
-+			voltage-tolerance = <5>;
- 		};
- 
- 		cpu at 1 {
-@@ -34,11 +39,24 @@
- 			next-level-cache = <&L2>;
- 			qcom,acc = <&acc1>;
- 			qcom,saw = <&saw1>;
-+			clocks = <&kraitcc 1>;
-+			clock-names = "cpu";
-+			clock-latency = <100000>;
-+			core-supply = <&smb208_s2b>;
- 		};
- 
- 		L2: l2-cache {
- 			compatible = "cache";
- 			cache-level = <2>;
-+			clocks = <&kraitcc 4>;
-+			clock-names = "cache";
-+			cache-points-kHz = <
-+				/* kHz    uV    CPU kHz */
-+				1200000 1150000 1200000
-+				1000000 1100000  600000
-+				 384000 1100000  384000
-+			>;
-+			vdd_dig-supply = <&smb208_s1a>;
- 		};
- 	};
- 
-@@ -71,6 +89,46 @@
- 		};
- 	};
- 
-+	kraitcc: clock-controller {
-+		compatible = "qcom,krait-cc-v1";
-+		#clock-cells = <1>;
-+	};
-+
-+	qcom,pvs {
-+		qcom,pvs-format-a;
-+		qcom,speed0-pvs0-bin-v0 =
-+			< 1400000000 1250000 >,
-+			< 1200000000 1200000 >,
-+			< 1000000000 1150000 >,
-+			 < 800000000 1100000 >,
-+			 < 600000000 1050000 >,
-+			 < 384000000 1000000 >;
-+
-+		qcom,speed0-pvs1-bin-v0 =
-+			< 1400000000 1175000 >,
-+			< 1200000000 1125000 >,
-+			< 1000000000 1075000 >,
-+			 < 800000000 1025000 >,
-+			 < 600000000  975000 >,
-+			 < 384000000  925000 >;
-+
-+		qcom,speed0-pvs2-bin-v0 =
-+			< 1400000000 1125000 >,
-+			< 1200000000 1075000 >,
-+			< 1000000000 1025000 >,
-+			 < 800000000  995000 >,
-+			 < 600000000  925000 >,
-+			 < 384000000  875000 >;
-+
-+		qcom,speed0-pvs3-bin-v0 =
-+			< 1400000000 1050000 >,
-+			< 1200000000 1000000 >,
-+			< 1000000000  950000 >,
-+			 < 800000000  900000 >,
-+			 < 600000000  850000 >,
-+			 < 384000000  800000 >;
-+	};
-+
- 	soc: soc {
- 		#address-cells = <1>;
- 		#size-cells = <1>;
-@@ -171,11 +229,13 @@
- 		acc0: clock-controller at 2088000 {
- 			compatible = "qcom,kpss-acc-v1";
- 			reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
-+			clock-output-names = "acpu0_aux";
- 		};
- 
- 		acc1: clock-controller at 2098000 {
- 			compatible = "qcom,kpss-acc-v1";
- 			reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
-+			clock-output-names = "acpu1_aux";
- 		};
- 
- 		l2cc: clock-controller at 2011000 {
diff --git a/target/linux/ipq806x/patches-4.0/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch b/target/linux/ipq806x/patches-4.0/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
deleted file mode 100644
index 521adc5..0000000
--- a/target/linux/ipq806x/patches-4.0/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
+++ /dev/null
@@ -1,461 +0,0 @@
-From dd77db4143290689d3a5e1ec61627233d0711b66 Mon Sep 17 00:00:00 2001
-From: Stephen Boyd <sboyd at codeaurora.org>
-Date: Fri, 30 May 2014 16:36:11 -0700
-Subject: [PATCH] FROMLIST: cpufreq: Add a cpufreq-krait based on cpufreq-cpu0
-
-Krait processors have individual clocks for each CPU that can
-scale independently from one another. cpufreq-cpu0 is fairly
-close to this, but assumes that there is only one clock for all
-CPUs. Add a driver to support the Krait configuration.
-
-TODO: Merge into cpufreq-cpu0? Or make generic?
-
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
-
----
- drivers/cpufreq/Kconfig         |  13 +++
- drivers/cpufreq/Makefile        |   1 +
- drivers/cpufreq/cpufreq-krait.c | 190 ++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 204 insertions(+)
- create mode 100644 drivers/cpufreq/cpufreq-krait.c
-
---- a/drivers/cpufreq/Kconfig
-+++ b/drivers/cpufreq/Kconfig
-@@ -198,6 +198,19 @@ config CPUFREQ_DT
- 
- 	  If in doubt, say N.
- 
-+config GENERIC_CPUFREQ_KRAIT
-+	tristate "Krait cpufreq driver"
-+	depends on HAVE_CLK && OF
-+	# if CPU_THERMAL is on and THERMAL=m, CPU0 cannot be =y:
-+	depends on !CPU_THERMAL || THERMAL
-+	select PM_OPP
-+	help
-+	  This adds a generic cpufreq driver for CPU0 frequency management.
-+	  It supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
-+	  systems which share clock and voltage across all CPUs.
-+
-+	  If in doubt, say N.
-+
- if X86
- source "drivers/cpufreq/Kconfig.x86"
- endif
---- a/drivers/cpufreq/Makefile
-+++ b/drivers/cpufreq/Makefile
-@@ -14,6 +14,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE)
- obj-$(CONFIG_CPU_FREQ_GOV_COMMON)		+= cpufreq_governor.o
- 
- obj-$(CONFIG_CPUFREQ_DT)		+= cpufreq-dt.o
-+obj-$(CONFIG_GENERIC_CPUFREQ_KRAIT)	+= cpufreq-krait.o
- 
- ##################################################################################
- # x86 drivers.
---- /dev/null
-+++ b/drivers/cpufreq/cpufreq-krait.c
-@@ -0,0 +1,390 @@
-+/*
-+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
-+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
-+ *
-+ * The OPP code in function krait_set_target() is reused from
-+ * drivers/cpufreq/omap-cpufreq.c
-+ *
-+ * 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.
-+ */
-+
-+#include <linux/clk.h>
-+#include <linux/cpu.h>
-+#include <linux/cpu_cooling.h>
-+#include <linux/cpufreq.h>
-+#include <linux/cpumask.h>
-+#include <linux/err.h>
-+#include <linux/module.h>
-+#include <linux/of.h>
-+#include <linux/pm_opp.h>
-+#include <linux/platform_device.h>
-+#include <linux/regulator/consumer.h>
-+#include <linux/slab.h>
-+#include <linux/thermal.h>
-+
-+static unsigned int transition_latency;
-+static unsigned int voltage_tolerance; /* in percentage */
-+
-+static struct device *cpu_dev;
-+static DEFINE_PER_CPU(struct clk *, krait_cpu_clks);
-+static DEFINE_PER_CPU(struct regulator *, krait_supply_core);
-+static struct cpufreq_frequency_table *freq_table;
-+static struct thermal_cooling_device *cdev;
-+
-+struct cache_points {
-+	unsigned long cache_freq;
-+	unsigned int cache_volt;
-+	unsigned long cpu_freq;
-+};
-+
-+static struct regulator *krait_l2_reg;
-+static struct clk *krait_l2_clk;
-+static struct cache_points *krait_l2_points;
-+static int nr_krait_l2_points;
-+
-+static int krait_parse_cache_points(struct device *dev,
-+		struct device_node *of_node)
-+{
-+	const struct property *prop;
-+	const __be32 *val;
-+	int nr, i;
-+
-+	prop = of_find_property(of_node, "cache-points-kHz", NULL);
-+	if (!prop)
-+		return -ENODEV;
-+	if (!prop->value)
-+		return -ENODATA;
-+
-+	/*
-+	 * Each OPP is a set of tuples consisting of frequency and
-+	 * cpu-frequency like <freq-kHz volt-uV freq-kHz>.
-+	 */
-+	nr = prop->length / sizeof(u32);
-+	if (nr % 3) {
-+		dev_err(dev, "%s: Invalid cache points\n", __func__);
-+		return -EINVAL;
-+	}
-+	nr /= 3;
-+
-+	krait_l2_points = devm_kcalloc(dev, nr, sizeof(*krait_l2_points),
-+				       GFP_KERNEL);
-+	if (!krait_l2_points)
-+		return -ENOMEM;
-+	nr_krait_l2_points = nr;
-+
-+	for (i = 0, val = prop->value; i < nr; i++) {
-+		unsigned long cache_freq = be32_to_cpup(val++) * 1000;
-+		unsigned int cache_volt = be32_to_cpup(val++);
-+		unsigned long cpu_freq = be32_to_cpup(val++) * 1000;
-+
-+		krait_l2_points[i].cache_freq = cache_freq;
-+		krait_l2_points[i].cache_volt = cache_volt;
-+		krait_l2_points[i].cpu_freq = cpu_freq;
-+	}
-+
-+	return 0;
-+}
-+
-+static int krait_set_target(struct cpufreq_policy *policy, unsigned int index)
-+{
-+	struct dev_pm_opp *opp;
-+	unsigned long volt = 0, volt_old = 0, tol = 0;
-+	unsigned long freq, max_cpu_freq = 0;
-+	unsigned int old_freq, new_freq;
-+	long freq_Hz, freq_exact;
-+	int ret, i;
-+	struct clk *cpu_clk;
-+	struct regulator *core;
-+	unsigned int cpu;
-+
-+	cpu_clk = per_cpu(krait_cpu_clks, policy->cpu);
-+
-+	freq_Hz = clk_round_rate(cpu_clk, freq_table[index].frequency * 1000);
-+	if (freq_Hz <= 0)
-+		freq_Hz = freq_table[index].frequency * 1000;
-+
-+	freq_exact = freq_Hz;
-+	new_freq = freq_Hz / 1000;
-+	old_freq = clk_get_rate(cpu_clk) / 1000;
-+
-+	core = per_cpu(krait_supply_core, policy->cpu);
-+
-+	rcu_read_lock();
-+	opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz);
-+	if (IS_ERR(opp)) {
-+		rcu_read_unlock();
-+		pr_err("failed to find OPP for %ld\n", freq_Hz);
-+		return PTR_ERR(opp);
-+	}
-+	volt = dev_pm_opp_get_voltage(opp);
-+	rcu_read_unlock();
-+	tol = volt * voltage_tolerance / 100;
-+	volt_old = regulator_get_voltage(core);
-+
-+	pr_debug("%u MHz, %ld mV --> %u MHz, %ld mV\n",
-+		 old_freq / 1000, volt_old ? volt_old / 1000 : -1,
-+		 new_freq / 1000, volt ? volt / 1000 : -1);
-+
-+	/* scaling up?  scale voltage before frequency */
-+	if (new_freq > old_freq) {
-+		ret = regulator_set_voltage_tol(core, volt, tol);
-+		if (ret) {
-+			pr_err("failed to scale voltage up: %d\n", ret);
-+			return ret;
-+		}
-+	}
-+
-+	ret = clk_set_rate(cpu_clk, freq_exact);
-+	if (ret) {
-+		pr_err("failed to set clock rate: %d\n", ret);
-+		return ret;
-+	}
-+
-+	/* scaling down?  scale voltage after frequency */
-+	if (new_freq < old_freq) {
-+		ret = regulator_set_voltage_tol(core, volt, tol);
-+		if (ret) {
-+			pr_err("failed to scale voltage down: %d\n", ret);
-+			clk_set_rate(cpu_clk, old_freq * 1000);
-+		}
-+	}
-+
-+	for_each_possible_cpu(cpu) {
-+		freq = clk_get_rate(per_cpu(krait_cpu_clks, cpu));
-+		max_cpu_freq = max(max_cpu_freq, freq);
-+	}
-+
-+	for (i = 0; i < nr_krait_l2_points; i++) {
-+		if (max_cpu_freq >= krait_l2_points[i].cpu_freq) {
-+			if (krait_l2_reg) {
-+				ret = regulator_set_voltage_tol(krait_l2_reg,
-+						krait_l2_points[i].cache_volt,
-+						tol);
-+				if (ret) {
-+					pr_err("failed to scale l2 voltage: %d\n",
-+						ret);
-+				}
-+			}
-+			ret = clk_set_rate(krait_l2_clk,
-+					krait_l2_points[i].cache_freq);
-+			if (ret)
-+				pr_err("failed to scale l2 clk: %d\n", ret);
-+			break;
-+		}
-+
-+	}
-+
-+	return ret;
-+}
-+
-+static int krait_cpufreq_init(struct cpufreq_policy *policy)
-+{
-+	int ret;
-+
-+	policy->clk = per_cpu(krait_cpu_clks, policy->cpu);
-+
-+	ret = cpufreq_table_validate_and_show(policy, freq_table);
-+	if (ret) {
-+		pr_err("%s: invalid frequency table: %d\n", __func__, ret);
-+		return ret;
-+	}
-+
-+	policy->cpuinfo.transition_latency = transition_latency;
-+
-+	return 0;
-+}
-+
-+static struct cpufreq_driver krait_cpufreq_driver = {
-+	.flags = CPUFREQ_STICKY,
-+	.verify = cpufreq_generic_frequency_table_verify,
-+	.target_index = krait_set_target,
-+	.get = cpufreq_generic_get,
-+	.init = krait_cpufreq_init,
-+	.name = "generic_krait",
-+	.attr = cpufreq_generic_attr,
-+};
-+
-+static int krait_cpufreq_probe(struct platform_device *pdev)
-+{
-+	struct device_node *np, *cache;
-+	int ret, i;
-+	unsigned int cpu;
-+	struct device *dev;
-+	struct clk *clk;
-+	struct regulator *core;
-+	unsigned long freq_Hz, freq, max_cpu_freq;
-+	struct dev_pm_opp *opp;
-+	unsigned long volt, tol;
-+
-+	cpu_dev = get_cpu_device(0);
-+	if (!cpu_dev) {
-+		pr_err("failed to get krait device\n");
-+		return -ENODEV;
-+	}
-+
-+	np = of_node_get(cpu_dev->of_node);
-+	if (!np) {
-+		pr_err("failed to find krait node\n");
-+		return -ENOENT;
-+	}
-+
-+	ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
-+	if (ret) {
-+		pr_err("failed to init cpufreq table: %d\n", ret);
-+		goto out_put_node;
-+	}
-+
-+	of_property_read_u32(np, "voltage-tolerance", &voltage_tolerance);
-+
-+	if (of_property_read_u32(np, "clock-latency", &transition_latency))
-+		transition_latency = CPUFREQ_ETERNAL;
-+
-+	cache = of_find_next_cache_node(np);
-+	if (cache) {
-+		struct device_node *vdd;
-+
-+		vdd = of_parse_phandle(cache, "vdd_dig-supply", 0);
-+		if (vdd) {
-+			krait_l2_reg = regulator_get(NULL, vdd->name);
-+			if (IS_ERR(krait_l2_reg)) {
-+				pr_warn("failed to get l2 vdd_dig supply\n");
-+				krait_l2_reg = NULL;
-+			}
-+			of_node_put(vdd);
-+		}
-+
-+		krait_l2_clk = of_clk_get(cache, 0);
-+		if (!IS_ERR(krait_l2_clk)) {
-+			ret = krait_parse_cache_points(&pdev->dev, cache);
-+			if (ret)
-+				clk_put(krait_l2_clk);
-+		}
-+		if (IS_ERR(krait_l2_clk) || ret)
-+			krait_l2_clk = NULL;
-+	}
-+
-+	for_each_possible_cpu(cpu) {
-+		dev = get_cpu_device(cpu);
-+		if (!dev) {
-+			pr_err("failed to get krait device\n");
-+			ret = -ENOENT;
-+			goto out_free_table;
-+		}
-+		per_cpu(krait_cpu_clks, cpu) = clk = devm_clk_get(dev, NULL);
-+		if (IS_ERR(clk)) {
-+			ret = PTR_ERR(clk);
-+			goto out_free_table;
-+		}
-+		core = devm_regulator_get(dev, "core");
-+		if (IS_ERR(core)) {
-+			pr_debug("failed to get core regulator\n");
-+			ret = PTR_ERR(core);
-+			goto out_free_table;
-+		}
-+		per_cpu(krait_supply_core, cpu) = core;
-+
-+		freq_Hz = clk_get_rate(clk);
-+
-+		rcu_read_lock();
-+		opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz);
-+		if (IS_ERR(opp)) {
-+			rcu_read_unlock();
-+			pr_err("failed to find OPP for %ld\n", freq_Hz);
-+			ret = PTR_ERR(opp);
-+			goto out_free_table;
-+		}
-+		volt = dev_pm_opp_get_voltage(opp);
-+		rcu_read_unlock();
-+
-+		tol = volt * voltage_tolerance / 100;
-+		ret = regulator_set_voltage_tol(core, volt, tol);
-+		if (ret) {
-+			pr_err("failed to scale voltage up: %d\n", ret);
-+			goto out_free_table;
-+		}
-+		ret = regulator_enable(core);
-+		if (ret) {
-+			pr_err("failed to enable regulator: %d\n", ret);
-+			goto out_free_table;
-+		}
-+		max_cpu_freq = max(max_cpu_freq, freq);
-+	}
-+
-+	for (i = 0; i < nr_krait_l2_points; i++) {
-+		if (max_cpu_freq >= krait_l2_points[i].cpu_freq) {
-+			if (krait_l2_reg) {
-+				ret = regulator_set_voltage_tol(krait_l2_reg,
-+						krait_l2_points[i].cache_volt,
-+						tol);
-+				if (ret)
-+					pr_err("failed to scale l2 voltage: %d\n",
-+							ret);
-+				ret = regulator_enable(krait_l2_reg);
-+				if (ret)
-+					pr_err("failed to enable l2 voltage: %d\n",
-+							ret);
-+			}
-+			break;
-+		}
-+
-+	}
-+
-+	ret = cpufreq_register_driver(&krait_cpufreq_driver);
-+	if (ret) {
-+		pr_err("failed register driver: %d\n", ret);
-+		goto out_free_table;
-+	}
-+	of_node_put(np);
-+
-+	/*
-+	 * For now, just loading the cooling device;
-+	 * thermal DT code takes care of matching them.
-+	 */
-+	for_each_possible_cpu(cpu) {
-+		dev = get_cpu_device(cpu);
-+		np = of_node_get(dev->of_node);
-+		if (of_find_property(np, "#cooling-cells", NULL)) {
-+			cdev = of_cpufreq_cooling_register(np, cpumask_of(cpu));
-+			if (IS_ERR(cdev))
-+				pr_err("running cpufreq without cooling device: %ld\n",
-+				       PTR_ERR(cdev));
-+		}
-+		of_node_put(np);
-+	}
-+
-+	return 0;
-+
-+out_free_table:
-+	regulator_put(krait_l2_reg);
-+	clk_put(krait_l2_clk);
-+	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
-+out_put_node:
-+	of_node_put(np);
-+	return ret;
-+}
-+
-+static int krait_cpufreq_remove(struct platform_device *pdev)
-+{
-+	cpufreq_cooling_unregister(cdev);
-+	cpufreq_unregister_driver(&krait_cpufreq_driver);
-+	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
-+	clk_put(krait_l2_clk);
-+	regulator_put(krait_l2_reg);
-+
-+	return 0;
-+}
-+
-+static struct platform_driver krait_cpufreq_platdrv = {
-+	.driver = {
-+		.name	= "cpufreq-krait",
-+		.owner	= THIS_MODULE,
-+	},
-+	.probe		= krait_cpufreq_probe,
-+	.remove		= krait_cpufreq_remove,
-+};
-+module_platform_driver(krait_cpufreq_platdrv);
-+
-+MODULE_DESCRIPTION("Krait CPUfreq driver");
-+MODULE_LICENSE("GPL v2");
---- a/drivers/cpufreq/qcom-cpufreq.c
-+++ b/drivers/cpufreq/qcom-cpufreq.c
-@@ -168,11 +168,8 @@ static int __init qcom_cpufreq_populate_
- 
- static int __init qcom_cpufreq_driver_init(void)
- {
--	struct cpufreq_dt_platform_data pdata = { .independent_clocks = true };
- 	struct platform_device_info devinfo = {
--		.name = "cpufreq-dt",
--		.data = &pdata,
--		.size_data = sizeof(pdata),
-+		.name = "cpufreq-krait",
- 	};
- 	struct device *cpu_dev;
- 	struct device_node *np;
diff --git a/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch b/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
deleted file mode 100644
index 930a463..0000000
--- a/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From b12e230f09d4481424e6a5d7e2ae566b6954e83f Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Wed, 29 Apr 2015 15:21:46 -0700
-Subject: [PATCH] HACK: arch: arm: force ZRELADDR on arch-qcom
-
-ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
-on most ARM architectures. This automatically calculate ZRELADDR by
-masking PHYS_OFFSET with 0xf8000000.
-
-However, on IPQ806x, the first ~20MB of RAM is reserved for the hardware
-network accelerators, and the bootloader removes this section from the
-layout passed from the ATAGS (when used).
-
-For newer bootloader, when DT is used, this is not a problem, we just
-reserve this memory in the device tree. But if the bootloader doesn't
-have DT support, then ATAGS have to be used. In this case, the ARM
-decompressor will position the kernel in this low mem, which will not be
-in the RAM section mapped by the bootloader, which means the kernel will
-freeze in the middle of the boot process trying to map the memory.
-
-As a work around, this patch allows disabling AUTO_ZRELADDR when
-ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
-which don't support device-tree, which is the case on certain early
-IPQ806x based designs.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- arch/arm/Kconfig                 | 2 +-
- arch/arm/Makefile                | 2 ++
- arch/arm/mach-qcom/Makefile.boot | 1 +
- 3 files changed, 4 insertions(+), 1 deletion(-)
- create mode 100644 arch/arm/mach-qcom/Makefile.boot
-
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -314,7 +314,7 @@ config ARCH_MULTIPLATFORM
- 	select ARCH_WANT_OPTIONAL_GPIOLIB
- 	select ARM_HAS_SG_CHAIN
- 	select ARM_PATCH_PHYS_VIRT
--	select AUTO_ZRELADDR
-+	select AUTO_ZRELADDR if !ARCH_QCOM
- 	select CLKSRC_OF
- 	select COMMON_CLK
- 	select GENERIC_CLOCKEVENTS
---- a/arch/arm/Makefile
-+++ b/arch/arm/Makefile
-@@ -241,9 +241,11 @@ MACHINE  := arch/arm/mach-$(word 1,$(mac
- else
- MACHINE  :=
- endif
-+ifeq ($(CONFIG_ARCH_QCOM),)
- ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
- MACHINE  :=
- endif
-+endif
- 
- machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
- platdirs := $(patsubst %,arch/arm/plat-%/,$(sort $(plat-y)))
---- /dev/null
-+++ b/arch/arm/mach-qcom/Makefile.boot
-@@ -0,0 +1 @@
-+zreladdr-y+= 0x42208000
diff --git a/target/linux/ipq806x/patches-4.0/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch b/target/linux/ipq806x/patches-4.0/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
deleted file mode 100644
index 1b9d47b..0000000
--- a/target/linux/ipq806x/patches-4.0/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
+++ /dev/null
@@ -1,733 +0,0 @@
-From 2fbb18f85826a9ba308fedb2cf90d3a661a39fd7 Mon Sep 17 00:00:00 2001
-From: Stephen Boyd <sboyd at codeaurora.org>
-Date: Fri, 27 Mar 2015 00:16:14 -0700
-Subject: [PATCH] clk: qcom: Add support for NSS/GMAC clocks and resets
-
-Add the NSS/GMAC clocks and the TCM clock and NSS resets.
-
-Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
----
- drivers/clk/qcom/gcc-ipq806x.c               | 594 ++++++++++++++++++++++++++-
- drivers/clk/qcom/gcc-ipq806x.c.rej           |  50 +++
- include/dt-bindings/clock/qcom,gcc-ipq806x.h |   2 +
- include/dt-bindings/reset/qcom,gcc-ipq806x.h |  43 ++
- 4 files changed, 688 insertions(+), 1 deletion(-)
- create mode 100644 drivers/clk/qcom/gcc-ipq806x.c.rej
-
---- a/drivers/clk/qcom/gcc-ipq806x.c
-+++ b/drivers/clk/qcom/gcc-ipq806x.c
-@@ -220,11 +220,46 @@ static struct clk_regmap pll14_vote = {
- 	},
- };
- 
-+#define NSS_PLL_RATE(f, _l, _m, _n, i) \
-+	{  \
-+		.freq = f,  \
-+		.l = _l, \
-+		.m = _m, \
-+		.n = _n, \
-+		.ibits = i, \
-+	}
-+
-+static struct pll_freq_tbl pll18_freq_tbl[] = {
-+	NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
-+	NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
-+};
-+
-+static struct clk_pll pll18 = {
-+	.l_reg = 0x31a4,
-+	.m_reg = 0x31a8,
-+	.n_reg = 0x31ac,
-+	.config_reg = 0x31b4,
-+	.mode_reg = 0x31a0,
-+	.status_reg = 0x31b8,
-+	.status_bit = 16,
-+	.post_div_shift = 16,
-+	.post_div_width = 1,
-+	.freq_tbl = pll18_freq_tbl,
-+	.clkr.hw.init = &(struct clk_init_data){
-+		.name = "pll18",
-+		.parent_names = (const char *[]){ "pxo" },
-+		.num_parents = 1,
-+		.ops = &clk_pll_ops,
-+	},
-+};
-+
- #define P_PXO	0
- #define P_PLL8	1
- #define P_PLL3	1
- #define P_PLL0	2
- #define P_CXO	2
-+#define P_PLL14	3
-+#define P_PLL18 4
- 
- static const u8 gcc_pxo_pll8_map[] = {
- 	[P_PXO]		= 0,
-@@ -275,6 +310,22 @@ static const char *gcc_pxo_pll8_pll0_map
- 	"pll0_vote",
- };
- 
-+static const u8 gcc_pxo_pll8_pll14_pll18_pll0_map[] = {
-+	[P_PXO] = 0 ,
-+	[P_PLL8] = 4,
-+	[P_PLL0] = 2,
-+	[P_PLL14] = 5,
-+	[P_PLL18] = 1,
-+};
-+
-+static const char *gcc_pxo_pll8_pll14_pll18_pll0[] = {
-+	"pxo",
-+	"pll8_vote",
-+	"pll0_vote",
-+	"pll14",
-+	"pll18",
-+};
-+
- static struct freq_tbl clk_tbl_gsbi_uart[] = {
- 	{  1843200, P_PLL8, 2,  6, 625 },
- 	{  3686400, P_PLL8, 2, 12, 625 },
-@@ -2250,6 +2301,472 @@ static struct clk_branch usb_fs1_h_clk =
- 	},
- };
- 
-+static const struct freq_tbl clk_tbl_gmac[] = {
-+	{ 133000000, P_PLL0, 1,  50, 301 },
-+	{ 266000000, P_PLL0, 1, 127, 382 },
-+	{ }
-+};
-+
-+static struct clk_dyn_rcg gmac_core1_src = {
-+	.ns_reg[0] = 0x3cac,
-+	.ns_reg[1] = 0x3cb0,
-+	.md_reg[0] = 0x3ca4,
-+	.md_reg[1] = 0x3ca8,
-+	.bank_reg = 0x3ca0,
-+	.mn[0] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.mn[1] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.s[0] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.s[1] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.p[0] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.p[1] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.mux_sel_bit = 0,
-+	.freq_tbl = clk_tbl_gmac,
-+	.clkr = {
-+		.enable_reg = 0x3ca0,
-+		.enable_mask = BIT(1),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "gmac_core1_src",
-+			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+			.num_parents = 5,
-+			.ops = &clk_dyn_rcg_ops,
-+		},
-+	},
-+};
-+
-+static struct clk_branch gmac_core1_clk = {
-+	.halt_reg = 0x3c20,
-+	.halt_bit = 4,
-+	.hwcg_reg = 0x3cb4,
-+	.hwcg_bit = 6,
-+	.clkr = {
-+		.enable_reg = 0x3cb4,
-+		.enable_mask = BIT(4),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "gmac_core1_clk",
-+			.parent_names = (const char *[]){
-+				"gmac_core1_src",
-+			},
-+			.num_parents = 1,
-+			.ops = &clk_branch_ops,
-+			.flags = CLK_SET_RATE_PARENT,
-+		},
-+	},
-+};
-+
-+static struct clk_dyn_rcg gmac_core2_src = {
-+	.ns_reg[0] = 0x3ccc,
-+	.ns_reg[1] = 0x3cd0,
-+	.md_reg[0] = 0x3cc4,
-+	.md_reg[1] = 0x3cc8,
-+	.bank_reg = 0x3ca0,
-+	.mn[0] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.mn[1] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.s[0] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.s[1] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.p[0] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.p[1] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.mux_sel_bit = 0,
-+	.freq_tbl = clk_tbl_gmac,
-+	.clkr = {
-+		.enable_reg = 0x3cc0,
-+		.enable_mask = BIT(1),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "gmac_core2_src",
-+			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+			.num_parents = 5,
-+			.ops = &clk_dyn_rcg_ops,
-+		},
-+	},
-+};
-+
-+static struct clk_branch gmac_core2_clk = {
-+	.halt_reg = 0x3c20,
-+	.halt_bit = 5,
-+	.hwcg_reg = 0x3cd4,
-+	.hwcg_bit = 6,
-+	.clkr = {
-+		.enable_reg = 0x3cd4,
-+		.enable_mask = BIT(4),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "gmac_core2_clk",
-+			.parent_names = (const char *[]){
-+				"gmac_core2_src",
-+			},
-+			.num_parents = 1,
-+			.ops = &clk_branch_ops,
-+			.flags = CLK_SET_RATE_PARENT,
-+		},
-+	},
-+};
-+
-+static struct clk_dyn_rcg gmac_core3_src = {
-+	.ns_reg[0] = 0x3cec,
-+	.ns_reg[1] = 0x3cf0,
-+	.md_reg[0] = 0x3ce4,
-+	.md_reg[1] = 0x3ce8,
-+	.bank_reg = 0x3ce0,
-+	.mn[0] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.mn[1] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.s[0] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.s[1] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.p[0] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.p[1] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.mux_sel_bit = 0,
-+	.freq_tbl = clk_tbl_gmac,
-+	.clkr = {
-+		.enable_reg = 0x3ce0,
-+		.enable_mask = BIT(1),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "gmac_core3_src",
-+			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+			.num_parents = 5,
-+			.ops = &clk_dyn_rcg_ops,
-+		},
-+	},
-+};
-+
-+static struct clk_branch gmac_core3_clk = {
-+	.halt_reg = 0x3c20,
-+	.halt_bit = 6,
-+	.hwcg_reg = 0x3cf4,
-+	.hwcg_bit = 6,
-+	.clkr = {
-+		.enable_reg = 0x3cf4,
-+		.enable_mask = BIT(4),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "gmac_core3_clk",
-+			.parent_names = (const char *[]){
-+				"gmac_core3_src",
-+			},
-+			.num_parents = 1,
-+			.ops = &clk_branch_ops,
-+			.flags = CLK_SET_RATE_PARENT,
-+		},
-+	},
-+};
-+
-+static struct clk_dyn_rcg gmac_core4_src = {
-+	.ns_reg[0] = 0x3d0c,
-+	.ns_reg[1] = 0x3d10,
-+	.md_reg[0] = 0x3d04,
-+	.md_reg[1] = 0x3d08,
-+	.bank_reg = 0x3d00,
-+	.mn[0] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.mn[1] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.s[0] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.s[1] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.p[0] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.p[1] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.mux_sel_bit = 0,
-+	.freq_tbl = clk_tbl_gmac,
-+	.clkr = {
-+		.enable_reg = 0x3d00,
-+		.enable_mask = BIT(1),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "gmac_core4_src",
-+			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+			.num_parents = 5,
-+			.ops = &clk_dyn_rcg_ops,
-+		},
-+	},
-+};
-+
-+static struct clk_branch gmac_core4_clk = {
-+	.halt_reg = 0x3c20,
-+	.halt_bit = 7,
-+	.hwcg_reg = 0x3d14,
-+	.hwcg_bit = 6,
-+	.clkr = {
-+		.enable_reg = 0x3d14,
-+		.enable_mask = BIT(4),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "gmac_core4_clk",
-+			.parent_names = (const char *[]){
-+				"gmac_core4_src",
-+			},
-+			.num_parents = 1,
-+			.ops = &clk_branch_ops,
-+			.flags = CLK_SET_RATE_PARENT,
-+		},
-+	},
-+};
-+
-+static const struct freq_tbl clk_tbl_nss_tcm[] = {
-+	{ 266000000, P_PLL0, 3, 0, 0 },
-+	{ 400000000, P_PLL0, 2, 0, 0 },
-+	{ }
-+};
-+
-+static struct clk_dyn_rcg nss_tcm_src = {
-+	.ns_reg[0] = 0x3dc4,
-+	.ns_reg[1] = 0x3dc8,
-+	.bank_reg = 0x3dc0,
-+	.s[0] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.s[1] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.p[0] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 4,
-+	},
-+	.p[1] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 4,
-+	},
-+	.mux_sel_bit = 0,
-+	.freq_tbl = clk_tbl_nss_tcm,
-+	.clkr = {
-+		.enable_reg = 0x3dc0,
-+		.enable_mask = BIT(1),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "nss_tcm_src",
-+			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+			.num_parents = 5,
-+			.ops = &clk_dyn_rcg_ops,
-+		},
-+	},
-+};
-+
-+static struct clk_branch nss_tcm_clk = {
-+	.halt_reg = 0x3c20,
-+	.halt_bit = 14,
-+	.clkr = {
-+		.enable_reg = 0x3dd0,
-+		.enable_mask = BIT(6) | BIT(4),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "nss_tcm_clk",
-+			.parent_names = (const char *[]){
-+				"nss_tcm_src",
-+			},
-+			.num_parents = 1,
-+			.ops = &clk_branch_ops,
-+			.flags = CLK_SET_RATE_PARENT,
-+		},
-+	},
-+};
-+
-+static const struct freq_tbl clk_tbl_nss[] = {
-+	{ 110000000, P_PLL18, 1, 1, 5 },
-+	{ 275000000, P_PLL18, 2, 0, 0 },
-+	{ 550000000, P_PLL18, 1, 0, 0 },
-+	{ 733000000, P_PLL18, 1, 0, 0 },
-+	{ }
-+};
-+
-+static struct clk_dyn_rcg ubi32_core1_src_clk = {
-+	.ns_reg[0] = 0x3d2c,
-+	.ns_reg[1] = 0x3d30,
-+	.md_reg[0] = 0x3d24,
-+	.md_reg[1] = 0x3d28,
-+	.bank_reg = 0x3d20,
-+	.mn[0] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.mn[1] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.s[0] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.s[1] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.p[0] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.p[1] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.mux_sel_bit = 0,
-+	.freq_tbl = clk_tbl_nss,
-+	.clkr = {
-+		.enable_reg = 0x3d20,
-+		.enable_mask = BIT(1),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "ubi32_core1_src_clk",
-+			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+			.num_parents = 5,
-+			.ops = &clk_dyn_rcg_ops,
-+			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
-+		},
-+	},
-+};
-+
-+static struct clk_dyn_rcg ubi32_core2_src_clk = {
-+	.ns_reg[0] = 0x3d4c,
-+	.ns_reg[1] = 0x3d50,
-+	.md_reg[0] = 0x3d44,
-+	.md_reg[1] = 0x3d48,
-+	.bank_reg = 0x3d40,
-+	.mn[0] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.mn[1] = {
-+		.mnctr_en_bit = 8,
-+		.mnctr_reset_bit = 7,
-+		.mnctr_mode_shift = 5,
-+		.n_val_shift = 16,
-+		.m_val_shift = 16,
-+		.width = 8,
-+	},
-+	.s[0] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.s[1] = {
-+		.src_sel_shift = 0,
-+		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
-+	},
-+	.p[0] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.p[1] = {
-+		.pre_div_shift = 3,
-+		.pre_div_width = 2,
-+	},
-+	.mux_sel_bit = 0,
-+	.freq_tbl = clk_tbl_nss,
-+	.clkr = {
-+		.enable_reg = 0x3d40,
-+		.enable_mask = BIT(1),
-+		.hw.init = &(struct clk_init_data){
-+			.name = "ubi32_core2_src_clk",
-+			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
-+			.num_parents = 5,
-+			.ops = &clk_dyn_rcg_ops,
-+			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
-+		},
-+	},
-+};
-+
- static struct clk_regmap *gcc_ipq806x_clks[] = {
- 	[PLL0] = &pll0.clkr,
- 	[PLL0_VOTE] = &pll0_vote,
-@@ -2259,6 +2776,7 @@ static struct clk_regmap *gcc_ipq806x_cl
- 	[PLL8_VOTE] = &pll8_vote,
- 	[PLL14] = &pll14.clkr,
- 	[PLL14_VOTE] = &pll14_vote,
-+	[PLL18] = &pll18.clkr,
- 	[GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
- 	[GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
- 	[GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
-@@ -2356,6 +2874,18 @@ static struct clk_regmap *gcc_ipq806x_cl
- 	[PLL9] = &hfpll0.clkr,
- 	[PLL10] = &hfpll1.clkr,
- 	[PLL12] = &hfpll_l2.clkr,
-+	[GMAC_CORE1_CLK_SRC] = &gmac_core1_src.clkr,
-+	[GMAC_CORE1_CLK] = &gmac_core1_clk.clkr,
-+	[GMAC_CORE2_CLK_SRC] = &gmac_core2_src.clkr,
-+	[GMAC_CORE2_CLK] = &gmac_core2_clk.clkr,
-+	[GMAC_CORE3_CLK_SRC] = &gmac_core3_src.clkr,
-+	[GMAC_CORE3_CLK] = &gmac_core3_clk.clkr,
-+	[GMAC_CORE4_CLK_SRC] = &gmac_core4_src.clkr,
-+	[GMAC_CORE4_CLK] = &gmac_core4_clk.clkr,
-+	[UBI32_CORE1_CLK_SRC] = &ubi32_core1_src_clk.clkr,
-+	[UBI32_CORE2_CLK_SRC] = &ubi32_core2_src_clk.clkr,
-+	[NSSTCM_CLK_SRC] = &nss_tcm_src.clkr,
-+	[NSSTCM_CLK] = &nss_tcm_clk.clkr,
- };
- 
- static const struct qcom_reset_map gcc_ipq806x_resets[] = {
-@@ -2474,6 +3004,48 @@ static const struct qcom_reset_map gcc_i
- 	[USB30_1_PHY_RESET] = { 0x3b58, 0 },
- 	[NSSFB0_RESET] = { 0x3b60, 6 },
- 	[NSSFB1_RESET] = { 0x3b60, 7 },
-+	[UBI32_CORE1_CLKRST_CLAMP_RESET] = { 0x3d3c, 3},
-+	[UBI32_CORE1_CLAMP_RESET] = { 0x3d3c, 2 },
-+	[UBI32_CORE1_AHB_RESET] = { 0x3d3c, 1 },
-+	[UBI32_CORE1_AXI_RESET] = { 0x3d3c, 0 },
-+	[UBI32_CORE2_CLKRST_CLAMP_RESET] = { 0x3d5c, 3 },
-+	[UBI32_CORE2_CLAMP_RESET] = { 0x3d5c, 2 },
-+	[UBI32_CORE2_AHB_RESET] = { 0x3d5c, 1 },
-+	[UBI32_CORE2_AXI_RESET] = { 0x3d5c, 0 },
-+	[GMAC_CORE1_RESET] = { 0x3cbc, 0 },
-+	[GMAC_CORE2_RESET] = { 0x3cdc, 0 },
-+	[GMAC_CORE3_RESET] = { 0x3cfc, 0 },
-+	[GMAC_CORE4_RESET] = { 0x3d1c, 0 },
-+	[GMAC_AHB_RESET] = { 0x3e24, 0 },
-+	[NSS_CH0_RST_RX_CLK_N_RESET] = { 0x3b60, 0 },
-+	[NSS_CH0_RST_TX_CLK_N_RESET] = { 0x3b60, 1 },
-+	[NSS_CH0_RST_RX_125M_N_RESET] = { 0x3b60, 2 },
-+	[NSS_CH0_HW_RST_RX_125M_N_RESET] = { 0x3b60, 3 },
-+	[NSS_CH0_RST_TX_125M_N_RESET] = { 0x3b60, 4 },
-+	[NSS_CH1_RST_RX_CLK_N_RESET] = { 0x3b60, 5 },
-+	[NSS_CH1_RST_TX_CLK_N_RESET] = { 0x3b60, 6 },
-+	[NSS_CH1_RST_RX_125M_N_RESET] = { 0x3b60, 7 },
-+	[NSS_CH1_HW_RST_RX_125M_N_RESET] = { 0x3b60, 8 },
-+	[NSS_CH1_RST_TX_125M_N_RESET] = { 0x3b60, 9 },
-+	[NSS_CH2_RST_RX_CLK_N_RESET] = { 0x3b60, 10 },
-+	[NSS_CH2_RST_TX_CLK_N_RESET] = { 0x3b60, 11 },
-+	[NSS_CH2_RST_RX_125M_N_RESET] = { 0x3b60, 12 },
-+	[NSS_CH2_HW_RST_RX_125M_N_RESET] = { 0x3b60, 13 },
-+	[NSS_CH2_RST_TX_125M_N_RESET] = { 0x3b60, 14 },
-+	[NSS_CH3_RST_RX_CLK_N_RESET] = { 0x3b60, 15 },
-+	[NSS_CH3_RST_TX_CLK_N_RESET] = { 0x3b60, 16 },
-+	[NSS_CH3_RST_RX_125M_N_RESET] = { 0x3b60, 17 },
-+	[NSS_CH3_HW_RST_RX_125M_N_RESET] = { 0x3b60, 18 },
-+	[NSS_CH3_RST_TX_125M_N_RESET] = { 0x3b60, 19 },
-+	[NSS_RST_RX_250M_125M_N_RESET] = { 0x3b60, 20 },
-+	[NSS_RST_TX_250M_125M_N_RESET] = { 0x3b60, 21 },
-+	[NSS_QSGMII_TXPI_RST_N_RESET] = { 0x3b60, 22 },
-+	[NSS_QSGMII_CDR_RST_N_RESET] = { 0x3b60, 23 },
-+	[NSS_SGMII2_CDR_RST_N_RESET] = { 0x3b60, 24 },
-+	[NSS_SGMII3_CDR_RST_N_RESET] = { 0x3b60, 25 },
-+	[NSS_CAL_PRBS_RST_N_RESET] = { 0x3b60, 26 },
-+	[NSS_LCKDT_RST_N_RESET] = { 0x3b60, 27 },
-+	[NSS_SRDS_N_RESET] = { 0x3b60, 28 },
- };
- 
- static const struct regmap_config gcc_ipq806x_regmap_config = {
-@@ -2502,6 +3074,8 @@ static int gcc_ipq806x_probe(struct plat
- {
- 	struct clk *clk;
- 	struct device *dev = &pdev->dev;
-+	struct regmap *regmap;
-+	int ret;
- 
- 	/* Temporary until RPM clocks supported */
- 	clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 25000000);
-@@ -2512,7 +3086,25 @@ static int gcc_ipq806x_probe(struct plat
- 	if (IS_ERR(clk))
- 		return PTR_ERR(clk);
- 
--	return qcom_cc_probe(pdev, &gcc_ipq806x_desc);
-+	ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);
-+	if (ret)
-+		return ret;
-+
-+	regmap = dev_get_regmap(dev, NULL);
-+	if (!regmap)
-+		return -ENODEV;
-+
-+	/* Setup PLL18 static bits */
-+	regmap_update_bits(regmap, 0x31a4, 0xffffffc0, 0x40000400);
-+	regmap_write(regmap, 0x31b0, 0x3080);
-+
-+	/* Set GMAC footswitch sleep/wakeup values */
-+	regmap_write(regmap, 0x3cb8, 8);
-+	regmap_write(regmap, 0x3cd8, 8);
-+	regmap_write(regmap, 0x3cf8, 8);
-+	regmap_write(regmap, 0x3d18, 8);
-+
-+	return 0;
- }
- 
- static int gcc_ipq806x_remove(struct platform_device *pdev)
---- a/include/dt-bindings/clock/qcom,gcc-ipq806x.h
-+++ b/include/dt-bindings/clock/qcom,gcc-ipq806x.h
-@@ -288,5 +288,7 @@
- #define UBI32_CORE2_CLK_SRC			278
- #define UBI32_CORE1_CLK				279
- #define UBI32_CORE2_CLK				280
-+#define NSSTCM_CLK_SRC				281
-+#define NSSTCM_CLK				282
- 
- #endif
---- a/include/dt-bindings/reset/qcom,gcc-ipq806x.h
-+++ b/include/dt-bindings/reset/qcom,gcc-ipq806x.h
-@@ -129,4 +129,47 @@
- #define USB30_1_PHY_RESET				112
- #define NSSFB0_RESET					113
- #define NSSFB1_RESET					114
-+#define UBI32_CORE1_CLKRST_CLAMP_RESET			115
-+#define UBI32_CORE1_CLAMP_RESET				116
-+#define UBI32_CORE1_AHB_RESET				117
-+#define UBI32_CORE1_AXI_RESET				118
-+#define UBI32_CORE2_CLKRST_CLAMP_RESET			119
-+#define UBI32_CORE2_CLAMP_RESET				120
-+#define UBI32_CORE2_AHB_RESET				121
-+#define UBI32_CORE2_AXI_RESET				122
-+#define GMAC_CORE1_RESET				123
-+#define GMAC_CORE2_RESET				124
-+#define GMAC_CORE3_RESET				125
-+#define GMAC_CORE4_RESET				126
-+#define GMAC_AHB_RESET					127
-+#define NSS_CH0_RST_RX_CLK_N_RESET			128
-+#define NSS_CH0_RST_TX_CLK_N_RESET			129
-+#define NSS_CH0_RST_RX_125M_N_RESET			130
-+#define NSS_CH0_HW_RST_RX_125M_N_RESET			131
-+#define NSS_CH0_RST_TX_125M_N_RESET			132
-+#define NSS_CH1_RST_RX_CLK_N_RESET			133
-+#define NSS_CH1_RST_TX_CLK_N_RESET			134
-+#define NSS_CH1_RST_RX_125M_N_RESET			135
-+#define NSS_CH1_HW_RST_RX_125M_N_RESET			136
-+#define NSS_CH1_RST_TX_125M_N_RESET			137
-+#define NSS_CH2_RST_RX_CLK_N_RESET			138
-+#define NSS_CH2_RST_TX_CLK_N_RESET			139
-+#define NSS_CH2_RST_RX_125M_N_RESET			140
-+#define NSS_CH2_HW_RST_RX_125M_N_RESET			141
-+#define NSS_CH2_RST_TX_125M_N_RESET			142
-+#define NSS_CH3_RST_RX_CLK_N_RESET			143
-+#define NSS_CH3_RST_TX_CLK_N_RESET			144
-+#define NSS_CH3_RST_RX_125M_N_RESET			145
-+#define NSS_CH3_HW_RST_RX_125M_N_RESET			146
-+#define NSS_CH3_RST_TX_125M_N_RESET			147
-+#define NSS_RST_RX_250M_125M_N_RESET			148
-+#define NSS_RST_TX_250M_125M_N_RESET			149
-+#define NSS_QSGMII_TXPI_RST_N_RESET			150
-+#define NSS_QSGMII_CDR_RST_N_RESET			151
-+#define NSS_SGMII2_CDR_RST_N_RESET			152
-+#define NSS_SGMII3_CDR_RST_N_RESET			153
-+#define NSS_CAL_PRBS_RST_N_RESET			154
-+#define NSS_LCKDT_RST_N_RESET				155
-+#define NSS_SRDS_N_RESET				156
-+
- #endif
diff --git a/target/linux/ipq806x/patches-4.0/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch b/target/linux/ipq806x/patches-4.0/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch
deleted file mode 100644
index e94a746..0000000
--- a/target/linux/ipq806x/patches-4.0/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From 4f09499bc1d9bb095caccbcd73ff951ee631e521 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Fri, 8 May 2015 15:42:40 -0700
-Subject: [PATCH 1/8] stmmac: add phy-handle support to the platform layer
-
-On stmmac driver, PHY specification in device-tree was done using the
-non-standard property "snps,phy-addr". Specifying a PHY on a different
-MDIO bus that the one within the stmmac controller doesn't seem to be
-possible when device-tree is used.
-
-This change adds support for the phy-handle property, as specified in
-Documentation/devicetree/bindings/net/ethernet.txt.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 28 ++++++++++++++--------
- .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |  6 ++++-
- include/linux/stmmac.h                             |  1 +
- 3 files changed, 24 insertions(+), 11 deletions(-)
-
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -52,6 +52,7 @@
- #include "stmmac_ptp.h"
- #include "stmmac.h"
- #include <linux/reset.h>
-+#include <linux/of_mdio.h>
- 
- #define STMMAC_ALIGN(x)	L1_CACHE_ALIGN(x)
- 
-@@ -816,18 +817,25 @@ static int stmmac_init_phy(struct net_de
- 	priv->speed = 0;
- 	priv->oldduplex = -1;
- 
--	if (priv->plat->phy_bus_name)
--		snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
--			 priv->plat->phy_bus_name, priv->plat->bus_id);
--	else
--		snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
--			 priv->plat->bus_id);
--
--	snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
--		 priv->plat->phy_addr);
--	pr_debug("stmmac_init_phy:  trying to attach to %s\n", phy_id_fmt);
-+	if (priv->plat->phy_node) {
-+		phydev = of_phy_connect(dev, priv->plat->phy_node,
-+					&stmmac_adjust_link, 0, interface);
-+	} else {
-+		if (priv->plat->phy_bus_name)
-+			snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
-+				 priv->plat->phy_bus_name, priv->plat->bus_id);
-+		else
-+			snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
-+				 priv->plat->bus_id);
-+
-+		snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
-+			 priv->plat->phy_addr);
-+		pr_debug("stmmac_init_phy:  trying to attach to %s\n",
-+			 phy_id_fmt);
- 
--	phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link, interface);
-+		phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link,
-+				     interface);
-+	}
- 
- 	if (IS_ERR(phydev)) {
- 		pr_err("%s: Could not attach to PHY\n", dev->name);
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-@@ -27,6 +27,7 @@
- #include <linux/of.h>
- #include <linux/of_net.h>
- #include <linux/of_device.h>
-+#include <linux/of_mdio.h>
- 
- #include "stmmac.h"
- #include "stmmac_platform.h"
-@@ -167,13 +168,16 @@ static int stmmac_probe_config_dt(struct
- 	/* Default to phy auto-detection */
- 	plat->phy_addr = -1;
- 
-+	/* If we find a phy-handle property, use it as the PHY */
-+	plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
-+
- 	/* "snps,phy-addr" is not a standard property. Mark it as deprecated
- 	 * and warn of its use. Remove this when phy node support is added.
- 	 */
- 	if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
- 		dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
- 
--	if (plat->phy_bus_name)
-+	if (plat->phy_node || plat->phy_bus_name)
- 		plat->mdio_bus_data = NULL;
- 	else
- 		plat->mdio_bus_data =
---- a/include/linux/stmmac.h
-+++ b/include/linux/stmmac.h
-@@ -99,6 +99,7 @@ struct plat_stmmacenet_data {
- 	int phy_addr;
- 	int interface;
- 	struct stmmac_mdio_bus_data *mdio_bus_data;
-+	struct device_node *phy_node;
- 	struct stmmac_dma_cfg *dma_cfg;
- 	int clk_csr;
- 	int has_gmac;
diff --git a/target/linux/ipq806x/patches-4.0/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch b/target/linux/ipq806x/patches-4.0/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch
deleted file mode 100644
index 3b2134e..0000000
--- a/target/linux/ipq806x/patches-4.0/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 0149d275415cd1b2382ce94e5eb32641590097d0 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Fri, 8 May 2015 15:57:12 -0700
-Subject: [PATCH 2/8] stmmac: move error path at the end of
- stmmac_probe_config_dt()
-
-We will want to do additional clean-up on certain errors. Therefore,
-this change moves the error path at the end of the function for better
-code readability.
-
-This patch doesn't change anything functionally.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- .../net/ethernet/stmicro/stmmac/stmmac_platform.c  | 22 ++++++++++++++++------
- 1 file changed, 16 insertions(+), 6 deletions(-)
-
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-@@ -129,13 +129,18 @@ static int stmmac_probe_config_dt(struct
- 	struct device_node *np = pdev->dev.of_node;
- 	struct stmmac_dma_cfg *dma_cfg;
- 	const struct of_device_id *device;
-+	int ret;
- 
--	if (!np)
--		return -ENODEV;
-+	if (!np) {
-+		ret = -ENODEV;
-+		goto err;
-+	}
- 
- 	device = of_match_device(stmmac_dt_ids, &pdev->dev);
--	if (!device)
--		return -ENODEV;
-+	if (!device) {
-+		ret = -ENODEV;
-+		goto err;
-+	}
- 
- 	if (device->data) {
- 		const struct stmmac_of_data *data = device->data;
-@@ -231,8 +236,10 @@ static int stmmac_probe_config_dt(struct
- 	if (of_find_property(np, "snps,pbl", NULL)) {
- 		dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
- 				       GFP_KERNEL);
--		if (!dma_cfg)
--			return -ENOMEM;
-+		if (!dma_cfg) {
-+			ret = -ENOMEM;
-+			goto err;
-+		}
- 		plat->dma_cfg = dma_cfg;
- 		of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
- 		dma_cfg->fixed_burst =
-@@ -250,6 +257,9 @@ static int stmmac_probe_config_dt(struct
- 	}
- 
- 	return 0;
-+
-+err:
-+	return ret;
- }
- #else
- static int stmmac_probe_config_dt(struct platform_device *pdev,
diff --git a/target/linux/ipq806x/patches-4.0/703-stmmac-add-fixed-link-device-tree-support.patch b/target/linux/ipq806x/patches-4.0/703-stmmac-add-fixed-link-device-tree-support.patch
deleted file mode 100644
index 4b2c9b5..0000000
--- a/target/linux/ipq806x/patches-4.0/703-stmmac-add-fixed-link-device-tree-support.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 3a95f75867be562cb919ff23a738f70357188fbd Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Fri, 8 May 2015 16:02:03 -0700
-Subject: [PATCH 3/8] stmmac: add fixed-link device-tree support
-
-In case DT is used, this change adds the ability to the stmmac driver to
-detect a fixed-link PHY, instanciate it, and use it during
-phy_connect().
-
-Fixed link PHYs DT usage is described in:
-Documentation/devicetree/bindings/net/fixed-link.txt
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c     |  2 +-
- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 +++++++++++-
- 2 files changed, 12 insertions(+), 2 deletions(-)
-
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -856,7 +856,7 @@ static int stmmac_init_phy(struct net_de
- 	 * device as well.
- 	 * Note: phydev->phy_id is the result of reading the UID PHY registers.
- 	 */
--	if (phydev->phy_id == 0) {
-+	if (!priv->plat->phy_node && phydev->phy_id == 0) {
- 		phy_disconnect(phydev);
- 		return -ENODEV;
- 	}
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-@@ -176,6 +176,14 @@ static int stmmac_probe_config_dt(struct
- 	/* If we find a phy-handle property, use it as the PHY */
- 	plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
- 
-+	/* If phy-handle is not specified, check if we have a fixed-phy */
-+	if (!plat->phy_node && of_phy_is_fixed_link(np)) {
-+		if ((of_phy_register_fixed_link(np) < 0))
-+			return -ENODEV;
-+
-+		plat->phy_node = of_node_get(np);
-+	}
-+
- 	/* "snps,phy-addr" is not a standard property. Mark it as deprecated
- 	 * and warn of its use. Remove this when phy node support is added.
- 	 */
-@@ -238,7 +246,7 @@ static int stmmac_probe_config_dt(struct
- 				       GFP_KERNEL);
- 		if (!dma_cfg) {
- 			ret = -ENOMEM;
--			goto err;
-+			goto err2;
- 		}
- 		plat->dma_cfg = dma_cfg;
- 		of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
-@@ -258,6 +266,8 @@ static int stmmac_probe_config_dt(struct
- 
- 	return 0;
- 
-+err2:
-+	of_node_put(np);
- err:
- 	return ret;
- }
diff --git a/target/linux/ipq806x/patches-4.0/704-stmmac-add-ipq806x-glue-layer.patch b/target/linux/ipq806x/patches-4.0/704-stmmac-add-ipq806x-glue-layer.patch
deleted file mode 100644
index fecc958..0000000
--- a/target/linux/ipq806x/patches-4.0/704-stmmac-add-ipq806x-glue-layer.patch
+++ /dev/null
@@ -1,407 +0,0 @@
-From 69fb970ad3fe05af7cb99ea78230c69c7ca0d03b Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Fri, 8 May 2015 16:10:22 -0700
-Subject: [PATCH 4/8] stmmac: add ipq806x glue layer
-
-The ethernet controller available in IPQ806x is a Synopsys DesignWare
-Gigabit MAC IP core, already supported by the stmmac driver.
-
-This glue layer implements some platform specific settings required to
-get the controller working on an IPQ806x based platform.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- drivers/net/ethernet/stmicro/stmmac/Kconfig        |   1 +
- drivers/net/ethernet/stmicro/stmmac/Makefile       |   2 +-
- drivers/net/ethernet/stmicro/stmmac/dwmac-ipq.c    | 324 +++++++++++++++++++++
- .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   1 +
- .../net/ethernet/stmicro/stmmac/stmmac_platform.h  |   1 +
- 5 files changed, 328 insertions(+), 1 deletion(-)
- create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-ipq.c
-
---- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
-+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
-@@ -16,6 +16,7 @@ if STMMAC_ETH
- config STMMAC_PLATFORM
- 	tristate "STMMAC Platform bus support"
- 	depends on STMMAC_ETH
-+	select MFD_SYSCON
- 	default y
- 	---help---
- 	  This selects the platform specific bus support for the stmmac driver.
---- a/drivers/net/ethernet/stmicro/stmmac/Makefile
-+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
-@@ -6,7 +6,7 @@ stmmac-objs:= stmmac_main.o stmmac_ethto
- 
- obj-$(CONFIG_STMMAC_PLATFORM) += stmmac-platform.o
- stmmac-platform-objs:= stmmac_platform.o dwmac-meson.o dwmac-sunxi.o	\
--		       dwmac-sti.o dwmac-socfpga.o dwmac-rk.o
-+		       dwmac-sti.o dwmac-socfpga.o dwmac-rk.o dwmac-ipq806x.o
- 
- obj-$(CONFIG_STMMAC_PCI) += stmmac-pci.o
- stmmac-pci-objs:= stmmac_pci.o
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-@@ -42,6 +42,7 @@ static const struct of_device_id stmmac_
- 	{ .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
- 	{ .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
- 	{ .compatible = "altr,socfpga-stmmac", .data = &socfpga_gmac_data },
-+	{ .compatible = "qcom,ipq806x-gmac", .data = &ipq806x_gmac_data },
- 	{ .compatible = "st,spear600-gmac"},
- 	{ .compatible = "snps,dwmac-3.610"},
- 	{ .compatible = "snps,dwmac-3.70a"},
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
-@@ -25,5 +25,6 @@ extern const struct stmmac_of_data stih4
- extern const struct stmmac_of_data stid127_dwmac_data;
- extern const struct stmmac_of_data socfpga_gmac_data;
- extern const struct stmmac_of_data rk3288_gmac_data;
-+extern const struct stmmac_of_data ipq806x_gmac_data;
- 
- #endif /* __STMMAC_PLATFORM_H__ */
---- /dev/null
-+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
-@@ -0,0 +1,343 @@
-+/*
-+ * Qualcomm Atheros IPQ806x GMAC glue layer
-+ *
-+ * Copyright (C) 2015 The Linux Foundation
-+ *
-+ * 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 WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#include <linux/device.h>
-+#include <linux/platform_device.h>
-+#include <linux/phy.h>
-+#include <linux/regmap.h>
-+#include <linux/clk.h>
-+#include <linux/reset.h>
-+#include <linux/of_net.h>
-+#include <linux/mfd/syscon.h>
-+#include <linux/stmmac.h>
-+#include <linux/of_mdio.h>
-+
-+#include "stmmac_platform.h"
-+
-+#define NSS_COMMON_CLK_GATE			0x8
-+#define NSS_COMMON_CLK_GATE_PTP_EN(x)		BIT(0x10 + x)
-+#define NSS_COMMON_CLK_GATE_RGMII_RX_EN(x)	BIT(0x9 + (x * 2))
-+#define NSS_COMMON_CLK_GATE_RGMII_TX_EN(x)	BIT(0x8 + (x * 2))
-+#define NSS_COMMON_CLK_GATE_GMII_RX_EN(x)	BIT(0x4 + x)
-+#define NSS_COMMON_CLK_GATE_GMII_TX_EN(x)	BIT(0x0 + x)
-+
-+#define NSS_COMMON_CLK_DIV0			0xC
-+#define NSS_COMMON_CLK_DIV_OFFSET(x)		(x * 8)
-+#define NSS_COMMON_CLK_DIV_MASK			0x7f
-+
-+#define NSS_COMMON_CLK_SRC_CTRL			0x14
-+#define NSS_COMMON_CLK_SRC_CTRL_OFFSET(x)	(1 << x)
-+/* Mode is coded on 1 bit but is different depending on the MAC ID:
-+ * MAC0: QSGMII=0 RGMII=1
-+ * MAC1: QSGMII=0 SGMII=0 RGMII=1
-+ * MAC2 & MAC3: QSGMII=0 SGMII=1
-+ */
-+#define NSS_COMMON_CLK_SRC_CTRL_RGMII(x)	1
-+#define NSS_COMMON_CLK_SRC_CTRL_SGMII(x)	((x >= 2) ? 1 : 0)
-+
-+#define NSS_COMMON_MACSEC_CTL			0x28
-+#define NSS_COMMON_MACSEC_CTL_EXT_BYPASS_EN(x)	(1 << x)
-+
-+#define NSS_COMMON_GMAC_CTL(x)			(0x30 + (x * 4))
-+#define NSS_COMMON_GMAC_CTL_CSYS_REQ		BIT(19)
-+#define NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL	BIT(16)
-+#define NSS_COMMON_GMAC_CTL_IFG_LIMIT_OFFSET	8
-+#define NSS_COMMON_GMAC_CTL_IFG_OFFSET		0
-+#define NSS_COMMON_GMAC_CTL_IFG_MASK		0x3f
-+
-+#define NSS_COMMON_CLK_DIV_RGMII_1000		1
-+#define NSS_COMMON_CLK_DIV_RGMII_100		9
-+#define NSS_COMMON_CLK_DIV_RGMII_10		99
-+#define NSS_COMMON_CLK_DIV_SGMII_1000		0
-+#define NSS_COMMON_CLK_DIV_SGMII_100		4
-+#define NSS_COMMON_CLK_DIV_SGMII_10		49
-+
-+#define QSGMII_PCS_MODE_CTL			0x68
-+#define QSGMII_PCS_MODE_CTL_AUTONEG_EN(x)	BIT((x * 8) + 7)
-+
-+#define QSGMII_PCS_CAL_LCKDT_CTL		0x120
-+#define QSGMII_PCS_CAL_LCKDT_CTL_RST		BIT(19)
-+
-+/* Only GMAC1/2/3 support SGMII and their CTL register are not contiguous */
-+#define QSGMII_PHY_SGMII_CTL(x)			((x == 1) ? 0x134 : \
-+						 (0x13c + (4 * (x - 2))))
-+#define QSGMII_PHY_CDR_EN			BIT(0)
-+#define QSGMII_PHY_RX_FRONT_EN			BIT(1)
-+#define QSGMII_PHY_RX_SIGNAL_DETECT_EN		BIT(2)
-+#define QSGMII_PHY_TX_DRIVER_EN			BIT(3)
-+#define QSGMII_PHY_QSGMII_EN			BIT(7)
-+#define QSGMII_PHY_PHASE_LOOP_GAIN_OFFSET	12
-+#define QSGMII_PHY_PHASE_LOOP_GAIN_MASK		0x7
-+#define QSGMII_PHY_RX_DC_BIAS_OFFSET		18
-+#define QSGMII_PHY_RX_DC_BIAS_MASK		0x3
-+#define QSGMII_PHY_RX_INPUT_EQU_OFFSET		20
-+#define QSGMII_PHY_RX_INPUT_EQU_MASK		0x3
-+#define QSGMII_PHY_CDR_PI_SLEW_OFFSET		22
-+#define QSGMII_PHY_CDR_PI_SLEW_MASK		0x3
-+#define QSGMII_PHY_TX_DRV_AMP_OFFSET		28
-+#define QSGMII_PHY_TX_DRV_AMP_MASK		0xf
-+
-+struct ipq806x_gmac {
-+	struct platform_device *pdev;
-+	struct regmap *nss_common;
-+	struct regmap *qsgmii_csr;
-+	uint32_t id;
-+	struct clk *core_clk;
-+	phy_interface_t phy_mode;
-+};
-+
-+static int get_clk_div_sgmii(struct ipq806x_gmac *gmac, unsigned int speed)
-+{
-+	struct device *dev = &gmac->pdev->dev;
-+	int div;
-+
-+	switch (speed) {
-+	case SPEED_1000:
-+		div = NSS_COMMON_CLK_DIV_SGMII_1000;
-+		break;
-+
-+	case SPEED_100:
-+		div = NSS_COMMON_CLK_DIV_SGMII_100;
-+		break;
-+
-+	case SPEED_10:
-+		div = NSS_COMMON_CLK_DIV_SGMII_10;
-+		break;
-+
-+	default:
-+		dev_err(dev, "Speed %dMbps not supported in SGMII\n", speed);
-+		return -EINVAL;
-+	}
-+
-+	return div;
-+}
-+
-+static int get_clk_div_rgmii(struct ipq806x_gmac *gmac, unsigned int speed)
-+{
-+	struct device *dev = &gmac->pdev->dev;
-+	int div;
-+
-+	switch (speed) {
-+	case SPEED_1000:
-+		div = NSS_COMMON_CLK_DIV_RGMII_1000;
-+		break;
-+
-+	case SPEED_100:
-+		div = NSS_COMMON_CLK_DIV_RGMII_100;
-+		break;
-+
-+	case SPEED_10:
-+		div = NSS_COMMON_CLK_DIV_RGMII_10;
-+		break;
-+
-+	default:
-+		dev_err(dev, "Speed %dMbps not supported in RGMII\n", speed);
-+		return -EINVAL;
-+	}
-+
-+	return div;
-+}
-+
-+static int ipq806x_gmac_set_speed(struct ipq806x_gmac *gmac, unsigned int speed)
-+{
-+	uint32_t clk_bits, val;
-+	int div;
-+
-+	switch (gmac->phy_mode) {
-+	case PHY_INTERFACE_MODE_RGMII:
-+		div = get_clk_div_rgmii(gmac, speed);
-+		clk_bits = NSS_COMMON_CLK_GATE_RGMII_RX_EN(gmac->id) |
-+			   NSS_COMMON_CLK_GATE_RGMII_TX_EN(gmac->id);
-+		break;
-+
-+	case PHY_INTERFACE_MODE_SGMII:
-+		div = get_clk_div_sgmii(gmac, speed);
-+		clk_bits = NSS_COMMON_CLK_GATE_GMII_RX_EN(gmac->id) |
-+			   NSS_COMMON_CLK_GATE_GMII_TX_EN(gmac->id);
-+		break;
-+
-+	default:
-+		dev_err(&gmac->pdev->dev, "Unsupported PHY mode: \"%s\"\n",
-+			phy_modes(gmac->phy_mode));
-+		return -EINVAL;
-+	}
-+
-+	/* Disable the clocks */
-+	regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
-+	val &= ~clk_bits;
-+	regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
-+
-+	/* Set the divider */
-+	regmap_read(gmac->nss_common, NSS_COMMON_CLK_DIV0, &val);
-+	val &= ~(NSS_COMMON_CLK_DIV_MASK
-+		 << NSS_COMMON_CLK_DIV_OFFSET(gmac->id));
-+	val |= div << NSS_COMMON_CLK_DIV_OFFSET(gmac->id);
-+	regmap_write(gmac->nss_common, NSS_COMMON_CLK_DIV0, val);
-+
-+	/* Enable the clock back */
-+	regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
-+	val |= clk_bits;
-+	regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
-+
-+	return 0;
-+}
-+
-+static void *ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
-+{
-+	struct device *dev = &gmac->pdev->dev;
-+
-+	gmac->phy_mode = of_get_phy_mode(dev->of_node);
-+	if (gmac->phy_mode < 0) {
-+		dev_err(dev, "missing phy mode property\n");
-+		return ERR_PTR(-EINVAL);
-+	}
-+
-+	if (of_property_read_u32(dev->of_node, "qcom,id", &gmac->id) < 0) {
-+		dev_err(dev, "missing qcom id property\n");
-+		return ERR_PTR(-EINVAL);
-+	}
-+
-+	/* The GMACs are called 1 to 4 in the documentation, but to simplify the
-+	 * code and keep it consistent with the Linux convention, we'll number
-+	 * them from 0 to 3 here.
-+	 */
-+	if (gmac->id < 0 || gmac->id > 3) {
-+		dev_err(dev, "invalid gmac id\n");
-+		return ERR_PTR(-EINVAL);
-+	}
-+
-+	gmac->core_clk = devm_clk_get(dev, "stmmaceth");
-+	if (IS_ERR(gmac->core_clk)) {
-+		dev_err(dev, "missing stmmaceth clk property\n");
-+		return gmac->core_clk;
-+	}
-+	clk_set_rate(gmac->core_clk, 266000000);
-+
-+	/* Setup the register map for the nss common registers */
-+	gmac->nss_common = syscon_regmap_lookup_by_phandle(dev->of_node,
-+							   "qcom,nss-common");
-+	if (IS_ERR(gmac->nss_common)) {
-+		dev_err(dev, "missing nss-common node\n");
-+		return gmac->nss_common;
-+	}
-+
-+	/* Setup the register map for the qsgmii csr registers */
-+	gmac->qsgmii_csr = syscon_regmap_lookup_by_phandle(dev->of_node,
-+							   "qcom,qsgmii-csr");
-+	if (IS_ERR(gmac->qsgmii_csr)) {
-+		dev_err(dev, "missing qsgmii-csr node\n");
-+		return gmac->qsgmii_csr;
-+	}
-+
-+	return NULL;
-+}
-+
-+static void *ipq806x_gmac_setup(struct platform_device *pdev)
-+{
-+	struct device *dev = &pdev->dev;
-+	struct ipq806x_gmac *gmac;
-+	int val;
-+	void *err;
-+
-+	gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL);
-+	if (!gmac)
-+		return ERR_PTR(-ENOMEM);
-+
-+	gmac->pdev = pdev;
-+
-+	err = ipq806x_gmac_of_parse(gmac);
-+	if (err) {
-+		dev_err(dev, "device tree parsing error\n");
-+		return err;
-+	}
-+
-+	regmap_write(gmac->qsgmii_csr, QSGMII_PCS_CAL_LCKDT_CTL,
-+		     QSGMII_PCS_CAL_LCKDT_CTL_RST);
-+
-+	/* Inter frame gap is set to 12 */
-+	val = 12 << NSS_COMMON_GMAC_CTL_IFG_OFFSET |
-+	      12 << NSS_COMMON_GMAC_CTL_IFG_LIMIT_OFFSET;
-+	/* We also initiate an AXI low power exit request */
-+	val |= NSS_COMMON_GMAC_CTL_CSYS_REQ;
-+	switch (gmac->phy_mode) {
-+	case PHY_INTERFACE_MODE_RGMII:
-+		val |= NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL;
-+		break;
-+	case PHY_INTERFACE_MODE_SGMII:
-+		val &= ~NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL;
-+		break;
-+	default:
-+		dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n",
-+			phy_modes(gmac->phy_mode));
-+		return NULL;
-+	}
-+	regmap_write(gmac->nss_common, NSS_COMMON_GMAC_CTL(gmac->id), val);
-+
-+	/* Configure the clock src according to the mode */
-+	regmap_read(gmac->nss_common, NSS_COMMON_CLK_SRC_CTRL, &val);
-+	val &= ~NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id);
-+	switch (gmac->phy_mode) {
-+	case PHY_INTERFACE_MODE_RGMII:
-+		val |= NSS_COMMON_CLK_SRC_CTRL_RGMII(gmac->id) <<
-+			NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id);
-+		break;
-+	case PHY_INTERFACE_MODE_SGMII:
-+		val |= NSS_COMMON_CLK_SRC_CTRL_SGMII(gmac->id) <<
-+			NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id);
-+		break;
-+	default:
-+		dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n",
-+			phy_modes(gmac->phy_mode));
-+		return NULL;
-+	}
-+	regmap_write(gmac->nss_common, NSS_COMMON_CLK_SRC_CTRL, val);
-+
-+	/* Enable PTP clock */
-+	regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
-+	val |= NSS_COMMON_CLK_GATE_PTP_EN(gmac->id);
-+	regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
-+
-+	if (gmac->phy_mode == PHY_INTERFACE_MODE_SGMII) {
-+		regmap_write(gmac->qsgmii_csr, QSGMII_PHY_SGMII_CTL(gmac->id),
-+			     QSGMII_PHY_CDR_EN |
-+			     QSGMII_PHY_RX_FRONT_EN |
-+			     QSGMII_PHY_RX_SIGNAL_DETECT_EN |
-+			     QSGMII_PHY_TX_DRIVER_EN |
-+			     QSGMII_PHY_QSGMII_EN |
-+			     0x4 << QSGMII_PHY_PHASE_LOOP_GAIN_OFFSET |
-+			     0x3 << QSGMII_PHY_RX_DC_BIAS_OFFSET |
-+			     0x1 << QSGMII_PHY_RX_INPUT_EQU_OFFSET |
-+			     0x2 << QSGMII_PHY_CDR_PI_SLEW_OFFSET |
-+			     0xC << QSGMII_PHY_TX_DRV_AMP_OFFSET);
-+	}
-+
-+	return gmac;
-+}
-+
-+static void ipq806x_gmac_fix_mac_speed(void *priv, unsigned int speed)
-+{
-+	struct ipq806x_gmac *gmac = priv;
-+
-+	ipq806x_gmac_set_speed(gmac, speed);
-+}
-+
-+const struct stmmac_of_data ipq806x_gmac_data = {
-+	.has_gmac	= 1,
-+	.setup		= ipq806x_gmac_setup,
-+	.fix_mac_speed	= ipq806x_gmac_fix_mac_speed,
-+};
diff --git a/target/linux/ipq806x/patches-4.0/705-net-stmmac-ipq806x-document-device-tree-bindings.patch b/target/linux/ipq806x/patches-4.0/705-net-stmmac-ipq806x-document-device-tree-bindings.patch
deleted file mode 100644
index 3144fa3..0000000
--- a/target/linux/ipq806x/patches-4.0/705-net-stmmac-ipq806x-document-device-tree-bindings.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 0f9605d9409b77a89daef91cc68239fc2ff50457 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Fri, 8 May 2015 16:51:25 -0700
-Subject: [PATCH 5/8] net: stmmac: ipq806x: document device tree bindings
-
-Add the device tree bindings documentation for the QCA IPQ806x
-variant of the Synopsys DesignWare MAC.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- .../devicetree/bindings/net/ipq806x-dwmac.txt      | 35 ++++++++++++++++++++++
- 1 file changed, 35 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/net/ipq806x-dwmac.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/net/ipq806x-dwmac.txt
-@@ -0,0 +1,35 @@
-+* IPQ806x DWMAC Ethernet controller
-+
-+The device inherits all the properties of the dwmac/stmmac devices
-+described in the file net/stmmac.txt with the following changes.
-+
-+Required properties:
-+
-+- compatible: should be "qcom,ipq806x-gmac" along with "snps,dwmac"
-+	      and any applicable more detailed version number
-+	      described in net/stmmac.txt
-+
-+- qcom,nss-common: should contain a phandle to a syscon device mapping the
-+		   nss-common registers.
-+
-+- qcom,qsgmii-csr: should contain a phandle to a syscon device mapping the
-+		   qsgmii-csr registers.
-+
-+Example:
-+
-+	gmac: ethernet at 37000000 {
-+		device_type = "network";
-+		compatible = "qcom,ipq806x-gmac";
-+		reg = <0x37000000 0x200000>;
-+		interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
-+		interrupt-names = "macirq";
-+
-+		qcom,nss-common = <&nss_common>;
-+		qcom,qsgmii-csr = <&qsgmii_csr>;
-+
-+		clocks = <&gcc GMAC_CORE1_CLK>;
-+		clock-names = "stmmaceth";
-+
-+		resets = <&gcc GMAC_CORE1_RESET>;
-+		reset-names = "stmmaceth";
-+	};
diff --git a/target/linux/ipq806x/patches-4.0/706-net-stmmac-create-one-debugfs-dir-per-net-device.patch b/target/linux/ipq806x/patches-4.0/706-net-stmmac-create-one-debugfs-dir-per-net-device.patch
deleted file mode 100644
index a9a2d55..0000000
--- a/target/linux/ipq806x/patches-4.0/706-net-stmmac-create-one-debugfs-dir-per-net-device.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-From df944689d491e6af533173bf2ef448c3dd334f15 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Mon, 11 May 2015 15:15:25 -0700
-Subject: [PATCH 6/8] net: stmmac: create one debugfs dir per net-device
-
-stmmac DebugFS entries are currently global to the driver. As a result,
-having more than one stmmac device in the system creates the following
-error:
-* ERROR stmmaceth, debugfs create directory failed
-* stmmac_hw_setup: failed debugFS registration
-
-This also results in being able to access the debugfs information for
-the first registered device only.
-
-This patch changes the debugfs structure to have one sub-directory per
-net-device. Files under "/sys/kernel/debug/stmmaceth" will now show-up
-under /sys/kernel/debug/stmmaceth/ethN/.
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- drivers/net/ethernet/stmicro/stmmac/stmmac.h      |  6 ++
- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 76 ++++++++++++++++-------
- 2 files changed, 59 insertions(+), 23 deletions(-)
-
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
-@@ -116,6 +116,12 @@ struct stmmac_priv {
- 	int use_riwt;
- 	int irq_wake;
- 	spinlock_t ptp_lock;
-+
-+#ifdef CONFIG_DEBUG_FS
-+	struct dentry *dbgfs_dir;
-+	struct dentry *dbgfs_rings_status;
-+	struct dentry *dbgfs_dma_cap;
-+#endif
- };
- 
- int stmmac_mdio_unregister(struct net_device *ndev);
---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -119,7 +119,7 @@ static irqreturn_t stmmac_interrupt(int
- 
- #ifdef CONFIG_DEBUG_FS
- static int stmmac_init_fs(struct net_device *dev);
--static void stmmac_exit_fs(void);
-+static void stmmac_exit_fs(struct net_device *dev);
- #endif
- 
- #define STMMAC_COAL_TIMER(x) (jiffies + usecs_to_jiffies(x))
-@@ -1918,7 +1918,7 @@ static int stmmac_release(struct net_dev
- 	netif_carrier_off(dev);
- 
- #ifdef CONFIG_DEBUG_FS
--	stmmac_exit_fs();
-+	stmmac_exit_fs(dev);
- #endif
- 
- 	stmmac_release_ptp(priv);
-@@ -2510,8 +2510,6 @@ static int stmmac_ioctl(struct net_devic
- 
- #ifdef CONFIG_DEBUG_FS
- static struct dentry *stmmac_fs_dir;
--static struct dentry *stmmac_rings_status;
--static struct dentry *stmmac_dma_cap;
- 
- static void sysfs_display_ring(void *head, int size, int extend_desc,
- 			       struct seq_file *seq)
-@@ -2650,36 +2648,39 @@ static const struct file_operations stmm
- 
- static int stmmac_init_fs(struct net_device *dev)
- {
--	/* Create debugfs entries */
--	stmmac_fs_dir = debugfs_create_dir(STMMAC_RESOURCE_NAME, NULL);
-+	struct stmmac_priv *priv = netdev_priv(dev);
-+
-+	/* Create per netdev entries */
-+	priv->dbgfs_dir = debugfs_create_dir(dev->name, stmmac_fs_dir);
- 
--	if (!stmmac_fs_dir || IS_ERR(stmmac_fs_dir)) {
--		pr_err("ERROR %s, debugfs create directory failed\n",
--		       STMMAC_RESOURCE_NAME);
-+	if (!priv->dbgfs_dir || IS_ERR(priv->dbgfs_dir)) {
-+		pr_err("ERROR %s/%s, debugfs create directory failed\n",
-+		       STMMAC_RESOURCE_NAME, dev->name);
- 
- 		return -ENOMEM;
- 	}
- 
- 	/* Entry to report DMA RX/TX rings */
--	stmmac_rings_status = debugfs_create_file("descriptors_status",
--						  S_IRUGO, stmmac_fs_dir, dev,
--						  &stmmac_rings_status_fops);
-+	priv->dbgfs_rings_status =
-+		debugfs_create_file("descriptors_status", S_IRUGO,
-+				    priv->dbgfs_dir, dev,
-+				    &stmmac_rings_status_fops);
- 
--	if (!stmmac_rings_status || IS_ERR(stmmac_rings_status)) {
-+	if (!priv->dbgfs_rings_status || IS_ERR(priv->dbgfs_rings_status)) {
- 		pr_info("ERROR creating stmmac ring debugfs file\n");
--		debugfs_remove(stmmac_fs_dir);
-+		debugfs_remove_recursive(priv->dbgfs_dir);
- 
- 		return -ENOMEM;
- 	}
- 
- 	/* Entry to report the DMA HW features */
--	stmmac_dma_cap = debugfs_create_file("dma_cap", S_IRUGO, stmmac_fs_dir,
--					     dev, &stmmac_dma_cap_fops);
-+	priv->dbgfs_dma_cap = debugfs_create_file("dma_cap", S_IRUGO,
-+					    priv->dbgfs_dir,
-+					    dev, &stmmac_dma_cap_fops);
- 
--	if (!stmmac_dma_cap || IS_ERR(stmmac_dma_cap)) {
-+	if (!priv->dbgfs_dma_cap || IS_ERR(priv->dbgfs_dma_cap)) {
- 		pr_info("ERROR creating stmmac MMC debugfs file\n");
--		debugfs_remove(stmmac_rings_status);
--		debugfs_remove(stmmac_fs_dir);
-+		debugfs_remove_recursive(priv->dbgfs_dir);
- 
- 		return -ENOMEM;
- 	}
-@@ -2687,11 +2688,11 @@ static int stmmac_init_fs(struct net_dev
- 	return 0;
- }
- 
--static void stmmac_exit_fs(void)
-+static void stmmac_exit_fs(struct net_device *dev)
- {
--	debugfs_remove(stmmac_rings_status);
--	debugfs_remove(stmmac_dma_cap);
--	debugfs_remove(stmmac_fs_dir);
-+	struct stmmac_priv *priv = netdev_priv(dev);
-+
-+	debugfs_remove_recursive(priv->dbgfs_dir);
- }
- #endif /* CONFIG_DEBUG_FS */
- 
-@@ -3136,6 +3137,35 @@ err:
- __setup("stmmaceth=", stmmac_cmdline_opt);
- #endif /* MODULE */
- 
-+static int __init stmmac_init(void)
-+{
-+#ifdef CONFIG_DEBUG_FS
-+	/* Create debugfs main directory if it doesn't exist yet */
-+	if (stmmac_fs_dir == NULL) {
-+		stmmac_fs_dir = debugfs_create_dir(STMMAC_RESOURCE_NAME, NULL);
-+
-+		if (!stmmac_fs_dir || IS_ERR(stmmac_fs_dir)) {
-+			pr_err("ERROR %s, debugfs create directory failed\n",
-+			       STMMAC_RESOURCE_NAME);
-+
-+			return -ENOMEM;
-+		}
-+	}
-+#endif
-+
-+	return 0;
-+}
-+
-+static void __exit stmmac_exit(void)
-+{
-+#ifdef CONFIG_DEBUG_FS
-+	debugfs_remove_recursive(stmmac_fs_dir);
-+#endif
-+}
-+
-+module_init(stmmac_init)
-+module_exit(stmmac_exit)
-+
- MODULE_DESCRIPTION("STMMAC 10/100/1000 Ethernet device driver");
- MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro at st.com>");
- MODULE_LICENSE("GPL");
diff --git a/target/linux/ipq806x/patches-4.0/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.0/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
deleted file mode 100644
index 20d8502..0000000
--- a/target/linux/ipq806x/patches-4.0/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-From e81de9d28bd0421c236df322872e64edf4ee1852 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Mon, 11 May 2015 16:32:09 -0700
-Subject: [PATCH 7/8] ARM: dts: qcom: add mdio nodes to ap148 & db149
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 40 ++++++++++++++++++++++++++-
- arch/arm/boot/dts/qcom-ipq8064-db149.dts | 46 ++++++++++++++++++++++++++++++++
- 2 files changed, 85 insertions(+), 1 deletion(-)
-
---- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -14,8 +14,9 @@
- 		};
- 	};
- 
--	alias {
-+	aliases {
- 		serial0 = &uart4;
-+		mdio-gpio0 = &mdio0;
- 	};
- 
- 	chosen {
-@@ -54,6 +55,15 @@
- 					bias-none;
- 				};
- 			};
-+
-+			mdio0_pins: mdio0_pins {
-+				mux {
-+					pins = "gpio0", "gpio1";
-+					function = "gpio";
-+					drive-strength = <8>;
-+					bias-disable;
-+				};
-+			};
- 		};
- 
- 		gsbi at 16300000 {
-@@ -139,5 +149,33 @@
- 			pinctrl-0 = <&pcie2_pins>;
- 			pinctrl-names = "default";
- 		};
-+
-+		mdio0: mdio {
-+			compatible = "virtual,mdio-gpio";
-+			#address-cells = <1>;
-+			#size-cells = <0>;
-+			gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
-+			pinctrl-0 = <&mdio0_pins>;
-+			pinctrl-names = "default";
-+
-+			phy0: ethernet-phy at 0 {
-+				device_type = "ethernet-phy";
-+				reg = <0>;
-+				qca,ar8327-initvals = <
-+					0x00004 0x7600000   /* PAD0_MODE */
-+					0x00008 0x1000000   /* PAD5_MODE */
-+					0x0000c 0x80        /* PAD6_MODE */
-+					0x000e4 0xaa545     /* MAC_POWER_SEL */
-+					0x000e0 0xc74164de  /* SGMII_CTRL */
-+					0x0007c 0x4e        /* PORT0_STATUS */
-+					0x00094 0x4e        /* PORT6_STATUS */
-+					>;
-+			};
-+
-+			phy4: ethernet-phy at 4 {
-+				device_type = "ethernet-phy";
-+				reg = <4>;
-+			};
-+		};
- 	};
- };
---- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -16,6 +16,7 @@
- 
- 	alias {
- 		serial0 = &uart2;
-+		mdio-gpio0 = &mdio0;
- 	};
- 
- 	chosen {
-@@ -62,6 +63,15 @@
- 					bias-none;
- 				};
- 			};
-+
-+			mdio0_pins: mdio0_pins {
-+				mux {
-+					pins = "gpio0", "gpio1";
-+					function = "gpio";
-+					drive-strength = <8>;
-+					bias-disable;
-+				};
-+			};
- 		};
- 
- 		gsbi2: gsbi at 12480000 {
-@@ -173,5 +183,44 @@
- 			pinctrl-0 = <&pcie3_pins>;
- 			pinctrl-names = "default";
- 		};
-+
-+		mdio0: mdio {
-+			compatible = "virtual,mdio-gpio";
-+			#address-cells = <1>;
-+			#size-cells = <0>;
-+			gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
-+
-+			pinctrl-0 = <&mdio0_pins>;
-+			pinctrl-names = "default";
-+
-+			phy0: ethernet-phy at 0 {
-+				device_type = "ethernet-phy";
-+				reg = <0>;
-+				qca,ar8327-initvals = <
-+					0x00004 0x7600000   /* PAD0_MODE */
-+					0x00008 0x1000000   /* PAD5_MODE */
-+					0x0000c 0x80        /* PAD6_MODE */
-+					0x000e4 0xaa545     /* MAC_POWER_SEL */
-+					0x000e0 0xc74164de  /* SGMII_CTRL */
-+					0x0007c 0x4e        /* PORT0_STATUS */
-+					0x00094 0x4e        /* PORT6_STATUS */
-+				>;
-+			};
-+
-+			phy4: ethernet-phy at 4 {
-+				device_type = "ethernet-phy";
-+				reg = <4>;
-+			};
-+
-+			phy6: ethernet-phy at 6 {
-+				device_type = "ethernet-phy";
-+				reg = <6>;
-+			};
-+
-+			phy7: ethernet-phy at 7 {
-+				device_type = "ethernet-phy";
-+				reg = <7>;
-+			};
-+		};
- 	};
- };
diff --git a/target/linux/ipq806x/patches-4.0/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.0/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
deleted file mode 100644
index 6a14f9f..0000000
--- a/target/linux/ipq806x/patches-4.0/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ /dev/null
@@ -1,210 +0,0 @@
-From cab1f4720e82f2e17eaeed9a9ad9e4f07c742977 Mon Sep 17 00:00:00 2001
-From: Mathieu Olivari <mathieu at codeaurora.org>
-Date: Mon, 11 May 2015 12:29:18 -0700
-Subject: [PATCH 8/8] ARM: dts: qcom: add gmac nodes to ipq806x platforms
-
-Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
----
- arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 31 ++++++++++++
- arch/arm/boot/dts/qcom-ipq8064-db149.dts | 43 ++++++++++++++++
- arch/arm/boot/dts/qcom-ipq8064.dtsi      | 86 ++++++++++++++++++++++++++++++++
- 3 files changed, 160 insertions(+)
-
---- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -64,6 +64,16 @@
- 					bias-disable;
- 				};
- 			};
-+
-+			rgmii2_pins: rgmii2_pins {
-+				mux {
-+					pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
-+					       "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
-+					function = "rgmii2";
-+					drive-strength = <8>;
-+					bias-disable;
-+				};
-+			};
- 		};
- 
- 		gsbi at 16300000 {
-@@ -177,5 +187,26 @@
- 				reg = <4>;
- 			};
- 		};
-+
-+		gmac1: ethernet at 37200000 {
-+			status = "ok";
-+			phy-mode = "rgmii";
-+			phy-handle = <&phy4>;
-+			qcom,id = <1>;
-+
-+			pinctrl-0 = <&rgmii2_pins>;
-+			pinctrl-names = "default";
-+		};
-+
-+		gmac2: ethernet at 37400000 {
-+			status = "ok";
-+			phy-mode = "sgmii";
-+			qcom,id = <2>;
-+
-+			fixed-link {
-+				speed = <1000>;
-+				full-duplex;
-+			};
-+		};
- 	};
- };
---- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -72,6 +72,14 @@
- 					bias-disable;
- 				};
- 			};
-+
-+			rgmii0_pins: rgmii0_pins {
-+				mux {
-+					pins = "gpio2", "gpio66";
-+					drive-strength = <8>;
-+					bias-disable;
-+				};
-+			};
- 		};
- 
- 		gsbi2: gsbi at 12480000 {
-@@ -222,5 +230,40 @@
- 				reg = <7>;
- 			};
- 		};
-+
-+		gmac0: ethernet at 37000000 {
-+			status = "ok";
-+			phy-mode = "rgmii";
-+			qcom,id = <0>;
-+			phy-handle = <&phy4>;
-+
-+			pinctrl-0 = <&rgmii0_pins>;
-+			pinctrl-names = "default";
-+		};
-+
-+		gmac1: ethernet at 37200000 {
-+			status = "ok";
-+			phy-mode = "sgmii";
-+			qcom,id = <1>;
-+
-+			fixed-link {
-+				speed = <1000>;
-+				full-duplex;
-+			};
-+		};
-+
-+		gmac2: ethernet at 37400000 {
-+			status = "ok";
-+			phy-mode = "sgmii";
-+			qcom,id = <2>;
-+			phy-handle = <&phy6>;
-+		};
-+
-+		gmac3: ethernet at 37600000 {
-+			status = "ok";
-+			phy-mode = "sgmii";
-+			qcom,id = <3>;
-+			phy-handle = <&phy7>;
-+		};
- 	};
- };
---- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
-+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -540,5 +540,91 @@
- 
- 			status = "disabled";
- 		};
-+
-+		nss_common: syscon at 03000000 {
-+			compatible = "syscon";
-+			reg = <0x03000000 0x0000FFFF>;
-+		};
-+
-+		qsgmii_csr: syscon at 1bb00000 {
-+			compatible = "syscon";
-+			reg = <0x1bb00000 0x000001FF>;
-+		};
-+
-+		gmac0: ethernet at 37000000 {
-+			device_type = "network";
-+			compatible = "qcom,ipq806x-gmac";
-+			reg = <0x37000000 0x200000>;
-+			interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
-+			interrupt-names = "macirq";
-+
-+			qcom,nss-common = <&nss_common>;
-+			qcom,qsgmii-csr = <&qsgmii_csr>;
-+
-+			clocks = <&gcc GMAC_CORE1_CLK>;
-+			clock-names = "stmmaceth";
-+
-+			resets = <&gcc GMAC_CORE1_RESET>;
-+			reset-names = "stmmaceth";
-+
-+			status = "disabled";
-+		};
-+
-+		gmac1: ethernet at 37200000 {
-+			device_type = "network";
-+			compatible = "qcom,ipq806x-gmac";
-+			reg = <0x37200000 0x200000>;
-+			interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
-+			interrupt-names = "macirq";
-+
-+			qcom,nss-common = <&nss_common>;
-+			qcom,qsgmii-csr = <&qsgmii_csr>;
-+
-+			clocks = <&gcc GMAC_CORE2_CLK>;
-+			clock-names = "stmmaceth";
-+
-+			resets = <&gcc GMAC_CORE2_RESET>;
-+			reset-names = "stmmaceth";
-+
-+			status = "disabled";
-+		};
-+
-+		gmac2: ethernet at 37400000 {
-+			device_type = "network";
-+			compatible = "qcom,ipq806x-gmac";
-+			reg = <0x37400000 0x200000>;
-+			interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
-+			interrupt-names = "macirq";
-+
-+			qcom,nss-common = <&nss_common>;
-+			qcom,qsgmii-csr = <&qsgmii_csr>;
-+
-+			clocks = <&gcc GMAC_CORE3_CLK>;
-+			clock-names = "stmmaceth";
-+
-+			resets = <&gcc GMAC_CORE3_RESET>;
-+			reset-names = "stmmaceth";
-+
-+			status = "disabled";
-+		};
-+
-+		gmac3: ethernet at 37600000 {
-+			device_type = "network";
-+			compatible = "qcom,ipq806x-gmac";
-+			reg = <0x37600000 0x200000>;
-+			interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
-+			interrupt-names = "macirq";
-+
-+			qcom,nss-common = <&nss_common>;
-+			qcom,qsgmii-csr = <&qsgmii_csr>;
-+
-+			clocks = <&gcc GMAC_CORE4_CLK>;
-+			clock-names = "stmmaceth";
-+
-+			resets = <&gcc GMAC_CORE4_RESET>;
-+			reset-names = "stmmaceth";
-+
-+			status = "disabled";
-+		};
- 	};
- };
diff --git a/target/linux/ipq806x/patches-4.1/020-add-ap148-bootargs.patch b/target/linux/ipq806x/patches-4.1/020-add-ap148-bootargs.patch
new file mode 100644
index 0000000..c0ad74c
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/020-add-ap148-bootargs.patch
@@ -0,0 +1,46 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -14,6 +14,14 @@
+ 		};
+ 	};
+ 
++	alias {
++		serial0 = &uart4;
++	};
++
++	chosen {
++		linux,stdout-path = "serial0:115200n8";
++	};
++
+ 	soc {
+ 		pinmux at 800000 {
+ 			i2c4_pins: i2c4_pinmux {
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -159,7 +159,7 @@
+ 
+ 			syscon-tcsr = <&tcsr>;
+ 
+-			serial at 12490000 {
++			uart2: serial at 12490000 {
+ 				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+ 				reg = <0x12490000 0x1000>,
+ 				      <0x12480000 0x1000>;
+@@ -197,7 +197,7 @@
+ 
+ 			syscon-tcsr = <&tcsr>;
+ 
+-			serial at 16340000 {
++			uart4: serial at 16340000 {
+ 				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+ 				reg = <0x16340000 0x1000>,
+ 				      <0x16300000 0x1000>;
+@@ -234,7 +234,7 @@
+ 
+ 			syscon-tcsr = <&tcsr>;
+ 
+-			serial at 1a240000 {
++			uart5: serial at 1a240000 {
+ 				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+ 				reg = <0x1a240000 0x1000>,
+ 				      <0x1a200000 0x1000>;
diff --git a/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch b/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
new file mode 100644
index 0000000..34eb9c0
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
@@ -0,0 +1,35 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -78,13 +78,28 @@
+ 					reg = <0>;
+ 
+ 					partition at 0 {
+-						label = "rootfs";
+-						reg = <0x0 0x1000000>;
++						label = "lowlevel_init";
++						reg = <0x0 0x1b0000>;
+ 					};
+ 
+ 					partition at 1 {
+-						label = "scratch";
+-						reg = <0x1000000 0x1000000>;
++						label = "u-boot";
++						reg = <0x1b0000 0x80000>;
++					};
++
++					partition at 2 {
++						label = "u-boot-env";
++						reg = <0x230000 0x40000>;
++					};
++
++					partition at 3 {
++						label = "caldata";
++						reg = <0x270000 0x40000>;
++					};
++
++					partition at 4 {
++						label = "firmware";
++						reg = <0x2b0000 0x1d50000>;
+ 					};
+ 				};
+ 			};
diff --git a/target/linux/ipq806x/patches-4.1/022-add-db149-dts.patch b/target/linux/ipq806x/patches-4.1/022-add-db149-dts.patch
new file mode 100644
index 0000000..7d8c8e8
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/022-add-db149-dts.patch
@@ -0,0 +1,160 @@
+From f26cc3733bdd697bd81ae505fc133fa7c9b6ea19 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Tue, 7 Apr 2015 19:58:58 -0700
+Subject: [PATCH] ARM: dts: qcom: add initial DB149 device-tree
+
+Add basic DB149 (IPQ806x based platform) device-tree. It supports UART,
+SATA, USB2, USB3 and NOR flash.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/boot/dts/Makefile               |   1 +
+ arch/arm/boot/dts/qcom-ipq8064-db149.dts | 132 +++++++++++++++++++++++++++++++
+ 2 files changed, 133 insertions(+)
+ create mode 100644 arch/arm/boot/dts/qcom-ipq8064-db149.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -451,6 +451,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+ 	qcom-apq8084-ifc6540.dtb \
+ 	qcom-apq8084-mtp.dtb \
+ 	qcom-ipq8064-ap148.dtb \
++	qcom-ipq8064-db149.dtb \
+ 	qcom-msm8660-surf.dtb \
+ 	qcom-msm8960-cdp.dtb \
+ 	qcom-msm8974-sony-xperia-honami.dtb
+--- /dev/null
++++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
+@@ -0,0 +1,132 @@
++#include "qcom-ipq8064-v1.0.dtsi"
++
++/ {
++	model = "Qualcomm IPQ8064/DB149";
++	compatible = "qcom,ipq8064-db149", "qcom,ipq8064";
++
++	reserved-memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges;
++		rsvd at 41200000 {
++			reg = <0x41200000 0x300000>;
++			no-map;
++		};
++	};
++
++	alias {
++		serial0 = &uart2;
++	};
++
++	chosen {
++		linux,stdout-path = "serial0:115200n8";
++	};
++
++	soc {
++		pinmux at 800000 {
++			i2c4_pins: i2c4_pinmux {
++				pins = "gpio12", "gpio13";
++				function = "gsbi4";
++				bias-disable;
++			};
++
++			spi_pins: spi_pins {
++				mux {
++					pins = "gpio18", "gpio19", "gpio21";
++					function = "gsbi5";
++					drive-strength = <10>;
++					bias-none;
++				};
++			};
++		};
++
++		gsbi2: gsbi at 12480000 {
++			qcom,mode = <GSBI_PROT_I2C_UART>;
++			status = "ok";
++			uart2: serial at 12490000 {
++				status = "ok";
++			};
++		};
++
++		gsbi5: gsbi at 1a200000 {
++			qcom,mode = <GSBI_PROT_SPI>;
++			status = "ok";
++
++			spi4: spi at 1a280000 {
++				status = "ok";
++				spi-max-frequency = <50000000>;
++
++				pinctrl-0 = <&spi_pins>;
++				pinctrl-names = "default";
++
++				cs-gpios = <&qcom_pinmux 20 0>;
++
++				flash: m25p80 at 0 {
++					compatible = "s25fl256s1";
++					#address-cells = <1>;
++					#size-cells = <1>;
++					spi-max-frequency = <50000000>;
++					reg = <0>;
++					m25p,fast-read;
++
++					partition at 0 {
++						label = "lowlevel_init";
++						reg = <0x0 0x1b0000>;
++					};
++
++					partition at 1 {
++						label = "u-boot";
++						reg = <0x1b0000 0x80000>;
++					};
++
++					partition at 2 {
++						label = "u-boot-env";
++						reg = <0x230000 0x40000>;
++					};
++
++					partition at 3 {
++						label = "caldata";
++						reg = <0x270000 0x40000>;
++					};
++
++					partition at 4 {
++						label = "firmware";
++						reg = <0x2b0000 0x1d50000>;
++					};
++				};
++			};
++		};
++
++		sata-phy at 1b400000 {
++			status = "ok";
++		};
++
++		sata at 29000000 {
++			status = "ok";
++		};
++
++		phy at 100f8800 {		/* USB3 port 1 HS phy */
++			status = "ok";
++		};
++
++		phy at 100f8830 {		/* USB3 port 1 SS phy */
++			status = "ok";
++		};
++
++		phy at 110f8800 {		/* USB3 port 0 HS phy */
++			status = "ok";
++		};
++
++		phy at 110f8830 {		/* USB3 port 0 SS phy */
++			status = "ok";
++		};
++
++		usb30 at 0 {
++			status = "ok";
++		};
++
++		usb30 at 1 {
++			status = "ok";
++		};
++	};
++};
diff --git a/target/linux/ipq806x/patches-4.1/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch b/target/linux/ipq806x/patches-4.1/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
new file mode 100644
index 0000000..6b29637
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
@@ -0,0 +1,53 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -46,15 +46,12 @@
+ 			serial at 16340000 {
+ 				status = "ok";
+ 			};
+-
+-			i2c4: i2c at 16380000 {
+-				status = "ok";
+-
+-				clock-frequency = <200000>;
+-
+-				pinctrl-0 = <&i2c4_pins>;
+-				pinctrl-names = "default";
+-			};
++			/*
++			 * The i2c device on gsbi4 should not be enabled.
++			 * On ipq806x designs gsbi4 i2c is meant for exclusive
++			 * RPM usage. Turning this on in kernel manifests as
++			 * i2c failure for the RPM.
++			 */
+ 		};
+ 
+ 		gsbi5: gsbi at 1a200000 {
+--- a/drivers/clk/qcom/gcc-ipq806x.c
++++ b/drivers/clk/qcom/gcc-ipq806x.c
+@@ -807,7 +807,7 @@ static struct clk_rcg gsbi7_qup_src = {
+ 			.parent_names = gcc_pxo_pll8,
+ 			.num_parents = 2,
+ 			.ops = &clk_rcg_ops,
+-			.flags = CLK_SET_PARENT_GATE,
++			.flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED,
+ 		},
+ 	},
+ };
+@@ -823,7 +823,7 @@ static struct clk_branch gsbi7_qup_clk =
+ 			.parent_names = (const char *[]){ "gsbi7_qup_src" },
+ 			.num_parents = 1,
+ 			.ops = &clk_branch_ops,
+-			.flags = CLK_SET_RATE_PARENT,
++			.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
+ 		},
+ 	},
+ };
+@@ -871,7 +871,7 @@ static struct clk_branch gsbi4_h_clk = {
+ 		.hw.init = &(struct clk_init_data){
+ 			.name = "gsbi4_h_clk",
+ 			.ops = &clk_branch_ops,
+-			.flags = CLK_IS_ROOT,
++			.flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED,
+ 		},
+ 	},
+ };
diff --git a/target/linux/ipq806x/patches-4.1/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch b/target/linux/ipq806x/patches-4.1/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
new file mode 100644
index 0000000..41f91fa
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
@@ -0,0 +1,263 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,3/5] DT: PCI: qcom: Document PCIe devicetree bindings
+From: Stanimir Varbanov <svarbanov at mm-sol.com>
+X-Patchwork-Id: 6326181
+Message-Id: <1430743338-10441-4-git-send-email-svarbanov at mm-sol.com>
+To: Rob Herring <robh+dt at kernel.org>, Kumar Gala <galak at codeaurora.org>,
+	Mark Rutland <mark.rutland at arm.com>,
+	Grant Likely <grant.likely at linaro.org>,
+	Bjorn Helgaas <bhelgaas at google.com>,
+	Kishon Vijay Abraham I <kishon at ti.com>,
+	Russell King <linux at arm.linux.org.uk>, Arnd Bergmann <arnd at arndb.de>
+Cc: linux-arm-msm at vger.kernel.org, linux-kernel at vger.kernel.org,
+	linux-arm-kernel at lists.infradead.org, devicetree at vger.kernel.org,
+	linux-pci at vger.kernel.org, Mathieu Olivari <mathieu at codeaurora.org>,
+	Srinivas Kandagatla <srinivas.kandagatla at linaro.org>,
+	Stanimir Varbanov <svarbanov at mm-sol.com>
+Date: Mon,  4 May 2015 15:42:16 +0300
+
+Document Qualcomm PCIe driver devicetree bindings.
+
+Signed-off-by: Stanimir Varbanov <svarbanov at mm-sol.com>
+
+---
+.../devicetree/bindings/pci/qcom,pcie.txt          |  231 ++++++++++++++++++++
+ 1 files changed, 231 insertions(+), 0 deletions(-)
+ create mode 100644 Documentation/devicetree/bindings/pci/qcom,pcie.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/pci/qcom,pcie.txt
+@@ -0,0 +1,231 @@
++* Qualcomm PCI express root complex
++
++- compatible:
++	Usage: required
++	Value type: <stringlist>
++	Definition: Value shall include
++		    - "qcom,pcie-v0" for apq/ipq8064
++		    - "qcom,pcie-v1" for apq8084
++
++- reg:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: Register ranges as listed in the reg-names property
++
++- reg-names:
++	Usage: required
++	Value type: <stringlist>
++	Definition: Must include the following entries
++		    - "parf"   Qualcomm specific registers
++		    - "dbi"    Designware PCIe registers
++		    - "elbi"   External local bus interface registers
++		    - "config" PCIe configuration space
++
++- device_type:
++	Usage: required
++	Value type: <string>
++	Definition: Should be "pci". As specified in designware-pcie.txt
++
++- #address-cells:
++	Usage: required
++	Value type: <u32>
++	Definition: Should be set to 3. As specified in designware-pcie.txt
++
++- #size-cells:
++	Usage: required
++	Value type: <u32>
++	Definition: Should be set 2. As specified in designware-pcie.txt
++
++- ranges:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: As specified in designware-pcie.txt
++
++- interrupts:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: MSI interrupt
++
++- interrupt-names:
++	Usage: required
++	Value type: <stringlist>
++	Definition: Should contain "msi"
++
++- #interrupt-cells:
++	Usage: required
++	Value type: <u32>
++	Definition: Should be 1. As specified in designware-pcie.txt
++
++- interrupt-map-mask:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: As specified in designware-pcie.txt
++
++- interrupt-map:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: As specified in designware-pcie.txt
++
++- clocks:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: List of phandle and clock specifier pairs as listed
++		    in clock-names property
++
++- clock-names:
++	Usage: required
++	Value type: <stringlist>
++	Definition: Should contain the following entries
++		    * should be populated for v0 and v1
++		    	- "iface"      Configuration AHB clock
++
++		    * should be populated for v0
++		    	- "core"       Clocks the pcie hw block
++		    	- "phy"        Clocks the pcie PHY block
++
++		    * should be populated for v1
++			- "aux"        Auxiliary (AUX) clock
++		    	- "bus_master" Master AXI clock
++		    	- "bus_slave"  Slave AXI clock
++
++- resets:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: List of phandle and reset specifier pairs as listed
++		    in reset-names property
++
++- reset-names:
++	Usage: required
++	Value type: <stringlist>
++	Definition: Should contain the following entries
++		    * should be populated for v0
++			- "axi"  AXI reset
++			- "ahb"  AHB reset
++			- "por"  POR reset
++			- "pci"  PCI reset
++			- "phy"  PHY reset
++
++		    * should be populated for v1
++			- "core" Core reset
++
++- power-domains:
++	Usage: required (for v1 only)
++	Value type: <prop-encoded-array>
++	Definition: A phandle and power domain specifier pair to the
++		    power domain which is responsible for collapsing
++		    and restoring power to the peripheral
++
++- <name>-supply:
++	Usage: required
++	Value type: <phandle>
++	Definition: List of phandles to the power supply regulator(s)
++		    * should be populated for v0 and v1
++			- "vdda"        core analog power supply
++
++		    * should be populated for v0
++			- "vdda_phy"    analog power supply for PHY
++			- "vdda_refclk" analog power supply for IC which generate
++					reference clock
++
++- phys:
++	Usage: required (for v1 only)
++	Value type: <phandle>
++	Definition: List of phandle(s) as listed in phy-names property
++
++- phy-names:
++	Usage: required (for v1 only)
++	Value type: <stringlist>
++	Definition: Should contain "pciephy"
++
++- <name>-gpio:
++	Usage: optional
++	Value type: <prop-encoded-array>
++	Definition: List of phandle and gpio specifier pairs. Should contain
++		    - "perst"  PCIe endpoint reset signal line
++		    - "pewake" PCIe endpoint wake signal line
++
++- pinctrl-0:
++	Usage: required
++	Value type: <phandle>
++	Definition: List of phandles pointing at a pin(s) configuration
++
++- pinctrl-names
++	Usage: required
++	Value type: <stringlist>
++	Definition: List of names of pinctrl-0 state
++
++* Example for v0
++	pcie0: pci at 1b500000 {
++		compatible = "qcom,pcie-v0";
++		reg = <0x1b500000 0x1000
++		       0x1b502000 0x80
++		       0x1b600000 0x100
++		       0x0ff00000 0x100000>;
++		reg-names = "dbi", "elbi", "parf", "config";
++		device_type = "pci";
++		linux,pci-domain = <0>;
++		bus-range = <0x00 0xff>;
++		num-lanes = <1>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++		ranges = <0x81000000 0 0	  0x0fe00000 0 0x00100000   /* I/O */
++			  0x82000000 0 0x00000000 0x08000000 0 0x07e00000>; /* memory */
++		interrupts = <GIC_SPI 35 IRQ_TYPE_NONE>;
++		interrupt-names = "msi";
++		#interrupt-cells = <1>;
++		interrupt-map-mask = <0 0 0 0x7>;
++		interrupt-map = <0 0 0 1 &intc 0 36 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
++				<0 0 0 2 &intc 0 37 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
++				<0 0 0 3 &intc 0 38 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
++				<0 0 0 4 &intc 0 39 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
++		clocks = <&gcc PCIE_A_CLK>,
++			 <&gcc PCIE_H_CLK>,
++			 <&gcc PCIE_PHY_CLK>;
++		clock-names = "core", "iface", "phy";
++		resets = <&gcc PCIE_ACLK_RESET>,
++			 <&gcc PCIE_HCLK_RESET>,
++			 <&gcc PCIE_POR_RESET>,
++			 <&gcc PCIE_PCI_RESET>,
++			 <&gcc PCIE_PHY_RESET>;
++		reset-names = "axi", "ahb", "por", "pci", "phy";
++	};
++
++* Example for v1
++	pcie0 at fc520000 {
++		compatible = "qcom,pcie-v1";
++		reg = <0xfc520000 0x2000>,
++		      <0xff000000 0x1000>,
++		      <0xff001000 0x1000>,
++		      <0xff002000 0x2000>;
++		reg-names = "parf", "dbi", "elbi", "config";
++		device_type = "pci";
++		linux,pci-domain = <0>;
++		bus-range = <0x00 0xff>;
++		num-lanes = <1>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++		ranges = <0x81000000 0 0          0xff200000 0 0x00100000   /* I/O */
++			  0x82000000 0 0x00300000 0xff300000 0 0x00d00000>; /* memory */
++		interrupts = <GIC_SPI 243 IRQ_TYPE_NONE>;
++		interrupt-names = "msi";
++		#interrupt-cells = <1>;
++		interrupt-map-mask = <0 0 0 0x7>;
++		interrupt-map = <0 0 0 1 &intc 0 244 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
++				<0 0 0 2 &intc 0 245 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
++				<0 0 0 3 &intc 0 247 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
++				<0 0 0 4 &intc 0 248 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
++		clocks = <&gcc GCC_PCIE_0_CFG_AHB_CLK>,
++			 <&gcc GCC_PCIE_0_MSTR_AXI_CLK>,
++			 <&gcc GCC_PCIE_0_SLV_AXI_CLK>,
++			 <&gcc GCC_PCIE_0_AUX_CLK>;
++		clock-names = "iface", "master_bus", "slave_bus", "aux";
++		resets = <&gcc GCC_PCIE_0_BCR>;
++		reset-names = "core";
++		power-domains = <&gcc PCIE0_GDSC>;
++		vdda-supply = <&pma8084_l3>;
++		phys = <&pciephy0>;
++		phy-names = "pciephy";
++		perst-gpio = <&tlmm 70 GPIO_ACTIVE_LOW>;
++		pinctrl-0 = <&pcie0_pins_default>;
++		pinctrl-names = "default";
++	};
diff --git a/target/linux/ipq806x/patches-4.1/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch b/target/linux/ipq806x/patches-4.1/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
new file mode 100644
index 0000000..dbf16a3
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
@@ -0,0 +1,753 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,4/5] PCI: qcom: Add Qualcomm PCIe controller driver
+From: Stanimir Varbanov <svarbanov at mm-sol.com>
+X-Patchwork-Id: 6326161
+Message-Id: <1430743338-10441-5-git-send-email-svarbanov at mm-sol.com>
+To: Rob Herring <robh+dt at kernel.org>, Kumar Gala <galak at codeaurora.org>,
+	Mark Rutland <mark.rutland at arm.com>,
+	Grant Likely <grant.likely at linaro.org>,
+	Bjorn Helgaas <bhelgaas at google.com>,
+	Kishon Vijay Abraham I <kishon at ti.com>,
+	Russell King <linux at arm.linux.org.uk>, Arnd Bergmann <arnd at arndb.de>
+Cc: linux-arm-msm at vger.kernel.org, linux-kernel at vger.kernel.org,
+	linux-arm-kernel at lists.infradead.org, devicetree at vger.kernel.org,
+	linux-pci at vger.kernel.org, Mathieu Olivari <mathieu at codeaurora.org>,
+	Srinivas Kandagatla <srinivas.kandagatla at linaro.org>,
+	Stanimir Varbanov <svarbanov at mm-sol.com>
+Date: Mon,  4 May 2015 15:42:17 +0300
+
+The PCIe driver reuse the Designware common code for host
+and MSI initialization, and also program the Qualcomm
+application specific registers.
+
+Signed-off-by: Stanimir Varbanov <svarbanov at mm-sol.com>
+
+---
+MAINTAINERS                  |    7 +
+ drivers/pci/host/Kconfig     |    9 +
+ drivers/pci/host/Makefile    |    1 +
+ drivers/pci/host/pcie-qcom.c |  677 ++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 694 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/pci/host/pcie-qcom.c
+
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -7599,6 +7599,13 @@ L:	linux-pci at vger.kernel.org
+ S:	Maintained
+ F:	drivers/pci/host/*spear*
+ 
++PCIE DRIVER FOR QUALCOMM MSM
++M:	Stanimir Varbanov <svarbanov at mm-sol.com>
++L:	linux-pci at vger.kernel.org
++L:	linux-arm-msm at vger.kernel.org
++S:	Maintained
++F:	drivers/pci/host/*qcom*
++
+ PCMCIA SUBSYSTEM
+ P:	Linux PCMCIA Team
+ L:	linux-pcmcia at lists.infradead.org
+--- a/drivers/pci/host/Kconfig
++++ b/drivers/pci/host/Kconfig
+@@ -125,4 +125,13 @@ config PCIE_IPROC_PLATFORM
+ 	  Say Y here if you want to use the Broadcom iProc PCIe controller
+ 	  through the generic platform bus interface
+ 
++config PCIE_QCOM
++	bool "Qualcomm PCIe controller"
++	depends on ARCH_QCOM && OF || (ARM && COMPILE_TEST)
++	select PCIE_DW
++	select PCIEPORTBUS
++	help
++	  Say Y here to enable PCIe controller support on Qualcomm SoCs. The
++	  PCIe controller use Designware core plus Qualcomm specific hardware
++	  wrappers.
+ endmenu
+--- /dev/null
++++ b/drivers/pci/host/pcie-qcom.c
+@@ -0,0 +1,677 @@
++/*
++ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/clk.h>
++#include <linux/delay.h>
++#include <linux/gpio.h>
++#include <linux/interrupt.h>
++#include <linux/io.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/of_gpio.h>
++#include <linux/pci.h>
++#include <linux/platform_device.h>
++#include <linux/phy/phy.h>
++#include <linux/regulator/consumer.h>
++#include <linux/reset.h>
++#include <linux/slab.h>
++#include <linux/types.h>
++
++#include "pcie-designware.h"
++
++#define PCIE20_PARF_PHY_CTRL			0x40
++#define PCIE20_PARF_PHY_REFCLK			0x4C
++#define PCIE20_PARF_DBI_BASE_ADDR		0x168
++#define PCIE20_PARF_SLV_ADDR_SPACE_SIZE		0x16c
++#define PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT	0x178
++
++#define PCIE20_ELBI_SYS_CTRL			0x04
++#define PCIE20_ELBI_SYS_STTS			0x08
++#define XMLH_LINK_UP				BIT(10)
++
++#define PCIE20_CAP				0x70
++#define PCIE20_CAP_LINKCTRLSTATUS		(PCIE20_CAP + 0x10)
++
++#define PERST_DELAY_MIN_US			1000
++#define PERST_DELAY_MAX_US			1005
++
++#define LINKUP_DELAY_MIN_US			5000
++#define LINKUP_DELAY_MAX_US			5100
++#define LINKUP_RETRIES_COUNT			20
++
++#define PCIE_V0					0	/* apq8064 */
++#define PCIE_V1					1	/* apq8084 */
++
++struct qcom_pcie_resources_v0 {
++	struct clk *iface_clk;
++	struct clk *core_clk;
++	struct clk *phy_clk;
++	struct reset_control *pci_reset;
++	struct reset_control *axi_reset;
++	struct reset_control *ahb_reset;
++	struct reset_control *por_reset;
++	struct reset_control *phy_reset;
++	struct regulator *vdda;
++	struct regulator *vdda_phy;
++	struct regulator *vdda_refclk;
++};
++
++struct qcom_pcie_resources_v1 {
++	struct clk *iface;
++	struct clk *aux;
++	struct clk *master_bus;
++	struct clk *slave_bus;
++	struct reset_control *core;
++	struct regulator *vdda;
++};
++
++union pcie_resources {
++	struct qcom_pcie_resources_v0 v0;
++	struct qcom_pcie_resources_v1 v1;
++};
++
++struct qcom_pcie {
++	struct pcie_port pp;
++	struct device *dev;
++	union pcie_resources res;
++	void __iomem *parf;
++	void __iomem *dbi;
++	void __iomem *elbi;
++	struct phy *phy;
++	struct gpio_desc *reset;
++	unsigned int version;
++};
++
++#define to_qcom_pcie(x)		container_of(x, struct qcom_pcie, pp)
++
++static inline void
++writel_masked(void __iomem *addr, u32 clear_mask, u32 set_mask)
++{
++	u32 val = readl(addr);
++
++	val &= ~clear_mask;
++	val |= set_mask;
++	writel(val, addr);
++}
++
++static void qcom_ep_reset_assert_deassert(struct qcom_pcie *pcie, int assert)
++{
++	int val, active_low;
++
++	if (IS_ERR_OR_NULL(pcie->reset))
++		return;
++
++	active_low = gpiod_is_active_low(pcie->reset);
++
++	if (assert)
++		val = !!active_low;
++	else
++		val = !active_low;
++
++	gpiod_set_value(pcie->reset, val);
++
++	usleep_range(PERST_DELAY_MIN_US, PERST_DELAY_MAX_US);
++}
++
++static void qcom_ep_reset_assert(struct qcom_pcie *pcie)
++{
++	qcom_ep_reset_assert_deassert(pcie, 1);
++}
++
++static void qcom_ep_reset_deassert(struct qcom_pcie *pcie)
++{
++	qcom_ep_reset_assert_deassert(pcie, 0);
++}
++
++static irqreturn_t qcom_pcie_msi_irq_handler(int irq, void *arg)
++{
++	struct pcie_port *pp = arg;
++
++	return dw_handle_msi_irq(pp);
++}
++
++static int qcom_pcie_link_up(struct pcie_port *pp)
++{
++	struct qcom_pcie *pcie = to_qcom_pcie(pp);
++	u32 val = readl(pcie->dbi + PCIE20_CAP_LINKCTRLSTATUS);
++
++	return val & BIT(29) ? 1 : 0;
++}
++
++static void qcom_pcie_disable_resources_v0(struct qcom_pcie *pcie)
++{
++	struct qcom_pcie_resources_v0 *res = &pcie->res.v0;
++
++	reset_control_assert(res->pci_reset);
++	reset_control_assert(res->axi_reset);
++	reset_control_assert(res->ahb_reset);
++	reset_control_assert(res->por_reset);
++	reset_control_assert(res->pci_reset);
++	clk_disable_unprepare(res->iface_clk);
++	clk_disable_unprepare(res->core_clk);
++	clk_disable_unprepare(res->phy_clk);
++	regulator_disable(res->vdda);
++	regulator_disable(res->vdda_phy);
++	regulator_disable(res->vdda_refclk);
++}
++
++static void qcom_pcie_disable_resources_v1(struct qcom_pcie *pcie)
++{
++	struct qcom_pcie_resources_v1 *res = &pcie->res.v1;
++
++	reset_control_assert(res->core);
++	clk_disable_unprepare(res->slave_bus);
++	clk_disable_unprepare(res->master_bus);
++	clk_disable_unprepare(res->iface);
++	clk_disable_unprepare(res->aux);
++	regulator_disable(res->vdda);
++}
++
++static int qcom_pcie_enable_resources_v0(struct qcom_pcie *pcie)
++{
++	struct qcom_pcie_resources_v0 *res = &pcie->res.v0;
++	struct device *dev = pcie->dev;
++	int ret;
++
++	ret = regulator_enable(res->vdda);
++	if (ret) {
++		dev_err(dev, "cannot enable vdda regulator\n");
++		return ret;
++	}
++
++	ret = regulator_enable(res->vdda_refclk);
++	if (ret) {
++		dev_err(dev, "cannot enable vdda_refclk regulator\n");
++		goto err_refclk;
++	}
++
++	ret = regulator_enable(res->vdda_phy);
++	if (ret) {
++		dev_err(dev, "cannot enable vdda_phy regulator\n");
++		goto err_vdda_phy;
++	}
++
++	ret = clk_prepare_enable(res->iface_clk);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable iface clock\n");
++		goto err_iface;
++	}
++
++	ret = clk_prepare_enable(res->core_clk);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable core clock\n");
++		goto err_clk_core;
++	}
++
++	ret = clk_prepare_enable(res->phy_clk);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable phy clock\n");
++		goto err_clk_phy;
++	}
++
++	ret = reset_control_deassert(res->ahb_reset);
++	if (ret) {
++		dev_err(dev, "cannot deassert ahb reset\n");
++		goto err_reset_ahb;
++	}
++
++	return 0;
++
++err_reset_ahb:
++	clk_disable_unprepare(res->phy_clk);
++err_clk_phy:
++	clk_disable_unprepare(res->core_clk);
++err_clk_core:
++	clk_disable_unprepare(res->iface_clk);
++err_iface:
++	regulator_disable(res->vdda_phy);
++err_vdda_phy:
++	regulator_disable(res->vdda_refclk);
++err_refclk:
++	regulator_disable(res->vdda);
++	return ret;
++}
++
++static int qcom_pcie_enable_resources_v1(struct qcom_pcie *pcie)
++{
++	struct qcom_pcie_resources_v1 *res = &pcie->res.v1;
++	struct device *dev = pcie->dev;
++	int ret;
++
++	ret = reset_control_deassert(res->core);
++	if (ret) {
++		dev_err(dev, "cannot deassert core reset\n");
++		return ret;
++	}
++
++	ret = clk_prepare_enable(res->aux);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable aux clock\n");
++		goto err_res;
++	}
++
++	ret = clk_prepare_enable(res->iface);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable iface clock\n");
++		goto err_aux;
++	}
++
++	ret = clk_prepare_enable(res->master_bus);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable master_bus clock\n");
++		goto err_iface;
++	}
++
++	ret = clk_prepare_enable(res->slave_bus);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable slave_bus clock\n");
++		goto err_master;
++	}
++
++	ret = regulator_enable(res->vdda);
++	if (ret) {
++		dev_err(dev, "cannot enable vdda regulator\n");
++		goto err_slave;
++	}
++
++	return 0;
++
++err_slave:
++	clk_disable_unprepare(res->slave_bus);
++err_master:
++	clk_disable_unprepare(res->master_bus);
++err_iface:
++	clk_disable_unprepare(res->iface);
++err_aux:
++	clk_disable_unprepare(res->aux);
++err_res:
++	reset_control_assert(res->core);
++
++	return ret;
++}
++
++static int qcom_pcie_get_resources_v0(struct qcom_pcie *pcie)
++{
++	struct qcom_pcie_resources_v0 *res = &pcie->res.v0;
++	struct device *dev = pcie->dev;
++
++	res->vdda = devm_regulator_get(dev, "vdda");
++	if (IS_ERR(res->vdda))
++		return PTR_ERR(res->vdda);
++
++	res->vdda_phy = devm_regulator_get(dev, "vdda_phy");
++	if (IS_ERR(res->vdda_phy))
++		return PTR_ERR(res->vdda_phy);
++
++	res->vdda_refclk = devm_regulator_get(dev, "vdda_refclk");
++	if (IS_ERR(res->vdda_refclk))
++		return PTR_ERR(res->vdda_refclk);
++
++	res->iface_clk = devm_clk_get(dev, "iface");
++	if (IS_ERR(res->iface_clk))
++		return PTR_ERR(res->iface_clk);
++
++	res->core_clk = devm_clk_get(dev, "core");
++	if (IS_ERR(res->core_clk))
++		return PTR_ERR(res->core_clk);
++
++	res->phy_clk = devm_clk_get(dev, "phy");
++	if (IS_ERR(res->phy_clk))
++		return PTR_ERR(res->phy_clk);
++
++	res->pci_reset = devm_reset_control_get(dev, "pci");
++	if (IS_ERR(res->pci_reset))
++		return PTR_ERR(res->pci_reset);
++
++	res->axi_reset = devm_reset_control_get(dev, "axi");
++	if (IS_ERR(res->axi_reset))
++		return PTR_ERR(res->axi_reset);
++
++	res->ahb_reset = devm_reset_control_get(dev, "ahb");
++	if (IS_ERR(res->ahb_reset))
++		return PTR_ERR(res->ahb_reset);
++
++	res->por_reset = devm_reset_control_get(dev, "por");
++	if (IS_ERR(res->por_reset))
++		return PTR_ERR(res->por_reset);
++
++	res->phy_reset = devm_reset_control_get(dev, "phy");
++	if (IS_ERR(res->phy_reset))
++		return PTR_ERR(res->phy_reset);
++
++	return 0;
++}
++
++static int qcom_pcie_get_resources_v1(struct qcom_pcie *pcie)
++{
++	struct qcom_pcie_resources_v1 *res = &pcie->res.v1;
++	struct device *dev = pcie->dev;
++
++	res->vdda = devm_regulator_get(dev, "vdda");
++	if (IS_ERR(res->vdda))
++		return PTR_ERR(res->vdda);
++
++	res->iface = devm_clk_get(dev, "iface");
++	if (IS_ERR(res->iface))
++		return PTR_ERR(res->iface);
++
++	res->aux = devm_clk_get(dev, "aux");
++	if (IS_ERR(res->aux) && PTR_ERR(res->aux) == -EPROBE_DEFER)
++		return -EPROBE_DEFER;
++	else if (IS_ERR(res->aux))
++		res->aux = NULL;
++
++	res->master_bus = devm_clk_get(dev, "master_bus");
++	if (IS_ERR(res->master_bus))
++		return PTR_ERR(res->master_bus);
++
++	res->slave_bus = devm_clk_get(dev, "slave_bus");
++	if (IS_ERR(res->slave_bus))
++		return PTR_ERR(res->slave_bus);
++
++	res->core = devm_reset_control_get(dev, "core");
++	if (IS_ERR(res->core))
++		return PTR_ERR(res->core);
++
++	return 0;
++}
++
++static int qcom_pcie_enable_link_training(struct pcie_port *pp)
++{
++	struct qcom_pcie *pcie = to_qcom_pcie(pp);
++	struct device *dev = pp->dev;
++	int retries;
++	u32 val;
++
++	/* enable link training */
++	writel_masked(pcie->elbi + PCIE20_ELBI_SYS_CTRL, 0, BIT(0));
++
++	/* wait for up to 100ms for the link to come up */
++	retries = LINKUP_RETRIES_COUNT;
++	do {
++		val = readl(pcie->elbi + PCIE20_ELBI_SYS_STTS);
++		if (val & XMLH_LINK_UP)
++			break;
++		usleep_range(LINKUP_DELAY_MIN_US, LINKUP_DELAY_MAX_US);
++	} while (retries--);
++
++	if (retries < 0 || !dw_pcie_link_up(pp)) {
++		dev_err(dev, "link initialization failed\n");
++		return -ENXIO;
++	}
++
++	return 0;
++}
++
++static void qcom_pcie_host_init_v1(struct pcie_port *pp)
++{
++	struct qcom_pcie *pcie = to_qcom_pcie(pp);
++	int ret;
++
++	qcom_ep_reset_assert(pcie);
++
++	ret = qcom_pcie_enable_resources_v1(pcie);
++	if (ret)
++		return;
++
++	/* change DBI base address */
++	writel(0, pcie->parf + PCIE20_PARF_DBI_BASE_ADDR);
++
++	if (IS_ENABLED(CONFIG_PCI_MSI))
++		writel_masked(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT,
++			      0, BIT(31));
++
++	ret = phy_init(pcie->phy);
++	if (ret)
++		goto err_res;
++
++	ret = phy_power_on(pcie->phy);
++	if (ret)
++		goto err_phy;
++
++	dw_pcie_setup_rc(pp);
++
++	if (IS_ENABLED(CONFIG_PCI_MSI))
++		dw_pcie_msi_init(pp);
++
++	qcom_ep_reset_deassert(pcie);
++
++	ret = qcom_pcie_enable_link_training(pp);
++	if (ret)
++		goto err;
++
++	return;
++
++err:
++	qcom_ep_reset_assert(pcie);
++	phy_power_off(pcie->phy);
++err_phy:
++	phy_exit(pcie->phy);
++err_res:
++	qcom_pcie_disable_resources_v1(pcie);
++}
++
++static void qcom_pcie_host_init_v0(struct pcie_port *pp)
++{
++	struct qcom_pcie *pcie = to_qcom_pcie(pp);
++	struct qcom_pcie_resources_v0 *res = &pcie->res.v0;
++	struct device *dev = pcie->dev;
++	int ret;
++
++	qcom_ep_reset_assert(pcie);
++
++	ret = qcom_pcie_enable_resources_v0(pcie);
++	if (ret)
++		return;
++
++	writel_masked(pcie->parf + PCIE20_PARF_PHY_CTRL, BIT(0), 0);
++
++	/* enable external reference clock */
++	writel_masked(pcie->parf + PCIE20_PARF_PHY_REFCLK, 0, BIT(16));
++
++	ret = reset_control_deassert(res->phy_reset);
++	if (ret) {
++		dev_err(dev, "cannot deassert phy reset\n");
++		return;
++	}
++
++	ret = reset_control_deassert(res->pci_reset);
++	if (ret) {
++		dev_err(dev, "cannot deassert pci reset\n");
++		return;
++	}
++
++	ret = reset_control_deassert(res->por_reset);
++	if (ret) {
++		dev_err(dev, "cannot deassert por reset\n");
++		return;
++	}
++
++	ret = reset_control_deassert(res->axi_reset);
++	if (ret) {
++		dev_err(dev, "cannot deassert axi reset\n");
++		return;
++	}
++
++	/* wait 150ms for clock acquisition */
++	usleep_range(10000, 15000);
++
++	dw_pcie_setup_rc(pp);
++
++	if (IS_ENABLED(CONFIG_PCI_MSI))
++		dw_pcie_msi_init(pp);
++
++	qcom_ep_reset_deassert(pcie);
++
++	ret = qcom_pcie_enable_link_training(pp);
++	if (ret)
++		goto err;
++
++	return;
++err:
++	qcom_ep_reset_assert(pcie);
++	qcom_pcie_disable_resources_v0(pcie);
++}
++
++static void qcom_pcie_host_init(struct pcie_port *pp)
++{
++	struct qcom_pcie *pcie = to_qcom_pcie(pp);
++
++	if (pcie->version == PCIE_V0)
++		return qcom_pcie_host_init_v0(pp);
++	else
++		return qcom_pcie_host_init_v1(pp);
++}
++
++static int
++qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, u32 *val)
++{
++	/* the device class is not reported correctly from the register */
++	if (where == PCI_CLASS_REVISION && size == 4) {
++		*val = readl(pp->dbi_base + PCI_CLASS_REVISION);
++		*val &= ~(0xffff << 16);
++		*val |= PCI_CLASS_BRIDGE_PCI << 16;
++		return PCIBIOS_SUCCESSFUL;
++	}
++
++	return dw_pcie_cfg_read(pp->dbi_base + (where & ~0x3), where,
++				size, val);
++}
++
++static struct pcie_host_ops qcom_pcie_ops = {
++	.link_up = qcom_pcie_link_up,
++	.host_init = qcom_pcie_host_init,
++	.rd_own_conf = qcom_pcie_rd_own_conf,
++};
++
++static const struct of_device_id qcom_pcie_match[] = {
++	{ .compatible = "qcom,pcie-v0", .data = (void *)PCIE_V0 },
++	{ .compatible = "qcom,pcie-v1", .data = (void *)PCIE_V1 },
++	{ }
++};
++
++static int qcom_pcie_probe(struct platform_device *pdev)
++{
++	struct device *dev = &pdev->dev;
++	const struct of_device_id *match;
++	struct resource *res;
++	struct qcom_pcie *pcie;
++	struct pcie_port *pp;
++	int ret;
++
++	match = of_match_node(qcom_pcie_match, dev->of_node);
++	if (!match)
++		return -ENXIO;
++
++	pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
++	if (!pcie)
++		return -ENOMEM;
++
++	pcie->version = (unsigned int)match->data;
++
++	pcie->reset = devm_gpiod_get_optional(dev, "perst");
++	if (IS_ERR(pcie->reset) && PTR_ERR(pcie->reset) == -EPROBE_DEFER)
++		return PTR_ERR(pcie->reset);
++
++	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "parf");
++	pcie->parf = devm_ioremap_resource(dev, res);
++	if (IS_ERR(pcie->parf))
++		return PTR_ERR(pcie->parf);
++
++	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbi");
++	pcie->dbi = devm_ioremap_resource(dev, res);
++	if (IS_ERR(pcie->dbi))
++		return PTR_ERR(pcie->dbi);
++
++	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "elbi");
++	pcie->elbi = devm_ioremap_resource(dev, res);
++	if (IS_ERR(pcie->elbi))
++		return PTR_ERR(pcie->elbi);
++
++	pcie->phy = devm_phy_optional_get(dev, "pciephy");
++	if (IS_ERR(pcie->phy))
++		return PTR_ERR(pcie->phy);
++
++	pcie->dev = dev;
++
++	if (pcie->version == PCIE_V0)
++		ret = qcom_pcie_get_resources_v0(pcie);
++	else
++		ret = qcom_pcie_get_resources_v1(pcie);
++
++	if (ret)
++		return ret;
++
++	pp = &pcie->pp;
++	pp->dev = dev;
++	pp->dbi_base = pcie->dbi;
++	pp->root_bus_nr = -1;
++	pp->ops = &qcom_pcie_ops;
++
++	if (IS_ENABLED(CONFIG_PCI_MSI)) {
++		pp->msi_irq = platform_get_irq_byname(pdev, "msi");
++		if (pp->msi_irq < 0) {
++			dev_err(dev, "cannot get msi irq\n");
++			return pp->msi_irq;
++		}
++
++		ret = devm_request_irq(dev, pp->msi_irq,
++				       qcom_pcie_msi_irq_handler,
++				       IRQF_SHARED, "qcom-pcie-msi", pp);
++		if (ret) {
++			dev_err(dev, "cannot request msi irq\n");
++			return ret;
++		}
++	}
++
++	ret = dw_pcie_host_init(pp);
++	if (ret) {
++		dev_err(dev, "cannot initialize host\n");
++		return ret;
++	}
++
++	platform_set_drvdata(pdev, pcie);
++
++	return 0;
++}
++
++static int qcom_pcie_remove(struct platform_device *pdev)
++{
++	struct qcom_pcie *pcie = platform_get_drvdata(pdev);
++
++	qcom_ep_reset_assert(pcie);
++	phy_power_off(pcie->phy);
++	phy_exit(pcie->phy);
++	if (pcie->version == PCIE_V0)
++		qcom_pcie_disable_resources_v0(pcie);
++	else
++		qcom_pcie_disable_resources_v1(pcie);
++
++	return 0;
++}
++
++static struct platform_driver qcom_pcie_driver = {
++	.probe = qcom_pcie_probe,
++	.remove = qcom_pcie_remove,
++	.driver = {
++		.name = "qcom-pcie",
++		.of_match_table = qcom_pcie_match,
++	},
++};
++
++module_platform_driver(qcom_pcie_driver);
++
++MODULE_AUTHOR("Stanimir Varbanov <svarbanov at mm-sol.com>");
++MODULE_DESCRIPTION("Qualcomm PCIe root complex driver");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:qcom-pcie");
+--- a/drivers/pci/host/Makefile
++++ b/drivers/pci/host/Makefile
+@@ -15,3 +15,4 @@ obj-$(CONFIG_PCI_LAYERSCAPE) += pci-laye
+ obj-$(CONFIG_PCI_VERSATILE) += pci-versatile.o
+ obj-$(CONFIG_PCIE_IPROC) += pcie-iproc.o
+ obj-$(CONFIG_PCIE_IPROC_PLATFORM) += pcie-iproc-platform.o
++obj-$(CONFIG_PCIE_QCOM) += pcie-qcom.o
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
new file mode 100644
index 0000000..e7de2bb
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -0,0 +1,260 @@
+From 5b40516b2f5fb9b2a7d6d3e2e924f12ec9d183a8 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Tue, 21 Apr 2015 19:01:42 -0700
+Subject: [PATCH 8/9] ARM: dts: qcom: add pcie nodes to ipq806x platforms
+
+qcom-pcie driver now supports version 0 of the controller. This change
+adds the corresponding entries to the IPQ806x dtsi file and
+corresponding platform (AP148).
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064-ap148.dts |  30 ++++++++
+ arch/arm/boot/dts/qcom-ipq8064.dtsi      | 124 +++++++++++++++++++++++++++++++
+ 2 files changed, 154 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -30,6 +30,22 @@
+ 				bias-disable;
+ 			};
+ 
++			pcie1_pins: pcie1_pinmux {
++				mux {
++					pins = "gpio3";
++					drive-strength = <2>;
++					bias-disable;
++				};
++			};
++
++			pcie2_pins: pcie2_pinmux {
++				mux {
++					pins = "gpio48";
++					drive-strength = <2>;
++					bias-disable;
++				};
++			};
++
+ 			spi_pins: spi_pins {
+ 				mux {
+ 					pins = "gpio18", "gpio19", "gpio21";
+@@ -109,5 +125,19 @@
+ 		sata at 29000000 {
+ 			status = "ok";
+ 		};
++
++		pcie0: pci at 1b500000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 3 0>;
++			pinctrl-0 = <&pcie1_pins>;
++			pinctrl-names = "default";
++		};
++
++		pcie1: pci at 1b700000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 48 0>;
++			pinctrl-0 = <&pcie2_pins>;
++			pinctrl-names = "default";
++		};
+ 	};
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
+@@ -30,6 +30,30 @@
+ 				bias-disable;
+ 			};
+ 
++			pcie1_pins: pcie1_pinmux {
++				mux {
++					pins = "gpio3";
++					drive-strength = <2>;
++					bias-disable;
++				};
++			};
++
++			pcie2_pins: pcie2_pinmux {
++				mux {
++					pins = "gpio48";
++					drive-strength = <2>;
++					bias-disable;
++				};
++			};
++
++			pcie3_pins: pcie3_pinmux {
++				mux {
++					pins = "gpio63";
++					drive-strength = <2>;
++					bias-disable;
++				};
++			};
++
+ 			spi_pins: spi_pins {
+ 				mux {
+ 					pins = "gpio18", "gpio19", "gpio21";
+@@ -128,5 +152,26 @@
+ 		usb30 at 1 {
+ 			status = "ok";
+ 		};
++
++		pcie0: pci at 1b500000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 3 0>;
++			pinctrl-0 = <&pcie1_pins>;
++			pinctrl-names = "default";
++		};
++
++		pcie1: pci at 1b700000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 48 0>;
++			pinctrl-0 = <&pcie2_pins>;
++			pinctrl-names = "default";
++		};
++
++		pcie2: pci at 1b900000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 63 0>;
++			pinctrl-0 = <&pcie3_pins>;
++			pinctrl-names = "default";
++		};
+ 	};
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -4,6 +4,8 @@
+ #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
+ #include <dt-bindings/clock/qcom,lcc-ipq806x.h>
+ #include <dt-bindings/soc/qcom,gsbi.h>
++#include <dt-bindings/reset/qcom,gcc-ipq806x.h>
++#include <include/dt-bindings/interrupt-controller/arm-gic.h>
+ 
+ / {
+ 	model = "Qualcomm IPQ8064";
+@@ -329,5 +331,128 @@
+ 			#reset-cells = <1>;
+ 		};
+ 
++		pcie0: pci at 1b500000 {
++			compatible = "qcom,pcie-v0";
++			reg = <0x1b500000 0x1000
++			       0x1b502000 0x80
++			       0x1b600000 0x100
++			       0x0ff00000 0x100000>;
++			reg-names = "dbi", "elbi", "parf", "config";
++			device_type = "pci";
++			linux,pci-domain = <0>;
++			bus-range = <0x00 0xff>;
++			num-lanes = <1>;
++			#address-cells = <3>;
++			#size-cells = <2>;
++
++			ranges = <0x81000000 0 0	  0x0fe00000 0 0x00100000   /* downstream I/O */
++				  0x82000000 0 0x00000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */
++
++			interrupts = <GIC_SPI 35 IRQ_TYPE_NONE>;
++			interrupt-names = "msi";
++			#interrupt-cells = <1>;
++			interrupt-map-mask = <0 0 0 0x7>;
++			interrupt-map = <0 0 0 1 &intc 0 36 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
++					<0 0 0 2 &intc 0 37 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
++					<0 0 0 3 &intc 0 38 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
++					<0 0 0 4 &intc 0 39 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
++
++			clocks = <&gcc PCIE_A_CLK>,
++				 <&gcc PCIE_H_CLK>,
++				 <&gcc PCIE_PHY_CLK>;
++			clock-names = "core", "iface", "phy";
++
++			resets = <&gcc PCIE_ACLK_RESET>,
++				 <&gcc PCIE_HCLK_RESET>,
++				 <&gcc PCIE_POR_RESET>,
++				 <&gcc PCIE_PCI_RESET>,
++				 <&gcc PCIE_PHY_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy";
++
++			status = "disabled";
++		};
++
++		pcie1: pci at 1b700000 {
++			compatible = "qcom,pcie-v0";
++			reg = <0x1b700000 0x1000
++			       0x1b702000 0x80
++			       0x1b800000 0x100
++			       0x31f00000 0x100000>;
++			reg-names = "dbi", "elbi", "parf", "config";
++			device_type = "pci";
++			linux,pci-domain = <1>;
++			bus-range = <0x00 0xff>;
++			num-lanes = <1>;
++			#address-cells = <3>;
++			#size-cells = <2>;
++
++			ranges = <0x81000000 0 0	  0x31e00000 0 0x00100000   /* downstream I/O */
++				  0x82000000 0 0x00000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */
++
++			interrupts = <GIC_SPI 57 IRQ_TYPE_NONE>;
++			interrupt-names = "msi";
++			#interrupt-cells = <1>;
++			interrupt-map-mask = <0 0 0 0x7>;
++			interrupt-map = <0 0 0 1 &intc 0 58 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
++					<0 0 0 2 &intc 0 59 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
++					<0 0 0 3 &intc 0 60 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
++					<0 0 0 4 &intc 0 61 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
++
++			clocks = <&gcc PCIE_1_A_CLK>,
++				 <&gcc PCIE_1_H_CLK>,
++				 <&gcc PCIE_1_PHY_CLK>;
++			clock-names = "core", "iface", "phy";
++
++			resets = <&gcc PCIE_1_ACLK_RESET>,
++				 <&gcc PCIE_1_HCLK_RESET>,
++				 <&gcc PCIE_1_POR_RESET>,
++				 <&gcc PCIE_1_PCI_RESET>,
++				 <&gcc PCIE_1_PHY_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy";
++
++			status = "disabled";
++		};
++
++		pcie2: pci at 1b900000 {
++			compatible = "qcom,pcie-v0";
++			reg = <0x1b900000 0x1000
++			       0x1b902000 0x80
++			       0x1ba00000 0x100
++			       0x35f00000 0x100000>;
++			reg-names = "dbi", "elbi", "parf", "config";
++			device_type = "pci";
++			linux,pci-domain = <2>;
++			bus-range = <0x00 0xff>;
++			num-lanes = <1>;
++			#address-cells = <3>;
++			#size-cells = <2>;
++
++			ranges = <0x81000000 0 0	  0x35e00000 0 0x00100000   /* downstream I/O */
++				  0x82000000 0 0x00000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */
++
++			interrupts = <GIC_SPI 71 IRQ_TYPE_NONE>;
++			interrupt-names = "msi";
++			#interrupt-cells = <1>;
++			interrupt-map-mask = <0 0 0 0x7>;
++			interrupt-map = <0 0 0 1 &intc 0 72 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
++					<0 0 0 2 &intc 0 73 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
++					<0 0 0 3 &intc 0 74 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
++					<0 0 0 4 &intc 0 75 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
++
++			clocks = <&gcc PCIE_2_A_CLK>,
++				 <&gcc PCIE_2_H_CLK>,
++				 <&gcc PCIE_2_PHY_CLK>;
++			clock-names = "core", "iface", "phy";
++
++			resets = <&gcc PCIE_2_ACLK_RESET>,
++				 <&gcc PCIE_2_HCLK_RESET>,
++				 <&gcc PCIE_2_POR_RESET>,
++				 <&gcc PCIE_2_PCI_RESET>,
++				 <&gcc PCIE_2_PHY_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy";
++
++			status = "disabled";
++		};
++
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-4.1/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch b/target/linux/ipq806x/patches-4.1/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
new file mode 100644
index 0000000..e2d3135
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
@@ -0,0 +1,29 @@
+From f004aa1dec6e2e206be025de15b115d60f2b21e3 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Tue, 21 Apr 2015 19:09:07 -0700
+Subject: [PATCH 9/9] ARM: qcom: automatically select PCI_DOMAINS if PCI is
+ enabled
+
+If multiple PCIe devices are present in the system, the kernel will
+panic at boot time when trying to scan the PCI buses. This happens on
+IPQ806x based platforms, which has 3 PCIe ports.
+
+Enabling this option allows the kernel to assign the pci-domains
+according to the device-tree content. This allows multiple PCIe
+controllers to coexist in the system.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/mach-qcom/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/mach-qcom/Kconfig
++++ b/arch/arm/mach-qcom/Kconfig
+@@ -5,6 +5,7 @@ menuconfig ARCH_QCOM
+ 	select ARM_AMBA
+ 	select PINCTRL
+ 	select QCOM_SCM if SMP
++	select PCI_DOMAINS if PCI
+ 	help
+ 	  Support for Qualcomm's devicetree based systems.
+ 
diff --git a/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch b/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
new file mode 100644
index 0000000..be80f4c
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
@@ -0,0 +1,87 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -2,6 +2,7 @@
+ 
+ #include "skeleton.dtsi"
+ #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
++#include <dt-bindings/mfd/qcom-rpm.h>
+ #include <dt-bindings/clock/qcom,lcc-ipq806x.h>
+ #include <dt-bindings/soc/qcom,gsbi.h>
+ #include <dt-bindings/reset/qcom,gcc-ipq806x.h>
+@@ -92,6 +93,63 @@
+ 			reg-names = "lpass-lpaif";
+ 		};
+ 
++		rpm at 108000 {
++			compatible = "qcom,rpm-ipq8064";
++			reg = <0x108000 0x1000>;
++			qcom,ipc = <&l2cc 0x8 2>;
++
++			interrupts = <0 19 0>,
++				     <0 21 0>,
++				     <0 22 0>;
++			interrupt-names = "ack",
++					  "err",
++					  "wakeup";
++
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			smb208_s1a: smb208-s1a {
++				compatible = "qcom,rpm-smb208";
++				reg = <QCOM_RPM_SMB208_S1a>;
++
++				regulator-min-microvolt = <1050000>;
++				regulator-max-microvolt = <1150000>;
++
++				qcom,switch-mode-frequency = <1200000>;
++
++			};
++
++			smb208_s1b: smb208-s1b {
++				compatible = "qcom,rpm-smb208";
++				reg = <QCOM_RPM_SMB208_S1b>;
++
++				regulator-min-microvolt = <1050000>;
++				regulator-max-microvolt = <1150000>;
++
++				qcom,switch-mode-frequency = <1200000>;
++			};
++
++			smb208_s2a: smb208-s2a {
++				compatible = "qcom,rpm-smb208";
++				reg = <QCOM_RPM_SMB208_S2a>;
++
++				regulator-min-microvolt = < 800000>;
++				regulator-max-microvolt = <1250000>;
++
++				qcom,switch-mode-frequency = <1200000>;
++			};
++
++			smb208_s2b: smb208-s2b {
++				compatible = "qcom,rpm-smb208";
++				reg = <QCOM_RPM_SMB208_S2b>;
++
++				regulator-min-microvolt = < 800000>;
++				regulator-max-microvolt = <1250000>;
++
++				qcom,switch-mode-frequency = <1200000>;
++			};
++		};
++
+ 		qcom_pinmux: pinmux at 800000 {
+ 			compatible = "qcom,ipq8064-pinctrl";
+ 			reg = <0x800000 0x4000>;
+@@ -136,6 +194,12 @@
+ 			reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
+ 		};
+ 
++		l2cc: clock-controller at 2011000 {
++			compatible = "qcom,kpss-gcc", "syscon";
++			reg = <0x2011000 0x1000>;
++			clock-output-names = "acpu_l2_aux";
++ 		};
++
+ 		saw0: regulator at 2089000 {
+ 			compatible = "qcom,saw2";
+ 			reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
diff --git a/target/linux/ipq806x/patches-4.1/133-ARM-Add-Krait-L2-register-accessor-functions.patch b/target/linux/ipq806x/patches-4.1/133-ARM-Add-Krait-L2-register-accessor-functions.patch
new file mode 100644
index 0000000..36a92c8
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/133-ARM-Add-Krait-L2-register-accessor-functions.patch
@@ -0,0 +1,144 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,01/13] ARM: Add Krait L2 register accessor functions
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063051
+Message-Id: <1426920332-9340-2-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>,
+	Mark Rutland <mark.rutland at arm.com>, Russell King <linux at arm.linux.org.uk>,
+	Courtney Cavin <courtney.cavin at sonymobile.com>
+Date: Fri, 20 Mar 2015 23:45:20 -0700
+
+Krait CPUs have a handful of L2 cache controller registers that
+live behind a cp15 based indirection register. First you program
+the indirection register (l2cpselr) to point the L2 'window'
+register (l2cpdr) at what you want to read/write.  Then you
+read/write the 'window' register to do what you want. The
+l2cpselr register is not banked per-cpu so we must lock around
+accesses to it to prevent other CPUs from re-pointing l2cpdr
+underneath us.
+
+Cc: Mark Rutland <mark.rutland at arm.com>
+Cc: Russell King <linux at arm.linux.org.uk>
+Cc: Courtney Cavin <courtney.cavin at sonymobile.com>
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+arch/arm/common/Kconfig                   |  3 ++
+ arch/arm/common/Makefile                  |  1 +
+ arch/arm/common/krait-l2-accessors.c      | 58 +++++++++++++++++++++++++++++++
+ arch/arm/include/asm/krait-l2-accessors.h | 20 +++++++++++
+ 4 files changed, 82 insertions(+)
+ create mode 100644 arch/arm/common/krait-l2-accessors.c
+ create mode 100644 arch/arm/include/asm/krait-l2-accessors.h
+
+--- a/arch/arm/common/Kconfig
++++ b/arch/arm/common/Kconfig
+@@ -9,6 +9,9 @@ config DMABOUNCE
+ 	bool
+ 	select ZONE_DMA
+ 
++config KRAIT_L2_ACCESSORS
++	bool
++
+ config SHARP_LOCOMO
+ 	bool
+ 
+--- a/arch/arm/common/Makefile
++++ b/arch/arm/common/Makefile
+@@ -7,6 +7,7 @@ obj-y				+= firmware.o
+ obj-$(CONFIG_ICST)		+= icst.o
+ obj-$(CONFIG_SA1111)		+= sa1111.o
+ obj-$(CONFIG_DMABOUNCE)		+= dmabounce.o
++obj-$(CONFIG_KRAIT_L2_ACCESSORS) += krait-l2-accessors.o
+ obj-$(CONFIG_SHARP_LOCOMO)	+= locomo.o
+ obj-$(CONFIG_SHARP_PARAM)	+= sharpsl_param.o
+ obj-$(CONFIG_SHARP_SCOOP)	+= scoop.o
+--- /dev/null
++++ b/arch/arm/common/krait-l2-accessors.c
+@@ -0,0 +1,58 @@
++/*
++ * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/spinlock.h>
++#include <linux/export.h>
++
++#include <asm/barrier.h>
++#include <asm/krait-l2-accessors.h>
++
++static DEFINE_RAW_SPINLOCK(krait_l2_lock);
++
++void krait_set_l2_indirect_reg(u32 addr, u32 val)
++{
++	unsigned long flags;
++
++	raw_spin_lock_irqsave(&krait_l2_lock, flags);
++	/*
++	 * Select the L2 window by poking l2cpselr, then write to the window
++	 * via l2cpdr.
++	 */
++	asm volatile ("mcr p15, 3, %0, c15, c0, 6 @ l2cpselr" : : "r" (addr));
++	isb();
++	asm volatile ("mcr p15, 3, %0, c15, c0, 7 @ l2cpdr" : : "r" (val));
++	isb();
++
++	raw_spin_unlock_irqrestore(&krait_l2_lock, flags);
++}
++EXPORT_SYMBOL(krait_set_l2_indirect_reg);
++
++u32 krait_get_l2_indirect_reg(u32 addr)
++{
++	u32 val;
++	unsigned long flags;
++
++	raw_spin_lock_irqsave(&krait_l2_lock, flags);
++	/*
++	 * Select the L2 window by poking l2cpselr, then read from the window
++	 * via l2cpdr.
++	 */
++	asm volatile ("mcr p15, 3, %0, c15, c0, 6 @ l2cpselr" : : "r" (addr));
++	isb();
++	asm volatile ("mrc p15, 3, %0, c15, c0, 7 @ l2cpdr" : "=r" (val));
++
++	raw_spin_unlock_irqrestore(&krait_l2_lock, flags);
++
++	return val;
++}
++EXPORT_SYMBOL(krait_get_l2_indirect_reg);
+--- /dev/null
++++ b/arch/arm/include/asm/krait-l2-accessors.h
+@@ -0,0 +1,20 @@
++/*
++ * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#ifndef __ASMARM_KRAIT_L2_ACCESSORS_H
++#define __ASMARM_KRAIT_L2_ACCESSORS_H
++
++extern void krait_set_l2_indirect_reg(u32 addr, u32 val);
++extern u32 krait_get_l2_indirect_reg(u32 addr);
++
++#endif
diff --git a/target/linux/ipq806x/patches-4.1/134-clk-mux-Split-out-register-accessors-for-reuse.patch b/target/linux/ipq806x/patches-4.1/134-clk-mux-Split-out-register-accessors-for-reuse.patch
new file mode 100644
index 0000000..3a475fb
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/134-clk-mux-Split-out-register-accessors-for-reuse.patch
@@ -0,0 +1,192 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,02/13] clk: mux: Split out register accessors for reuse
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063111
+Message-Id: <1426920332-9340-3-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>
+Date: Fri, 20 Mar 2015 23:45:21 -0700
+
+We want to reuse the logic in clk-mux.c for other clock drivers
+that don't use readl as register accessors. Fortunately, there
+really isn't much to the mux code besides the table indirection
+and quirk flags if you assume any bit shifting and masking has
+been done already. Pull that logic out into reusable functions
+that operate on an optional table and some flags so that other
+drivers can use the same logic.
+
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+drivers/clk/clk-mux.c        | 76 +++++++++++++++++++++++++++-----------------
+ include/linux/clk-provider.h |  9 ++++--
+ 2 files changed, 54 insertions(+), 31 deletions(-)
+
+--- a/drivers/clk/clk-mux.c
++++ b/drivers/clk/clk-mux.c
+@@ -29,35 +29,24 @@
+ 
+ #define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
+ 
+-static u8 clk_mux_get_parent(struct clk_hw *hw)
++unsigned int clk_mux_get_parent(struct clk_hw *hw, unsigned int val,
++				unsigned int *table, unsigned long flags)
+ {
+-	struct clk_mux *mux = to_clk_mux(hw);
+ 	int num_parents = __clk_get_num_parents(hw->clk);
+-	u32 val;
+ 
+-	/*
+-	 * FIXME need a mux-specific flag to determine if val is bitwise or numeric
+-	 * e.g. sys_clkin_ck's clksel field is 3 bits wide, but ranges from 0x1
+-	 * to 0x7 (index starts at one)
+-	 * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so
+-	 * val = 0x4 really means "bit 2, index starts at bit 0"
+-	 */
+-	val = clk_readl(mux->reg) >> mux->shift;
+-	val &= mux->mask;
+-
+-	if (mux->table) {
++	if (table) {
+ 		int i;
+ 
+ 		for (i = 0; i < num_parents; i++)
+-			if (mux->table[i] == val)
++			if (table[i] == val)
+ 				return i;
+ 		return -EINVAL;
+ 	}
+ 
+-	if (val && (mux->flags & CLK_MUX_INDEX_BIT))
++	if (val && (flags & CLK_MUX_INDEX_BIT))
+ 		val = ffs(val) - 1;
+ 
+-	if (val && (mux->flags & CLK_MUX_INDEX_ONE))
++	if (val && (flags & CLK_MUX_INDEX_ONE))
+ 		val--;
+ 
+ 	if (val >= num_parents)
+@@ -65,24 +54,53 @@ static u8 clk_mux_get_parent(struct clk_
+ 
+ 	return val;
+ }
++EXPORT_SYMBOL_GPL(clk_mux_get_parent);
+ 
+-static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
++static u8 _clk_mux_get_parent(struct clk_hw *hw)
+ {
+ 	struct clk_mux *mux = to_clk_mux(hw);
+ 	u32 val;
+-	unsigned long flags = 0;
+ 
+-	if (mux->table)
+-		index = mux->table[index];
++	/*
++	 * FIXME need a mux-specific flag to determine if val is bitwise or numeric
++	 * e.g. sys_clkin_ck's clksel field is 3 bits wide, but ranges from 0x1
++	 * to 0x7 (index starts at one)
++	 * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so
++	 * val = 0x4 really means "bit 2, index starts at bit 0"
++	 */
++	val = clk_readl(mux->reg) >> mux->shift;
++	val &= mux->mask;
++
++	return clk_mux_get_parent(hw, val, mux->table, mux->flags);
++}
+ 
+-	else {
+-		if (mux->flags & CLK_MUX_INDEX_BIT)
+-			index = 1 << index;
++unsigned int clk_mux_reindex(u8 index, unsigned int *table,
++			     unsigned long flags)
++{
++	unsigned int val = index;
+ 
+-		if (mux->flags & CLK_MUX_INDEX_ONE)
+-			index++;
++	if (table) {
++		val = table[val];
++	} else {
++		if (flags & CLK_MUX_INDEX_BIT)
++			val = 1 << index;
++
++		if (flags & CLK_MUX_INDEX_ONE)
++			val++;
+ 	}
+ 
++	return val;
++}
++EXPORT_SYMBOL_GPL(clk_mux_reindex);
++
++static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
++{
++	struct clk_mux *mux = to_clk_mux(hw);
++	u32 val;
++	unsigned long flags = 0;
++
++	index = clk_mux_reindex(index, mux->table, mux->flags);
++
+ 	if (mux->lock)
+ 		spin_lock_irqsave(mux->lock, flags);
+ 
+@@ -102,21 +120,21 @@ static int clk_mux_set_parent(struct clk
+ }
+ 
+ const struct clk_ops clk_mux_ops = {
+-	.get_parent = clk_mux_get_parent,
++	.get_parent = _clk_mux_get_parent,
+ 	.set_parent = clk_mux_set_parent,
+ 	.determine_rate = __clk_mux_determine_rate,
+ };
+ EXPORT_SYMBOL_GPL(clk_mux_ops);
+ 
+ const struct clk_ops clk_mux_ro_ops = {
+-	.get_parent = clk_mux_get_parent,
++	.get_parent = _clk_mux_get_parent,
+ };
+ EXPORT_SYMBOL_GPL(clk_mux_ro_ops);
+ 
+ struct clk *clk_register_mux_table(struct device *dev, const char *name,
+ 		const char **parent_names, u8 num_parents, unsigned long flags,
+ 		void __iomem *reg, u8 shift, u32 mask,
+-		u8 clk_mux_flags, u32 *table, spinlock_t *lock)
++		u8 clk_mux_flags, unsigned int *table, spinlock_t *lock)
+ {
+ 	struct clk_mux *mux;
+ 	struct clk *clk;
+--- a/include/linux/clk-provider.h
++++ b/include/linux/clk-provider.h
+@@ -409,7 +409,7 @@ void clk_unregister_divider(struct clk *
+ struct clk_mux {
+ 	struct clk_hw	hw;
+ 	void __iomem	*reg;
+-	u32		*table;
++	unsigned int	*table;
+ 	u32		mask;
+ 	u8		shift;
+ 	u8		flags;
+@@ -425,6 +425,11 @@ struct clk_mux {
+ extern const struct clk_ops clk_mux_ops;
+ extern const struct clk_ops clk_mux_ro_ops;
+ 
++unsigned int clk_mux_get_parent(struct clk_hw *hw, unsigned int val,
++				unsigned int *table, unsigned long flags);
++unsigned int clk_mux_reindex(u8 index, unsigned int *table,
++			     unsigned long flags);
++
+ struct clk *clk_register_mux(struct device *dev, const char *name,
+ 		const char **parent_names, u8 num_parents, unsigned long flags,
+ 		void __iomem *reg, u8 shift, u8 width,
+@@ -433,7 +438,7 @@ struct clk *clk_register_mux(struct devi
+ struct clk *clk_register_mux_table(struct device *dev, const char *name,
+ 		const char **parent_names, u8 num_parents, unsigned long flags,
+ 		void __iomem *reg, u8 shift, u32 mask,
+-		u8 clk_mux_flags, u32 *table, spinlock_t *lock);
++		u8 clk_mux_flags, unsigned int *table, spinlock_t *lock);
+ 
+ void clk_unregister_mux(struct clk *clk);
+ 
diff --git a/target/linux/ipq806x/patches-4.1/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch b/target/linux/ipq806x/patches-4.1/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch
new file mode 100644
index 0000000..8063860
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/135-clk-Avoid-sending-high-rates-to-downstream-clocks-during-set_rate.patch
@@ -0,0 +1,130 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3, 03/13] clk: Avoid sending high rates to downstream clocks during
+	set_rate
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063271
+Message-Id: <1426920332-9340-4-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>
+Date: Fri, 20 Mar 2015 23:45:22 -0700
+
+If a clock is on and we call clk_set_rate() on it we may get into
+a situation where the clock temporarily increases in rate
+dramatically while we walk the tree and call .set_rate() ops. For
+example, consider a case where a PLL feeds into a divider.
+Initially the divider is set to divide by 1 and the PLL is
+running fairly slow (100MHz). The downstream consumer of the
+divider output can only handle rates =< 400 MHz, but the divider
+can only choose between divisors of 1 and 4.
+
+ +-----+   +----------------+
+ | PLL |-->| div 1 or div 4 |---> consumer device
+ +-----+   +----------------+
+
+To achieve a rate of 400MHz on the output of the divider, we
+would have to set the rate of the PLL to 1.6 GHz and then divide
+it by 4. The current code would set the PLL to 1.6GHz first while
+the divider is still set to 1, thus causing the downstream
+consumer of the clock to receive a few clock cycles of 1.6GHz
+clock (far beyond it's maximum acceptable rate). We should be
+changing the divider first before increasing the PLL rate to
+avoid this problem.
+
+Therefore, set the rate of any child clocks that are increasing
+in rate from their current rate so that they can increase their
+dividers if necessary. We assume that there isn't such a thing as
+minimum rate requirements.
+
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+drivers/clk/clk.c | 34 ++++++++++++++++++++++------------
+ 1 file changed, 22 insertions(+), 12 deletions(-)
+
+--- a/drivers/clk/clk.c
++++ b/drivers/clk/clk.c
+@@ -1743,21 +1743,24 @@ static struct clk_core *clk_propagate_ra
+  * walk down a subtree and set the new rates notifying the rate
+  * change on the way
+  */
+-static void clk_change_rate(struct clk_core *clk)
++static void
++clk_change_rate(struct clk_core *clk, unsigned long best_parent_rate)
+ {
+ 	struct clk_core *child;
+ 	struct hlist_node *tmp;
+ 	unsigned long old_rate;
+-	unsigned long best_parent_rate = 0;
+ 	bool skip_set_rate = false;
+ 	struct clk_core *old_parent;
+ 
+-	old_rate = clk->rate;
++	hlist_for_each_entry(child, &clk->children, child_node) {
++		/* Skip children who will be reparented to another clock */
++		if (child->new_parent && child->new_parent != clk)
++			continue;
++		if (child->new_rate > child->rate)
++			clk_change_rate(child, clk->new_rate);
++	}
+ 
+-	if (clk->new_parent)
+-		best_parent_rate = clk->new_parent->rate;
+-	else if (clk->parent)
+-		best_parent_rate = clk->parent->rate;
++	old_rate = clk->rate;
+ 
+ 	if (clk->new_parent && clk->new_parent != clk->parent) {
+ 		old_parent = __clk_set_parent_before(clk, clk->new_parent);
+@@ -1783,7 +1786,7 @@ static void clk_change_rate(struct clk_c
+ 
+ 	trace_clk_set_rate_complete(clk, clk->new_rate);
+ 
+-	clk->rate = clk_recalc(clk, best_parent_rate);
++	clk->rate = clk->new_rate;
+ 
+ 	if (clk->notifier_count && old_rate != clk->rate)
+ 		__clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);
+@@ -1796,12 +1799,13 @@ static void clk_change_rate(struct clk_c
+ 		/* Skip children who will be reparented to another clock */
+ 		if (child->new_parent && child->new_parent != clk)
+ 			continue;
+-		clk_change_rate(child);
++		if (child->new_rate != child->rate)
++			clk_change_rate(child, clk->new_rate);
+ 	}
+ 
+ 	/* handle the new child who might not be in clk->children yet */
+-	if (clk->new_child)
+-		clk_change_rate(clk->new_child);
++	if (clk->new_child && clk->new_child->new_rate != clk->new_child->rate)
++		clk_change_rate(clk->new_child, clk->new_rate);
+ }
+ 
+ static int clk_core_set_rate_nolock(struct clk_core *clk,
+@@ -1810,6 +1814,7 @@ static int clk_core_set_rate_nolock(stru
+ 	struct clk_core *top, *fail_clk;
+ 	unsigned long rate = req_rate;
+ 	int ret = 0;
++	unsigned long parent_rate;
+ 
+ 	if (!clk)
+ 		return 0;
+@@ -1835,8 +1840,13 @@ static int clk_core_set_rate_nolock(stru
+ 		return -EBUSY;
+ 	}
+ 
++	if (top->parent)
++		parent_rate = top->parent->rate;
++	else
++		parent_rate = 0;
++
+ 	/* change the rates */
+-	clk_change_rate(top);
++	clk_change_rate(top, parent_rate);
+ 
+ 	clk->req_rate = req_rate;
+ 
diff --git a/target/linux/ipq806x/patches-4.1/136-clk-Add-safe-switch-hook.patch b/target/linux/ipq806x/patches-4.1/136-clk-Add-safe-switch-hook.patch
new file mode 100644
index 0000000..0cf4eb3
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/136-clk-Add-safe-switch-hook.patch
@@ -0,0 +1,164 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,04/13] clk: Add safe switch hook
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063211
+Message-Id: <1426920332-9340-5-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>
+Date: Fri, 20 Mar 2015 23:45:23 -0700
+
+Sometimes clocks can't accept their parent source turning off
+while the source is reprogrammed to a different rate. Most
+notably CPU clocks require a way to switch away from the current
+PLL they're running on, reprogram that PLL to a new rate, and
+then switch back to the PLL with the new rate once they're done.
+Add a hook that drivers can implement allowing them to return a
+'safe parent' that they can switch their parent to while the
+upstream source is reprogrammed to support this.
+
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+This patch is good enough for Krait, but soon I'll need to 
+support a "safe rate" where we ask a clock what rate it needs to be running
+at to be sure it's within voltage constraints. Right now safe parent
+handles that problem on Krait, but on other platforms it won't work.
+
+ drivers/clk/clk.c            | 61 ++++++++++++++++++++++++++++++++++++++------
+ include/linux/clk-provider.h |  1 +
+ 2 files changed, 54 insertions(+), 8 deletions(-)
+
+--- a/drivers/clk/clk.c
++++ b/drivers/clk/clk.c
+@@ -56,9 +56,12 @@ struct clk_core {
+ 	struct clk_core		**parents;
+ 	u8			num_parents;
+ 	u8			new_parent_index;
++	u8			safe_parent_index;
+ 	unsigned long		rate;
+ 	unsigned long		req_rate;
++	unsigned long		old_rate;
+ 	unsigned long		new_rate;
++	struct clk_core		*safe_parent;
+ 	struct clk_core		*new_parent;
+ 	struct clk_core		*new_child;
+ 	unsigned long		flags;
+@@ -1595,7 +1598,8 @@ out:
+ static void clk_calc_subtree(struct clk_core *clk, unsigned long new_rate,
+ 			     struct clk_core *new_parent, u8 p_index)
+ {
+-	struct clk_core *child;
++	struct clk_core *child, *parent;
++	struct clk_hw *parent_hw;
+ 
+ 	clk->new_rate = new_rate;
+ 	clk->new_parent = new_parent;
+@@ -1605,6 +1609,18 @@ static void clk_calc_subtree(struct clk_
+ 	if (new_parent && new_parent != clk->parent)
+ 		new_parent->new_child = clk;
+ 
++	if (clk->ops->get_safe_parent) {
++		parent_hw = clk->ops->get_safe_parent(clk->hw);
++		if (parent_hw) {
++			parent = parent_hw->core;
++			p_index = clk_fetch_parent_index(clk, parent);
++			clk->safe_parent_index = p_index;
++			clk->safe_parent = parent;
++		}
++	} else {
++		clk->safe_parent = NULL;
++	}
++
+ 	hlist_for_each_entry(child, &clk->children, child_node) {
+ 		child->new_rate = clk_recalc(child, new_rate);
+ 		clk_calc_subtree(child, child->new_rate, NULL, 0);
+@@ -1709,14 +1725,43 @@ static struct clk_core *clk_propagate_ra
+ 						  unsigned long event)
+ {
+ 	struct clk_core *child, *tmp_clk, *fail_clk = NULL;
++	struct clk_core *old_parent;
+ 	int ret = NOTIFY_DONE;
+ 
+-	if (clk->rate == clk->new_rate)
++	if (clk->rate == clk->new_rate && event != POST_RATE_CHANGE)
+ 		return NULL;
+ 
++	switch (event) {
++	case PRE_RATE_CHANGE:
++		if (clk->safe_parent)
++			clk->ops->set_parent(clk->hw, clk->safe_parent_index);
++		clk->old_rate = clk->rate;
++		break;
++	case POST_RATE_CHANGE:
++		if (clk->safe_parent) {
++			old_parent = __clk_set_parent_before(clk,
++							     clk->new_parent);
++			if (clk->ops->set_rate_and_parent) {
++				clk->ops->set_rate_and_parent(clk->hw,
++						clk->new_rate,
++						clk->new_parent ?
++						clk->new_parent->rate : 0,
++						clk->new_parent_index);
++			} else if (clk->ops->set_parent) {
++				clk->ops->set_parent(clk->hw,
++						clk->new_parent_index);
++			}
++			__clk_set_parent_after(clk, clk->new_parent,
++					       old_parent);
++		}
++		break;
++	}
++
+ 	if (clk->notifier_count) {
+-		ret = __clk_notify(clk, event, clk->rate, clk->new_rate);
+-		if (ret & NOTIFY_STOP_MASK)
++		if (event != POST_RATE_CHANGE || clk->old_rate != clk->rate)
++			ret = __clk_notify(clk, event, clk->old_rate,
++					   clk->new_rate);
++		if (ret & NOTIFY_STOP_MASK && event != POST_RATE_CHANGE)
+ 			fail_clk = clk;
+ 	}
+ 
+@@ -1762,7 +1807,8 @@ clk_change_rate(struct clk_core *clk, un
+ 
+ 	old_rate = clk->rate;
+ 
+-	if (clk->new_parent && clk->new_parent != clk->parent) {
++	if (clk->new_parent && clk->new_parent != clk->parent &&
++			!clk->safe_parent) {
+ 		old_parent = __clk_set_parent_before(clk, clk->new_parent);
+ 		trace_clk_set_parent(clk, clk->new_parent);
+ 
+@@ -1788,9 +1834,6 @@ clk_change_rate(struct clk_core *clk, un
+ 
+ 	clk->rate = clk->new_rate;
+ 
+-	if (clk->notifier_count && old_rate != clk->rate)
+-		__clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);
+-
+ 	/*
+ 	 * Use safe iteration, as change_rate can actually swap parents
+ 	 * for certain clock types.
+@@ -1850,6 +1893,8 @@ static int clk_core_set_rate_nolock(stru
+ 
+ 	clk->req_rate = req_rate;
+ 
++	clk_propagate_rate_change(top, POST_RATE_CHANGE);
++
+ 	return ret;
+ }
+ 
+--- a/include/linux/clk-provider.h
++++ b/include/linux/clk-provider.h
+@@ -183,6 +183,7 @@ struct clk_ops {
+ 					  struct clk_hw **best_parent_hw);
+ 	int		(*set_parent)(struct clk_hw *hw, u8 index);
+ 	u8		(*get_parent)(struct clk_hw *hw);
++	struct clk_hw	*(*get_safe_parent)(struct clk_hw *hw);
+ 	int		(*set_rate)(struct clk_hw *hw, unsigned long rate,
+ 				    unsigned long parent_rate);
+ 	int		(*set_rate_and_parent)(struct clk_hw *hw,
diff --git a/target/linux/ipq806x/patches-4.1/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch b/target/linux/ipq806x/patches-4.1/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
new file mode 100644
index 0000000..6fad6e8
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/137-clk-qcom-Add-support-for-High-Frequency-PLLs-HFPLLs.patch
@@ -0,0 +1,351 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,05/13] clk: qcom: Add support for High-Frequency PLLs (HFPLLs)
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063261
+Message-Id: <1426920332-9340-6-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>
+Date: Fri, 20 Mar 2015 23:45:24 -0700
+
+HFPLLs are the main frequency source for Krait CPU clocks. Add
+support for changing the rate of these PLLs.
+
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+I'd really like to get rid of __clk_hfpll_init_once() if possible...
+
+ drivers/clk/qcom/Makefile    |   1 +
+ drivers/clk/qcom/clk-hfpll.c | 253 +++++++++++++++++++++++++++++++++++++++++++
+ drivers/clk/qcom/clk-hfpll.h |  54 +++++++++
+ 3 files changed, 308 insertions(+)
+ create mode 100644 drivers/clk/qcom/clk-hfpll.c
+ create mode 100644 drivers/clk/qcom/clk-hfpll.h
+
+--- a/drivers/clk/qcom/Makefile
++++ b/drivers/clk/qcom/Makefile
+@@ -8,6 +8,7 @@ clk-qcom-y += clk-rcg2.o
+ clk-qcom-y += clk-branch.o
+ clk-qcom-y += clk-regmap-divider.o
+ clk-qcom-y += clk-regmap-mux.o
++clk-qcom-y += clk-hfpll.o
+ clk-qcom-y += reset.o
+ 
+ obj-$(CONFIG_APQ_GCC_8084) += gcc-apq8084.o
+--- /dev/null
++++ b/drivers/clk/qcom/clk-hfpll.c
+@@ -0,0 +1,253 @@
++/*
++ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++#include <linux/kernel.h>
++#include <linux/export.h>
++#include <linux/regmap.h>
++#include <linux/delay.h>
++#include <linux/err.h>
++#include <linux/clk-provider.h>
++#include <linux/spinlock.h>
++
++#include "clk-regmap.h"
++#include "clk-hfpll.h"
++
++#define PLL_OUTCTRL	BIT(0)
++#define PLL_BYPASSNL	BIT(1)
++#define PLL_RESET_N	BIT(2)
++
++/* Initialize a HFPLL at a given rate and enable it. */
++static void __clk_hfpll_init_once(struct clk_hw *hw)
++{
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	struct hfpll_data const *hd = h->d;
++	struct regmap *regmap = h->clkr.regmap;
++
++	if (likely(h->init_done))
++		return;
++
++	/* Configure PLL parameters for integer mode. */
++	if (hd->config_val)
++		regmap_write(regmap, hd->config_reg, hd->config_val);
++	regmap_write(regmap, hd->m_reg, 0);
++	regmap_write(regmap, hd->n_reg, 1);
++
++	if (hd->user_reg) {
++		u32 regval = hd->user_val;
++		unsigned long rate;
++
++		rate = __clk_get_rate(hw->clk);
++
++		/* Pick the right VCO. */
++		if (hd->user_vco_mask && rate > hd->low_vco_max_rate)
++			regval |= hd->user_vco_mask;
++		regmap_write(regmap, hd->user_reg, regval);
++	}
++
++	if (hd->droop_reg)
++		regmap_write(regmap, hd->droop_reg, hd->droop_val);
++
++	h->init_done = true;
++}
++
++static void __clk_hfpll_enable(struct clk_hw *hw)
++{
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	struct hfpll_data const *hd = h->d;
++	struct regmap *regmap = h->clkr.regmap;
++	u32 val;
++
++	__clk_hfpll_init_once(hw);
++
++	/* Disable PLL bypass mode. */
++	regmap_update_bits(regmap, hd->mode_reg, PLL_BYPASSNL, PLL_BYPASSNL);
++
++	/*
++	 * H/W requires a 5us delay between disabling the bypass and
++	 * de-asserting the reset. Delay 10us just to be safe.
++	 */
++	udelay(10);
++
++	/* De-assert active-low PLL reset. */
++	regmap_update_bits(regmap, hd->mode_reg, PLL_RESET_N, PLL_RESET_N);
++
++	/* Wait for PLL to lock. */
++	if (hd->status_reg) {
++		do {
++			regmap_read(regmap, hd->status_reg, &val);
++		} while (!(val & BIT(hd->lock_bit)));
++	} else {
++		udelay(60);
++	}
++
++	/* Enable PLL output. */
++	regmap_update_bits(regmap, hd->mode_reg, PLL_OUTCTRL, PLL_OUTCTRL);
++}
++
++/* Enable an already-configured HFPLL. */
++static int clk_hfpll_enable(struct clk_hw *hw)
++{
++	unsigned long flags;
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	struct hfpll_data const *hd = h->d;
++	struct regmap *regmap = h->clkr.regmap;
++	u32 mode;
++
++	spin_lock_irqsave(&h->lock, flags);
++	regmap_read(regmap, hd->mode_reg, &mode);
++	if (!(mode & (PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL)))
++		__clk_hfpll_enable(hw);
++	spin_unlock_irqrestore(&h->lock, flags);
++
++	return 0;
++}
++
++static void __clk_hfpll_disable(struct clk_hfpll *h)
++{
++	struct hfpll_data const *hd = h->d;
++	struct regmap *regmap = h->clkr.regmap;
++
++	/*
++	 * Disable the PLL output, disable test mode, enable the bypass mode,
++	 * and assert the reset.
++	 */
++	regmap_update_bits(regmap, hd->mode_reg,
++			PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL, 0);
++}
++
++static void clk_hfpll_disable(struct clk_hw *hw)
++{
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	unsigned long flags;
++
++	spin_lock_irqsave(&h->lock, flags);
++	__clk_hfpll_disable(h);
++	spin_unlock_irqrestore(&h->lock, flags);
++}
++
++static long clk_hfpll_round_rate(struct clk_hw *hw, unsigned long rate,
++				 unsigned long *parent_rate)
++{
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	struct hfpll_data const *hd = h->d;
++	unsigned long rrate;
++
++	rate = clamp(rate, hd->min_rate, hd->max_rate);
++
++	rrate = DIV_ROUND_UP(rate, *parent_rate) * *parent_rate;
++	if (rrate > hd->max_rate)
++		rrate -= *parent_rate;
++
++	return rrate;
++}
++
++/*
++ * For optimization reasons, assumes no downstream clocks are actively using
++ * it.
++ */
++static int clk_hfpll_set_rate(struct clk_hw *hw, unsigned long rate,
++			      unsigned long parent_rate)
++{
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	struct hfpll_data const *hd = h->d;
++	struct regmap *regmap = h->clkr.regmap;
++	unsigned long flags;
++	u32 l_val, val;
++	bool enabled;
++
++	l_val = rate / parent_rate;
++
++	spin_lock_irqsave(&h->lock, flags);
++
++	enabled = __clk_is_enabled(hw->clk);
++	if (enabled)
++		__clk_hfpll_disable(h);
++
++	/* Pick the right VCO. */
++	if (hd->user_reg && hd->user_vco_mask) {
++		regmap_read(regmap, hd->user_reg, &val);
++		if (rate <= hd->low_vco_max_rate)
++			val &= ~hd->user_vco_mask;
++		else
++			val |= hd->user_vco_mask;
++		regmap_write(regmap, hd->user_reg, val);
++	}
++
++	regmap_write(regmap, hd->l_reg, l_val);
++
++	if (enabled)
++		__clk_hfpll_enable(hw);
++
++	spin_unlock_irqrestore(&h->lock, flags);
++
++	return 0;
++}
++
++static unsigned long clk_hfpll_recalc_rate(struct clk_hw *hw,
++					   unsigned long parent_rate)
++{
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	struct hfpll_data const *hd = h->d;
++	struct regmap *regmap = h->clkr.regmap;
++	u32 l_val;
++
++	regmap_read(regmap, hd->l_reg, &l_val);
++
++	return l_val * parent_rate;
++}
++
++static void clk_hfpll_init(struct clk_hw *hw)
++{
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	struct hfpll_data const *hd = h->d;
++	struct regmap *regmap = h->clkr.regmap;
++	u32 mode, status;
++
++	regmap_read(regmap, hd->mode_reg, &mode);
++	if (mode != (PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL)) {
++		__clk_hfpll_init_once(hw);
++		return;
++	}
++
++	if (hd->status_reg) {
++		regmap_read(regmap, hd->status_reg, &status);
++		if (!(status & BIT(hd->lock_bit))) {
++			WARN(1, "HFPLL %s is ON, but not locked!\n",
++					__clk_get_name(hw->clk));
++			clk_hfpll_disable(hw);
++			__clk_hfpll_init_once(hw);
++		}
++	}
++}
++
++static int hfpll_is_enabled(struct clk_hw *hw)
++{
++	struct clk_hfpll *h = to_clk_hfpll(hw);
++	struct hfpll_data const *hd = h->d;
++	struct regmap *regmap = h->clkr.regmap;
++	u32 mode;
++
++	regmap_read(regmap, hd->mode_reg, &mode);
++	mode &= 0x7;
++	return mode == (PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL);
++}
++
++const struct clk_ops clk_ops_hfpll = {
++	.enable = clk_hfpll_enable,
++	.disable = clk_hfpll_disable,
++	.is_enabled = hfpll_is_enabled,
++	.round_rate = clk_hfpll_round_rate,
++	.set_rate = clk_hfpll_set_rate,
++	.recalc_rate = clk_hfpll_recalc_rate,
++	.init = clk_hfpll_init,
++};
++EXPORT_SYMBOL_GPL(clk_ops_hfpll);
+--- /dev/null
++++ b/drivers/clk/qcom/clk-hfpll.h
+@@ -0,0 +1,54 @@
++/*
++ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++#ifndef __QCOM_CLK_HFPLL_H__
++#define __QCOM_CLK_HFPLL_H__
++
++#include <linux/clk-provider.h>
++#include <linux/spinlock.h>
++#include "clk-regmap.h"
++
++struct hfpll_data {
++	u32 mode_reg;
++	u32 l_reg;
++	u32 m_reg;
++	u32 n_reg;
++	u32 user_reg;
++	u32 droop_reg;
++	u32 config_reg;
++	u32 status_reg;
++	u8  lock_bit;
++
++	u32 droop_val;
++	u32 config_val;
++	u32 user_val;
++	u32 user_vco_mask;
++	unsigned long low_vco_max_rate;
++
++	unsigned long min_rate;
++	unsigned long max_rate;
++};
++
++struct clk_hfpll {
++	struct hfpll_data const *d;
++	int init_done;
++
++	struct clk_regmap clkr;
++	spinlock_t lock;
++};
++
++#define to_clk_hfpll(_hw) \
++	container_of(to_clk_regmap(_hw), struct clk_hfpll, clkr)
++
++extern const struct clk_ops clk_ops_hfpll;
++
++#endif
diff --git a/target/linux/ipq806x/patches-4.1/138-clk-qcom-Add-HFPLL-driver.patch b/target/linux/ipq806x/patches-4.1/138-clk-qcom-Add-HFPLL-driver.patch
new file mode 100644
index 0000000..4056784
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/138-clk-qcom-Add-HFPLL-driver.patch
@@ -0,0 +1,206 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,06/13] clk: qcom: Add HFPLL driver
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063231
+Message-Id: <1426920332-9340-7-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>, <devicetree at vger.kernel.org>
+Date: Fri, 20 Mar 2015 23:45:25 -0700
+
+On some devices (MSM8974 for example), the HFPLLs are
+instantiated within the Krait processor subsystem as separate
+register regions. Add a driver for these PLLs so that we can
+provide HFPLL clocks for use by the system.
+
+Cc: <devicetree at vger.kernel.org>
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+.../devicetree/bindings/clock/qcom,hfpll.txt       |  40 ++++++++
+ drivers/clk/qcom/Kconfig                           |   8 ++
+ drivers/clk/qcom/Makefile                          |   1 +
+ drivers/clk/qcom/hfpll.c                           | 109 +++++++++++++++++++++
+ 4 files changed, 158 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/clock/qcom,hfpll.txt
+ create mode 100644 drivers/clk/qcom/hfpll.c
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/clock/qcom,hfpll.txt
+@@ -0,0 +1,40 @@
++High-Frequency PLL (HFPLL)
++
++PROPERTIES
++
++- compatible:
++	Usage: required
++	Value type: <string>
++	Definition: must be "qcom,hfpll"
++
++- reg:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: address and size of HPLL registers. An optional second
++		    element specifies the address and size of the alias
++		    register region.
++
++- clock-output-names:
++	Usage: required
++	Value type: <string>
++	Definition: Name of the PLL. Typically hfpllX where X is a CPU number
++		    starting at 0. Otherwise hfpll_Y where Y is more specific
++		    such as "l2".
++
++Example:
++
++1) An HFPLL for the L2 cache.
++
++	clock-controller at f9016000 {
++		compatible = "qcom,hfpll";
++		reg = <0xf9016000 0x30>;
++		clock-output-names = "hfpll_l2";
++	};
++
++2) An HFPLL for CPU0. This HFPLL has the alias register region.
++
++	clock-controller at f908a000 {
++		compatible = "qcom,hfpll";
++		reg = <0xf908a000 0x30>, <0xf900a000 0x30>;
++		clock-output-names = "hfpll0";
++	};
+--- a/drivers/clk/qcom/Kconfig
++++ b/drivers/clk/qcom/Kconfig
+@@ -97,3 +97,11 @@ config MSM_MMCC_8974
+ 	  Support for the multimedia clock controller on msm8974 devices.
+ 	  Say Y if you want to support multimedia devices such as display,
+ 	  graphics, video encode/decode, camera, etc.
++
++config QCOM_HFPLL
++	tristate "High-Frequency PLL (HFPLL) Clock Controller"
++	depends on COMMON_CLK_QCOM
++	help
++	  Support for the high-frequency PLLs present on Qualcomm devices.
++	  Say Y if you want to support CPU frequency scaling on devices
++	  such as MSM8974, APQ8084, etc.
+--- a/drivers/clk/qcom/Makefile
++++ b/drivers/clk/qcom/Makefile
+@@ -22,3 +22,4 @@ obj-$(CONFIG_MSM_LCC_8960) += lcc-msm896
+ obj-$(CONFIG_MSM_GCC_8974) += gcc-msm8974.o
+ obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
+ obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
++obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
+--- /dev/null
++++ b/drivers/clk/qcom/hfpll.c
+@@ -0,0 +1,109 @@
++/*
++ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/of.h>
++#include <linux/clk.h>
++#include <linux/clk-provider.h>
++#include <linux/regmap.h>
++
++#include "clk-regmap.h"
++#include "clk-hfpll.h"
++
++static const struct hfpll_data hdata = {
++	.mode_reg = 0x00,
++	.l_reg = 0x04,
++	.m_reg = 0x08,
++	.n_reg = 0x0c,
++	.user_reg = 0x10,
++	.config_reg = 0x14,
++	.config_val = 0x430405d,
++	.status_reg = 0x1c,
++	.lock_bit = 16,
++
++	.user_val = 0x8,
++	.user_vco_mask = 0x100000,
++	.low_vco_max_rate = 1248000000,
++	.min_rate = 537600000UL,
++	.max_rate = 2900000000UL,
++};
++
++static const struct of_device_id qcom_hfpll_match_table[] = {
++	{ .compatible = "qcom,hfpll" },
++	{ }
++};
++MODULE_DEVICE_TABLE(of, qcom_hfpll_match_table);
++
++static const struct regmap_config hfpll_regmap_config = {
++	.reg_bits	= 32,
++	.reg_stride	= 4,
++	.val_bits	= 32,
++	.max_register	= 0x30,
++	.fast_io	= true,
++};
++
++static int qcom_hfpll_probe(struct platform_device *pdev)
++{
++	struct clk *clk;
++	struct resource *res;
++	struct device *dev = &pdev->dev;
++	void __iomem *base;
++	struct regmap *regmap;
++	struct clk_hfpll *h;
++	struct clk_init_data init = {
++		.parent_names = (const char *[]){ "xo" },
++		.num_parents = 1,
++		.ops = &clk_ops_hfpll,
++	};
++
++	h = devm_kzalloc(dev, sizeof(*h), GFP_KERNEL);
++	if (!h)
++		return -ENOMEM;
++
++	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	base = devm_ioremap_resource(dev, res);
++	if (IS_ERR(base))
++		return PTR_ERR(base);
++
++	regmap = devm_regmap_init_mmio(&pdev->dev, base, &hfpll_regmap_config);
++	if (IS_ERR(regmap))
++		return PTR_ERR(regmap);
++
++	if (of_property_read_string_index(dev->of_node, "clock-output-names",
++						  0, &init.name))
++		return -ENODEV;
++
++	h->d = &hdata;
++	h->clkr.hw.init = &init;
++	spin_lock_init(&h->lock);
++
++	clk = devm_clk_register_regmap(&pdev->dev, &h->clkr);
++
++	return PTR_ERR_OR_ZERO(clk);
++}
++
++static struct platform_driver qcom_hfpll_driver = {
++	.probe		= qcom_hfpll_probe,
++	.driver		= {
++		.name	= "qcom-hfpll",
++		.of_match_table = qcom_hfpll_match_table,
++	},
++};
++module_platform_driver(qcom_hfpll_driver);
++
++MODULE_DESCRIPTION("QCOM HFPLL Clock Driver");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:qcom-hfpll");
diff --git a/target/linux/ipq806x/patches-4.1/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch b/target/linux/ipq806x/patches-4.1/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
new file mode 100644
index 0000000..ffcd462
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch
@@ -0,0 +1,127 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,08/13] clk: qcom: Add IPQ806X's HFPLLs
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063241
+Message-Id: <1426920332-9340-9-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>
+Date: Fri, 20 Mar 2015 23:45:27 -0700
+
+Describe the HFPLLs present on IPQ806X devices.
+
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+drivers/clk/qcom/gcc-ipq806x.c | 83 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 83 insertions(+)
+
+--- a/drivers/clk/qcom/gcc-ipq806x.c
++++ b/drivers/clk/qcom/gcc-ipq806x.c
+@@ -30,6 +30,7 @@
+ #include "clk-pll.h"
+ #include "clk-rcg.h"
+ #include "clk-branch.h"
++#include "clk-hfpll.h"
+ #include "reset.h"
+ 
+ static struct clk_pll pll0 = {
+@@ -113,6 +114,85 @@ static struct clk_regmap pll8_vote = {
+ 	},
+ };
+ 
++static struct hfpll_data hfpll0_data = {
++	.mode_reg = 0x3200,
++	.l_reg = 0x3208,
++	.m_reg = 0x320c,
++	.n_reg = 0x3210,
++	.config_reg = 0x3204,
++	.status_reg = 0x321c,
++	.config_val = 0x7845c665,
++	.droop_reg = 0x3214,
++	.droop_val = 0x0108c000,
++	.min_rate = 600000000UL,
++	.max_rate = 1800000000UL,
++};
++
++static struct clk_hfpll hfpll0 = {
++	.d = &hfpll0_data,
++	.clkr.hw.init = &(struct clk_init_data){
++		.parent_names = (const char *[]){ "pxo" },
++		.num_parents = 1,
++		.name = "hfpll0",
++		.ops = &clk_ops_hfpll,
++		.flags = CLK_IGNORE_UNUSED,
++	},
++	.lock = __SPIN_LOCK_UNLOCKED(hfpll0.lock),
++};
++
++static struct hfpll_data hfpll1_data = {
++	.mode_reg = 0x3240,
++	.l_reg = 0x3248,
++	.m_reg = 0x324c,
++	.n_reg = 0x3250,
++	.config_reg = 0x3244,
++	.status_reg = 0x325c,
++	.config_val = 0x7845c665,
++	.droop_reg = 0x3314,
++	.droop_val = 0x0108c000,
++	.min_rate = 600000000UL,
++	.max_rate = 1800000000UL,
++};
++
++static struct clk_hfpll hfpll1 = {
++	.d = &hfpll1_data,
++	.clkr.hw.init = &(struct clk_init_data){
++		.parent_names = (const char *[]){ "pxo" },
++		.num_parents = 1,
++		.name = "hfpll1",
++		.ops = &clk_ops_hfpll,
++		.flags = CLK_IGNORE_UNUSED,
++	},
++	.lock = __SPIN_LOCK_UNLOCKED(hfpll1.lock),
++};
++
++static struct hfpll_data hfpll_l2_data = {
++	.mode_reg = 0x3300,
++	.l_reg = 0x3308,
++	.m_reg = 0x330c,
++	.n_reg = 0x3310,
++	.config_reg = 0x3304,
++	.status_reg = 0x331c,
++	.config_val = 0x7845c665,
++	.droop_reg = 0x3314,
++	.droop_val = 0x0108c000,
++	.min_rate = 600000000UL,
++	.max_rate = 1800000000UL,
++};
++
++static struct clk_hfpll hfpll_l2 = {
++	.d = &hfpll_l2_data,
++	.clkr.hw.init = &(struct clk_init_data){
++		.parent_names = (const char *[]){ "pxo" },
++		.num_parents = 1,
++		.name = "hfpll_l2",
++		.ops = &clk_ops_hfpll,
++		.flags = CLK_IGNORE_UNUSED,
++	},
++	.lock = __SPIN_LOCK_UNLOCKED(hfpll_l2.lock),
++};
++
++
+ static struct clk_pll pll14 = {
+ 	.l_reg = 0x31c4,
+ 	.m_reg = 0x31c8,
+@@ -2307,6 +2387,9 @@ static struct clk_regmap *gcc_ipq806x_cl
+ 	[USB_FS1_SYSTEM_CLK] = &usb_fs1_sys_clk.clkr,
+ 	[EBI2_CLK] = &ebi2_clk.clkr,
+ 	[EBI2_AON_CLK] = &ebi2_aon_clk.clkr,
++	[PLL9] = &hfpll0.clkr,
++	[PLL10] = &hfpll1.clkr,
++	[PLL12] = &hfpll_l2.clkr,
+ };
+ 
+ static const struct qcom_reset_map gcc_ipq806x_resets[] = {
diff --git a/target/linux/ipq806x/patches-4.1/140-clk-qcom-Add-support-for-Krait-clocks.patch b/target/linux/ipq806x/patches-4.1/140-clk-qcom-Add-support-for-Krait-clocks.patch
new file mode 100644
index 0000000..5fcc787
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/140-clk-qcom-Add-support-for-Krait-clocks.patch
@@ -0,0 +1,271 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,09/13] clk: qcom: Add support for Krait clocks
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063251
+Message-Id: <1426920332-9340-10-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>
+Date: Fri, 20 Mar 2015 23:45:28 -0700
+
+The Krait clocks are made up of a series of muxes and a divider
+that choose between a fixed rate clock and dedicated HFPLLs for
+each CPU. Instead of using mmio accesses to remux parents, the
+Krait implementation exposes the remux control via cp15
+registers. Support these clocks.
+
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+drivers/clk/qcom/Kconfig     |   4 ++
+ drivers/clk/qcom/Makefile    |   1 +
+ drivers/clk/qcom/clk-krait.c | 166 +++++++++++++++++++++++++++++++++++++++++++
+ drivers/clk/qcom/clk-krait.h |  49 +++++++++++++
+ 4 files changed, 220 insertions(+)
+ create mode 100644 drivers/clk/qcom/clk-krait.c
+ create mode 100644 drivers/clk/qcom/clk-krait.h
+
+--- a/drivers/clk/qcom/Kconfig
++++ b/drivers/clk/qcom/Kconfig
+@@ -105,3 +105,7 @@ config QCOM_HFPLL
+ 	  Support for the high-frequency PLLs present on Qualcomm devices.
+ 	  Say Y if you want to support CPU frequency scaling on devices
+ 	  such as MSM8974, APQ8084, etc.
++
++config KRAIT_CLOCKS
++	bool
++	select KRAIT_L2_ACCESSORS
+--- a/drivers/clk/qcom/Makefile
++++ b/drivers/clk/qcom/Makefile
+@@ -8,6 +8,7 @@ clk-qcom-y += clk-rcg2.o
+ clk-qcom-y += clk-branch.o
+ clk-qcom-y += clk-regmap-divider.o
+ clk-qcom-y += clk-regmap-mux.o
++clk-qcom-$(CONFIG_KRAIT_CLOCKS) += clk-krait.o
+ clk-qcom-y += clk-hfpll.o
+ clk-qcom-y += reset.o
+ 
+--- /dev/null
++++ b/drivers/clk/qcom/clk-krait.c
+@@ -0,0 +1,166 @@
++/*
++ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/io.h>
++#include <linux/delay.h>
++#include <linux/err.h>
++#include <linux/clk-provider.h>
++#include <linux/spinlock.h>
++
++#include <asm/krait-l2-accessors.h>
++
++#include "clk-krait.h"
++
++/* Secondary and primary muxes share the same cp15 register */
++static DEFINE_SPINLOCK(krait_clock_reg_lock);
++
++#define LPL_SHIFT	8
++static void __krait_mux_set_sel(struct krait_mux_clk *mux, int sel)
++{
++	unsigned long flags;
++	u32 regval;
++
++	spin_lock_irqsave(&krait_clock_reg_lock, flags);
++	regval = krait_get_l2_indirect_reg(mux->offset);
++	regval &= ~(mux->mask << mux->shift);
++	regval |= (sel & mux->mask) << mux->shift;
++	if (mux->lpl) {
++		regval &= ~(mux->mask << (mux->shift + LPL_SHIFT));
++		regval |= (sel & mux->mask) << (mux->shift + LPL_SHIFT);
++	}
++	krait_set_l2_indirect_reg(mux->offset, regval);
++	spin_unlock_irqrestore(&krait_clock_reg_lock, flags);
++
++	/* Wait for switch to complete. */
++	mb();
++	udelay(1);
++}
++
++static int krait_mux_set_parent(struct clk_hw *hw, u8 index)
++{
++	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
++	u32 sel;
++
++	sel = clk_mux_reindex(index, mux->parent_map, 0);
++	mux->en_mask = sel;
++	/* Don't touch mux if CPU is off as it won't work */
++	if (__clk_is_enabled(hw->clk))
++		__krait_mux_set_sel(mux, sel);
++	return 0;
++}
++
++static u8 krait_mux_get_parent(struct clk_hw *hw)
++{
++	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
++	u32 sel;
++
++	sel = krait_get_l2_indirect_reg(mux->offset);
++	sel >>= mux->shift;
++	sel &= mux->mask;
++	mux->en_mask = sel;
++
++	return clk_mux_get_parent(hw, sel, mux->parent_map, 0);
++}
++
++static struct clk_hw *krait_mux_get_safe_parent(struct clk_hw *hw)
++{
++	int i;
++	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
++	int num_parents = __clk_get_num_parents(hw->clk);
++
++	i = mux->safe_sel;
++	for (i = 0; i < num_parents; i++)
++		if (mux->safe_sel == mux->parent_map[i])
++			break;
++
++	return __clk_get_hw(clk_get_parent_by_index(hw->clk, i));
++}
++
++static int krait_mux_enable(struct clk_hw *hw)
++{
++	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
++
++	__krait_mux_set_sel(mux, mux->en_mask);
++
++	return 0;
++}
++
++static void krait_mux_disable(struct clk_hw *hw)
++{
++	struct krait_mux_clk *mux = to_krait_mux_clk(hw);
++
++	__krait_mux_set_sel(mux, mux->safe_sel);
++}
++
++const struct clk_ops krait_mux_clk_ops = {
++	.enable = krait_mux_enable,
++	.disable = krait_mux_disable,
++	.set_parent = krait_mux_set_parent,
++	.get_parent = krait_mux_get_parent,
++	.determine_rate = __clk_mux_determine_rate_closest,
++	.get_safe_parent = krait_mux_get_safe_parent,
++};
++EXPORT_SYMBOL_GPL(krait_mux_clk_ops);
++
++/* The divider can divide by 2, 4, 6 and 8. But we only really need div-2. */
++static long krait_div2_round_rate(struct clk_hw *hw, unsigned long rate,
++				  unsigned long *parent_rate)
++{
++	*parent_rate = __clk_round_rate(__clk_get_parent(hw->clk), rate * 2);
++	return DIV_ROUND_UP(*parent_rate, 2);
++}
++
++static int krait_div2_set_rate(struct clk_hw *hw, unsigned long rate,
++			unsigned long parent_rate)
++{
++	struct krait_div2_clk *d = to_krait_div2_clk(hw);
++	unsigned long flags;
++	u32 val;
++	u32 mask = BIT(d->width) - 1;
++
++	if (d->lpl)
++		mask = mask << (d->shift + LPL_SHIFT) | mask << d->shift;
++
++	spin_lock_irqsave(&krait_clock_reg_lock, flags);
++	val = krait_get_l2_indirect_reg(d->offset);
++	val &= ~mask;
++	krait_set_l2_indirect_reg(d->offset, val);
++	spin_unlock_irqrestore(&krait_clock_reg_lock, flags);
++
++	return 0;
++}
++
++static unsigned long
++krait_div2_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
++{
++	struct krait_div2_clk *d = to_krait_div2_clk(hw);
++	u32 mask = BIT(d->width) - 1;
++	u32 div;
++
++	div = krait_get_l2_indirect_reg(d->offset);
++	div >>= d->shift;
++	div &= mask;
++	div = (div + 1) * 2;
++
++	return DIV_ROUND_UP(parent_rate, div);
++}
++
++const struct clk_ops krait_div2_clk_ops = {
++	.round_rate = krait_div2_round_rate,
++	.set_rate = krait_div2_set_rate,
++	.recalc_rate = krait_div2_recalc_rate,
++};
++EXPORT_SYMBOL_GPL(krait_div2_clk_ops);
+--- /dev/null
++++ b/drivers/clk/qcom/clk-krait.h
+@@ -0,0 +1,49 @@
++/*
++ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#ifndef __QCOM_CLK_KRAIT_H
++#define __QCOM_CLK_KRAIT_H
++
++#include <linux/clk-provider.h>
++
++struct krait_mux_clk {
++	unsigned int	*parent_map;
++	bool		has_safe_parent;
++	u8		safe_sel;
++	u32		offset;
++	u32		mask;
++	u32		shift;
++	u32		en_mask;
++	bool		lpl;
++
++	struct clk_hw	hw;
++};
++
++#define to_krait_mux_clk(_hw) container_of(_hw, struct krait_mux_clk, hw)
++
++extern const struct clk_ops krait_mux_clk_ops;
++
++struct krait_div2_clk {
++	u32		offset;
++	u8		width;
++	u32		shift;
++	bool		lpl;
++
++	struct clk_hw	hw;
++};
++
++#define to_krait_div2_clk(_hw) container_of(_hw, struct krait_div2_clk, hw)
++
++extern const struct clk_ops krait_div2_clk_ops;
++
++#endif
diff --git a/target/linux/ipq806x/patches-4.1/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch b/target/linux/ipq806x/patches-4.1/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
new file mode 100644
index 0000000..db43888
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch
@@ -0,0 +1,205 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,10/13] clk: qcom: Add KPSS ACC/GCC driver
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063201
+Message-Id: <1426920332-9340-11-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>, <devicetree at vger.kernel.org>
+Date: Fri, 20 Mar 2015 23:45:29 -0700
+
+The ACC and GCC regions present in KPSSv1 contain registers to
+control clocks and power to each Krait CPU and L2. For CPUfreq
+purposes probe these devices and expose a mux clock that chooses
+between PXO and PLL8.
+
+Cc: <devicetree at vger.kernel.org>
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+.../devicetree/bindings/arm/msm/qcom,kpss-acc.txt  |  7 ++
+ .../devicetree/bindings/arm/msm/qcom,kpss-gcc.txt  | 28 +++++++
+ drivers/clk/qcom/Kconfig                           |  8 ++
+ drivers/clk/qcom/Makefile                          |  1 +
+ drivers/clk/qcom/kpss-xcc.c                        | 95 ++++++++++++++++++++++
+ 5 files changed, 139 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
+ create mode 100644 drivers/clk/qcom/kpss-xcc.c
+
+--- a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
++++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
+@@ -21,10 +21,17 @@ PROPERTIES
+ 		    the register region. An optional second element specifies
+ 		    the base address and size of the alias register region.
+ 
++- clock-output-names:
++	Usage: optional
++	Value type: <string>
++	Definition: Name of the output clock. Typically acpuX_aux where X is a
++		    CPU number starting at 0.
++
+ Example:
+ 
+ 	clock-controller at 2088000 {
+ 		compatible = "qcom,kpss-acc-v2";
+ 		reg = <0x02088000 0x1000>,
+ 		      <0x02008000 0x1000>;
++		clock-output-names = "acpu0_aux";
+ 	};
+--- /dev/null
++++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
+@@ -0,0 +1,28 @@
++Krait Processor Sub-system (KPSS) Global Clock Controller (GCC)
++
++PROPERTIES
++
++- compatible:
++	Usage: required
++	Value type: <string>
++	Definition: should be one of:
++			"qcom,kpss-gcc"
++
++- reg:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: base address and size of the register region
++
++- clock-output-names:
++	Usage: required
++	Value type: <string>
++	Definition: Name of the output clock. Typically acpu_l2_aux indicating
++		    an L2 cache auxiliary clock.
++
++Example:
++
++	l2cc: clock-controller at 2011000 {
++		compatible = "qcom,kpss-gcc";
++		reg = <0x2011000 0x1000>;
++		clock-output-names = "acpu_l2_aux";
++	};
+--- a/drivers/clk/qcom/Kconfig
++++ b/drivers/clk/qcom/Kconfig
+@@ -106,6 +106,14 @@ config QCOM_HFPLL
+ 	  Say Y if you want to support CPU frequency scaling on devices
+ 	  such as MSM8974, APQ8084, etc.
+ 
++config KPSS_XCC
++	tristate "KPSS Clock Controller"
++	depends on COMMON_CLK_QCOM
++	help
++	  Support for the Krait ACC and GCC clock controllers. Say Y
++	  if you want to support CPU frequency scaling on devices such
++	  as MSM8960, APQ8064, etc.
++
+ config KRAIT_CLOCKS
+ 	bool
+ 	select KRAIT_L2_ACCESSORS
+--- a/drivers/clk/qcom/Makefile
++++ b/drivers/clk/qcom/Makefile
+@@ -23,4 +23,5 @@ obj-$(CONFIG_MSM_LCC_8960) += lcc-msm896
+ obj-$(CONFIG_MSM_GCC_8974) += gcc-msm8974.o
+ obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
+ obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
++obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o
+ obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
+--- /dev/null
++++ b/drivers/clk/qcom/kpss-xcc.c
+@@ -0,0 +1,95 @@
++/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/err.h>
++#include <linux/io.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/clk.h>
++#include <linux/clk-provider.h>
++
++static const char *aux_parents[] = {
++	"pll8_vote",
++	"pxo",
++};
++
++static unsigned int aux_parent_map[] = {
++	3,
++	0,
++};
++
++static const struct of_device_id kpss_xcc_match_table[] = {
++	{ .compatible = "qcom,kpss-acc-v1", .data = (void *)1UL },
++	{ .compatible = "qcom,kpss-gcc" },
++	{}
++};
++MODULE_DEVICE_TABLE(of, kpss_xcc_match_table);
++
++static int kpss_xcc_driver_probe(struct platform_device *pdev)
++{
++	const struct of_device_id *id;
++	struct clk *clk;
++	struct resource *res;
++	void __iomem *base;
++	const char *name;
++
++	id = of_match_device(kpss_xcc_match_table, &pdev->dev);
++	if (!id)
++		return -ENODEV;
++
++	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	base = devm_ioremap_resource(&pdev->dev, res);
++	if (IS_ERR(base))
++		return PTR_ERR(base);
++
++	if (id->data) {
++		if (of_property_read_string_index(pdev->dev.of_node,
++					"clock-output-names", 0, &name))
++			return -ENODEV;
++		base += 0x14;
++	} else {
++		name = "acpu_l2_aux";
++		base += 0x28;
++	}
++
++	clk = clk_register_mux_table(&pdev->dev, name, aux_parents,
++				     ARRAY_SIZE(aux_parents), 0, base, 0, 0x3,
++				     0, aux_parent_map, NULL);
++
++	platform_set_drvdata(pdev, clk);
++
++	return PTR_ERR_OR_ZERO(clk);
++}
++
++static int kpss_xcc_driver_remove(struct platform_device *pdev)
++{
++	clk_unregister_mux(platform_get_drvdata(pdev));
++	return 0;
++}
++
++static struct platform_driver kpss_xcc_driver = {
++	.probe = kpss_xcc_driver_probe,
++	.remove = kpss_xcc_driver_remove,
++	.driver = {
++		.name = "kpss-xcc",
++		.of_match_table = kpss_xcc_match_table,
++	},
++};
++module_platform_driver(kpss_xcc_driver);
++
++MODULE_DESCRIPTION("Krait Processor Sub System (KPSS) Clock Driver");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:kpss-xcc");
diff --git a/target/linux/ipq806x/patches-4.1/142-clk-qcom-Add-Krait-clock-controller-driver.patch b/target/linux/ipq806x/patches-4.1/142-clk-qcom-Add-Krait-clock-controller-driver.patch
new file mode 100644
index 0000000..59fc44f
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/142-clk-qcom-Add-Krait-clock-controller-driver.patch
@@ -0,0 +1,435 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,11/13] clk: qcom: Add Krait clock controller driver
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063121
+Message-Id: <1426920332-9340-12-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>, <devicetree at vger.kernel.org>
+Date: Fri, 20 Mar 2015 23:45:30 -0700
+
+The Krait CPU clocks are made up of a primary mux and secondary
+mux for each CPU and the L2, controlled via cp15 accessors. For
+Kraits within KPSSv1 each secondary mux accepts a different aux
+source, but on KPSSv2 each secondary mux accepts the same aux
+source.
+
+Cc: <devicetree at vger.kernel.org>
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+.../devicetree/bindings/clock/qcom,krait-cc.txt    |  22 ++
+ drivers/clk/qcom/Kconfig                           |   8 +
+ drivers/clk/qcom/Makefile                          |   1 +
+ drivers/clk/qcom/krait-cc.c                        | 352 +++++++++++++++++++++
+ 4 files changed, 383 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
+ create mode 100644 drivers/clk/qcom/krait-cc.c
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
+@@ -0,0 +1,22 @@
++Krait Clock Controller
++
++PROPERTIES
++
++- compatible:
++	Usage: required
++	Value type: <string>
++	Definition: must be one of:
++			"qcom,krait-cc-v1"
++			"qcom,krait-cc-v2"
++
++- #clock-cells:
++	Usage: required
++	Value type: <u32>
++	Definition: must be 1
++
++Example:
++
++	kraitcc: clock-controller {
++		compatible = "qcom,krait-cc-v1";
++		#clock-cells = <1>;
++	};
+--- a/drivers/clk/qcom/Kconfig
++++ b/drivers/clk/qcom/Kconfig
+@@ -114,6 +114,14 @@ config KPSS_XCC
+ 	  if you want to support CPU frequency scaling on devices such
+ 	  as MSM8960, APQ8064, etc.
+ 
++config KRAITCC
++	tristate "Krait Clock Controller"
++	depends on COMMON_CLK_QCOM && ARM
++	select KRAIT_CLOCKS
++	help
++	  Support for the Krait CPU clocks on Qualcomm devices.
++	  Say Y if you want to support CPU frequency scaling.
++
+ config KRAIT_CLOCKS
+ 	bool
+ 	select KRAIT_L2_ACCESSORS
+--- a/drivers/clk/qcom/Makefile
++++ b/drivers/clk/qcom/Makefile
+@@ -25,3 +25,4 @@ obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8
+ obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
+ obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o
+ obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
++obj-$(CONFIG_KRAITCC) += krait-cc.o
+--- /dev/null
++++ b/drivers/clk/qcom/krait-cc.c
+@@ -0,0 +1,352 @@
++/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/err.h>
++#include <linux/io.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/clk.h>
++#include <linux/clk-provider.h>
++#include <linux/slab.h>
++
++#include "clk-krait.h"
++
++static unsigned int sec_mux_map[] = {
++	2,
++	0,
++};
++
++static unsigned int pri_mux_map[] = {
++	1,
++	2,
++	0,
++};
++
++static int
++krait_add_div(struct device *dev, int id, const char *s, unsigned offset)
++{
++	struct krait_div2_clk *div;
++	struct clk_init_data init = {
++		.num_parents = 1,
++		.ops = &krait_div2_clk_ops,
++		.flags = CLK_SET_RATE_PARENT,
++	};
++	const char *p_names[1];
++	struct clk *clk;
++
++	div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL);
++	if (!div)
++		return -ENOMEM;
++
++	div->width = 2;
++	div->shift = 6;
++	div->lpl = id >= 0;
++	div->offset = offset;
++	div->hw.init = &init;
++
++	init.name = kasprintf(GFP_KERNEL, "hfpll%s_div", s);
++	if (!init.name)
++		return -ENOMEM;
++
++	init.parent_names = p_names;
++	p_names[0] = kasprintf(GFP_KERNEL, "hfpll%s", s);
++	if (!p_names[0]) {
++		kfree(init.name);
++		return -ENOMEM;
++	}
++
++	clk = devm_clk_register(dev, &div->hw);
++	kfree(p_names[0]);
++	kfree(init.name);
++
++	return PTR_ERR_OR_ZERO(clk);
++}
++
++static int
++krait_add_sec_mux(struct device *dev, int id, const char *s, unsigned offset,
++		  bool unique_aux)
++{
++	struct krait_mux_clk *mux;
++	static const char *sec_mux_list[] = {
++		"acpu_aux",
++		"qsb",
++	};
++	struct clk_init_data init = {
++		.parent_names = sec_mux_list,
++		.num_parents = ARRAY_SIZE(sec_mux_list),
++		.ops = &krait_mux_clk_ops,
++		.flags = CLK_SET_RATE_PARENT,
++	};
++	struct clk *clk;
++
++	mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL);
++	if (!mux)
++		return -ENOMEM;
++
++	mux->offset = offset;
++	mux->lpl = id >= 0;
++	mux->has_safe_parent = true;
++	mux->safe_sel = 2;
++	mux->mask = 0x3;
++	mux->shift = 2;
++	mux->parent_map = sec_mux_map;
++	mux->hw.init = &init;
++
++	init.name = kasprintf(GFP_KERNEL, "krait%s_sec_mux", s);
++	if (!init.name)
++		return -ENOMEM;
++
++	if (unique_aux) {
++		sec_mux_list[0] = kasprintf(GFP_KERNEL, "acpu%s_aux", s);
++		if (!sec_mux_list[0]) {
++			clk = ERR_PTR(-ENOMEM);
++			goto err_aux;
++		}
++	}
++
++	clk = devm_clk_register(dev, &mux->hw);
++
++	if (unique_aux)
++		kfree(sec_mux_list[0]);
++err_aux:
++	kfree(init.name);
++	return PTR_ERR_OR_ZERO(clk);
++}
++
++static struct clk *
++krait_add_pri_mux(struct device *dev, int id, const char *s, unsigned offset)
++{
++	struct krait_mux_clk *mux;
++	const char *p_names[3];
++	struct clk_init_data init = {
++		.parent_names = p_names,
++		.num_parents = ARRAY_SIZE(p_names),
++		.ops = &krait_mux_clk_ops,
++		.flags = CLK_SET_RATE_PARENT,
++	};
++	struct clk *clk;
++
++	mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL);
++	if (!mux)
++		return ERR_PTR(-ENOMEM);
++
++	mux->has_safe_parent = true;
++	mux->safe_sel = 0;
++	mux->mask = 0x3;
++	mux->shift = 0;
++	mux->offset = offset;
++	mux->lpl = id >= 0;
++	mux->parent_map = pri_mux_map;
++	mux->hw.init = &init;
++
++	init.name = kasprintf(GFP_KERNEL, "krait%s_pri_mux", s);
++	if (!init.name)
++		return ERR_PTR(-ENOMEM);
++
++	p_names[0] = kasprintf(GFP_KERNEL, "hfpll%s", s);
++	if (!p_names[0]) {
++		clk = ERR_PTR(-ENOMEM);
++		goto err_p0;
++	}
++
++	p_names[1] = kasprintf(GFP_KERNEL, "hfpll%s_div", s);
++	if (!p_names[1]) {
++		clk = ERR_PTR(-ENOMEM);
++		goto err_p1;
++	}
++
++	p_names[2] = kasprintf(GFP_KERNEL, "krait%s_sec_mux", s);
++	if (!p_names[2]) {
++		clk = ERR_PTR(-ENOMEM);
++		goto err_p2;
++	}
++
++	clk = devm_clk_register(dev, &mux->hw);
++
++	kfree(p_names[2]);
++err_p2:
++	kfree(p_names[1]);
++err_p1:
++	kfree(p_names[0]);
++err_p0:
++	kfree(init.name);
++	return clk;
++}
++
++/* id < 0 for L2, otherwise id == physical CPU number */
++static struct clk *krait_add_clks(struct device *dev, int id, bool unique_aux)
++{
++	int ret;
++	unsigned offset;
++	void *p = NULL;
++	const char *s;
++	struct clk *clk;
++
++	if (id >= 0) {
++		offset = 0x4501 + (0x1000 * id);
++		s = p = kasprintf(GFP_KERNEL, "%d", id);
++		if (!s)
++			return ERR_PTR(-ENOMEM);
++	} else {
++		offset = 0x500;
++		s = "_l2";
++	}
++
++	ret = krait_add_div(dev, id, s, offset);
++	if (ret) {
++		clk = ERR_PTR(ret);
++		goto err;
++	}
++
++	ret = krait_add_sec_mux(dev, id, s, offset, unique_aux);
++	if (ret) {
++		clk = ERR_PTR(ret);
++		goto err;
++	}
++
++	clk = krait_add_pri_mux(dev, id, s, offset);
++err:
++	kfree(p);
++	return clk;
++}
++
++static struct clk *krait_of_get(struct of_phandle_args *clkspec, void *data)
++{
++	unsigned int idx = clkspec->args[0];
++	struct clk **clks = data;
++
++	if (idx >= 5) {
++		pr_err("%s: invalid clock index %d\n", __func__, idx);
++		return ERR_PTR(-EINVAL);
++	}
++
++	return clks[idx] ? : ERR_PTR(-ENODEV);
++}
++
++static const struct of_device_id krait_cc_match_table[] = {
++	{ .compatible = "qcom,krait-cc-v1", (void *)1UL },
++	{ .compatible = "qcom,krait-cc-v2" },
++	{}
++};
++MODULE_DEVICE_TABLE(of, krait_cc_match_table);
++
++static int krait_cc_probe(struct platform_device *pdev)
++{
++	struct device *dev = &pdev->dev;
++	const struct of_device_id *id;
++	unsigned long cur_rate, aux_rate;
++	int cpu;
++	struct clk *clk;
++	struct clk **clks;
++	struct clk *l2_pri_mux_clk;
++
++	id = of_match_device(krait_cc_match_table, dev);
++	if (!id)
++		return -ENODEV;
++
++	/* Rate is 1 because 0 causes problems for __clk_mux_determine_rate */
++	clk = clk_register_fixed_rate(dev, "qsb", NULL, CLK_IS_ROOT, 1);
++	if (IS_ERR(clk))
++		return PTR_ERR(clk);
++
++	if (!id->data) {
++		clk = clk_register_fixed_factor(dev, "acpu_aux",
++						"gpll0_vote", 0, 1, 2);
++		if (IS_ERR(clk))
++			return PTR_ERR(clk);
++	}
++
++	/* Krait configurations have at most 4 CPUs and one L2 */
++	clks = devm_kcalloc(dev, 5, sizeof(*clks), GFP_KERNEL);
++	if (!clks)
++		return -ENOMEM;
++
++	for_each_possible_cpu(cpu) {
++		clk = krait_add_clks(dev, cpu, id->data);
++		if (IS_ERR(clk))
++			return PTR_ERR(clk);
++		clks[cpu] = clk;
++	}
++
++	l2_pri_mux_clk = krait_add_clks(dev, -1, id->data);
++	if (IS_ERR(l2_pri_mux_clk))
++		return PTR_ERR(l2_pri_mux_clk);
++	clks[4] = l2_pri_mux_clk;
++
++	/*
++	 * We don't want the CPU or L2 clocks to be turned off at late init
++	 * if CPUFREQ or HOTPLUG configs are disabled. So, bump up the
++	 * refcount of these clocks. Any cpufreq/hotplug manager can assume
++	 * that the clocks have already been prepared and enabled by the time
++	 * they take over.
++	 */
++	for_each_online_cpu(cpu) {
++		clk_prepare_enable(l2_pri_mux_clk);
++		WARN(clk_prepare_enable(clks[cpu]),
++			"Unable to turn on CPU%d clock", cpu);
++	}
++
++	/*
++	 * Force reinit of HFPLLs and muxes to overwrite any potential
++	 * incorrect configuration of HFPLLs and muxes by the bootloader.
++	 * While at it, also make sure the cores are running at known rates
++	 * and print the current rate.
++	 *
++	 * The clocks are set to aux clock rate first to make sure the
++	 * secondary mux is not sourcing off of QSB. The rate is then set to
++	 * two different rates to force a HFPLL reinit under all
++	 * circumstances.
++	 */
++	cur_rate = clk_get_rate(l2_pri_mux_clk);
++	aux_rate = 384000000;
++	if (cur_rate == 1) {
++		pr_info("L2 @ QSB rate. Forcing new rate.\n");
++		cur_rate = aux_rate;
++	}
++	clk_set_rate(l2_pri_mux_clk, aux_rate);
++	clk_set_rate(l2_pri_mux_clk, 2);
++	clk_set_rate(l2_pri_mux_clk, cur_rate);
++	pr_info("L2 @ %lu KHz\n", clk_get_rate(l2_pri_mux_clk) / 1000);
++	for_each_possible_cpu(cpu) {
++		clk = clks[cpu];
++		cur_rate = clk_get_rate(clk);
++		if (cur_rate == 1) {
++			pr_info("CPU%d @ QSB rate. Forcing new rate.\n", cpu);
++			cur_rate = aux_rate;
++		}
++		clk_set_rate(clk, aux_rate);
++		clk_set_rate(clk, 2);
++		clk_set_rate(clk, cur_rate);
++		pr_info("CPU%d @ %lu KHz\n", cpu, clk_get_rate(clk) / 1000);
++	}
++
++	of_clk_add_provider(dev->of_node, krait_of_get, clks);
++
++	return 0;
++}
++
++static struct platform_driver krait_cc_driver = {
++	.probe = krait_cc_probe,
++	.driver = {
++		.name = "krait-cc",
++		.of_match_table = krait_cc_match_table,
++	},
++};
++module_platform_driver(krait_cc_driver);
++
++MODULE_DESCRIPTION("Krait CPU Clock Driver");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:krait-cc");
diff --git a/target/linux/ipq806x/patches-4.1/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch b/target/linux/ipq806x/patches-4.1/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
new file mode 100644
index 0000000..fd37c05
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/143-cpufreq-Add-module-to-register-cpufreq-on-Krait-CPUs.patch
@@ -0,0 +1,304 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,12/13] cpufreq: Add module to register cpufreq on Krait CPUs
+From: Stephen Boyd <sboyd at codeaurora.org>
+X-Patchwork-Id: 6063191
+Message-Id: <1426920332-9340-13-git-send-email-sboyd at codeaurora.org>
+To: Mike Turquette <mturquette at linaro.org>, Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-kernel at vger.kernel.org, linux-arm-msm at vger.kernel.org,
+	linux-pm at vger.kernel.org, linux-arm-kernel at lists.infradead.org,
+	Viresh Kumar <viresh.kumar at linaro.org>, <devicetree at vger.kernel.org>
+Date: Fri, 20 Mar 2015 23:45:31 -0700
+
+Register a cpufreq-generic device whenever we detect that a
+"qcom,krait" compatible CPU is present in DT.
+
+Cc: <devicetree at vger.kernel.org>
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+.../devicetree/bindings/arm/msm/qcom,pvs.txt       |  38 ++++
+ drivers/cpufreq/Kconfig.arm                        |   9 +
+ drivers/cpufreq/Makefile                           |   1 +
+ drivers/cpufreq/qcom-cpufreq.c                     | 204 +++++++++++++++++++++
+ 4 files changed, 252 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,pvs.txt
+ create mode 100644 drivers/cpufreq/qcom-cpufreq.c
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/arm/msm/qcom,pvs.txt
+@@ -0,0 +1,38 @@
++Qualcomm Process Voltage Scaling Tables
++
++The node name is required to be "qcom,pvs". There shall only be one
++such node present in the root of the tree.
++
++PROPERTIES
++
++- qcom,pvs-format-a or qcom,pvs-format-b:
++	Usage: required
++	Value type: <empty>
++	Definition: Indicates the format of qcom,speedX-pvsY-bin-vZ properties.
++		    If qcom,pvs-format-a is used the table is two columns
++		    (frequency and voltage in that order). If qcom,pvs-format-b 		    is used the table is three columns (frequency, voltage,
++		    and current in that order).
++
++- qcom,speedX-pvsY-bin-vZ:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: The PVS table corresponding to the speed bin X, pvs bin Y,
++		    and version Z.
++Example:
++
++	qcom,pvs {
++		qcom,pvs-format-a;
++		qcom,speed0-pvs0-bin-v0 =
++			<  384000000  950000 >,
++			<  486000000  975000 >,
++			<  594000000 1000000 >,
++			<  702000000 1025000 >,
++			<  810000000 1075000 >,
++			<  918000000 1100000 >,
++			< 1026000000 1125000 >,
++			< 1134000000 1175000 >,
++			< 1242000000 1200000 >,
++			< 1350000000 1225000 >,
++			< 1458000000 1237500 >,
++			< 1512000000 1250000 >;
++	};
+--- a/drivers/cpufreq/Kconfig.arm
++++ b/drivers/cpufreq/Kconfig.arm
+@@ -146,6 +146,15 @@ config ARM_OMAP2PLUS_CPUFREQ
+ 	depends on ARCH_OMAP2PLUS
+ 	default ARCH_OMAP2PLUS
+ 
++config ARM_QCOM_CPUFREQ
++	tristate "Qualcomm based"
++	depends on ARCH_QCOM
++	select PM_OPP
++	help
++	  This adds the CPUFreq driver for Qualcomm SoC based boards.
++
++	  If in doubt, say N.
++
+ config ARM_S3C_CPUFREQ
+ 	bool
+ 	help
+--- a/drivers/cpufreq/Makefile
++++ b/drivers/cpufreq/Makefile
+@@ -66,6 +66,7 @@ obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ)	+= ki
+ obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ)	+= omap-cpufreq.o
+ obj-$(CONFIG_ARM_PXA2xx_CPUFREQ)	+= pxa2xx-cpufreq.o
+ obj-$(CONFIG_PXA3xx)			+= pxa3xx-cpufreq.o
++obj-$(CONFIG_ARM_QCOM_CPUFREQ)		+= qcom-cpufreq.o
+ obj-$(CONFIG_ARM_S3C24XX_CPUFREQ)	+= s3c24xx-cpufreq.o
+ obj-$(CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS) += s3c24xx-cpufreq-debugfs.o
+ obj-$(CONFIG_ARM_S3C2410_CPUFREQ)	+= s3c2410-cpufreq.o
+--- /dev/null
++++ b/drivers/cpufreq/qcom-cpufreq.c
+@@ -0,0 +1,204 @@
++/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/cpu.h>
++#include <linux/err.h>
++#include <linux/init.h>
++#include <linux/io.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/platform_device.h>
++#include <linux/pm_opp.h>
++#include <linux/slab.h>
++#include <linux/cpufreq-dt.h>
++
++static void __init get_krait_bin_format_a(int *speed, int *pvs, int *pvs_ver)
++{
++	void __iomem *base;
++	u32 pte_efuse;
++
++	*speed = *pvs = *pvs_ver = 0;
++
++	base = ioremap(0x007000c0, 4);
++	if (!base) {
++		pr_warn("Unable to read efuse data. Defaulting to 0!\n");
++		return;
++	}
++
++	pte_efuse = readl_relaxed(base);
++	iounmap(base);
++
++	*speed = pte_efuse & 0xf;
++	if (*speed == 0xf)
++		*speed = (pte_efuse >> 4) & 0xf;
++
++	if (*speed == 0xf) {
++		*speed = 0;
++		pr_warn("Speed bin: Defaulting to %d\n", *speed);
++	} else {
++		pr_info("Speed bin: %d\n", *speed);
++	}
++
++	*pvs = (pte_efuse >> 10) & 0x7;
++	if (*pvs == 0x7)
++		*pvs = (pte_efuse >> 13) & 0x7;
++
++	if (*pvs == 0x7) {
++		*pvs = 0;
++		pr_warn("PVS bin: Defaulting to %d\n", *pvs);
++	} else {
++		pr_info("PVS bin: %d\n", *pvs);
++	}
++}
++
++static void __init get_krait_bin_format_b(int *speed, int *pvs, int *pvs_ver)
++{
++	u32 pte_efuse, redundant_sel;
++	void __iomem *base;
++
++	*speed = 0;
++	*pvs = 0;
++	*pvs_ver = 0;
++
++	base = ioremap(0xfc4b80b0, 8);
++	if (!base) {
++		pr_warn("Unable to read efuse data. Defaulting to 0!\n");
++		return;
++	}
++
++	pte_efuse = readl_relaxed(base);
++	redundant_sel = (pte_efuse >> 24) & 0x7;
++	*speed = pte_efuse & 0x7;
++	/* 4 bits of PVS are in efuse register bits 31, 8-6. */
++	*pvs = ((pte_efuse >> 28) & 0x8) | ((pte_efuse >> 6) & 0x7);
++	*pvs_ver = (pte_efuse >> 4) & 0x3;
++
++	switch (redundant_sel) {
++	case 1:
++		*speed = (pte_efuse >> 27) & 0xf;
++		break;
++	case 2:
++		*pvs = (pte_efuse >> 27) & 0xf;
++		break;
++	}
++
++	/* Check SPEED_BIN_BLOW_STATUS */
++	if (pte_efuse & BIT(3)) {
++		pr_info("Speed bin: %d\n", *speed);
++	} else {
++		pr_warn("Speed bin not set. Defaulting to 0!\n");
++		*speed = 0;
++	}
++
++	/* Check PVS_BLOW_STATUS */
++	pte_efuse = readl_relaxed(base + 0x4) & BIT(21);
++	if (pte_efuse) {
++		pr_info("PVS bin: %d\n", *pvs);
++	} else {
++		pr_warn("PVS bin not set. Defaulting to 0!\n");
++		*pvs = 0;
++	}
++
++	pr_info("PVS version: %d\n", *pvs_ver);
++	iounmap(base);
++}
++
++static int __init qcom_cpufreq_populate_opps(void)
++{
++	int len, rows, cols, i, k, speed, pvs, pvs_ver;
++	char table_name[] = "qcom,speedXX-pvsXX-bin-vXX";
++	struct device_node *np;
++	struct device *dev;
++	int cpu = 0;
++
++	np = of_find_node_by_name(NULL, "qcom,pvs");
++	if (!np)
++		return -ENODEV;
++
++	if (of_property_read_bool(np, "qcom,pvs-format-a")) {
++		get_krait_bin_format_a(&speed, &pvs, &pvs_ver);
++		cols = 2;
++	} else if (of_property_read_bool(np, "qcom,pvs-format-b")) {
++		get_krait_bin_format_b(&speed, &pvs, &pvs_ver);
++		cols = 3;
++	} else {
++		return -ENODEV;
++	}
++
++	snprintf(table_name, sizeof(table_name),
++			"qcom,speed%d-pvs%d-bin-v%d", speed, pvs, pvs_ver);
++
++	if (!of_find_property(np, table_name, &len))
++		return -EINVAL;
++
++	len /= sizeof(u32);
++	if (len % cols || len == 0)
++		return -EINVAL;
++
++	rows = len / cols;
++
++	for (i = 0, k = 0; i < rows; i++) {
++		u32 freq, volt;
++
++		of_property_read_u32_index(np, table_name, k++, &freq);
++		of_property_read_u32_index(np, table_name, k++, &volt);
++		while (k % cols)
++			k++; /* Skip uA entries if present */
++		for (cpu = 0; cpu < num_possible_cpus(); cpu++) {
++			dev = get_cpu_device(cpu);
++			if (!dev)
++				return -ENODEV;
++			if (dev_pm_opp_add(dev, freq, volt))
++				pr_warn("failed to add OPP %u\n", freq);
++		}
++	}
++
++	return 0;
++}
++
++static int __init qcom_cpufreq_driver_init(void)
++{
++	struct cpufreq_dt_platform_data pdata = { .independent_clocks = true };
++	struct platform_device_info devinfo = {
++		.name = "cpufreq-dt",
++		.data = &pdata,
++		.size_data = sizeof(pdata),
++	};
++	struct device *cpu_dev;
++	struct device_node *np;
++	int ret;
++
++	cpu_dev = get_cpu_device(0);
++	if (!cpu_dev)
++		return -ENODEV;
++
++	np = of_node_get(cpu_dev->of_node);
++	if (!np)
++		return -ENOENT;
++
++	if (!of_device_is_compatible(np, "qcom,krait")) {
++		of_node_put(np);
++		return -ENODEV;
++	}
++	of_node_put(np);
++
++	ret = qcom_cpufreq_populate_opps();
++	if (ret)
++		return ret;
++
++	return PTR_ERR_OR_ZERO(platform_device_register_full(&devinfo));
++}
++module_init(qcom_cpufreq_driver_init);
++
++MODULE_DESCRIPTION("Qualcomm CPUfreq driver");
++MODULE_LICENSE("GPL v2");
diff --git a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
new file mode 100644
index 0000000..46feec3
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
@@ -0,0 +1,100 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -25,6 +25,11 @@
+ 			next-level-cache = <&L2>;
+ 			qcom,acc = <&acc0>;
+ 			qcom,saw = <&saw0>;
++			clocks = <&kraitcc 0>;
++			clock-names = "cpu";
++			clock-latency = <100000>;
++			core-supply = <&smb208_s2a>;
++			voltage-tolerance = <5>;
+ 		};
+ 
+ 		cpu at 1 {
+@@ -35,11 +40,24 @@
+ 			next-level-cache = <&L2>;
+ 			qcom,acc = <&acc1>;
+ 			qcom,saw = <&saw1>;
++			clocks = <&kraitcc 1>;
++			clock-names = "cpu";
++			clock-latency = <100000>;
++			core-supply = <&smb208_s2b>;
+ 		};
+ 
+ 		L2: l2-cache {
+ 			compatible = "cache";
+ 			cache-level = <2>;
++			clocks = <&kraitcc 4>;
++			clock-names = "cache";
++			cache-points-kHz = <
++				/* kHz    uV    CPU kHz */
++				1200000 1150000 1200000
++				1000000 1100000  600000
++				 384000 1100000  384000
++			>;
++			vdd_dig-supply = <&smb208_s1a>;
+ 		};
+ 	};
+ 
+@@ -195,6 +213,46 @@
+ 		};
+ 	};
+ 
++	kraitcc: clock-controller {
++		compatible = "qcom,krait-cc-v1";
++		#clock-cells = <1>;
++	};
++
++	qcom,pvs {
++		qcom,pvs-format-a;
++		qcom,speed0-pvs0-bin-v0 =
++			< 1400000000 1250000 >,
++			< 1200000000 1200000 >,
++			< 1000000000 1150000 >,
++			 < 800000000 1100000 >,
++			 < 600000000 1050000 >,
++			 < 384000000 1000000 >;
++
++		qcom,speed0-pvs1-bin-v0 =
++			< 1400000000 1175000 >,
++			< 1200000000 1125000 >,
++			< 1000000000 1075000 >,
++			 < 800000000 1025000 >,
++			 < 600000000  975000 >,
++			 < 384000000  925000 >;
++
++		qcom,speed0-pvs2-bin-v0 =
++			< 1400000000 1125000 >,
++			< 1200000000 1075000 >,
++			< 1000000000 1025000 >,
++			 < 800000000  995000 >,
++			 < 600000000  925000 >,
++			 < 384000000  875000 >;
++
++		qcom,speed0-pvs3-bin-v0 =
++			< 1400000000 1050000 >,
++			< 1200000000 1000000 >,
++			< 1000000000  950000 >,
++			 < 800000000  900000 >,
++			 < 600000000  850000 >,
++			 < 384000000  800000 >;
++	};
++
+ 	soc: soc {
+ 		#address-cells = <1>;
+ 		#size-cells = <1>;
+@@ -310,11 +368,13 @@
+ 		acc0: clock-controller at 2088000 {
+ 			compatible = "qcom,kpss-acc-v1";
+ 			reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
++			clock-output-names = "acpu0_aux";
+ 		};
+ 
+ 		acc1: clock-controller at 2098000 {
+ 			compatible = "qcom,kpss-acc-v1";
+ 			reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
++			clock-output-names = "acpu1_aux";
+ 		};
+ 
+ 		l2cc: clock-controller at 2011000 {
diff --git a/target/linux/ipq806x/patches-4.1/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch b/target/linux/ipq806x/patches-4.1/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
new file mode 100644
index 0000000..521adc5
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/145-cpufreq-Add-a-cpufreq-krait-based-on-cpufre.patch
@@ -0,0 +1,461 @@
+From dd77db4143290689d3a5e1ec61627233d0711b66 Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd at codeaurora.org>
+Date: Fri, 30 May 2014 16:36:11 -0700
+Subject: [PATCH] FROMLIST: cpufreq: Add a cpufreq-krait based on cpufreq-cpu0
+
+Krait processors have individual clocks for each CPU that can
+scale independently from one another. cpufreq-cpu0 is fairly
+close to this, but assumes that there is only one clock for all
+CPUs. Add a driver to support the Krait configuration.
+
+TODO: Merge into cpufreq-cpu0? Or make generic?
+
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+
+---
+ drivers/cpufreq/Kconfig         |  13 +++
+ drivers/cpufreq/Makefile        |   1 +
+ drivers/cpufreq/cpufreq-krait.c | 190 ++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 204 insertions(+)
+ create mode 100644 drivers/cpufreq/cpufreq-krait.c
+
+--- a/drivers/cpufreq/Kconfig
++++ b/drivers/cpufreq/Kconfig
+@@ -198,6 +198,19 @@ config CPUFREQ_DT
+ 
+ 	  If in doubt, say N.
+ 
++config GENERIC_CPUFREQ_KRAIT
++	tristate "Krait cpufreq driver"
++	depends on HAVE_CLK && OF
++	# if CPU_THERMAL is on and THERMAL=m, CPU0 cannot be =y:
++	depends on !CPU_THERMAL || THERMAL
++	select PM_OPP
++	help
++	  This adds a generic cpufreq driver for CPU0 frequency management.
++	  It supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
++	  systems which share clock and voltage across all CPUs.
++
++	  If in doubt, say N.
++
+ if X86
+ source "drivers/cpufreq/Kconfig.x86"
+ endif
+--- a/drivers/cpufreq/Makefile
++++ b/drivers/cpufreq/Makefile
+@@ -14,6 +14,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE)
+ obj-$(CONFIG_CPU_FREQ_GOV_COMMON)		+= cpufreq_governor.o
+ 
+ obj-$(CONFIG_CPUFREQ_DT)		+= cpufreq-dt.o
++obj-$(CONFIG_GENERIC_CPUFREQ_KRAIT)	+= cpufreq-krait.o
+ 
+ ##################################################################################
+ # x86 drivers.
+--- /dev/null
++++ b/drivers/cpufreq/cpufreq-krait.c
+@@ -0,0 +1,390 @@
++/*
++ * Copyright (C) 2012 Freescale Semiconductor, Inc.
++ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
++ *
++ * The OPP code in function krait_set_target() is reused from
++ * drivers/cpufreq/omap-cpufreq.c
++ *
++ * 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.
++ */
++
++#include <linux/clk.h>
++#include <linux/cpu.h>
++#include <linux/cpu_cooling.h>
++#include <linux/cpufreq.h>
++#include <linux/cpumask.h>
++#include <linux/err.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/pm_opp.h>
++#include <linux/platform_device.h>
++#include <linux/regulator/consumer.h>
++#include <linux/slab.h>
++#include <linux/thermal.h>
++
++static unsigned int transition_latency;
++static unsigned int voltage_tolerance; /* in percentage */
++
++static struct device *cpu_dev;
++static DEFINE_PER_CPU(struct clk *, krait_cpu_clks);
++static DEFINE_PER_CPU(struct regulator *, krait_supply_core);
++static struct cpufreq_frequency_table *freq_table;
++static struct thermal_cooling_device *cdev;
++
++struct cache_points {
++	unsigned long cache_freq;
++	unsigned int cache_volt;
++	unsigned long cpu_freq;
++};
++
++static struct regulator *krait_l2_reg;
++static struct clk *krait_l2_clk;
++static struct cache_points *krait_l2_points;
++static int nr_krait_l2_points;
++
++static int krait_parse_cache_points(struct device *dev,
++		struct device_node *of_node)
++{
++	const struct property *prop;
++	const __be32 *val;
++	int nr, i;
++
++	prop = of_find_property(of_node, "cache-points-kHz", NULL);
++	if (!prop)
++		return -ENODEV;
++	if (!prop->value)
++		return -ENODATA;
++
++	/*
++	 * Each OPP is a set of tuples consisting of frequency and
++	 * cpu-frequency like <freq-kHz volt-uV freq-kHz>.
++	 */
++	nr = prop->length / sizeof(u32);
++	if (nr % 3) {
++		dev_err(dev, "%s: Invalid cache points\n", __func__);
++		return -EINVAL;
++	}
++	nr /= 3;
++
++	krait_l2_points = devm_kcalloc(dev, nr, sizeof(*krait_l2_points),
++				       GFP_KERNEL);
++	if (!krait_l2_points)
++		return -ENOMEM;
++	nr_krait_l2_points = nr;
++
++	for (i = 0, val = prop->value; i < nr; i++) {
++		unsigned long cache_freq = be32_to_cpup(val++) * 1000;
++		unsigned int cache_volt = be32_to_cpup(val++);
++		unsigned long cpu_freq = be32_to_cpup(val++) * 1000;
++
++		krait_l2_points[i].cache_freq = cache_freq;
++		krait_l2_points[i].cache_volt = cache_volt;
++		krait_l2_points[i].cpu_freq = cpu_freq;
++	}
++
++	return 0;
++}
++
++static int krait_set_target(struct cpufreq_policy *policy, unsigned int index)
++{
++	struct dev_pm_opp *opp;
++	unsigned long volt = 0, volt_old = 0, tol = 0;
++	unsigned long freq, max_cpu_freq = 0;
++	unsigned int old_freq, new_freq;
++	long freq_Hz, freq_exact;
++	int ret, i;
++	struct clk *cpu_clk;
++	struct regulator *core;
++	unsigned int cpu;
++
++	cpu_clk = per_cpu(krait_cpu_clks, policy->cpu);
++
++	freq_Hz = clk_round_rate(cpu_clk, freq_table[index].frequency * 1000);
++	if (freq_Hz <= 0)
++		freq_Hz = freq_table[index].frequency * 1000;
++
++	freq_exact = freq_Hz;
++	new_freq = freq_Hz / 1000;
++	old_freq = clk_get_rate(cpu_clk) / 1000;
++
++	core = per_cpu(krait_supply_core, policy->cpu);
++
++	rcu_read_lock();
++	opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz);
++	if (IS_ERR(opp)) {
++		rcu_read_unlock();
++		pr_err("failed to find OPP for %ld\n", freq_Hz);
++		return PTR_ERR(opp);
++	}
++	volt = dev_pm_opp_get_voltage(opp);
++	rcu_read_unlock();
++	tol = volt * voltage_tolerance / 100;
++	volt_old = regulator_get_voltage(core);
++
++	pr_debug("%u MHz, %ld mV --> %u MHz, %ld mV\n",
++		 old_freq / 1000, volt_old ? volt_old / 1000 : -1,
++		 new_freq / 1000, volt ? volt / 1000 : -1);
++
++	/* scaling up?  scale voltage before frequency */
++	if (new_freq > old_freq) {
++		ret = regulator_set_voltage_tol(core, volt, tol);
++		if (ret) {
++			pr_err("failed to scale voltage up: %d\n", ret);
++			return ret;
++		}
++	}
++
++	ret = clk_set_rate(cpu_clk, freq_exact);
++	if (ret) {
++		pr_err("failed to set clock rate: %d\n", ret);
++		return ret;
++	}
++
++	/* scaling down?  scale voltage after frequency */
++	if (new_freq < old_freq) {
++		ret = regulator_set_voltage_tol(core, volt, tol);
++		if (ret) {
++			pr_err("failed to scale voltage down: %d\n", ret);
++			clk_set_rate(cpu_clk, old_freq * 1000);
++		}
++	}
++
++	for_each_possible_cpu(cpu) {
++		freq = clk_get_rate(per_cpu(krait_cpu_clks, cpu));
++		max_cpu_freq = max(max_cpu_freq, freq);
++	}
++
++	for (i = 0; i < nr_krait_l2_points; i++) {
++		if (max_cpu_freq >= krait_l2_points[i].cpu_freq) {
++			if (krait_l2_reg) {
++				ret = regulator_set_voltage_tol(krait_l2_reg,
++						krait_l2_points[i].cache_volt,
++						tol);
++				if (ret) {
++					pr_err("failed to scale l2 voltage: %d\n",
++						ret);
++				}
++			}
++			ret = clk_set_rate(krait_l2_clk,
++					krait_l2_points[i].cache_freq);
++			if (ret)
++				pr_err("failed to scale l2 clk: %d\n", ret);
++			break;
++		}
++
++	}
++
++	return ret;
++}
++
++static int krait_cpufreq_init(struct cpufreq_policy *policy)
++{
++	int ret;
++
++	policy->clk = per_cpu(krait_cpu_clks, policy->cpu);
++
++	ret = cpufreq_table_validate_and_show(policy, freq_table);
++	if (ret) {
++		pr_err("%s: invalid frequency table: %d\n", __func__, ret);
++		return ret;
++	}
++
++	policy->cpuinfo.transition_latency = transition_latency;
++
++	return 0;
++}
++
++static struct cpufreq_driver krait_cpufreq_driver = {
++	.flags = CPUFREQ_STICKY,
++	.verify = cpufreq_generic_frequency_table_verify,
++	.target_index = krait_set_target,
++	.get = cpufreq_generic_get,
++	.init = krait_cpufreq_init,
++	.name = "generic_krait",
++	.attr = cpufreq_generic_attr,
++};
++
++static int krait_cpufreq_probe(struct platform_device *pdev)
++{
++	struct device_node *np, *cache;
++	int ret, i;
++	unsigned int cpu;
++	struct device *dev;
++	struct clk *clk;
++	struct regulator *core;
++	unsigned long freq_Hz, freq, max_cpu_freq;
++	struct dev_pm_opp *opp;
++	unsigned long volt, tol;
++
++	cpu_dev = get_cpu_device(0);
++	if (!cpu_dev) {
++		pr_err("failed to get krait device\n");
++		return -ENODEV;
++	}
++
++	np = of_node_get(cpu_dev->of_node);
++	if (!np) {
++		pr_err("failed to find krait node\n");
++		return -ENOENT;
++	}
++
++	ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
++	if (ret) {
++		pr_err("failed to init cpufreq table: %d\n", ret);
++		goto out_put_node;
++	}
++
++	of_property_read_u32(np, "voltage-tolerance", &voltage_tolerance);
++
++	if (of_property_read_u32(np, "clock-latency", &transition_latency))
++		transition_latency = CPUFREQ_ETERNAL;
++
++	cache = of_find_next_cache_node(np);
++	if (cache) {
++		struct device_node *vdd;
++
++		vdd = of_parse_phandle(cache, "vdd_dig-supply", 0);
++		if (vdd) {
++			krait_l2_reg = regulator_get(NULL, vdd->name);
++			if (IS_ERR(krait_l2_reg)) {
++				pr_warn("failed to get l2 vdd_dig supply\n");
++				krait_l2_reg = NULL;
++			}
++			of_node_put(vdd);
++		}
++
++		krait_l2_clk = of_clk_get(cache, 0);
++		if (!IS_ERR(krait_l2_clk)) {
++			ret = krait_parse_cache_points(&pdev->dev, cache);
++			if (ret)
++				clk_put(krait_l2_clk);
++		}
++		if (IS_ERR(krait_l2_clk) || ret)
++			krait_l2_clk = NULL;
++	}
++
++	for_each_possible_cpu(cpu) {
++		dev = get_cpu_device(cpu);
++		if (!dev) {
++			pr_err("failed to get krait device\n");
++			ret = -ENOENT;
++			goto out_free_table;
++		}
++		per_cpu(krait_cpu_clks, cpu) = clk = devm_clk_get(dev, NULL);
++		if (IS_ERR(clk)) {
++			ret = PTR_ERR(clk);
++			goto out_free_table;
++		}
++		core = devm_regulator_get(dev, "core");
++		if (IS_ERR(core)) {
++			pr_debug("failed to get core regulator\n");
++			ret = PTR_ERR(core);
++			goto out_free_table;
++		}
++		per_cpu(krait_supply_core, cpu) = core;
++
++		freq_Hz = clk_get_rate(clk);
++
++		rcu_read_lock();
++		opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_Hz);
++		if (IS_ERR(opp)) {
++			rcu_read_unlock();
++			pr_err("failed to find OPP for %ld\n", freq_Hz);
++			ret = PTR_ERR(opp);
++			goto out_free_table;
++		}
++		volt = dev_pm_opp_get_voltage(opp);
++		rcu_read_unlock();
++
++		tol = volt * voltage_tolerance / 100;
++		ret = regulator_set_voltage_tol(core, volt, tol);
++		if (ret) {
++			pr_err("failed to scale voltage up: %d\n", ret);
++			goto out_free_table;
++		}
++		ret = regulator_enable(core);
++		if (ret) {
++			pr_err("failed to enable regulator: %d\n", ret);
++			goto out_free_table;
++		}
++		max_cpu_freq = max(max_cpu_freq, freq);
++	}
++
++	for (i = 0; i < nr_krait_l2_points; i++) {
++		if (max_cpu_freq >= krait_l2_points[i].cpu_freq) {
++			if (krait_l2_reg) {
++				ret = regulator_set_voltage_tol(krait_l2_reg,
++						krait_l2_points[i].cache_volt,
++						tol);
++				if (ret)
++					pr_err("failed to scale l2 voltage: %d\n",
++							ret);
++				ret = regulator_enable(krait_l2_reg);
++				if (ret)
++					pr_err("failed to enable l2 voltage: %d\n",
++							ret);
++			}
++			break;
++		}
++
++	}
++
++	ret = cpufreq_register_driver(&krait_cpufreq_driver);
++	if (ret) {
++		pr_err("failed register driver: %d\n", ret);
++		goto out_free_table;
++	}
++	of_node_put(np);
++
++	/*
++	 * For now, just loading the cooling device;
++	 * thermal DT code takes care of matching them.
++	 */
++	for_each_possible_cpu(cpu) {
++		dev = get_cpu_device(cpu);
++		np = of_node_get(dev->of_node);
++		if (of_find_property(np, "#cooling-cells", NULL)) {
++			cdev = of_cpufreq_cooling_register(np, cpumask_of(cpu));
++			if (IS_ERR(cdev))
++				pr_err("running cpufreq without cooling device: %ld\n",
++				       PTR_ERR(cdev));
++		}
++		of_node_put(np);
++	}
++
++	return 0;
++
++out_free_table:
++	regulator_put(krait_l2_reg);
++	clk_put(krait_l2_clk);
++	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
++out_put_node:
++	of_node_put(np);
++	return ret;
++}
++
++static int krait_cpufreq_remove(struct platform_device *pdev)
++{
++	cpufreq_cooling_unregister(cdev);
++	cpufreq_unregister_driver(&krait_cpufreq_driver);
++	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
++	clk_put(krait_l2_clk);
++	regulator_put(krait_l2_reg);
++
++	return 0;
++}
++
++static struct platform_driver krait_cpufreq_platdrv = {
++	.driver = {
++		.name	= "cpufreq-krait",
++		.owner	= THIS_MODULE,
++	},
++	.probe		= krait_cpufreq_probe,
++	.remove		= krait_cpufreq_remove,
++};
++module_platform_driver(krait_cpufreq_platdrv);
++
++MODULE_DESCRIPTION("Krait CPUfreq driver");
++MODULE_LICENSE("GPL v2");
+--- a/drivers/cpufreq/qcom-cpufreq.c
++++ b/drivers/cpufreq/qcom-cpufreq.c
+@@ -168,11 +168,8 @@ static int __init qcom_cpufreq_populate_
+ 
+ static int __init qcom_cpufreq_driver_init(void)
+ {
+-	struct cpufreq_dt_platform_data pdata = { .independent_clocks = true };
+ 	struct platform_device_info devinfo = {
+-		.name = "cpufreq-dt",
+-		.data = &pdata,
+-		.size_data = sizeof(pdata),
++		.name = "cpufreq-krait",
+ 	};
+ 	struct device *cpu_dev;
+ 	struct device_node *np;
diff --git a/target/linux/ipq806x/patches-4.1/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch b/target/linux/ipq806x/patches-4.1/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
new file mode 100644
index 0000000..51ebc19
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
@@ -0,0 +1,62 @@
+From b12e230f09d4481424e6a5d7e2ae566b6954e83f Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Wed, 29 Apr 2015 15:21:46 -0700
+Subject: [PATCH] HACK: arch: arm: force ZRELADDR on arch-qcom
+
+ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
+on most ARM architectures. This automatically calculate ZRELADDR by
+masking PHYS_OFFSET with 0xf8000000.
+
+However, on IPQ806x, the first ~20MB of RAM is reserved for the hardware
+network accelerators, and the bootloader removes this section from the
+layout passed from the ATAGS (when used).
+
+For newer bootloader, when DT is used, this is not a problem, we just
+reserve this memory in the device tree. But if the bootloader doesn't
+have DT support, then ATAGS have to be used. In this case, the ARM
+decompressor will position the kernel in this low mem, which will not be
+in the RAM section mapped by the bootloader, which means the kernel will
+freeze in the middle of the boot process trying to map the memory.
+
+As a work around, this patch allows disabling AUTO_ZRELADDR when
+ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
+which don't support device-tree, which is the case on certain early
+IPQ806x based designs.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/Kconfig                 | 2 +-
+ arch/arm/Makefile                | 2 ++
+ arch/arm/mach-qcom/Makefile.boot | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+ create mode 100644 arch/arm/mach-qcom/Makefile.boot
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -320,7 +320,7 @@ config ARCH_MULTIPLATFORM
+ 	select ARCH_WANT_OPTIONAL_GPIOLIB
+ 	select ARM_HAS_SG_CHAIN
+ 	select ARM_PATCH_PHYS_VIRT
+-	select AUTO_ZRELADDR
++	select AUTO_ZRELADDR if !ARCH_QCOM
+ 	select CLKSRC_OF
+ 	select COMMON_CLK
+ 	select GENERIC_CLOCKEVENTS
+--- a/arch/arm/Makefile
++++ b/arch/arm/Makefile
+@@ -240,9 +240,11 @@ MACHINE  := arch/arm/mach-$(word 1,$(mac
+ else
+ MACHINE  :=
+ endif
++ifeq ($(CONFIG_ARCH_QCOM),)
+ ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
+ MACHINE  :=
+ endif
++endif
+ 
+ machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
+ platdirs := $(patsubst %,arch/arm/plat-%/,$(sort $(plat-y)))
+--- /dev/null
++++ b/arch/arm/mach-qcom/Makefile.boot
+@@ -0,0 +1 @@
++zreladdr-y+= 0x42208000
diff --git a/target/linux/ipq806x/patches-4.1/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch b/target/linux/ipq806x/patches-4.1/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
new file mode 100644
index 0000000..dfe7169
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
@@ -0,0 +1,734 @@
+From 2fbb18f85826a9ba308fedb2cf90d3a661a39fd7 Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd at codeaurora.org>
+Date: Fri, 27 Mar 2015 00:16:14 -0700
+Subject: [PATCH] clk: qcom: Add support for NSS/GMAC clocks and resets
+
+Add the NSS/GMAC clocks and the TCM clock and NSS resets.
+
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+---
+ drivers/clk/qcom/gcc-ipq806x.c               | 594 ++++++++++++++++++++++++++-
+ drivers/clk/qcom/gcc-ipq806x.c.rej           |  50 +++
+ include/dt-bindings/clock/qcom,gcc-ipq806x.h |   2 +
+ include/dt-bindings/reset/qcom,gcc-ipq806x.h |  43 ++
+ 4 files changed, 688 insertions(+), 1 deletion(-)
+ create mode 100644 drivers/clk/qcom/gcc-ipq806x.c.rej
+
+--- a/drivers/clk/qcom/gcc-ipq806x.c
++++ b/drivers/clk/qcom/gcc-ipq806x.c
+@@ -220,12 +220,47 @@ static struct clk_regmap pll14_vote = {
+ 	},
+ };
+ 
++#define NSS_PLL_RATE(f, _l, _m, _n, i) \
++	{  \
++		.freq = f,  \
++		.l = _l, \
++		.m = _m, \
++		.n = _n, \
++		.ibits = i, \
++	}
++
++static struct pll_freq_tbl pll18_freq_tbl[] = {
++	NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
++	NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
++};
++
++static struct clk_pll pll18 = {
++	.l_reg = 0x31a4,
++	.m_reg = 0x31a8,
++	.n_reg = 0x31ac,
++	.config_reg = 0x31b4,
++	.mode_reg = 0x31a0,
++	.status_reg = 0x31b8,
++	.status_bit = 16,
++	.post_div_shift = 16,
++	.post_div_width = 1,
++	.freq_tbl = pll18_freq_tbl,
++	.clkr.hw.init = &(struct clk_init_data){
++		.name = "pll18",
++		.parent_names = (const char *[]){ "pxo" },
++		.num_parents = 1,
++		.ops = &clk_pll_ops,
++	},
++};
++
+ enum {
+ 	P_PXO,
+ 	P_PLL8,
+ 	P_PLL3,
+ 	P_PLL0,
+ 	P_CXO,
++	P_PLL14,
++	P_PLL18,
+ };
+ 
+ static const struct parent_map gcc_pxo_pll8_map[] = {
+@@ -277,6 +312,22 @@ static const char *gcc_pxo_pll8_pll0_map
+ 	"pll0_vote",
+ };
+ 
++static const struct parent_map gcc_pxo_pll8_pll14_pll18_pll0_map[] = {
++	{ P_PXO, 0 },
++	{ P_PLL8, 4 },
++	{ P_PLL0, 2 },
++	{ P_PLL14, 5 },
++	{ P_PLL18, 1 },
++};
++
++static const char *gcc_pxo_pll8_pll14_pll18_pll0[] = {
++	"pxo",
++	"pll8_vote",
++	"pll0_vote",
++	"pll14",
++	"pll18",
++};
++
+ static struct freq_tbl clk_tbl_gsbi_uart[] = {
+ 	{  1843200, P_PLL8, 2,  6, 625 },
+ 	{  3686400, P_PLL8, 2, 12, 625 },
+@@ -2282,6 +2333,472 @@ static struct clk_branch ebi2_aon_clk =
+ 	},
+ };
+ 
++static const struct freq_tbl clk_tbl_gmac[] = {
++	{ 133000000, P_PLL0, 1,  50, 301 },
++	{ 266000000, P_PLL0, 1, 127, 382 },
++	{ }
++};
++
++static struct clk_dyn_rcg gmac_core1_src = {
++	.ns_reg[0] = 0x3cac,
++	.ns_reg[1] = 0x3cb0,
++	.md_reg[0] = 0x3ca4,
++	.md_reg[1] = 0x3ca8,
++	.bank_reg = 0x3ca0,
++	.mn[0] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.mn[1] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.s[0] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.s[1] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.p[0] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.p[1] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.mux_sel_bit = 0,
++	.freq_tbl = clk_tbl_gmac,
++	.clkr = {
++		.enable_reg = 0x3ca0,
++		.enable_mask = BIT(1),
++		.hw.init = &(struct clk_init_data){
++			.name = "gmac_core1_src",
++			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
++			.num_parents = 5,
++			.ops = &clk_dyn_rcg_ops,
++		},
++	},
++};
++
++static struct clk_branch gmac_core1_clk = {
++	.halt_reg = 0x3c20,
++	.halt_bit = 4,
++	.hwcg_reg = 0x3cb4,
++	.hwcg_bit = 6,
++	.clkr = {
++		.enable_reg = 0x3cb4,
++		.enable_mask = BIT(4),
++		.hw.init = &(struct clk_init_data){
++			.name = "gmac_core1_clk",
++			.parent_names = (const char *[]){
++				"gmac_core1_src",
++			},
++			.num_parents = 1,
++			.ops = &clk_branch_ops,
++			.flags = CLK_SET_RATE_PARENT,
++		},
++	},
++};
++
++static struct clk_dyn_rcg gmac_core2_src = {
++	.ns_reg[0] = 0x3ccc,
++	.ns_reg[1] = 0x3cd0,
++	.md_reg[0] = 0x3cc4,
++	.md_reg[1] = 0x3cc8,
++	.bank_reg = 0x3ca0,
++	.mn[0] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.mn[1] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.s[0] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.s[1] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.p[0] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.p[1] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.mux_sel_bit = 0,
++	.freq_tbl = clk_tbl_gmac,
++	.clkr = {
++		.enable_reg = 0x3cc0,
++		.enable_mask = BIT(1),
++		.hw.init = &(struct clk_init_data){
++			.name = "gmac_core2_src",
++			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
++			.num_parents = 5,
++			.ops = &clk_dyn_rcg_ops,
++		},
++	},
++};
++
++static struct clk_branch gmac_core2_clk = {
++	.halt_reg = 0x3c20,
++	.halt_bit = 5,
++	.hwcg_reg = 0x3cd4,
++	.hwcg_bit = 6,
++	.clkr = {
++		.enable_reg = 0x3cd4,
++		.enable_mask = BIT(4),
++		.hw.init = &(struct clk_init_data){
++			.name = "gmac_core2_clk",
++			.parent_names = (const char *[]){
++				"gmac_core2_src",
++			},
++			.num_parents = 1,
++			.ops = &clk_branch_ops,
++			.flags = CLK_SET_RATE_PARENT,
++		},
++	},
++};
++
++static struct clk_dyn_rcg gmac_core3_src = {
++	.ns_reg[0] = 0x3cec,
++	.ns_reg[1] = 0x3cf0,
++	.md_reg[0] = 0x3ce4,
++	.md_reg[1] = 0x3ce8,
++	.bank_reg = 0x3ce0,
++	.mn[0] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.mn[1] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.s[0] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.s[1] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.p[0] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.p[1] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.mux_sel_bit = 0,
++	.freq_tbl = clk_tbl_gmac,
++	.clkr = {
++		.enable_reg = 0x3ce0,
++		.enable_mask = BIT(1),
++		.hw.init = &(struct clk_init_data){
++			.name = "gmac_core3_src",
++			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
++			.num_parents = 5,
++			.ops = &clk_dyn_rcg_ops,
++		},
++	},
++};
++
++static struct clk_branch gmac_core3_clk = {
++	.halt_reg = 0x3c20,
++	.halt_bit = 6,
++	.hwcg_reg = 0x3cf4,
++	.hwcg_bit = 6,
++	.clkr = {
++		.enable_reg = 0x3cf4,
++		.enable_mask = BIT(4),
++		.hw.init = &(struct clk_init_data){
++			.name = "gmac_core3_clk",
++			.parent_names = (const char *[]){
++				"gmac_core3_src",
++			},
++			.num_parents = 1,
++			.ops = &clk_branch_ops,
++			.flags = CLK_SET_RATE_PARENT,
++		},
++	},
++};
++
++static struct clk_dyn_rcg gmac_core4_src = {
++	.ns_reg[0] = 0x3d0c,
++	.ns_reg[1] = 0x3d10,
++	.md_reg[0] = 0x3d04,
++	.md_reg[1] = 0x3d08,
++	.bank_reg = 0x3d00,
++	.mn[0] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.mn[1] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.s[0] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.s[1] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.p[0] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.p[1] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.mux_sel_bit = 0,
++	.freq_tbl = clk_tbl_gmac,
++	.clkr = {
++		.enable_reg = 0x3d00,
++		.enable_mask = BIT(1),
++		.hw.init = &(struct clk_init_data){
++			.name = "gmac_core4_src",
++			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
++			.num_parents = 5,
++			.ops = &clk_dyn_rcg_ops,
++		},
++	},
++};
++
++static struct clk_branch gmac_core4_clk = {
++	.halt_reg = 0x3c20,
++	.halt_bit = 7,
++	.hwcg_reg = 0x3d14,
++	.hwcg_bit = 6,
++	.clkr = {
++		.enable_reg = 0x3d14,
++		.enable_mask = BIT(4),
++		.hw.init = &(struct clk_init_data){
++			.name = "gmac_core4_clk",
++			.parent_names = (const char *[]){
++				"gmac_core4_src",
++			},
++			.num_parents = 1,
++			.ops = &clk_branch_ops,
++			.flags = CLK_SET_RATE_PARENT,
++		},
++	},
++};
++
++static const struct freq_tbl clk_tbl_nss_tcm[] = {
++	{ 266000000, P_PLL0, 3, 0, 0 },
++	{ 400000000, P_PLL0, 2, 0, 0 },
++	{ }
++};
++
++static struct clk_dyn_rcg nss_tcm_src = {
++	.ns_reg[0] = 0x3dc4,
++	.ns_reg[1] = 0x3dc8,
++	.bank_reg = 0x3dc0,
++	.s[0] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.s[1] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.p[0] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 4,
++	},
++	.p[1] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 4,
++	},
++	.mux_sel_bit = 0,
++	.freq_tbl = clk_tbl_nss_tcm,
++	.clkr = {
++		.enable_reg = 0x3dc0,
++		.enable_mask = BIT(1),
++		.hw.init = &(struct clk_init_data){
++			.name = "nss_tcm_src",
++			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
++			.num_parents = 5,
++			.ops = &clk_dyn_rcg_ops,
++		},
++	},
++};
++
++static struct clk_branch nss_tcm_clk = {
++	.halt_reg = 0x3c20,
++	.halt_bit = 14,
++	.clkr = {
++		.enable_reg = 0x3dd0,
++		.enable_mask = BIT(6) | BIT(4),
++		.hw.init = &(struct clk_init_data){
++			.name = "nss_tcm_clk",
++			.parent_names = (const char *[]){
++				"nss_tcm_src",
++			},
++			.num_parents = 1,
++			.ops = &clk_branch_ops,
++			.flags = CLK_SET_RATE_PARENT,
++		},
++	},
++};
++
++static const struct freq_tbl clk_tbl_nss[] = {
++	{ 110000000, P_PLL18, 1, 1, 5 },
++	{ 275000000, P_PLL18, 2, 0, 0 },
++	{ 550000000, P_PLL18, 1, 0, 0 },
++	{ 733000000, P_PLL18, 1, 0, 0 },
++	{ }
++};
++
++static struct clk_dyn_rcg ubi32_core1_src_clk = {
++	.ns_reg[0] = 0x3d2c,
++	.ns_reg[1] = 0x3d30,
++	.md_reg[0] = 0x3d24,
++	.md_reg[1] = 0x3d28,
++	.bank_reg = 0x3d20,
++	.mn[0] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.mn[1] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.s[0] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.s[1] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.p[0] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.p[1] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.mux_sel_bit = 0,
++	.freq_tbl = clk_tbl_nss,
++	.clkr = {
++		.enable_reg = 0x3d20,
++		.enable_mask = BIT(1),
++		.hw.init = &(struct clk_init_data){
++			.name = "ubi32_core1_src_clk",
++			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
++			.num_parents = 5,
++			.ops = &clk_dyn_rcg_ops,
++			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
++		},
++	},
++};
++
++static struct clk_dyn_rcg ubi32_core2_src_clk = {
++	.ns_reg[0] = 0x3d4c,
++	.ns_reg[1] = 0x3d50,
++	.md_reg[0] = 0x3d44,
++	.md_reg[1] = 0x3d48,
++	.bank_reg = 0x3d40,
++	.mn[0] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.mn[1] = {
++		.mnctr_en_bit = 8,
++		.mnctr_reset_bit = 7,
++		.mnctr_mode_shift = 5,
++		.n_val_shift = 16,
++		.m_val_shift = 16,
++		.width = 8,
++	},
++	.s[0] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.s[1] = {
++		.src_sel_shift = 0,
++		.parent_map = gcc_pxo_pll8_pll14_pll18_pll0_map,
++	},
++	.p[0] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.p[1] = {
++		.pre_div_shift = 3,
++		.pre_div_width = 2,
++	},
++	.mux_sel_bit = 0,
++	.freq_tbl = clk_tbl_nss,
++	.clkr = {
++		.enable_reg = 0x3d40,
++		.enable_mask = BIT(1),
++		.hw.init = &(struct clk_init_data){
++			.name = "ubi32_core2_src_clk",
++			.parent_names = gcc_pxo_pll8_pll14_pll18_pll0,
++			.num_parents = 5,
++			.ops = &clk_dyn_rcg_ops,
++			.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
++		},
++	},
++};
++
+ static struct clk_regmap *gcc_ipq806x_clks[] = {
+ 	[PLL0] = &pll0.clkr,
+ 	[PLL0_VOTE] = &pll0_vote,
+@@ -2291,6 +2808,7 @@ static struct clk_regmap *gcc_ipq806x_cl
+ 	[PLL8_VOTE] = &pll8_vote,
+ 	[PLL14] = &pll14.clkr,
+ 	[PLL14_VOTE] = &pll14_vote,
++	[PLL18] = &pll18.clkr,
+ 	[GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
+ 	[GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
+ 	[GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
+@@ -2390,6 +2908,18 @@ static struct clk_regmap *gcc_ipq806x_cl
+ 	[PLL9] = &hfpll0.clkr,
+ 	[PLL10] = &hfpll1.clkr,
+ 	[PLL12] = &hfpll_l2.clkr,
++	[GMAC_CORE1_CLK_SRC] = &gmac_core1_src.clkr,
++	[GMAC_CORE1_CLK] = &gmac_core1_clk.clkr,
++	[GMAC_CORE2_CLK_SRC] = &gmac_core2_src.clkr,
++	[GMAC_CORE2_CLK] = &gmac_core2_clk.clkr,
++	[GMAC_CORE3_CLK_SRC] = &gmac_core3_src.clkr,
++	[GMAC_CORE3_CLK] = &gmac_core3_clk.clkr,
++	[GMAC_CORE4_CLK_SRC] = &gmac_core4_src.clkr,
++	[GMAC_CORE4_CLK] = &gmac_core4_clk.clkr,
++	[UBI32_CORE1_CLK_SRC] = &ubi32_core1_src_clk.clkr,
++	[UBI32_CORE2_CLK_SRC] = &ubi32_core2_src_clk.clkr,
++	[NSSTCM_CLK_SRC] = &nss_tcm_src.clkr,
++	[NSSTCM_CLK] = &nss_tcm_clk.clkr,
+ };
+ 
+ static const struct qcom_reset_map gcc_ipq806x_resets[] = {
+@@ -2508,6 +3038,48 @@ static const struct qcom_reset_map gcc_i
+ 	[USB30_1_PHY_RESET] = { 0x3b58, 0 },
+ 	[NSSFB0_RESET] = { 0x3b60, 6 },
+ 	[NSSFB1_RESET] = { 0x3b60, 7 },
++	[UBI32_CORE1_CLKRST_CLAMP_RESET] = { 0x3d3c, 3},
++	[UBI32_CORE1_CLAMP_RESET] = { 0x3d3c, 2 },
++	[UBI32_CORE1_AHB_RESET] = { 0x3d3c, 1 },
++	[UBI32_CORE1_AXI_RESET] = { 0x3d3c, 0 },
++	[UBI32_CORE2_CLKRST_CLAMP_RESET] = { 0x3d5c, 3 },
++	[UBI32_CORE2_CLAMP_RESET] = { 0x3d5c, 2 },
++	[UBI32_CORE2_AHB_RESET] = { 0x3d5c, 1 },
++	[UBI32_CORE2_AXI_RESET] = { 0x3d5c, 0 },
++	[GMAC_CORE1_RESET] = { 0x3cbc, 0 },
++	[GMAC_CORE2_RESET] = { 0x3cdc, 0 },
++	[GMAC_CORE3_RESET] = { 0x3cfc, 0 },
++	[GMAC_CORE4_RESET] = { 0x3d1c, 0 },
++	[GMAC_AHB_RESET] = { 0x3e24, 0 },
++	[NSS_CH0_RST_RX_CLK_N_RESET] = { 0x3b60, 0 },
++	[NSS_CH0_RST_TX_CLK_N_RESET] = { 0x3b60, 1 },
++	[NSS_CH0_RST_RX_125M_N_RESET] = { 0x3b60, 2 },
++	[NSS_CH0_HW_RST_RX_125M_N_RESET] = { 0x3b60, 3 },
++	[NSS_CH0_RST_TX_125M_N_RESET] = { 0x3b60, 4 },
++	[NSS_CH1_RST_RX_CLK_N_RESET] = { 0x3b60, 5 },
++	[NSS_CH1_RST_TX_CLK_N_RESET] = { 0x3b60, 6 },
++	[NSS_CH1_RST_RX_125M_N_RESET] = { 0x3b60, 7 },
++	[NSS_CH1_HW_RST_RX_125M_N_RESET] = { 0x3b60, 8 },
++	[NSS_CH1_RST_TX_125M_N_RESET] = { 0x3b60, 9 },
++	[NSS_CH2_RST_RX_CLK_N_RESET] = { 0x3b60, 10 },
++	[NSS_CH2_RST_TX_CLK_N_RESET] = { 0x3b60, 11 },
++	[NSS_CH2_RST_RX_125M_N_RESET] = { 0x3b60, 12 },
++	[NSS_CH2_HW_RST_RX_125M_N_RESET] = { 0x3b60, 13 },
++	[NSS_CH2_RST_TX_125M_N_RESET] = { 0x3b60, 14 },
++	[NSS_CH3_RST_RX_CLK_N_RESET] = { 0x3b60, 15 },
++	[NSS_CH3_RST_TX_CLK_N_RESET] = { 0x3b60, 16 },
++	[NSS_CH3_RST_RX_125M_N_RESET] = { 0x3b60, 17 },
++	[NSS_CH3_HW_RST_RX_125M_N_RESET] = { 0x3b60, 18 },
++	[NSS_CH3_RST_TX_125M_N_RESET] = { 0x3b60, 19 },
++	[NSS_RST_RX_250M_125M_N_RESET] = { 0x3b60, 20 },
++	[NSS_RST_TX_250M_125M_N_RESET] = { 0x3b60, 21 },
++	[NSS_QSGMII_TXPI_RST_N_RESET] = { 0x3b60, 22 },
++	[NSS_QSGMII_CDR_RST_N_RESET] = { 0x3b60, 23 },
++	[NSS_SGMII2_CDR_RST_N_RESET] = { 0x3b60, 24 },
++	[NSS_SGMII3_CDR_RST_N_RESET] = { 0x3b60, 25 },
++	[NSS_CAL_PRBS_RST_N_RESET] = { 0x3b60, 26 },
++	[NSS_LCKDT_RST_N_RESET] = { 0x3b60, 27 },
++	[NSS_SRDS_N_RESET] = { 0x3b60, 28 },
+ };
+ 
+ static const struct regmap_config gcc_ipq806x_regmap_config = {
+@@ -2536,6 +3108,8 @@ static int gcc_ipq806x_probe(struct plat
+ {
+ 	struct clk *clk;
+ 	struct device *dev = &pdev->dev;
++	struct regmap *regmap;
++	int ret;
+ 
+ 	/* Temporary until RPM clocks supported */
+ 	clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 25000000);
+@@ -2546,7 +3120,25 @@ static int gcc_ipq806x_probe(struct plat
+ 	if (IS_ERR(clk))
+ 		return PTR_ERR(clk);
+ 
+-	return qcom_cc_probe(pdev, &gcc_ipq806x_desc);
++	ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);
++	if (ret)
++		return ret;
++
++	regmap = dev_get_regmap(dev, NULL);
++	if (!regmap)
++		return -ENODEV;
++
++	/* Setup PLL18 static bits */
++	regmap_update_bits(regmap, 0x31a4, 0xffffffc0, 0x40000400);
++	regmap_write(regmap, 0x31b0, 0x3080);
++
++	/* Set GMAC footswitch sleep/wakeup values */
++	regmap_write(regmap, 0x3cb8, 8);
++	regmap_write(regmap, 0x3cd8, 8);
++	regmap_write(regmap, 0x3cf8, 8);
++	regmap_write(regmap, 0x3d18, 8);
++
++	return 0;
+ }
+ 
+ static int gcc_ipq806x_remove(struct platform_device *pdev)
+--- a/include/dt-bindings/reset/qcom,gcc-ipq806x.h
++++ b/include/dt-bindings/reset/qcom,gcc-ipq806x.h
+@@ -129,4 +129,47 @@
+ #define USB30_1_PHY_RESET				112
+ #define NSSFB0_RESET					113
+ #define NSSFB1_RESET					114
++#define UBI32_CORE1_CLKRST_CLAMP_RESET			115
++#define UBI32_CORE1_CLAMP_RESET				116
++#define UBI32_CORE1_AHB_RESET				117
++#define UBI32_CORE1_AXI_RESET				118
++#define UBI32_CORE2_CLKRST_CLAMP_RESET			119
++#define UBI32_CORE2_CLAMP_RESET				120
++#define UBI32_CORE2_AHB_RESET				121
++#define UBI32_CORE2_AXI_RESET				122
++#define GMAC_CORE1_RESET				123
++#define GMAC_CORE2_RESET				124
++#define GMAC_CORE3_RESET				125
++#define GMAC_CORE4_RESET				126
++#define GMAC_AHB_RESET					127
++#define NSS_CH0_RST_RX_CLK_N_RESET			128
++#define NSS_CH0_RST_TX_CLK_N_RESET			129
++#define NSS_CH0_RST_RX_125M_N_RESET			130
++#define NSS_CH0_HW_RST_RX_125M_N_RESET			131
++#define NSS_CH0_RST_TX_125M_N_RESET			132
++#define NSS_CH1_RST_RX_CLK_N_RESET			133
++#define NSS_CH1_RST_TX_CLK_N_RESET			134
++#define NSS_CH1_RST_RX_125M_N_RESET			135
++#define NSS_CH1_HW_RST_RX_125M_N_RESET			136
++#define NSS_CH1_RST_TX_125M_N_RESET			137
++#define NSS_CH2_RST_RX_CLK_N_RESET			138
++#define NSS_CH2_RST_TX_CLK_N_RESET			139
++#define NSS_CH2_RST_RX_125M_N_RESET			140
++#define NSS_CH2_HW_RST_RX_125M_N_RESET			141
++#define NSS_CH2_RST_TX_125M_N_RESET			142
++#define NSS_CH3_RST_RX_CLK_N_RESET			143
++#define NSS_CH3_RST_TX_CLK_N_RESET			144
++#define NSS_CH3_RST_RX_125M_N_RESET			145
++#define NSS_CH3_HW_RST_RX_125M_N_RESET			146
++#define NSS_CH3_RST_TX_125M_N_RESET			147
++#define NSS_RST_RX_250M_125M_N_RESET			148
++#define NSS_RST_TX_250M_125M_N_RESET			149
++#define NSS_QSGMII_TXPI_RST_N_RESET			150
++#define NSS_QSGMII_CDR_RST_N_RESET			151
++#define NSS_SGMII2_CDR_RST_N_RESET			152
++#define NSS_SGMII3_CDR_RST_N_RESET			153
++#define NSS_CAL_PRBS_RST_N_RESET			154
++#define NSS_LCKDT_RST_N_RESET				155
++#define NSS_SRDS_N_RESET				156
++
+ #endif
+--- a/include/dt-bindings/clock/qcom,gcc-ipq806x.h
++++ b/include/dt-bindings/clock/qcom,gcc-ipq806x.h
+@@ -289,5 +289,7 @@
+ #define UBI32_CORE1_CLK				279
+ #define UBI32_CORE2_CLK				280
+ #define EBI2_AON_CLK				281
++#define NSSTCM_CLK_SRC				282
++#define NSSTCM_CLK				283
+ 
+ #endif
diff --git a/target/linux/ipq806x/patches-4.1/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch b/target/linux/ipq806x/patches-4.1/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch
new file mode 100644
index 0000000..3711e12
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch
@@ -0,0 +1,105 @@
+From 4f09499bc1d9bb095caccbcd73ff951ee631e521 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Fri, 8 May 2015 15:42:40 -0700
+Subject: [PATCH 1/8] stmmac: add phy-handle support to the platform layer
+
+On stmmac driver, PHY specification in device-tree was done using the
+non-standard property "snps,phy-addr". Specifying a PHY on a different
+MDIO bus that the one within the stmmac controller doesn't seem to be
+possible when device-tree is used.
+
+This change adds support for the phy-handle property, as specified in
+Documentation/devicetree/bindings/net/ethernet.txt.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 28 ++++++++++++++--------
+ .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |  6 ++++-
+ include/linux/stmmac.h                             |  1 +
+ 3 files changed, 24 insertions(+), 11 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+@@ -52,6 +52,7 @@
+ #include "stmmac_ptp.h"
+ #include "stmmac.h"
+ #include <linux/reset.h>
++#include <linux/of_mdio.h>
+ 
+ #define STMMAC_ALIGN(x)	L1_CACHE_ALIGN(x)
+ 
+@@ -816,18 +817,25 @@ static int stmmac_init_phy(struct net_de
+ 	priv->speed = 0;
+ 	priv->oldduplex = -1;
+ 
+-	if (priv->plat->phy_bus_name)
+-		snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
+-			 priv->plat->phy_bus_name, priv->plat->bus_id);
+-	else
+-		snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
+-			 priv->plat->bus_id);
+-
+-	snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
+-		 priv->plat->phy_addr);
+-	pr_debug("stmmac_init_phy:  trying to attach to %s\n", phy_id_fmt);
++	if (priv->plat->phy_node) {
++		phydev = of_phy_connect(dev, priv->plat->phy_node,
++					&stmmac_adjust_link, 0, interface);
++	} else {
++		if (priv->plat->phy_bus_name)
++			snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
++				 priv->plat->phy_bus_name, priv->plat->bus_id);
++		else
++			snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
++				 priv->plat->bus_id);
++
++		snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
++			 priv->plat->phy_addr);
++		pr_debug("stmmac_init_phy:  trying to attach to %s\n",
++			 phy_id_fmt);
+ 
+-	phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link, interface);
++		phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link,
++				     interface);
++	}
+ 
+ 	if (IS_ERR(phydev)) {
+ 		pr_err("%s: Could not attach to PHY\n", dev->name);
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -28,6 +28,7 @@
+ #include <linux/of.h>
+ #include <linux/of_net.h>
+ #include <linux/of_device.h>
++#include <linux/of_mdio.h>
+ 
+ #include "stmmac.h"
+ #include "stmmac_platform.h"
+@@ -168,13 +169,16 @@ static int stmmac_probe_config_dt(struct
+ 	/* Default to phy auto-detection */
+ 	plat->phy_addr = -1;
+ 
++	/* If we find a phy-handle property, use it as the PHY */
++	plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
++
+ 	/* "snps,phy-addr" is not a standard property. Mark it as deprecated
+ 	 * and warn of its use. Remove this when phy node support is added.
+ 	 */
+ 	if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
+ 		dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
+ 
+-	if (plat->phy_bus_name)
++	if (plat->phy_node || plat->phy_bus_name)
+ 		plat->mdio_bus_data = NULL;
+ 	else
+ 		plat->mdio_bus_data =
+--- a/include/linux/stmmac.h
++++ b/include/linux/stmmac.h
+@@ -99,6 +99,7 @@ struct plat_stmmacenet_data {
+ 	int phy_addr;
+ 	int interface;
+ 	struct stmmac_mdio_bus_data *mdio_bus_data;
++	struct device_node *phy_node;
+ 	struct stmmac_dma_cfg *dma_cfg;
+ 	int clk_csr;
+ 	int has_gmac;
diff --git a/target/linux/ipq806x/patches-4.1/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch b/target/linux/ipq806x/patches-4.1/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch
new file mode 100644
index 0000000..37f1002
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch
@@ -0,0 +1,65 @@
+From 0149d275415cd1b2382ce94e5eb32641590097d0 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Fri, 8 May 2015 15:57:12 -0700
+Subject: [PATCH 2/8] stmmac: move error path at the end of
+ stmmac_probe_config_dt()
+
+We will want to do additional clean-up on certain errors. Therefore,
+this change moves the error path at the end of the function for better
+code readability.
+
+This patch doesn't change anything functionally.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ .../net/ethernet/stmicro/stmmac/stmmac_platform.c  | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -130,13 +130,18 @@ static int stmmac_probe_config_dt(struct
+ 	struct device_node *np = pdev->dev.of_node;
+ 	struct stmmac_dma_cfg *dma_cfg;
+ 	const struct of_device_id *device;
++	int ret;
+ 
+-	if (!np)
+-		return -ENODEV;
++	if (!np) {
++		ret = -ENODEV;
++		goto err;
++	}
+ 
+ 	device = of_match_device(stmmac_dt_ids, &pdev->dev);
+-	if (!device)
+-		return -ENODEV;
++	if (!device) {
++		ret = -ENODEV;
++		goto err;
++	}
+ 
+ 	if (device->data) {
+ 		const struct stmmac_of_data *data = device->data;
+@@ -236,8 +241,10 @@ static int stmmac_probe_config_dt(struct
+ 	if (of_find_property(np, "snps,pbl", NULL)) {
+ 		dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
+ 				       GFP_KERNEL);
+-		if (!dma_cfg)
+-			return -ENOMEM;
++		if (!dma_cfg) {
++			ret = -ENOMEM;
++			goto err;
++		}
+ 		plat->dma_cfg = dma_cfg;
+ 		of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
+ 		dma_cfg->fixed_burst =
+@@ -255,6 +262,9 @@ static int stmmac_probe_config_dt(struct
+ 	}
+ 
+ 	return 0;
++
++err:
++	return ret;
+ }
+ #else
+ static int stmmac_probe_config_dt(struct platform_device *pdev,
diff --git a/target/linux/ipq806x/patches-4.1/703-stmmac-add-fixed-link-device-tree-support.patch b/target/linux/ipq806x/patches-4.1/703-stmmac-add-fixed-link-device-tree-support.patch
new file mode 100644
index 0000000..a05875b
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/703-stmmac-add-fixed-link-device-tree-support.patch
@@ -0,0 +1,64 @@
+From 3a95f75867be562cb919ff23a738f70357188fbd Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Fri, 8 May 2015 16:02:03 -0700
+Subject: [PATCH 3/8] stmmac: add fixed-link device-tree support
+
+In case DT is used, this change adds the ability to the stmmac driver to
+detect a fixed-link PHY, instanciate it, and use it during
+phy_connect().
+
+Fixed link PHYs DT usage is described in:
+Documentation/devicetree/bindings/net/fixed-link.txt
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c     |  2 +-
+ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+@@ -856,7 +856,7 @@ static int stmmac_init_phy(struct net_de
+ 	 * device as well.
+ 	 * Note: phydev->phy_id is the result of reading the UID PHY registers.
+ 	 */
+-	if (phydev->phy_id == 0) {
++	if (!priv->plat->phy_node && phydev->phy_id == 0) {
+ 		phy_disconnect(phydev);
+ 		return -ENODEV;
+ 	}
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -177,6 +177,14 @@ static int stmmac_probe_config_dt(struct
+ 	/* If we find a phy-handle property, use it as the PHY */
+ 	plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
+ 
++	/* If phy-handle is not specified, check if we have a fixed-phy */
++	if (!plat->phy_node && of_phy_is_fixed_link(np)) {
++		if ((of_phy_register_fixed_link(np) < 0))
++			return -ENODEV;
++
++		plat->phy_node = of_node_get(np);
++	}
++
+ 	/* "snps,phy-addr" is not a standard property. Mark it as deprecated
+ 	 * and warn of its use. Remove this when phy node support is added.
+ 	 */
+@@ -243,7 +251,7 @@ static int stmmac_probe_config_dt(struct
+ 				       GFP_KERNEL);
+ 		if (!dma_cfg) {
+ 			ret = -ENOMEM;
+-			goto err;
++			goto err2;
+ 		}
+ 		plat->dma_cfg = dma_cfg;
+ 		of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
+@@ -263,6 +271,8 @@ static int stmmac_probe_config_dt(struct
+ 
+ 	return 0;
+ 
++err2:
++	of_node_put(np);
+ err:
+ 	return ret;
+ }
diff --git a/target/linux/ipq806x/patches-4.1/704-stmmac-add-ipq806x-glue-layer.patch b/target/linux/ipq806x/patches-4.1/704-stmmac-add-ipq806x-glue-layer.patch
new file mode 100644
index 0000000..7fd72be
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/704-stmmac-add-ipq806x-glue-layer.patch
@@ -0,0 +1,407 @@
+From 69fb970ad3fe05af7cb99ea78230c69c7ca0d03b Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Fri, 8 May 2015 16:10:22 -0700
+Subject: [PATCH 4/8] stmmac: add ipq806x glue layer
+
+The ethernet controller available in IPQ806x is a Synopsys DesignWare
+Gigabit MAC IP core, already supported by the stmmac driver.
+
+This glue layer implements some platform specific settings required to
+get the controller working on an IPQ806x based platform.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ drivers/net/ethernet/stmicro/stmmac/Kconfig        |   1 +
+ drivers/net/ethernet/stmicro/stmmac/Makefile       |   2 +-
+ drivers/net/ethernet/stmicro/stmmac/dwmac-ipq.c    | 324 +++++++++++++++++++++
+ .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   1 +
+ .../net/ethernet/stmicro/stmmac/stmmac_platform.h  |   1 +
+ 5 files changed, 328 insertions(+), 1 deletion(-)
+ create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-ipq.c
+
+--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
++++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
+@@ -16,6 +16,7 @@ if STMMAC_ETH
+ config STMMAC_PLATFORM
+ 	tristate "STMMAC Platform bus support"
+ 	depends on STMMAC_ETH
++	select MFD_SYSCON
+ 	default y
+ 	---help---
+ 	  This selects the platform specific bus support for the stmmac driver.
+--- a/drivers/net/ethernet/stmicro/stmmac/Makefile
++++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
+@@ -6,7 +6,7 @@ stmmac-objs:= stmmac_main.o stmmac_ethto
+ 
+ obj-$(CONFIG_STMMAC_PLATFORM) += stmmac-platform.o
+ stmmac-platform-objs:= stmmac_platform.o dwmac-meson.o dwmac-sunxi.o	\
+-		       dwmac-sti.o dwmac-socfpga.o dwmac-rk.o
++		       dwmac-sti.o dwmac-socfpga.o dwmac-rk.o dwmac-ipq806x.o
+ 
+ obj-$(CONFIG_STMMAC_PCI) += stmmac-pci.o
+ stmmac-pci-objs:= stmmac_pci.o
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -43,6 +43,7 @@ static const struct of_device_id stmmac_
+ 	{ .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
+ 	{ .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
+ 	{ .compatible = "altr,socfpga-stmmac", .data = &socfpga_gmac_data },
++	{ .compatible = "qcom,ipq806x-gmac", .data = &ipq806x_gmac_data },
+ 	{ .compatible = "st,spear600-gmac"},
+ 	{ .compatible = "snps,dwmac-3.610"},
+ 	{ .compatible = "snps,dwmac-3.70a"},
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
+@@ -25,5 +25,6 @@ extern const struct stmmac_of_data stih4
+ extern const struct stmmac_of_data stid127_dwmac_data;
+ extern const struct stmmac_of_data socfpga_gmac_data;
+ extern const struct stmmac_of_data rk3288_gmac_data;
++extern const struct stmmac_of_data ipq806x_gmac_data;
+ 
+ #endif /* __STMMAC_PLATFORM_H__ */
+--- /dev/null
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
+@@ -0,0 +1,343 @@
++/*
++ * Qualcomm Atheros IPQ806x GMAC glue layer
++ *
++ * Copyright (C) 2015 The Linux Foundation
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#include <linux/device.h>
++#include <linux/platform_device.h>
++#include <linux/phy.h>
++#include <linux/regmap.h>
++#include <linux/clk.h>
++#include <linux/reset.h>
++#include <linux/of_net.h>
++#include <linux/mfd/syscon.h>
++#include <linux/stmmac.h>
++#include <linux/of_mdio.h>
++
++#include "stmmac_platform.h"
++
++#define NSS_COMMON_CLK_GATE			0x8
++#define NSS_COMMON_CLK_GATE_PTP_EN(x)		BIT(0x10 + x)
++#define NSS_COMMON_CLK_GATE_RGMII_RX_EN(x)	BIT(0x9 + (x * 2))
++#define NSS_COMMON_CLK_GATE_RGMII_TX_EN(x)	BIT(0x8 + (x * 2))
++#define NSS_COMMON_CLK_GATE_GMII_RX_EN(x)	BIT(0x4 + x)
++#define NSS_COMMON_CLK_GATE_GMII_TX_EN(x)	BIT(0x0 + x)
++
++#define NSS_COMMON_CLK_DIV0			0xC
++#define NSS_COMMON_CLK_DIV_OFFSET(x)		(x * 8)
++#define NSS_COMMON_CLK_DIV_MASK			0x7f
++
++#define NSS_COMMON_CLK_SRC_CTRL			0x14
++#define NSS_COMMON_CLK_SRC_CTRL_OFFSET(x)	(1 << x)
++/* Mode is coded on 1 bit but is different depending on the MAC ID:
++ * MAC0: QSGMII=0 RGMII=1
++ * MAC1: QSGMII=0 SGMII=0 RGMII=1
++ * MAC2 & MAC3: QSGMII=0 SGMII=1
++ */
++#define NSS_COMMON_CLK_SRC_CTRL_RGMII(x)	1
++#define NSS_COMMON_CLK_SRC_CTRL_SGMII(x)	((x >= 2) ? 1 : 0)
++
++#define NSS_COMMON_MACSEC_CTL			0x28
++#define NSS_COMMON_MACSEC_CTL_EXT_BYPASS_EN(x)	(1 << x)
++
++#define NSS_COMMON_GMAC_CTL(x)			(0x30 + (x * 4))
++#define NSS_COMMON_GMAC_CTL_CSYS_REQ		BIT(19)
++#define NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL	BIT(16)
++#define NSS_COMMON_GMAC_CTL_IFG_LIMIT_OFFSET	8
++#define NSS_COMMON_GMAC_CTL_IFG_OFFSET		0
++#define NSS_COMMON_GMAC_CTL_IFG_MASK		0x3f
++
++#define NSS_COMMON_CLK_DIV_RGMII_1000		1
++#define NSS_COMMON_CLK_DIV_RGMII_100		9
++#define NSS_COMMON_CLK_DIV_RGMII_10		99
++#define NSS_COMMON_CLK_DIV_SGMII_1000		0
++#define NSS_COMMON_CLK_DIV_SGMII_100		4
++#define NSS_COMMON_CLK_DIV_SGMII_10		49
++
++#define QSGMII_PCS_MODE_CTL			0x68
++#define QSGMII_PCS_MODE_CTL_AUTONEG_EN(x)	BIT((x * 8) + 7)
++
++#define QSGMII_PCS_CAL_LCKDT_CTL		0x120
++#define QSGMII_PCS_CAL_LCKDT_CTL_RST		BIT(19)
++
++/* Only GMAC1/2/3 support SGMII and their CTL register are not contiguous */
++#define QSGMII_PHY_SGMII_CTL(x)			((x == 1) ? 0x134 : \
++						 (0x13c + (4 * (x - 2))))
++#define QSGMII_PHY_CDR_EN			BIT(0)
++#define QSGMII_PHY_RX_FRONT_EN			BIT(1)
++#define QSGMII_PHY_RX_SIGNAL_DETECT_EN		BIT(2)
++#define QSGMII_PHY_TX_DRIVER_EN			BIT(3)
++#define QSGMII_PHY_QSGMII_EN			BIT(7)
++#define QSGMII_PHY_PHASE_LOOP_GAIN_OFFSET	12
++#define QSGMII_PHY_PHASE_LOOP_GAIN_MASK		0x7
++#define QSGMII_PHY_RX_DC_BIAS_OFFSET		18
++#define QSGMII_PHY_RX_DC_BIAS_MASK		0x3
++#define QSGMII_PHY_RX_INPUT_EQU_OFFSET		20
++#define QSGMII_PHY_RX_INPUT_EQU_MASK		0x3
++#define QSGMII_PHY_CDR_PI_SLEW_OFFSET		22
++#define QSGMII_PHY_CDR_PI_SLEW_MASK		0x3
++#define QSGMII_PHY_TX_DRV_AMP_OFFSET		28
++#define QSGMII_PHY_TX_DRV_AMP_MASK		0xf
++
++struct ipq806x_gmac {
++	struct platform_device *pdev;
++	struct regmap *nss_common;
++	struct regmap *qsgmii_csr;
++	uint32_t id;
++	struct clk *core_clk;
++	phy_interface_t phy_mode;
++};
++
++static int get_clk_div_sgmii(struct ipq806x_gmac *gmac, unsigned int speed)
++{
++	struct device *dev = &gmac->pdev->dev;
++	int div;
++
++	switch (speed) {
++	case SPEED_1000:
++		div = NSS_COMMON_CLK_DIV_SGMII_1000;
++		break;
++
++	case SPEED_100:
++		div = NSS_COMMON_CLK_DIV_SGMII_100;
++		break;
++
++	case SPEED_10:
++		div = NSS_COMMON_CLK_DIV_SGMII_10;
++		break;
++
++	default:
++		dev_err(dev, "Speed %dMbps not supported in SGMII\n", speed);
++		return -EINVAL;
++	}
++
++	return div;
++}
++
++static int get_clk_div_rgmii(struct ipq806x_gmac *gmac, unsigned int speed)
++{
++	struct device *dev = &gmac->pdev->dev;
++	int div;
++
++	switch (speed) {
++	case SPEED_1000:
++		div = NSS_COMMON_CLK_DIV_RGMII_1000;
++		break;
++
++	case SPEED_100:
++		div = NSS_COMMON_CLK_DIV_RGMII_100;
++		break;
++
++	case SPEED_10:
++		div = NSS_COMMON_CLK_DIV_RGMII_10;
++		break;
++
++	default:
++		dev_err(dev, "Speed %dMbps not supported in RGMII\n", speed);
++		return -EINVAL;
++	}
++
++	return div;
++}
++
++static int ipq806x_gmac_set_speed(struct ipq806x_gmac *gmac, unsigned int speed)
++{
++	uint32_t clk_bits, val;
++	int div;
++
++	switch (gmac->phy_mode) {
++	case PHY_INTERFACE_MODE_RGMII:
++		div = get_clk_div_rgmii(gmac, speed);
++		clk_bits = NSS_COMMON_CLK_GATE_RGMII_RX_EN(gmac->id) |
++			   NSS_COMMON_CLK_GATE_RGMII_TX_EN(gmac->id);
++		break;
++
++	case PHY_INTERFACE_MODE_SGMII:
++		div = get_clk_div_sgmii(gmac, speed);
++		clk_bits = NSS_COMMON_CLK_GATE_GMII_RX_EN(gmac->id) |
++			   NSS_COMMON_CLK_GATE_GMII_TX_EN(gmac->id);
++		break;
++
++	default:
++		dev_err(&gmac->pdev->dev, "Unsupported PHY mode: \"%s\"\n",
++			phy_modes(gmac->phy_mode));
++		return -EINVAL;
++	}
++
++	/* Disable the clocks */
++	regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
++	val &= ~clk_bits;
++	regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
++
++	/* Set the divider */
++	regmap_read(gmac->nss_common, NSS_COMMON_CLK_DIV0, &val);
++	val &= ~(NSS_COMMON_CLK_DIV_MASK
++		 << NSS_COMMON_CLK_DIV_OFFSET(gmac->id));
++	val |= div << NSS_COMMON_CLK_DIV_OFFSET(gmac->id);
++	regmap_write(gmac->nss_common, NSS_COMMON_CLK_DIV0, val);
++
++	/* Enable the clock back */
++	regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
++	val |= clk_bits;
++	regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
++
++	return 0;
++}
++
++static void *ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
++{
++	struct device *dev = &gmac->pdev->dev;
++
++	gmac->phy_mode = of_get_phy_mode(dev->of_node);
++	if (gmac->phy_mode < 0) {
++		dev_err(dev, "missing phy mode property\n");
++		return ERR_PTR(-EINVAL);
++	}
++
++	if (of_property_read_u32(dev->of_node, "qcom,id", &gmac->id) < 0) {
++		dev_err(dev, "missing qcom id property\n");
++		return ERR_PTR(-EINVAL);
++	}
++
++	/* The GMACs are called 1 to 4 in the documentation, but to simplify the
++	 * code and keep it consistent with the Linux convention, we'll number
++	 * them from 0 to 3 here.
++	 */
++	if (gmac->id < 0 || gmac->id > 3) {
++		dev_err(dev, "invalid gmac id\n");
++		return ERR_PTR(-EINVAL);
++	}
++
++	gmac->core_clk = devm_clk_get(dev, "stmmaceth");
++	if (IS_ERR(gmac->core_clk)) {
++		dev_err(dev, "missing stmmaceth clk property\n");
++		return gmac->core_clk;
++	}
++	clk_set_rate(gmac->core_clk, 266000000);
++
++	/* Setup the register map for the nss common registers */
++	gmac->nss_common = syscon_regmap_lookup_by_phandle(dev->of_node,
++							   "qcom,nss-common");
++	if (IS_ERR(gmac->nss_common)) {
++		dev_err(dev, "missing nss-common node\n");
++		return gmac->nss_common;
++	}
++
++	/* Setup the register map for the qsgmii csr registers */
++	gmac->qsgmii_csr = syscon_regmap_lookup_by_phandle(dev->of_node,
++							   "qcom,qsgmii-csr");
++	if (IS_ERR(gmac->qsgmii_csr)) {
++		dev_err(dev, "missing qsgmii-csr node\n");
++		return gmac->qsgmii_csr;
++	}
++
++	return NULL;
++}
++
++static void *ipq806x_gmac_setup(struct platform_device *pdev)
++{
++	struct device *dev = &pdev->dev;
++	struct ipq806x_gmac *gmac;
++	int val;
++	void *err;
++
++	gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL);
++	if (!gmac)
++		return ERR_PTR(-ENOMEM);
++
++	gmac->pdev = pdev;
++
++	err = ipq806x_gmac_of_parse(gmac);
++	if (err) {
++		dev_err(dev, "device tree parsing error\n");
++		return err;
++	}
++
++	regmap_write(gmac->qsgmii_csr, QSGMII_PCS_CAL_LCKDT_CTL,
++		     QSGMII_PCS_CAL_LCKDT_CTL_RST);
++
++	/* Inter frame gap is set to 12 */
++	val = 12 << NSS_COMMON_GMAC_CTL_IFG_OFFSET |
++	      12 << NSS_COMMON_GMAC_CTL_IFG_LIMIT_OFFSET;
++	/* We also initiate an AXI low power exit request */
++	val |= NSS_COMMON_GMAC_CTL_CSYS_REQ;
++	switch (gmac->phy_mode) {
++	case PHY_INTERFACE_MODE_RGMII:
++		val |= NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL;
++		break;
++	case PHY_INTERFACE_MODE_SGMII:
++		val &= ~NSS_COMMON_GMAC_CTL_PHY_IFACE_SEL;
++		break;
++	default:
++		dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n",
++			phy_modes(gmac->phy_mode));
++		return NULL;
++	}
++	regmap_write(gmac->nss_common, NSS_COMMON_GMAC_CTL(gmac->id), val);
++
++	/* Configure the clock src according to the mode */
++	regmap_read(gmac->nss_common, NSS_COMMON_CLK_SRC_CTRL, &val);
++	val &= ~NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id);
++	switch (gmac->phy_mode) {
++	case PHY_INTERFACE_MODE_RGMII:
++		val |= NSS_COMMON_CLK_SRC_CTRL_RGMII(gmac->id) <<
++			NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id);
++		break;
++	case PHY_INTERFACE_MODE_SGMII:
++		val |= NSS_COMMON_CLK_SRC_CTRL_SGMII(gmac->id) <<
++			NSS_COMMON_CLK_SRC_CTRL_OFFSET(gmac->id);
++		break;
++	default:
++		dev_err(&pdev->dev, "Unsupported PHY mode: \"%s\"\n",
++			phy_modes(gmac->phy_mode));
++		return NULL;
++	}
++	regmap_write(gmac->nss_common, NSS_COMMON_CLK_SRC_CTRL, val);
++
++	/* Enable PTP clock */
++	regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val);
++	val |= NSS_COMMON_CLK_GATE_PTP_EN(gmac->id);
++	regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val);
++
++	if (gmac->phy_mode == PHY_INTERFACE_MODE_SGMII) {
++		regmap_write(gmac->qsgmii_csr, QSGMII_PHY_SGMII_CTL(gmac->id),
++			     QSGMII_PHY_CDR_EN |
++			     QSGMII_PHY_RX_FRONT_EN |
++			     QSGMII_PHY_RX_SIGNAL_DETECT_EN |
++			     QSGMII_PHY_TX_DRIVER_EN |
++			     QSGMII_PHY_QSGMII_EN |
++			     0x4 << QSGMII_PHY_PHASE_LOOP_GAIN_OFFSET |
++			     0x3 << QSGMII_PHY_RX_DC_BIAS_OFFSET |
++			     0x1 << QSGMII_PHY_RX_INPUT_EQU_OFFSET |
++			     0x2 << QSGMII_PHY_CDR_PI_SLEW_OFFSET |
++			     0xC << QSGMII_PHY_TX_DRV_AMP_OFFSET);
++	}
++
++	return gmac;
++}
++
++static void ipq806x_gmac_fix_mac_speed(void *priv, unsigned int speed)
++{
++	struct ipq806x_gmac *gmac = priv;
++
++	ipq806x_gmac_set_speed(gmac, speed);
++}
++
++const struct stmmac_of_data ipq806x_gmac_data = {
++	.has_gmac	= 1,
++	.setup		= ipq806x_gmac_setup,
++	.fix_mac_speed	= ipq806x_gmac_fix_mac_speed,
++};
diff --git a/target/linux/ipq806x/patches-4.1/705-net-stmmac-ipq806x-document-device-tree-bindings.patch b/target/linux/ipq806x/patches-4.1/705-net-stmmac-ipq806x-document-device-tree-bindings.patch
new file mode 100644
index 0000000..3144fa3
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/705-net-stmmac-ipq806x-document-device-tree-bindings.patch
@@ -0,0 +1,52 @@
+From 0f9605d9409b77a89daef91cc68239fc2ff50457 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Fri, 8 May 2015 16:51:25 -0700
+Subject: [PATCH 5/8] net: stmmac: ipq806x: document device tree bindings
+
+Add the device tree bindings documentation for the QCA IPQ806x
+variant of the Synopsys DesignWare MAC.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ .../devicetree/bindings/net/ipq806x-dwmac.txt      | 35 ++++++++++++++++++++++
+ 1 file changed, 35 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/net/ipq806x-dwmac.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/net/ipq806x-dwmac.txt
+@@ -0,0 +1,35 @@
++* IPQ806x DWMAC Ethernet controller
++
++The device inherits all the properties of the dwmac/stmmac devices
++described in the file net/stmmac.txt with the following changes.
++
++Required properties:
++
++- compatible: should be "qcom,ipq806x-gmac" along with "snps,dwmac"
++	      and any applicable more detailed version number
++	      described in net/stmmac.txt
++
++- qcom,nss-common: should contain a phandle to a syscon device mapping the
++		   nss-common registers.
++
++- qcom,qsgmii-csr: should contain a phandle to a syscon device mapping the
++		   qsgmii-csr registers.
++
++Example:
++
++	gmac: ethernet at 37000000 {
++		device_type = "network";
++		compatible = "qcom,ipq806x-gmac";
++		reg = <0x37000000 0x200000>;
++		interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
++		interrupt-names = "macirq";
++
++		qcom,nss-common = <&nss_common>;
++		qcom,qsgmii-csr = <&qsgmii_csr>;
++
++		clocks = <&gcc GMAC_CORE1_CLK>;
++		clock-names = "stmmaceth";
++
++		resets = <&gcc GMAC_CORE1_RESET>;
++		reset-names = "stmmaceth";
++	};
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
new file mode 100644
index 0000000..20d8502
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -0,0 +1,145 @@
+From e81de9d28bd0421c236df322872e64edf4ee1852 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Mon, 11 May 2015 16:32:09 -0700
+Subject: [PATCH 7/8] ARM: dts: qcom: add mdio nodes to ap148 & db149
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 40 ++++++++++++++++++++++++++-
+ arch/arm/boot/dts/qcom-ipq8064-db149.dts | 46 ++++++++++++++++++++++++++++++++
+ 2 files changed, 85 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -14,8 +14,9 @@
+ 		};
+ 	};
+ 
+-	alias {
++	aliases {
+ 		serial0 = &uart4;
++		mdio-gpio0 = &mdio0;
+ 	};
+ 
+ 	chosen {
+@@ -54,6 +55,15 @@
+ 					bias-none;
+ 				};
+ 			};
++
++			mdio0_pins: mdio0_pins {
++				mux {
++					pins = "gpio0", "gpio1";
++					function = "gpio";
++					drive-strength = <8>;
++					bias-disable;
++				};
++			};
+ 		};
+ 
+ 		gsbi at 16300000 {
+@@ -139,5 +149,33 @@
+ 			pinctrl-0 = <&pcie2_pins>;
+ 			pinctrl-names = "default";
+ 		};
++
++		mdio0: mdio {
++			compatible = "virtual,mdio-gpio";
++			#address-cells = <1>;
++			#size-cells = <0>;
++			gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
++			pinctrl-0 = <&mdio0_pins>;
++			pinctrl-names = "default";
++
++			phy0: ethernet-phy at 0 {
++				device_type = "ethernet-phy";
++				reg = <0>;
++				qca,ar8327-initvals = <
++					0x00004 0x7600000   /* PAD0_MODE */
++					0x00008 0x1000000   /* PAD5_MODE */
++					0x0000c 0x80        /* PAD6_MODE */
++					0x000e4 0xaa545     /* MAC_POWER_SEL */
++					0x000e0 0xc74164de  /* SGMII_CTRL */
++					0x0007c 0x4e        /* PORT0_STATUS */
++					0x00094 0x4e        /* PORT6_STATUS */
++					>;
++			};
++
++			phy4: ethernet-phy at 4 {
++				device_type = "ethernet-phy";
++				reg = <4>;
++			};
++		};
+ 	};
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
+@@ -16,6 +16,7 @@
+ 
+ 	alias {
+ 		serial0 = &uart2;
++		mdio-gpio0 = &mdio0;
+ 	};
+ 
+ 	chosen {
+@@ -62,6 +63,15 @@
+ 					bias-none;
+ 				};
+ 			};
++
++			mdio0_pins: mdio0_pins {
++				mux {
++					pins = "gpio0", "gpio1";
++					function = "gpio";
++					drive-strength = <8>;
++					bias-disable;
++				};
++			};
+ 		};
+ 
+ 		gsbi2: gsbi at 12480000 {
+@@ -173,5 +183,44 @@
+ 			pinctrl-0 = <&pcie3_pins>;
+ 			pinctrl-names = "default";
+ 		};
++
++		mdio0: mdio {
++			compatible = "virtual,mdio-gpio";
++			#address-cells = <1>;
++			#size-cells = <0>;
++			gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
++
++			pinctrl-0 = <&mdio0_pins>;
++			pinctrl-names = "default";
++
++			phy0: ethernet-phy at 0 {
++				device_type = "ethernet-phy";
++				reg = <0>;
++				qca,ar8327-initvals = <
++					0x00004 0x7600000   /* PAD0_MODE */
++					0x00008 0x1000000   /* PAD5_MODE */
++					0x0000c 0x80        /* PAD6_MODE */
++					0x000e4 0xaa545     /* MAC_POWER_SEL */
++					0x000e0 0xc74164de  /* SGMII_CTRL */
++					0x0007c 0x4e        /* PORT0_STATUS */
++					0x00094 0x4e        /* PORT6_STATUS */
++				>;
++			};
++
++			phy4: ethernet-phy at 4 {
++				device_type = "ethernet-phy";
++				reg = <4>;
++			};
++
++			phy6: ethernet-phy at 6 {
++				device_type = "ethernet-phy";
++				reg = <6>;
++			};
++
++			phy7: ethernet-phy at 7 {
++				device_type = "ethernet-phy";
++				reg = <7>;
++			};
++		};
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
new file mode 100644
index 0000000..de68678
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -0,0 +1,210 @@
+From cab1f4720e82f2e17eaeed9a9ad9e4f07c742977 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Mon, 11 May 2015 12:29:18 -0700
+Subject: [PATCH 8/8] ARM: dts: qcom: add gmac nodes to ipq806x platforms
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 31 ++++++++++++
+ arch/arm/boot/dts/qcom-ipq8064-db149.dts | 43 ++++++++++++++++
+ arch/arm/boot/dts/qcom-ipq8064.dtsi      | 86 ++++++++++++++++++++++++++++++++
+ 3 files changed, 160 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -64,6 +64,16 @@
+ 					bias-disable;
+ 				};
+ 			};
++
++			rgmii2_pins: rgmii2_pins {
++				mux {
++					pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
++					       "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
++					function = "rgmii2";
++					drive-strength = <8>;
++					bias-disable;
++				};
++			};
+ 		};
+ 
+ 		gsbi at 16300000 {
+@@ -177,5 +187,26 @@
+ 				reg = <4>;
+ 			};
+ 		};
++
++		gmac1: ethernet at 37200000 {
++			status = "ok";
++			phy-mode = "rgmii";
++			phy-handle = <&phy4>;
++			qcom,id = <1>;
++
++			pinctrl-0 = <&rgmii2_pins>;
++			pinctrl-names = "default";
++		};
++
++		gmac2: ethernet at 37400000 {
++			status = "ok";
++			phy-mode = "sgmii";
++			qcom,id = <2>;
++
++			fixed-link {
++				speed = <1000>;
++				full-duplex;
++			};
++		};
+ 	};
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
+@@ -72,6 +72,14 @@
+ 					bias-disable;
+ 				};
+ 			};
++
++			rgmii0_pins: rgmii0_pins {
++				mux {
++					pins = "gpio2", "gpio66";
++					drive-strength = <8>;
++					bias-disable;
++				};
++			};
+ 		};
+ 
+ 		gsbi2: gsbi at 12480000 {
+@@ -222,5 +230,40 @@
+ 				reg = <7>;
+ 			};
+ 		};
++
++		gmac0: ethernet at 37000000 {
++			status = "ok";
++			phy-mode = "rgmii";
++			qcom,id = <0>;
++			phy-handle = <&phy4>;
++
++			pinctrl-0 = <&rgmii0_pins>;
++			pinctrl-names = "default";
++		};
++
++		gmac1: ethernet at 37200000 {
++			status = "ok";
++			phy-mode = "sgmii";
++			qcom,id = <1>;
++
++			fixed-link {
++				speed = <1000>;
++				full-duplex;
++			};
++		};
++
++		gmac2: ethernet at 37400000 {
++			status = "ok";
++			phy-mode = "sgmii";
++			qcom,id = <2>;
++			phy-handle = <&phy6>;
++		};
++
++		gmac3: ethernet at 37600000 {
++			status = "ok";
++			phy-mode = "sgmii";
++			qcom,id = <3>;
++			phy-handle = <&phy7>;
++		};
+ 	};
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -578,5 +578,91 @@
+ 			status = "disabled";
+ 		};
+ 
++		nss_common: syscon at 03000000 {
++			compatible = "syscon";
++			reg = <0x03000000 0x0000FFFF>;
++		};
++
++		qsgmii_csr: syscon at 1bb00000 {
++			compatible = "syscon";
++			reg = <0x1bb00000 0x000001FF>;
++		};
++
++		gmac0: ethernet at 37000000 {
++			device_type = "network";
++			compatible = "qcom,ipq806x-gmac";
++			reg = <0x37000000 0x200000>;
++			interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
++			interrupt-names = "macirq";
++
++			qcom,nss-common = <&nss_common>;
++			qcom,qsgmii-csr = <&qsgmii_csr>;
++
++			clocks = <&gcc GMAC_CORE1_CLK>;
++			clock-names = "stmmaceth";
++
++			resets = <&gcc GMAC_CORE1_RESET>;
++			reset-names = "stmmaceth";
++
++			status = "disabled";
++		};
++
++		gmac1: ethernet at 37200000 {
++			device_type = "network";
++			compatible = "qcom,ipq806x-gmac";
++			reg = <0x37200000 0x200000>;
++			interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
++			interrupt-names = "macirq";
++
++			qcom,nss-common = <&nss_common>;
++			qcom,qsgmii-csr = <&qsgmii_csr>;
++
++			clocks = <&gcc GMAC_CORE2_CLK>;
++			clock-names = "stmmaceth";
++
++			resets = <&gcc GMAC_CORE2_RESET>;
++			reset-names = "stmmaceth";
++
++			status = "disabled";
++		};
++
++		gmac2: ethernet at 37400000 {
++			device_type = "network";
++			compatible = "qcom,ipq806x-gmac";
++			reg = <0x37400000 0x200000>;
++			interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
++			interrupt-names = "macirq";
++
++			qcom,nss-common = <&nss_common>;
++			qcom,qsgmii-csr = <&qsgmii_csr>;
++
++			clocks = <&gcc GMAC_CORE3_CLK>;
++			clock-names = "stmmaceth";
++
++			resets = <&gcc GMAC_CORE3_RESET>;
++			reset-names = "stmmaceth";
++
++			status = "disabled";
++		};
++
++		gmac3: ethernet at 37600000 {
++			device_type = "network";
++			compatible = "qcom,ipq806x-gmac";
++			reg = <0x37600000 0x200000>;
++			interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
++			interrupt-names = "macirq";
++
++			qcom,nss-common = <&nss_common>;
++			qcom,qsgmii-csr = <&qsgmii_csr>;
++
++			clocks = <&gcc GMAC_CORE4_CLK>;
++			clock-names = "stmmaceth";
++
++			resets = <&gcc GMAC_CORE4_RESET>;
++			reset-names = "stmmaceth";
++
++			status = "disabled";
++		};
++
+ 	};
+ };
-- 
2.1.4

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Tue Aug  4 17:55:30 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Tue,  4 Aug 2015 14:55:30 -0700
Subject: [OpenWrt-Devel] [PATCH 2/4] ipq806x: add support for non-dt enabled
	ap148 bootloader
In-Reply-To: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>
References: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438725332-19984-2-git-send-email-mathieu@codeaurora.org>

Certain AP148 platforms (and derivative) use bootloaders which did not
have DT enabled.
In order to support these old platforms, we'll now make the following
modifications:
*explicitely add the memory node in the AP148 DT: this used to be added
 by new u-boot through a run-time patch mechanism. We'll now add it
 explicitely so it works on boots which don't support that feature. New
 boots will have the node twice, the second one will be ignored.
*add the zImage generation next to the FIT image for AP148.

Other platforms using non-DT enabled bootloaders may want to leverage
this zImage code to generate their own firmare as well.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/image/Makefile                        | 10 ++++++++++
 .../ipq806x/patches-3.18/024-ap148-add-memory-node.patch   | 14 ++++++++++++++
 .../ipq806x/patches-4.1/024-ap148-add-memory-node.patch    | 14 ++++++++++++++
 ...-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  4 ++--
 ...-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch |  4 ++--
 .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch   |  6 +++---
 ...-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  4 ++--
 7 files changed, 47 insertions(+), 9 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch

diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index 9a1bad8..99e9811 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -8,6 +8,15 @@ UBINIZE_OPTS = -m 2048 -p 128KiB
 
 E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024)))
 
+define Image/BuildKernel/zImage
+	cat $(KDIR)/zImage $(LINUX_DIR)/arch/arm/boot/dts/$(1).dtb > $(KDIR)/zImage-$(1)
+	$(CP) $(KDIR)/zImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-zImage
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+	cat $(KDIR)/zImage-initramfs $(LINUX_DIR)/arch/arm/boot/dts/$(1).dtb > $(KDIR)/zImage-initramfs-$(1)
+	$(CP) $(KDIR)/zImage-initramfs-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-zImage-initramfs
+endif
+endef
+
 define Image/BuildKernel/FIT
 	gzip -9n -c $(KDIR)/Image > $(KDIR)/Image.gz
 	$(call CompressLzma,$(KDIR)/Image,$(KDIR)/Image.gz)
@@ -26,6 +35,7 @@ endef
 define Image/BuildKernel
 	$(CP) $(KDIR)/$(IMG_PREFIX)-vmlinux.elf $(BIN_DIR)
 	$(call Image/BuildKernel/FIT,qcom-ipq8064-ap148)
+	$(call Image/BuildKernel/zImage,qcom-ipq8064-ap148)
 	$(call Image/BuildKernel/FIT,qcom-ipq8064-db149)
 endef
 
diff --git a/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch b/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch
new file mode 100644
index 0000000..f026ed9
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch
@@ -0,0 +1,14 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -4,6 +4,11 @@
+ 	model = "Qualcomm IPQ8064/AP148";
+ 	compatible = "qcom,ipq8064-ap148", "qcom,ipq8064";
+ 
++	memory at 0 {
++		reg = <0x42000000 0x1e000000>;
++		device_type = "memory";
++	};
++
+ 	reserved-memory {
+ 		#address-cells = <1>;
+ 		#size-cells = <1>;
diff --git a/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch b/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch
new file mode 100644
index 0000000..f026ed9
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch
@@ -0,0 +1,14 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -4,6 +4,11 @@
+ 	model = "Qualcomm IPQ8064/AP148";
+ 	compatible = "qcom,ipq8064-ap148", "qcom,ipq8064";
+ 
++	memory at 0 {
++		reg = <0x42000000 0x1e000000>;
++		device_type = "memory";
++	};
++
+ 	reserved-memory {
+ 		#address-cells = <1>;
+ 		#size-cells = <1>;
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index e7de2bb..e494d32 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -15,7 +15,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -30,6 +30,22 @@
+@@ -35,6 +35,22 @@
  				bias-disable;
  			};
  
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -109,5 +125,19 @@
+@@ -114,5 +130,19 @@
  		sata at 29000000 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
index 46feec3..9435de6 100644
--- a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
+++ b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
@@ -37,7 +37,7 @@
  		};
  	};
  
-@@ -195,6 +213,46 @@
+@@ -72,6 +90,46 @@
  		};
  	};
  
@@ -84,7 +84,7 @@
  	soc: soc {
  		#address-cells = <1>;
  		#size-cells = <1>;
-@@ -310,11 +368,13 @@
+@@ -187,11 +245,13 @@
  		acc0: clock-controller at 2088000 {
  			compatible = "qcom,kpss-acc-v1";
  			reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 20d8502..846f738 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -11,7 +11,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -14,8 +14,9 @@
+@@ -19,8 +19,9 @@
  		};
  	};
  
@@ -22,7 +22,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  	};
  
  	chosen {
-@@ -54,6 +55,15 @@
+@@ -59,6 +60,15 @@
  					bias-none;
  				};
  			};
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -139,5 +149,33 @@
+@@ -144,5 +154,33 @@
  			pinctrl-0 = <&pcie2_pins>;
  			pinctrl-names = "default";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index de68678..8019713 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -64,6 +64,16 @@
+@@ -69,6 +69,16 @@
  					bias-disable;
  				};
  			};
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -177,5 +187,26 @@
+@@ -182,5 +192,26 @@
  				reg = <4>;
  			};
  		};
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Tue Aug  4 17:55:31 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Tue,  4 Aug 2015 14:55:31 -0700
Subject: [OpenWrt-Devel] [PATCH 3/4] ipq806x: fix pcie pinmux naming in
	ipq806x dts
In-Reply-To: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>
References: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438725332-19984-3-git-send-email-mathieu@codeaurora.org>

PCIe controller nodes are numbers 0/1/2 in the chipset dtsi file, but
the pinmux nodes are numbers 1/2/3. We'll make it consistent by changing
the pinmux numbering to match the controller's one.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 31 +++++++++-------------
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch | 10 +++----
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch | 13 ++++-----
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 25 +++++++++--------
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  4 +--
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  6 ++---
 6 files changed, 41 insertions(+), 48 deletions(-)

diff --git a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 80ac25f..bdc91fb 100644
--- a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -15,11 +15,11 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -30,6 +30,22 @@
+@@ -35,6 +35,22 @@
  				bias-disable;
  			};
  
-+			pcie1_pins: pcie1_pinmux {
++			pcie0_pins: pcie0_pinmux {
 +				mux {
 +					pins = "gpio3";
 +					drive-strength = <2>;
@@ -27,7 +27,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +				};
 +			};
 +
-+			pcie2_pins: pcie2_pinmux {
++			pcie1_pins: pcie1_pinmux {
 +				mux {
 +					pins = "gpio48";
 +					drive-strength = <2>;
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -133,5 +149,19 @@
+@@ -138,5 +154,19 @@
  		usb30 at 1 {
  			status = "ok";
  		};
@@ -46,14 +46,14 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		pcie0: pci at 1b500000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 3 0>;
-+			pinctrl-0 = <&pcie1_pins>;
++			pinctrl-0 = <&pcie0_pins>;
 +			pinctrl-names = "default";
 +		};
 +
 +		pcie1: pci at 1b700000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 48 0>;
-+			pinctrl-0 = <&pcie2_pins>;
++			pinctrl-0 = <&pcie1_pins>;
 +			pinctrl-names = "default";
 +		};
  	};
@@ -64,7 +64,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  				bias-disable;
  			};
  
-+			pcie1_pins: pcie1_pinmux {
++			pcie0_pins: pcie0_pinmux {
 +				mux {
 +					pins = "gpio3";
 +					drive-strength = <2>;
@@ -72,7 +72,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +				};
 +			};
 +
-+			pcie2_pins: pcie2_pinmux {
++			pcie1_pins: pcie1_pinmux {
 +				mux {
 +					pins = "gpio48";
 +					drive-strength = <2>;
@@ -80,7 +80,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +				};
 +			};
 +
-+			pcie3_pins: pcie3_pinmux {
++			pcie2_pins: pcie2_pinmux {
 +				mux {
 +					pins = "gpio63";
 +					drive-strength = <2>;
@@ -99,21 +99,21 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		pcie0: pci at 1b500000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 3 0>;
-+			pinctrl-0 = <&pcie1_pins>;
++			pinctrl-0 = <&pcie0_pins>;
 +			pinctrl-names = "default";
 +		};
 +
 +		pcie1: pci at 1b700000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 48 0>;
-+			pinctrl-0 = <&pcie2_pins>;
++			pinctrl-0 = <&pcie1_pins>;
 +			pinctrl-names = "default";
 +		};
 +
 +		pcie2: pci at 1b900000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 63 0>;
-+			pinctrl-0 = <&pcie3_pins>;
++			pinctrl-0 = <&pcie2_pins>;
 +			pinctrl-names = "default";
 +		};
  	};
@@ -259,10 +259,3 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		hs_phy_1: phy at 100f8800 {
  			compatible = "qcom,dwc3-hs-usb-phy";
  			reg = <0x100f8800 0x30>;
-@@ -389,6 +514,5 @@
- 				dr_mode = "host";
- 			};
- 		};
--
- 	};
- };
diff --git a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 809d743..851682a 100644
--- a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -11,7 +11,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -14,8 +14,9 @@
+@@ -19,8 +19,9 @@
  		};
  	};
  
@@ -22,7 +22,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  	};
  
  	chosen {
-@@ -54,6 +55,15 @@
+@@ -59,6 +60,15 @@
  					bias-none;
  				};
  			};
@@ -38,8 +38,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -163,5 +173,33 @@
- 			pinctrl-0 = <&pcie2_pins>;
+@@ -168,5 +178,33 @@
+ 			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
 +
@@ -99,7 +99,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  		gsbi2: gsbi at 12480000 {
 @@ -173,5 +183,44 @@
- 			pinctrl-0 = <&pcie3_pins>;
+ 			pinctrl-0 = <&pcie2_pins>;
  			pinctrl-names = "default";
  		};
 +
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index cce30b0..8d6e77a 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -64,6 +64,16 @@
+@@ -69,6 +69,16 @@
  					bias-disable;
  				};
  			};
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -201,5 +211,26 @@
+@@ -206,5 +216,26 @@
  				reg = <4>;
  			};
  		};
@@ -116,9 +116,9 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -638,5 +638,91 @@
- 				dr_mode = "host";
- 			};
+@@ -87,6 +87,92 @@
+ 			clock-frequency = <32768>;
+ 			#clock-cells = <0>;
  		};
 +
 +		nss_common: syscon at 03000000 {
@@ -207,4 +207,5 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			status = "disabled";
 +		};
  	};
- };
+ 
+ 	kraitcc: clock-controller {
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index e494d32..df96ad5 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -19,7 +19,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  				bias-disable;
  			};
  
-+			pcie1_pins: pcie1_pinmux {
++			pcie0_pins: pcie0_pinmux {
 +				mux {
 +					pins = "gpio3";
 +					drive-strength = <2>;
@@ -27,7 +27,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +				};
 +			};
 +
-+			pcie2_pins: pcie2_pinmux {
++			pcie1_pins: pcie1_pinmux {
 +				mux {
 +					pins = "gpio48";
 +					drive-strength = <2>;
@@ -46,14 +46,14 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		pcie0: pci at 1b500000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 3 0>;
-+			pinctrl-0 = <&pcie1_pins>;
++			pinctrl-0 = <&pcie0_pins>;
 +			pinctrl-names = "default";
 +		};
 +
 +		pcie1: pci at 1b700000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 48 0>;
-+			pinctrl-0 = <&pcie2_pins>;
++			pinctrl-0 = <&pcie1_pins>;
 +			pinctrl-names = "default";
 +		};
  	};
@@ -64,7 +64,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  				bias-disable;
  			};
  
-+			pcie1_pins: pcie1_pinmux {
++			pcie0_pins: pcie0_pinmux {
 +				mux {
 +					pins = "gpio3";
 +					drive-strength = <2>;
@@ -72,7 +72,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +				};
 +			};
 +
-+			pcie2_pins: pcie2_pinmux {
++			pcie1_pins: pcie1_pinmux {
 +				mux {
 +					pins = "gpio48";
 +					drive-strength = <2>;
@@ -80,7 +80,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +				};
 +			};
 +
-+			pcie3_pins: pcie3_pinmux {
++			pcie2_pins: pcie2_pinmux {
 +				mux {
 +					pins = "gpio63";
 +					drive-strength = <2>;
@@ -99,21 +99,21 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		pcie0: pci at 1b500000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 3 0>;
-+			pinctrl-0 = <&pcie1_pins>;
++			pinctrl-0 = <&pcie0_pins>;
 +			pinctrl-names = "default";
 +		};
 +
 +		pcie1: pci at 1b700000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 48 0>;
-+			pinctrl-0 = <&pcie2_pins>;
++			pinctrl-0 = <&pcie1_pins>;
 +			pinctrl-names = "default";
 +		};
 +
 +		pcie2: pci at 1b900000 {
 +			status = "ok";
 +			reset-gpio = <&qcom_pinmux 63 0>;
-+			pinctrl-0 = <&pcie3_pins>;
++			pinctrl-0 = <&pcie2_pins>;
 +			pinctrl-names = "default";
 +		};
  	};
@@ -125,11 +125,11 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  #include <dt-bindings/clock/qcom,lcc-ipq806x.h>
  #include <dt-bindings/soc/qcom,gsbi.h>
 +#include <dt-bindings/reset/qcom,gcc-ipq806x.h>
-+#include <include/dt-bindings/interrupt-controller/arm-gic.h>
++#include <dt-bindings/interrupt-controller/arm-gic.h>
  
  / {
  	model = "Qualcomm IPQ8064";
-@@ -329,5 +331,128 @@
+@@ -329,5 +331,127 @@
  			#reset-cells = <1>;
  		};
  
@@ -255,6 +255,5 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +
 +			status = "disabled";
 +		};
-+
  	};
  };
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 846f738..f327050 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -39,7 +39,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  		gsbi at 16300000 {
 @@ -144,5 +154,33 @@
- 			pinctrl-0 = <&pcie2_pins>;
+ 			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
 +
@@ -99,7 +99,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  		gsbi2: gsbi at 12480000 {
 @@ -173,5 +183,44 @@
- 			pinctrl-0 = <&pcie3_pins>;
+ 			pinctrl-0 = <&pcie2_pins>;
  			pinctrl-names = "default";
  		};
 +
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 8019713..7f290d9 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -116,10 +116,11 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -578,5 +578,91 @@
+@@ -577,5 +577,91 @@
+ 
  			status = "disabled";
  		};
- 
++
 +		nss_common: syscon at 03000000 {
 +			compatible = "syscon";
 +			reg = <0x03000000 0x0000FFFF>;
@@ -205,6 +206,5 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +
 +			status = "disabled";
 +		};
-+
  	};
  };
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Tue Aug  4 17:55:32 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Tue,  4 Aug 2015 14:55:32 -0700
Subject: [OpenWrt-Devel] [PATCH 4/4] ipq806x: fix freeze in PCIe code when
	booting with an old u-boot
In-Reply-To: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>
References: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438725332-19984-4-git-send-email-mathieu@codeaurora.org>

Old bootloader (same ones which have DT disabled) don't perform any PCIe
initialization. The consequence is a freeze during PCIe bring-up on
these old u-boot. Same kernel with a newer bootloaders works fine as
they contain the corresponding PCIe init code.

In this change, we'll add the missing init and make sure the kernel
doesn't rely on some preexisting init to get PCIe to work. That includes
the following changes:
*GPIOs: set function & drive strength
*Clocks: add init code for aux & ref clocks
*PCIe driver: additional init of the hardware controller

Tested 3.18 and 4.1 on an AP148 with bootloader branch 0.0.1

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  23 +-
 .../patches-3.18/114-pcie-add-ctlr-init.patch      | 278 +++++++++++++++++++++
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch    |  80 ++++++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   8 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   8 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  23 +-
 .../patches-4.1/114-pcie-add-ctlr-init.patch       | 278 +++++++++++++++++++++
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch     |  80 ++++++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   8 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  10 +-
 10 files changed, 761 insertions(+), 35 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/114-pcie-add-ctlr-init.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/114-pcie-add-ctlr-init.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch

diff --git a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index bdc91fb..ed66047 100644
--- a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -15,14 +15,15 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -35,6 +35,22 @@
+@@ -35,6 +35,24 @@
  				bias-disable;
  			};
  
 +			pcie0_pins: pcie0_pinmux {
 +				mux {
 +					pins = "gpio3";
-+					drive-strength = <2>;
++					function = "pcie1_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -30,7 +31,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			pcie1_pins: pcie1_pinmux {
 +				mux {
 +					pins = "gpio48";
-+					drive-strength = <2>;
++					function = "pcie2_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -38,7 +40,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -138,5 +154,19 @@
+@@ -138,5 +156,19 @@
  		usb30 at 1 {
  			status = "ok";
  		};
@@ -60,14 +62,15 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -30,6 +30,30 @@
+@@ -30,6 +30,33 @@
  				bias-disable;
  			};
  
 +			pcie0_pins: pcie0_pinmux {
 +				mux {
 +					pins = "gpio3";
-+					drive-strength = <2>;
++					function = "pcie1_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -75,7 +78,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			pcie1_pins: pcie1_pinmux {
 +				mux {
 +					pins = "gpio48";
-+					drive-strength = <2>;
++					function = "pcie2_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -83,7 +87,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			pcie2_pins: pcie2_pinmux {
 +				mux {
 +					pins = "gpio63";
-+					drive-strength = <2>;
++					function = "pcie3_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -91,7 +96,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -128,5 +152,26 @@
+@@ -128,5 +155,26 @@
  		usb30 at 1 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/114-pcie-add-ctlr-init.patch b/target/linux/ipq806x/patches-3.18/114-pcie-add-ctlr-init.patch
new file mode 100644
index 0000000..11c9810
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/114-pcie-add-ctlr-init.patch
@@ -0,0 +1,278 @@
+--- a/drivers/pci/host/pcie-qcom.c
++++ b/drivers/pci/host/pcie-qcom.c
+@@ -29,8 +29,53 @@
+ 
+ #include "pcie-designware.h"
+ 
++/* DBI registers */
++#define PCIE20_CAP				0x70
++#define PCIE20_CAP_LINKCTRLSTATUS		(PCIE20_CAP + 0x10)
++
++#define PCIE20_AXI_MSTR_RESP_COMP_CTRL0		0x818
++#define PCIE20_AXI_MSTR_RESP_COMP_CTRL1		0x81c
++
++#define PCIE20_PLR_IATU_VIEWPORT		0x900
++#define PCIE20_PLR_IATU_REGION_OUTBOUND		(0x0 << 31)
++#define PCIE20_PLR_IATU_REGION_INDEX(x)		(x << 0)
++
++#define PCIE20_PLR_IATU_CTRL1			0x904
++#define PCIE20_PLR_IATU_TYPE_CFG0		(0x4 << 0)
++#define PCIE20_PLR_IATU_TYPE_MEM		(0x0 << 0)
++
++#define PCIE20_PLR_IATU_CTRL2			0x908
++#define PCIE20_PLR_IATU_ENABLE			BIT(31)
++
++#define PCIE20_PLR_IATU_LBAR			0x90C
++#define PCIE20_PLR_IATU_UBAR			0x910
++#define PCIE20_PLR_IATU_LAR			0x914
++#define PCIE20_PLR_IATU_LTAR			0x918
++#define PCIE20_PLR_IATU_UTAR			0x91c
++
++#define MSM_PCIE_DEV_CFG_ADDR			0x01000000
++
++/* PARF registers */
++#define PCIE20_PARF_PCS_DEEMPH			0x34
++#define PCS_DEEMPH_TX_DEEMPH_GEN1(x)		(x << 16)
++#define PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB(x)	(x << 8)
++#define PCS_DEEMPH_TX_DEEMPH_GEN2_6DB(x)	(x << 0)
++
++#define PCIE20_PARF_PCS_SWING			0x38
++#define PCS_SWING_TX_SWING_FULL(x)		(x << 8)
++#define PCS_SWING_TX_SWING_LOW(x)		(x << 0)
++
+ #define PCIE20_PARF_PHY_CTRL			0x40
++#define PHY_CTRL_PHY_TX0_TERM_OFFSET_MASK	(0x1f << 16)
++#define PHY_CTRL_PHY_TX0_TERM_OFFSET(x)		(x << 16)
++
+ #define PCIE20_PARF_PHY_REFCLK			0x4C
++#define REF_SSP_EN				BIT(16)
++#define REF_USE_PAD				BIT(12)
++
++#define PCIE20_PARF_CONFIG_BITS			0x50
++#define PHY_RX0_EQ(x)				(x << 24)
++
+ #define PCIE20_PARF_DBI_BASE_ADDR		0x168
+ #define PCIE20_PARF_SLV_ADDR_SPACE_SIZE		0x16c
+ #define PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT	0x178
+@@ -39,9 +84,6 @@
+ #define PCIE20_ELBI_SYS_STTS			0x08
+ #define XMLH_LINK_UP				BIT(10)
+ 
+-#define PCIE20_CAP				0x70
+-#define PCIE20_CAP_LINKCTRLSTATUS		(PCIE20_CAP + 0x10)
+-
+ #define PERST_DELAY_MIN_US			1000
+ #define PERST_DELAY_MAX_US			1005
+ 
+@@ -56,14 +98,18 @@ struct qcom_pcie_resources_v0 {
+ 	struct clk *iface_clk;
+ 	struct clk *core_clk;
+ 	struct clk *phy_clk;
++	struct clk *aux_clk;
++	struct clk *ref_clk;
+ 	struct reset_control *pci_reset;
+ 	struct reset_control *axi_reset;
+ 	struct reset_control *ahb_reset;
+ 	struct reset_control *por_reset;
+ 	struct reset_control *phy_reset;
++	struct reset_control *ext_reset;
+ 	struct regulator *vdda;
+ 	struct regulator *vdda_phy;
+ 	struct regulator *vdda_refclk;
++	uint8_t phy_tx0_term_offset;
+ };
+ 
+ struct qcom_pcie_resources_v1 {
+@@ -156,10 +202,13 @@ static void qcom_pcie_disable_resources_
+ 	reset_control_assert(res->axi_reset);
+ 	reset_control_assert(res->ahb_reset);
+ 	reset_control_assert(res->por_reset);
+-	reset_control_assert(res->pci_reset);
++	reset_control_assert(res->phy_reset);
++	reset_control_assert(res->ext_reset);
+ 	clk_disable_unprepare(res->iface_clk);
+ 	clk_disable_unprepare(res->core_clk);
+ 	clk_disable_unprepare(res->phy_clk);
++	clk_disable_unprepare(res->aux_clk);
++	clk_disable_unprepare(res->ref_clk);
+ 	regulator_disable(res->vdda);
+ 	regulator_disable(res->vdda_phy);
+ 	regulator_disable(res->vdda_refclk);
+@@ -201,6 +250,12 @@ static int qcom_pcie_enable_resources_v0
+ 		goto err_vdda_phy;
+ 	}
+ 
++	ret = reset_control_deassert(res->ext_reset);
++	if (ret) {
++		dev_err(dev, "cannot assert ext reset\n");
++		goto err_reset_ext;
++	}
++
+ 	ret = clk_prepare_enable(res->iface_clk);
+ 	if (ret) {
+ 		dev_err(dev, "cannot prepare/enable iface clock\n");
+@@ -219,6 +274,18 @@ static int qcom_pcie_enable_resources_v0
+ 		goto err_clk_phy;
+ 	}
+ 
++	ret = clk_prepare_enable(res->aux_clk);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable aux clock\n");
++		goto err_clk_aux;
++	}
++
++	ret = clk_prepare_enable(res->ref_clk);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable ref clock\n");
++		goto err_clk_ref;
++	}
++
+ 	ret = reset_control_deassert(res->ahb_reset);
+ 	if (ret) {
+ 		dev_err(dev, "cannot deassert ahb reset\n");
+@@ -228,12 +295,18 @@ static int qcom_pcie_enable_resources_v0
+ 	return 0;
+ 
+ err_reset_ahb:
++	clk_disable_unprepare(res->ref_clk);
++err_clk_ref:
++	clk_disable_unprepare(res->aux_clk);
++err_clk_aux:
+ 	clk_disable_unprepare(res->phy_clk);
+ err_clk_phy:
+ 	clk_disable_unprepare(res->core_clk);
+ err_clk_core:
+ 	clk_disable_unprepare(res->iface_clk);
+ err_iface:
++	reset_control_assert(res->ext_reset);
++err_reset_ext:
+ 	regulator_disable(res->vdda_phy);
+ err_vdda_phy:
+ 	regulator_disable(res->vdda_refclk);
+@@ -329,6 +402,14 @@ static int qcom_pcie_get_resources_v0(st
+ 	if (IS_ERR(res->phy_clk))
+ 		return PTR_ERR(res->phy_clk);
+ 
++	res->aux_clk = devm_clk_get(dev, "aux");
++	if (IS_ERR(res->aux_clk))
++		return PTR_ERR(res->aux_clk);
++
++	res->ref_clk = devm_clk_get(dev, "ref");
++	if (IS_ERR(res->ref_clk))
++		return PTR_ERR(res->ref_clk);
++
+ 	res->pci_reset = devm_reset_control_get(dev, "pci");
+ 	if (IS_ERR(res->pci_reset))
+ 		return PTR_ERR(res->pci_reset);
+@@ -349,6 +430,14 @@ static int qcom_pcie_get_resources_v0(st
+ 	if (IS_ERR(res->phy_reset))
+ 		return PTR_ERR(res->phy_reset);
+ 
++	res->ext_reset = devm_reset_control_get(dev, "ext");
++	if (IS_ERR(res->ext_reset))
++		return PTR_ERR(res->ext_reset);
++
++	if (of_property_read_u8(dev->of_node, "phy-tx0-term-offset",
++				&res->phy_tx0_term_offset))
++		res->phy_tx0_term_offset = 0;
++
+ 	return 0;
+ }
+ 
+@@ -461,6 +550,57 @@ err_res:
+ 	qcom_pcie_disable_resources_v1(pcie);
+ }
+ 
++static void qcom_pcie_prog_viewport_cfg0(struct qcom_pcie *pcie, u32 busdev)
++{
++	struct pcie_port *pp = &pcie->pp;
++
++	/*
++	 * program and enable address translation region 0 (device config
++	 * address space); region type config;
++	 * axi config address range to device config address range
++	 */
++	writel(PCIE20_PLR_IATU_REGION_OUTBOUND |
++	       PCIE20_PLR_IATU_REGION_INDEX(0),
++	       pcie->dbi + PCIE20_PLR_IATU_VIEWPORT);
++
++	writel(PCIE20_PLR_IATU_TYPE_CFG0, pcie->dbi + PCIE20_PLR_IATU_CTRL1);
++	writel(PCIE20_PLR_IATU_ENABLE, pcie->dbi + PCIE20_PLR_IATU_CTRL2);
++	writel(pp->cfg0_mod_base, pcie->dbi + PCIE20_PLR_IATU_LBAR);
++	writel((pp->cfg0_mod_base >> 32), pcie->dbi + PCIE20_PLR_IATU_UBAR);
++	writel((pp->cfg0_mod_base + pp->cfg0_size - 1),
++	       pcie->dbi + PCIE20_PLR_IATU_LAR);
++	writel(busdev, pcie->dbi + PCIE20_PLR_IATU_LTAR);
++	writel(0, pcie->dbi + PCIE20_PLR_IATU_UTAR);
++}
++
++static void qcom_pcie_prog_viewport_mem2_outbound(struct qcom_pcie *pcie)
++{
++	struct pcie_port *pp = &pcie->pp;
++
++	/*
++	 * program and enable address translation region 2 (device resource
++	 * address space); region type memory;
++	 * axi device bar address range to device bar address range
++	 */
++	writel(PCIE20_PLR_IATU_REGION_OUTBOUND |
++	       PCIE20_PLR_IATU_REGION_INDEX(2),
++	       pcie->dbi + PCIE20_PLR_IATU_VIEWPORT);
++
++	writel(PCIE20_PLR_IATU_TYPE_MEM, pcie->dbi + PCIE20_PLR_IATU_CTRL1);
++	writel(PCIE20_PLR_IATU_ENABLE, pcie->dbi + PCIE20_PLR_IATU_CTRL2);
++	writel(pp->mem_mod_base, pcie->dbi + PCIE20_PLR_IATU_LBAR);
++	writel((pp->mem_mod_base >> 32), pcie->dbi + PCIE20_PLR_IATU_UBAR);
++	writel(pp->mem_mod_base + pp->mem_size - 1,
++	       pcie->dbi + PCIE20_PLR_IATU_LAR);
++	writel(pp->mem_bus_addr, pcie->dbi + PCIE20_PLR_IATU_LTAR);
++	writel(upper_32_bits(pp->mem_bus_addr),
++	       pcie->dbi + PCIE20_PLR_IATU_UTAR);
++
++	/* 1K PCIE buffer setting */
++	writel(0x3, pcie->dbi + PCIE20_AXI_MSTR_RESP_COMP_CTRL0);
++	writel(0x1, pcie->dbi + PCIE20_AXI_MSTR_RESP_COMP_CTRL1);
++}
++
+ static void qcom_pcie_host_init_v0(struct pcie_port *pp)
+ {
+ 	struct qcom_pcie *pcie = to_qcom_pcie(pp);
+@@ -476,9 +616,26 @@ static void qcom_pcie_host_init_v0(struc
+ 
+ 	writel_masked(pcie->parf + PCIE20_PARF_PHY_CTRL, BIT(0), 0);
+ 
+-	/* enable external reference clock */
+-	writel_masked(pcie->parf + PCIE20_PARF_PHY_REFCLK, 0, BIT(16));
++	/* Set Tx termination offset */
++	writel_masked(pcie->parf + PCIE20_PARF_PHY_CTRL,
++		      PHY_CTRL_PHY_TX0_TERM_OFFSET_MASK,
++		      PHY_CTRL_PHY_TX0_TERM_OFFSET(res->phy_tx0_term_offset));
++
++	/* PARF programming */
++	writel(PCS_DEEMPH_TX_DEEMPH_GEN1(0x18) |
++	       PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB(0x18) |
++	       PCS_DEEMPH_TX_DEEMPH_GEN2_6DB(0x22),
++	       pcie->parf + PCIE20_PARF_PCS_DEEMPH);
++	writel(PCS_SWING_TX_SWING_FULL(0x78) |
++	       PCS_SWING_TX_SWING_LOW(0x78),
++	       pcie->parf + PCIE20_PARF_PCS_SWING);
++	writel(PHY_RX0_EQ(0x4), pcie->parf + PCIE20_PARF_CONFIG_BITS);
++
++	/* Enable reference clock */
++	writel_masked(pcie->parf + PCIE20_PARF_PHY_REFCLK,
++		      REF_USE_PAD, REF_SSP_EN);
+ 
++	/* De-assert PHY, PCIe, POR and AXI resets */
+ 	ret = reset_control_deassert(res->phy_reset);
+ 	if (ret) {
+ 		dev_err(dev, "cannot deassert phy reset\n");
+@@ -517,6 +674,9 @@ static void qcom_pcie_host_init_v0(struc
+ 	if (ret)
+ 		goto err;
+ 
++	qcom_pcie_prog_viewport_cfg0(pcie, MSM_PCIE_DEV_CFG_ADDR);
++	qcom_pcie_prog_viewport_mem2_outbound(pcie);
++
+ 	return;
+ err:
+ 	qcom_ep_reset_assert(pcie);
diff --git a/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
new file mode 100644
index 0000000..13ff921
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
@@ -0,0 +1,80 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -336,15 +336,21 @@
+ 
+ 			clocks = <&gcc PCIE_A_CLK>,
+ 				 <&gcc PCIE_H_CLK>,
+-				 <&gcc PCIE_PHY_CLK>;
+-			clock-names = "core", "iface", "phy";
++				 <&gcc PCIE_PHY_CLK>,
++				 <&gcc PCIE_AUX_CLK>,
++				 <&gcc PCIE_ALT_REF_CLK>;
++			clock-names = "core", "iface", "phy", "aux", "ref";
++
++			assigned-clocks = <&gcc PCIE_ALT_REF_CLK>;
++			assigned-clock-rates = <100000000>;
+ 
+ 			resets = <&gcc PCIE_ACLK_RESET>,
+ 				 <&gcc PCIE_HCLK_RESET>,
+ 				 <&gcc PCIE_POR_RESET>,
+ 				 <&gcc PCIE_PCI_RESET>,
+-				 <&gcc PCIE_PHY_RESET>;
+-			reset-names = "axi", "ahb", "por", "pci", "phy";
++				 <&gcc PCIE_PHY_RESET>,
++				 <&gcc PCIE_EXT_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+ 
+ 			status = "disabled";
+ 		};
+@@ -377,15 +383,21 @@
+ 
+ 			clocks = <&gcc PCIE_1_A_CLK>,
+ 				 <&gcc PCIE_1_H_CLK>,
+-				 <&gcc PCIE_1_PHY_CLK>;
+-			clock-names = "core", "iface", "phy";
++				 <&gcc PCIE_1_PHY_CLK>,
++				 <&gcc PCIE_1_AUX_CLK>,
++				 <&gcc PCIE_1_ALT_REF_CLK>;
++			clock-names = "core", "iface", "phy", "aux", "ref";
++
++			assigned-clocks = <&gcc PCIE_1_ALT_REF_CLK>;
++			assigned-clock-rates = <100000000>;
+ 
+ 			resets = <&gcc PCIE_1_ACLK_RESET>,
+ 				 <&gcc PCIE_1_HCLK_RESET>,
+ 				 <&gcc PCIE_1_POR_RESET>,
+ 				 <&gcc PCIE_1_PCI_RESET>,
+-				 <&gcc PCIE_1_PHY_RESET>;
+-			reset-names = "axi", "ahb", "por", "pci", "phy";
++				 <&gcc PCIE_1_PHY_RESET>,
++				 <&gcc PCIE_1_EXT_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+ 
+ 			status = "disabled";
+ 		};
+@@ -418,15 +430,21 @@
+ 
+ 			clocks = <&gcc PCIE_2_A_CLK>,
+ 				 <&gcc PCIE_2_H_CLK>,
+-				 <&gcc PCIE_2_PHY_CLK>;
+-			clock-names = "core", "iface", "phy";
++				 <&gcc PCIE_2_PHY_CLK>,
++				 <&gcc PCIE_2_AUX_CLK>,
++				 <&gcc PCIE_2_ALT_REF_CLK>;
++			clock-names = "core", "iface", "phy", "aux", "ref";
++
++			assigned-clocks = <&gcc PCIE_2_ALT_REF_CLK>;
++			assigned-clock-rates = <100000000>;
+ 
+ 			resets = <&gcc PCIE_2_ACLK_RESET>,
+ 				 <&gcc PCIE_2_HCLK_RESET>,
+ 				 <&gcc PCIE_2_POR_RESET>,
+ 				 <&gcc PCIE_2_PCI_RESET>,
+-				 <&gcc PCIE_2_PHY_RESET>;
+-			reset-names = "axi", "ahb", "por", "pci", "phy";
++				 <&gcc PCIE_2_PHY_RESET>,
++				 <&gcc PCIE_2_EXT_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+ 
+ 			status = "disabled";
+ 		};
diff --git a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 851682a..e1b41d8 100644
--- a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -22,7 +22,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  	};
  
  	chosen {
-@@ -59,6 +60,15 @@
+@@ -61,6 +62,15 @@
  					bias-none;
  				};
  			};
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -168,5 +178,33 @@
+@@ -170,5 +180,33 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
@@ -82,7 +82,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  	};
  
  	chosen {
-@@ -62,6 +63,15 @@
+@@ -65,6 +66,15 @@
  					bias-none;
  				};
  			};
@@ -98,7 +98,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi2: gsbi at 12480000 {
-@@ -173,5 +183,44 @@
+@@ -176,5 +186,44 @@
  			pinctrl-0 = <&pcie2_pins>;
  			pinctrl-names = "default";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 8d6e77a..d417dc1 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -69,6 +69,16 @@
+@@ -71,6 +71,16 @@
  					bias-disable;
  				};
  			};
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -206,5 +216,26 @@
+@@ -208,5 +218,26 @@
  				reg = <4>;
  			};
  		};
@@ -58,7 +58,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -72,6 +72,14 @@
+@@ -75,6 +75,14 @@
  					bias-disable;
  				};
  			};
@@ -73,7 +73,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi2: gsbi at 12480000 {
-@@ -222,5 +230,40 @@
+@@ -225,5 +233,40 @@
  				reg = <7>;
  			};
  		};
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index df96ad5..fc2fe0a 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -15,14 +15,15 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -35,6 +35,22 @@
+@@ -35,6 +35,24 @@
  				bias-disable;
  			};
  
 +			pcie0_pins: pcie0_pinmux {
 +				mux {
 +					pins = "gpio3";
-+					drive-strength = <2>;
++					function = "pcie1_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -30,7 +31,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			pcie1_pins: pcie1_pinmux {
 +				mux {
 +					pins = "gpio48";
-+					drive-strength = <2>;
++					function = "pcie2_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -38,7 +40,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -114,5 +130,19 @@
+@@ -114,5 +132,19 @@
  		sata at 29000000 {
  			status = "ok";
  		};
@@ -60,14 +62,15 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -30,6 +30,30 @@
+@@ -30,6 +30,33 @@
  				bias-disable;
  			};
  
 +			pcie0_pins: pcie0_pinmux {
 +				mux {
 +					pins = "gpio3";
-+					drive-strength = <2>;
++					function = "pcie1_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -75,7 +78,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			pcie1_pins: pcie1_pinmux {
 +				mux {
 +					pins = "gpio48";
-+					drive-strength = <2>;
++					function = "pcie2_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -83,7 +87,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			pcie2_pins: pcie2_pinmux {
 +				mux {
 +					pins = "gpio63";
-+					drive-strength = <2>;
++					function = "pcie3_rst";
++					drive-strength = <12>;
 +					bias-disable;
 +				};
 +			};
@@ -91,7 +96,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -128,5 +152,26 @@
+@@ -128,5 +155,26 @@
  		usb30 at 1 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/114-pcie-add-ctlr-init.patch b/target/linux/ipq806x/patches-4.1/114-pcie-add-ctlr-init.patch
new file mode 100644
index 0000000..11c9810
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/114-pcie-add-ctlr-init.patch
@@ -0,0 +1,278 @@
+--- a/drivers/pci/host/pcie-qcom.c
++++ b/drivers/pci/host/pcie-qcom.c
+@@ -29,8 +29,53 @@
+ 
+ #include "pcie-designware.h"
+ 
++/* DBI registers */
++#define PCIE20_CAP				0x70
++#define PCIE20_CAP_LINKCTRLSTATUS		(PCIE20_CAP + 0x10)
++
++#define PCIE20_AXI_MSTR_RESP_COMP_CTRL0		0x818
++#define PCIE20_AXI_MSTR_RESP_COMP_CTRL1		0x81c
++
++#define PCIE20_PLR_IATU_VIEWPORT		0x900
++#define PCIE20_PLR_IATU_REGION_OUTBOUND		(0x0 << 31)
++#define PCIE20_PLR_IATU_REGION_INDEX(x)		(x << 0)
++
++#define PCIE20_PLR_IATU_CTRL1			0x904
++#define PCIE20_PLR_IATU_TYPE_CFG0		(0x4 << 0)
++#define PCIE20_PLR_IATU_TYPE_MEM		(0x0 << 0)
++
++#define PCIE20_PLR_IATU_CTRL2			0x908
++#define PCIE20_PLR_IATU_ENABLE			BIT(31)
++
++#define PCIE20_PLR_IATU_LBAR			0x90C
++#define PCIE20_PLR_IATU_UBAR			0x910
++#define PCIE20_PLR_IATU_LAR			0x914
++#define PCIE20_PLR_IATU_LTAR			0x918
++#define PCIE20_PLR_IATU_UTAR			0x91c
++
++#define MSM_PCIE_DEV_CFG_ADDR			0x01000000
++
++/* PARF registers */
++#define PCIE20_PARF_PCS_DEEMPH			0x34
++#define PCS_DEEMPH_TX_DEEMPH_GEN1(x)		(x << 16)
++#define PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB(x)	(x << 8)
++#define PCS_DEEMPH_TX_DEEMPH_GEN2_6DB(x)	(x << 0)
++
++#define PCIE20_PARF_PCS_SWING			0x38
++#define PCS_SWING_TX_SWING_FULL(x)		(x << 8)
++#define PCS_SWING_TX_SWING_LOW(x)		(x << 0)
++
+ #define PCIE20_PARF_PHY_CTRL			0x40
++#define PHY_CTRL_PHY_TX0_TERM_OFFSET_MASK	(0x1f << 16)
++#define PHY_CTRL_PHY_TX0_TERM_OFFSET(x)		(x << 16)
++
+ #define PCIE20_PARF_PHY_REFCLK			0x4C
++#define REF_SSP_EN				BIT(16)
++#define REF_USE_PAD				BIT(12)
++
++#define PCIE20_PARF_CONFIG_BITS			0x50
++#define PHY_RX0_EQ(x)				(x << 24)
++
+ #define PCIE20_PARF_DBI_BASE_ADDR		0x168
+ #define PCIE20_PARF_SLV_ADDR_SPACE_SIZE		0x16c
+ #define PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT	0x178
+@@ -39,9 +84,6 @@
+ #define PCIE20_ELBI_SYS_STTS			0x08
+ #define XMLH_LINK_UP				BIT(10)
+ 
+-#define PCIE20_CAP				0x70
+-#define PCIE20_CAP_LINKCTRLSTATUS		(PCIE20_CAP + 0x10)
+-
+ #define PERST_DELAY_MIN_US			1000
+ #define PERST_DELAY_MAX_US			1005
+ 
+@@ -56,14 +98,18 @@ struct qcom_pcie_resources_v0 {
+ 	struct clk *iface_clk;
+ 	struct clk *core_clk;
+ 	struct clk *phy_clk;
++	struct clk *aux_clk;
++	struct clk *ref_clk;
+ 	struct reset_control *pci_reset;
+ 	struct reset_control *axi_reset;
+ 	struct reset_control *ahb_reset;
+ 	struct reset_control *por_reset;
+ 	struct reset_control *phy_reset;
++	struct reset_control *ext_reset;
+ 	struct regulator *vdda;
+ 	struct regulator *vdda_phy;
+ 	struct regulator *vdda_refclk;
++	uint8_t phy_tx0_term_offset;
+ };
+ 
+ struct qcom_pcie_resources_v1 {
+@@ -156,10 +202,13 @@ static void qcom_pcie_disable_resources_
+ 	reset_control_assert(res->axi_reset);
+ 	reset_control_assert(res->ahb_reset);
+ 	reset_control_assert(res->por_reset);
+-	reset_control_assert(res->pci_reset);
++	reset_control_assert(res->phy_reset);
++	reset_control_assert(res->ext_reset);
+ 	clk_disable_unprepare(res->iface_clk);
+ 	clk_disable_unprepare(res->core_clk);
+ 	clk_disable_unprepare(res->phy_clk);
++	clk_disable_unprepare(res->aux_clk);
++	clk_disable_unprepare(res->ref_clk);
+ 	regulator_disable(res->vdda);
+ 	regulator_disable(res->vdda_phy);
+ 	regulator_disable(res->vdda_refclk);
+@@ -201,6 +250,12 @@ static int qcom_pcie_enable_resources_v0
+ 		goto err_vdda_phy;
+ 	}
+ 
++	ret = reset_control_deassert(res->ext_reset);
++	if (ret) {
++		dev_err(dev, "cannot assert ext reset\n");
++		goto err_reset_ext;
++	}
++
+ 	ret = clk_prepare_enable(res->iface_clk);
+ 	if (ret) {
+ 		dev_err(dev, "cannot prepare/enable iface clock\n");
+@@ -219,6 +274,18 @@ static int qcom_pcie_enable_resources_v0
+ 		goto err_clk_phy;
+ 	}
+ 
++	ret = clk_prepare_enable(res->aux_clk);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable aux clock\n");
++		goto err_clk_aux;
++	}
++
++	ret = clk_prepare_enable(res->ref_clk);
++	if (ret) {
++		dev_err(dev, "cannot prepare/enable ref clock\n");
++		goto err_clk_ref;
++	}
++
+ 	ret = reset_control_deassert(res->ahb_reset);
+ 	if (ret) {
+ 		dev_err(dev, "cannot deassert ahb reset\n");
+@@ -228,12 +295,18 @@ static int qcom_pcie_enable_resources_v0
+ 	return 0;
+ 
+ err_reset_ahb:
++	clk_disable_unprepare(res->ref_clk);
++err_clk_ref:
++	clk_disable_unprepare(res->aux_clk);
++err_clk_aux:
+ 	clk_disable_unprepare(res->phy_clk);
+ err_clk_phy:
+ 	clk_disable_unprepare(res->core_clk);
+ err_clk_core:
+ 	clk_disable_unprepare(res->iface_clk);
+ err_iface:
++	reset_control_assert(res->ext_reset);
++err_reset_ext:
+ 	regulator_disable(res->vdda_phy);
+ err_vdda_phy:
+ 	regulator_disable(res->vdda_refclk);
+@@ -329,6 +402,14 @@ static int qcom_pcie_get_resources_v0(st
+ 	if (IS_ERR(res->phy_clk))
+ 		return PTR_ERR(res->phy_clk);
+ 
++	res->aux_clk = devm_clk_get(dev, "aux");
++	if (IS_ERR(res->aux_clk))
++		return PTR_ERR(res->aux_clk);
++
++	res->ref_clk = devm_clk_get(dev, "ref");
++	if (IS_ERR(res->ref_clk))
++		return PTR_ERR(res->ref_clk);
++
+ 	res->pci_reset = devm_reset_control_get(dev, "pci");
+ 	if (IS_ERR(res->pci_reset))
+ 		return PTR_ERR(res->pci_reset);
+@@ -349,6 +430,14 @@ static int qcom_pcie_get_resources_v0(st
+ 	if (IS_ERR(res->phy_reset))
+ 		return PTR_ERR(res->phy_reset);
+ 
++	res->ext_reset = devm_reset_control_get(dev, "ext");
++	if (IS_ERR(res->ext_reset))
++		return PTR_ERR(res->ext_reset);
++
++	if (of_property_read_u8(dev->of_node, "phy-tx0-term-offset",
++				&res->phy_tx0_term_offset))
++		res->phy_tx0_term_offset = 0;
++
+ 	return 0;
+ }
+ 
+@@ -461,6 +550,57 @@ err_res:
+ 	qcom_pcie_disable_resources_v1(pcie);
+ }
+ 
++static void qcom_pcie_prog_viewport_cfg0(struct qcom_pcie *pcie, u32 busdev)
++{
++	struct pcie_port *pp = &pcie->pp;
++
++	/*
++	 * program and enable address translation region 0 (device config
++	 * address space); region type config;
++	 * axi config address range to device config address range
++	 */
++	writel(PCIE20_PLR_IATU_REGION_OUTBOUND |
++	       PCIE20_PLR_IATU_REGION_INDEX(0),
++	       pcie->dbi + PCIE20_PLR_IATU_VIEWPORT);
++
++	writel(PCIE20_PLR_IATU_TYPE_CFG0, pcie->dbi + PCIE20_PLR_IATU_CTRL1);
++	writel(PCIE20_PLR_IATU_ENABLE, pcie->dbi + PCIE20_PLR_IATU_CTRL2);
++	writel(pp->cfg0_mod_base, pcie->dbi + PCIE20_PLR_IATU_LBAR);
++	writel((pp->cfg0_mod_base >> 32), pcie->dbi + PCIE20_PLR_IATU_UBAR);
++	writel((pp->cfg0_mod_base + pp->cfg0_size - 1),
++	       pcie->dbi + PCIE20_PLR_IATU_LAR);
++	writel(busdev, pcie->dbi + PCIE20_PLR_IATU_LTAR);
++	writel(0, pcie->dbi + PCIE20_PLR_IATU_UTAR);
++}
++
++static void qcom_pcie_prog_viewport_mem2_outbound(struct qcom_pcie *pcie)
++{
++	struct pcie_port *pp = &pcie->pp;
++
++	/*
++	 * program and enable address translation region 2 (device resource
++	 * address space); region type memory;
++	 * axi device bar address range to device bar address range
++	 */
++	writel(PCIE20_PLR_IATU_REGION_OUTBOUND |
++	       PCIE20_PLR_IATU_REGION_INDEX(2),
++	       pcie->dbi + PCIE20_PLR_IATU_VIEWPORT);
++
++	writel(PCIE20_PLR_IATU_TYPE_MEM, pcie->dbi + PCIE20_PLR_IATU_CTRL1);
++	writel(PCIE20_PLR_IATU_ENABLE, pcie->dbi + PCIE20_PLR_IATU_CTRL2);
++	writel(pp->mem_mod_base, pcie->dbi + PCIE20_PLR_IATU_LBAR);
++	writel((pp->mem_mod_base >> 32), pcie->dbi + PCIE20_PLR_IATU_UBAR);
++	writel(pp->mem_mod_base + pp->mem_size - 1,
++	       pcie->dbi + PCIE20_PLR_IATU_LAR);
++	writel(pp->mem_bus_addr, pcie->dbi + PCIE20_PLR_IATU_LTAR);
++	writel(upper_32_bits(pp->mem_bus_addr),
++	       pcie->dbi + PCIE20_PLR_IATU_UTAR);
++
++	/* 1K PCIE buffer setting */
++	writel(0x3, pcie->dbi + PCIE20_AXI_MSTR_RESP_COMP_CTRL0);
++	writel(0x1, pcie->dbi + PCIE20_AXI_MSTR_RESP_COMP_CTRL1);
++}
++
+ static void qcom_pcie_host_init_v0(struct pcie_port *pp)
+ {
+ 	struct qcom_pcie *pcie = to_qcom_pcie(pp);
+@@ -476,9 +616,26 @@ static void qcom_pcie_host_init_v0(struc
+ 
+ 	writel_masked(pcie->parf + PCIE20_PARF_PHY_CTRL, BIT(0), 0);
+ 
+-	/* enable external reference clock */
+-	writel_masked(pcie->parf + PCIE20_PARF_PHY_REFCLK, 0, BIT(16));
++	/* Set Tx termination offset */
++	writel_masked(pcie->parf + PCIE20_PARF_PHY_CTRL,
++		      PHY_CTRL_PHY_TX0_TERM_OFFSET_MASK,
++		      PHY_CTRL_PHY_TX0_TERM_OFFSET(res->phy_tx0_term_offset));
++
++	/* PARF programming */
++	writel(PCS_DEEMPH_TX_DEEMPH_GEN1(0x18) |
++	       PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB(0x18) |
++	       PCS_DEEMPH_TX_DEEMPH_GEN2_6DB(0x22),
++	       pcie->parf + PCIE20_PARF_PCS_DEEMPH);
++	writel(PCS_SWING_TX_SWING_FULL(0x78) |
++	       PCS_SWING_TX_SWING_LOW(0x78),
++	       pcie->parf + PCIE20_PARF_PCS_SWING);
++	writel(PHY_RX0_EQ(0x4), pcie->parf + PCIE20_PARF_CONFIG_BITS);
++
++	/* Enable reference clock */
++	writel_masked(pcie->parf + PCIE20_PARF_PHY_REFCLK,
++		      REF_USE_PAD, REF_SSP_EN);
+ 
++	/* De-assert PHY, PCIe, POR and AXI resets */
+ 	ret = reset_control_deassert(res->phy_reset);
+ 	if (ret) {
+ 		dev_err(dev, "cannot deassert phy reset\n");
+@@ -517,6 +674,9 @@ static void qcom_pcie_host_init_v0(struc
+ 	if (ret)
+ 		goto err;
+ 
++	qcom_pcie_prog_viewport_cfg0(pcie, MSM_PCIE_DEV_CFG_ADDR);
++	qcom_pcie_prog_viewport_mem2_outbound(pcie);
++
+ 	return;
+ err:
+ 	qcom_ep_reset_assert(pcie);
diff --git a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
new file mode 100644
index 0000000..59b7fcc
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
@@ -0,0 +1,80 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -359,15 +359,21 @@
+ 
+ 			clocks = <&gcc PCIE_A_CLK>,
+ 				 <&gcc PCIE_H_CLK>,
+-				 <&gcc PCIE_PHY_CLK>;
+-			clock-names = "core", "iface", "phy";
++				 <&gcc PCIE_PHY_CLK>,
++				 <&gcc PCIE_AUX_CLK>,
++				 <&gcc PCIE_ALT_REF_CLK>;
++			clock-names = "core", "iface", "phy", "aux", "ref";
++
++			assigned-clocks = <&gcc PCIE_ALT_REF_CLK>;
++			assigned-clock-rates = <100000000>;
+ 
+ 			resets = <&gcc PCIE_ACLK_RESET>,
+ 				 <&gcc PCIE_HCLK_RESET>,
+ 				 <&gcc PCIE_POR_RESET>,
+ 				 <&gcc PCIE_PCI_RESET>,
+-				 <&gcc PCIE_PHY_RESET>;
+-			reset-names = "axi", "ahb", "por", "pci", "phy";
++				 <&gcc PCIE_PHY_RESET>,
++				 <&gcc PCIE_EXT_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+ 
+ 			status = "disabled";
+ 		};
+@@ -400,15 +406,21 @@
+ 
+ 			clocks = <&gcc PCIE_1_A_CLK>,
+ 				 <&gcc PCIE_1_H_CLK>,
+-				 <&gcc PCIE_1_PHY_CLK>;
+-			clock-names = "core", "iface", "phy";
++				 <&gcc PCIE_1_PHY_CLK>,
++				 <&gcc PCIE_1_AUX_CLK>,
++				 <&gcc PCIE_1_ALT_REF_CLK>;
++			clock-names = "core", "iface", "phy", "aux", "ref";
++
++			assigned-clocks = <&gcc PCIE_1_ALT_REF_CLK>;
++			assigned-clock-rates = <100000000>;
+ 
+ 			resets = <&gcc PCIE_1_ACLK_RESET>,
+ 				 <&gcc PCIE_1_HCLK_RESET>,
+ 				 <&gcc PCIE_1_POR_RESET>,
+ 				 <&gcc PCIE_1_PCI_RESET>,
+-				 <&gcc PCIE_1_PHY_RESET>;
+-			reset-names = "axi", "ahb", "por", "pci", "phy";
++				 <&gcc PCIE_1_PHY_RESET>,
++				 <&gcc PCIE_1_EXT_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+ 
+ 			status = "disabled";
+ 		};
+@@ -441,15 +453,21 @@
+ 
+ 			clocks = <&gcc PCIE_2_A_CLK>,
+ 				 <&gcc PCIE_2_H_CLK>,
+-				 <&gcc PCIE_2_PHY_CLK>;
+-			clock-names = "core", "iface", "phy";
++				 <&gcc PCIE_2_PHY_CLK>,
++				 <&gcc PCIE_2_AUX_CLK>,
++				 <&gcc PCIE_2_ALT_REF_CLK>;
++			clock-names = "core", "iface", "phy", "aux", "ref";
++
++			assigned-clocks = <&gcc PCIE_2_ALT_REF_CLK>;
++			assigned-clock-rates = <100000000>;
+ 
+ 			resets = <&gcc PCIE_2_ACLK_RESET>,
+ 				 <&gcc PCIE_2_HCLK_RESET>,
+ 				 <&gcc PCIE_2_POR_RESET>,
+ 				 <&gcc PCIE_2_PCI_RESET>,
+-				 <&gcc PCIE_2_PHY_RESET>;
+-			reset-names = "axi", "ahb", "por", "pci", "phy";
++				 <&gcc PCIE_2_PHY_RESET>,
++				 <&gcc PCIE_2_EXT_RESET>;
++			reset-names = "axi", "ahb", "por", "pci", "phy", "ext";
+ 
+ 			status = "disabled";
+ 		};
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index f327050..d17ff44 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -22,7 +22,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  	};
  
  	chosen {
-@@ -59,6 +60,15 @@
+@@ -61,6 +62,15 @@
  					bias-none;
  				};
  			};
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -144,5 +154,33 @@
+@@ -146,5 +156,33 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
@@ -82,7 +82,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  	};
  
  	chosen {
-@@ -62,6 +63,15 @@
+@@ -65,6 +66,15 @@
  					bias-none;
  				};
  			};
@@ -98,7 +98,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi2: gsbi at 12480000 {
-@@ -173,5 +183,44 @@
+@@ -176,5 +186,44 @@
  			pinctrl-0 = <&pcie2_pins>;
  			pinctrl-names = "default";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 7f290d9..ce45089 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -69,6 +69,16 @@
+@@ -71,6 +71,16 @@
  					bias-disable;
  				};
  			};
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -182,5 +192,26 @@
+@@ -184,5 +194,26 @@
  				reg = <4>;
  			};
  		};
@@ -58,7 +58,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -72,6 +72,14 @@
+@@ -75,6 +75,14 @@
  					bias-disable;
  				};
  			};
@@ -73,7 +73,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi2: gsbi at 12480000 {
-@@ -222,5 +230,40 @@
+@@ -225,5 +233,40 @@
  				reg = <7>;
  			};
  		};
@@ -116,7 +116,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -577,5 +577,91 @@
+@@ -595,5 +595,91 @@
  
  			status = "disabled";
  		};
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Tue Aug  4 18:25:42 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Tue,  4 Aug 2015 15:25:42 -0700
Subject: [OpenWrt-Devel] [PATCH 1/2] ipq806x: refresh kernel configs
Message-ID: <1438727143-13665-1-git-send-email-mathieu@codeaurora.org>

Remove options which have been moved into the generic config ever since.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/config-3.18 |  1 -
 target/linux/ipq806x/config-4.1  | 12 ------------
 2 files changed, 13 deletions(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 4d3b884..f5bd58e 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -410,7 +410,6 @@ CONFIG_WATCHDOG_CORE=y
 # CONFIG_WIZNET_W5300 is not set
 # CONFIG_WL_TI is not set
 # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
-# CONFIG_XEN is not set
 CONFIG_XPS=y
 CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index e80b632..ffb0334 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -4,7 +4,6 @@ CONFIG_ALIGNMENT_TRAP=y
 CONFIG_APQ_GCC_8084=y
 CONFIG_APQ_MMCC_8084=y
 CONFIG_AR8216_PHY=y
-# CONFIG_ARCH_ALPINE is not set
 CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
@@ -243,8 +242,6 @@ CONFIG_KRAIT_L2_ACCESSORS=y
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
-# CONFIG_LZ4_COMPRESS is not set
-# CONFIG_LZ4_DECOMPRESS is not set
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 CONFIG_MDIO_BITBANG=y
@@ -316,7 +313,6 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_QCOM_IPQ806X_SATA=y
 # CONFIG_PHY_QCOM_UFS is not set
 CONFIG_PINCTRL=y
-# CONFIG_PINCTRL_AMD is not set
 CONFIG_PINCTRL_APQ8064=y
 # CONFIG_PINCTRL_APQ8084 is not set
 CONFIG_PINCTRL_IPQ8064=y
@@ -334,12 +330,7 @@ CONFIG_PM_SLEEP=y
 CONFIG_PM_SLEEP_SMP=y
 CONFIG_POWER_RESET=y
 # CONFIG_POWER_RESET_BRCMSTB is not set
-# CONFIG_POWER_RESET_GPIO is not set
-# CONFIG_POWER_RESET_GPIO_RESTART is not set
-# CONFIG_POWER_RESET_LTC2952 is not set
 CONFIG_POWER_RESET_MSM=y
-# CONFIG_POWER_RESET_SYSCON is not set
-# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
 CONFIG_POWER_SUPPLY=y
 CONFIG_PREEMPT=y
 CONFIG_PREEMPT_COUNT=y
@@ -352,11 +343,9 @@ CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
 CONFIG_QCOM_WDT=y
-# CONFIG_QORIQ_CPUFREQ is not set
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
 CONFIG_RCU_CPU_STALL_TIMEOUT=21
-# CONFIG_RCU_EXPEDITE_BOOT is not set
 CONFIG_RCU_STALL_COMMON=y
 CONFIG_RD_GZIP=y
 CONFIG_REGMAP=y
@@ -427,7 +416,6 @@ CONFIG_WATCHDOG_CORE=y
 # CONFIG_WIZNET_W5300 is not set
 # CONFIG_WL_TI is not set
 # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
-# CONFIG_XEN is not set
 CONFIG_XPS=y
 CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Tue Aug  4 18:25:43 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Tue,  4 Aug 2015 15:25:43 -0700
Subject: [OpenWrt-Devel] [PATCH 2/2] ipq806x: add ethernet (stmmac) support
In-Reply-To: <1438727143-13665-1-git-send-email-mathieu@codeaurora.org>
References: <1438727143-13665-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438727143-13665-2-git-send-email-mathieu@codeaurora.org>

We forgot to enable the stmmac driver for 4.1 kernel, so ethernet
interfaces don't show-up on this kernel.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/config-4.1 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index ffb0334..e3cff2f 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -271,6 +271,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEON=y
 CONFIG_NET_FLOW_LIMIT=y
+CONFIG_NET_PTP_CLASSIFY=y
 CONFIG_NET_VENDOR_WIZNET=y
 CONFIG_NO_BOOTMEM=y
 CONFIG_NO_HZ=y
@@ -332,12 +333,14 @@ CONFIG_POWER_RESET=y
 # CONFIG_POWER_RESET_BRCMSTB is not set
 CONFIG_POWER_RESET_MSM=y
 CONFIG_POWER_SUPPLY=y
+CONFIG_PPS=y
 CONFIG_PREEMPT=y
 CONFIG_PREEMPT_COUNT=y
 # CONFIG_PREEMPT_NONE is not set
 CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_PTP_1588_CLOCK=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
@@ -379,6 +382,8 @@ CONFIG_SPI_QUP=y
 CONFIG_SPMI=y
 CONFIG_SPMI_MSM_PMIC_ARB=y
 CONFIG_SRCU=y
+CONFIG_STMMAC_ETH=y
+CONFIG_STMMAC_PLATFORM=y
 CONFIG_STOP_MACHINE=y
 # CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_SUSPEND=y
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From daniel at makrotopia.org  Tue Aug  4 18:53:10 2015
From: daniel at makrotopia.org (Daniel Golle)
Date: Wed, 5 Aug 2015 00:53:10 +0200
Subject: [OpenWrt-Devel] [PATCH] kernel: update 4.1 to 4.1.4
Message-ID: <20150804225142.GA6286@makrotopia.org>

Changelog:
 * https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.1.4

Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 include/kernel-version.mk                          |   4 +-
 ...79-add-gpio-func-register-for-QCA955x-SoC.patch |   2 +-
 .../813-MIPS-ath79-add-ap147-support.patch         |   6 +-
 .../140-overlayfs_readdir_locking_fix.patch        | 148 ---------------------
 .../generic/patches-4.1/834-ledtrig-libata.patch   |  10 +-
 5 files changed, 11 insertions(+), 159 deletions(-)
 delete mode 100644 target/linux/generic/patches-4.1/140-overlayfs_readdir_locking_fix.patch

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index e03590f..9f68716 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,11 +4,11 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .19
 LINUX_VERSION-4.0 = .9
-LINUX_VERSION-4.1 = .3
+LINUX_VERSION-4.1 = .4
 
 LINUX_KERNEL_MD5SUM-3.18.19 = a143f9421bd8413752609d0d771c2955
 LINUX_KERNEL_MD5SUM-4.0.9 = 40fc5f6e2d718e539b45e6601c71985b
-LINUX_KERNEL_MD5SUM-4.1.3 = 96c2c77b1c54ba01cfd8fc2d13fbf828
+LINUX_KERNEL_MD5SUM-4.1.4 = 32cb4dd9f14d37bf71bafa6ed368f769
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/ar71xx/patches-4.1/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-4.1/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch
index 24ce7d8..23425dc 100644
--- a/target/linux/ar71xx/patches-4.1/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch
+++ b/target/linux/ar71xx/patches-4.1/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/gpio.c
 +++ b/arch/mips/ath79/gpio.c
-@@ -185,15 +185,27 @@ void __init ath79_gpio_output_select(uns
+@@ -221,15 +221,27 @@ void __init ath79_gpio_output_select(uns
  {
  	void __iomem *base = ath79_gpio_base;
  	unsigned long flags;
diff --git a/target/linux/ar71xx/patches-4.1/813-MIPS-ath79-add-ap147-support.patch b/target/linux/ar71xx/patches-4.1/813-MIPS-ath79-add-ap147-support.patch
index 2ca9a1e..ed0d984 100644
--- a/target/linux/ar71xx/patches-4.1/813-MIPS-ath79-add-ap147-support.patch
+++ b/target/linux/ar71xx/patches-4.1/813-MIPS-ath79-add-ap147-support.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/Kconfig
 +++ b/arch/mips/ath79/Kconfig
-@@ -118,6 +118,19 @@ config ATH79_MACH_AP143
+@@ -138,6 +138,19 @@ config ATH79_MACH_AP143
  	  Say 'Y' here if you want your kernel to support the
  	  Atheros AP143 reference board.
  
@@ -22,7 +22,7 @@
  	select SOC_AR913X
 --- a/arch/mips/ath79/Makefile
 +++ b/arch/mips/ath79/Makefile
-@@ -47,6 +47,7 @@ obj-$(CONFIG_ATH79_MACH_AP121)		+= mach-
+@@ -49,6 +49,7 @@ obj-$(CONFIG_ATH79_MACH_AP121)		+= mach-
  obj-$(CONFIG_ATH79_MACH_AP132)		+= mach-ap132.o
  obj-$(CONFIG_ATH79_MACH_AP136)		+= mach-ap136.o
  obj-$(CONFIG_ATH79_MACH_AP143)		+= mach-ap143.o
@@ -32,7 +32,7 @@
  obj-$(CONFIG_ATH79_MACH_AP96)		+= mach-ap96.o
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -29,6 +29,7 @@ enum ath79_mach_type {
+@@ -31,6 +31,7 @@ enum ath79_mach_type {
  	ATH79_MACH_AP136_010,		/* Atheros AP136-010 reference board */
  	ATH79_MACH_AP136_020,		/* Atheros AP136-020 reference board */
  	ATH79_MACH_AP143,		/* Atheros AP143 reference board */
diff --git a/target/linux/generic/patches-4.1/140-overlayfs_readdir_locking_fix.patch b/target/linux/generic/patches-4.1/140-overlayfs_readdir_locking_fix.patch
deleted file mode 100644
index 67dff98..0000000
--- a/target/linux/generic/patches-4.1/140-overlayfs_readdir_locking_fix.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-Patch by: Miklos Szeredi <miklos at szeredi.hu>
-
-Some filesystems (e.g. jffs2) lock the same resources for both readdir
-and lookup, leading to a deadlock in ovl_cache_entry_new, which is called
-from the filldir, and calls lookup itself.
-
---- a/fs/overlayfs/readdir.c
-+++ b/fs/overlayfs/readdir.c
-@@ -23,6 +23,7 @@ struct ovl_cache_entry {
- 	u64 ino;
- 	struct list_head l_node;
- 	struct rb_node node;
-+	struct ovl_cache_entry *next_maybe_whiteout;
- 	bool is_whiteout;
- 	char name[];
- };
-@@ -39,7 +40,7 @@ struct ovl_readdir_data {
- 	struct rb_root root;
- 	struct list_head *list;
- 	struct list_head middle;
--	struct dentry *dir;
-+	struct ovl_cache_entry *first_maybe_whiteout;
- 	int count;
- 	int err;
- };
-@@ -79,7 +80,7 @@ static struct ovl_cache_entry *ovl_cache
- 	return NULL;
- }
- 
--static struct ovl_cache_entry *ovl_cache_entry_new(struct dentry *dir,
-+static struct ovl_cache_entry *ovl_cache_entry_new(struct ovl_readdir_data *rdd,
- 						   const char *name, int len,
- 						   u64 ino, unsigned int d_type)
- {
-@@ -98,29 +99,8 @@ static struct ovl_cache_entry *ovl_cache
- 	p->is_whiteout = false;
- 
- 	if (d_type == DT_CHR) {
--		struct dentry *dentry;
--		const struct cred *old_cred;
--		struct cred *override_cred;
--
--		override_cred = prepare_creds();
--		if (!override_cred) {
--			kfree(p);
--			return NULL;
--		}
--
--		/*
--		 * CAP_DAC_OVERRIDE for lookup
--		 */
--		cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
--		old_cred = override_creds(override_cred);
--
--		dentry = lookup_one_len(name, dir, len);
--		if (!IS_ERR(dentry)) {
--			p->is_whiteout = ovl_is_whiteout(dentry);
--			dput(dentry);
--		}
--		revert_creds(old_cred);
--		put_cred(override_cred);
-+		p->next_maybe_whiteout = rdd->first_maybe_whiteout;
-+		rdd->first_maybe_whiteout = p;
- 	}
- 	return p;
- }
-@@ -148,7 +128,7 @@ static int ovl_cache_entry_add_rb(struct
- 			return 0;
- 	}
- 
--	p = ovl_cache_entry_new(rdd->dir, name, len, ino, d_type);
-+	p = ovl_cache_entry_new(rdd, name, len, ino, d_type);
- 	if (p == NULL)
- 		return -ENOMEM;
- 
-@@ -169,7 +149,7 @@ static int ovl_fill_lower(struct ovl_rea
- 	if (p) {
- 		list_move_tail(&p->l_node, &rdd->middle);
- 	} else {
--		p = ovl_cache_entry_new(rdd->dir, name, namelen, ino, d_type);
-+		p = ovl_cache_entry_new(rdd, name, namelen, ino, d_type);
- 		if (p == NULL)
- 			rdd->err = -ENOMEM;
- 		else
-@@ -219,6 +199,43 @@ static int ovl_fill_merge(struct dir_con
- 		return ovl_fill_lower(rdd, name, namelen, offset, ino, d_type);
- }
- 
-+static int ovl_check_whiteouts(struct dentry *dir, struct ovl_readdir_data *rdd)
-+{
-+	int err = 0;
-+
-+	mutex_lock(&dir->d_inode->i_mutex);
-+	while (rdd->first_maybe_whiteout) {
-+		struct dentry *dentry;
-+		const struct cred *old_cred;
-+		struct cred *override_cred;
-+		struct ovl_cache_entry *p = rdd->first_maybe_whiteout;
-+
-+		rdd->first_maybe_whiteout = p->next_maybe_whiteout;
-+
-+		override_cred = prepare_creds();
-+		if (!override_cred) {
-+			err = -ENOMEM;
-+			break;
-+		}
-+		/*
-+		 * CAP_DAC_OVERRIDE for lookup
-+		 */
-+		cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE);
-+		old_cred = override_creds(override_cred);
-+
-+		dentry = lookup_one_len(p->name, dir, p->len);
-+		if (!IS_ERR(dentry)) {
-+			p->is_whiteout = ovl_is_whiteout(dentry);
-+			dput(dentry);
-+		}
-+		revert_creds(old_cred);
-+		put_cred(override_cred);
-+	}
-+	mutex_unlock(&dir->d_inode->i_mutex);
-+
-+	return err;
-+}
-+
- static inline int ovl_dir_read(struct path *realpath,
- 			       struct ovl_readdir_data *rdd)
- {
-@@ -229,7 +246,7 @@ static inline int ovl_dir_read(struct pa
- 	if (IS_ERR(realfile))
- 		return PTR_ERR(realfile);
- 
--	rdd->dir = realpath->dentry;
-+	rdd->first_maybe_whiteout = NULL;
- 	rdd->ctx.pos = 0;
- 	do {
- 		rdd->count = 0;
-@@ -238,6 +255,10 @@ static inline int ovl_dir_read(struct pa
- 		if (err >= 0)
- 			err = rdd->err;
- 	} while (!err && rdd->count);
-+
-+	if (!err && rdd->first_maybe_whiteout)
-+		err = ovl_check_whiteouts(realpath->dentry, rdd);
-+
- 	fput(realfile);
- 
- 	return err;
diff --git a/target/linux/generic/patches-4.1/834-ledtrig-libata.patch b/target/linux/generic/patches-4.1/834-ledtrig-libata.patch
index 2a0fb07..b794c46 100644
--- a/target/linux/generic/patches-4.1/834-ledtrig-libata.patch
+++ b/target/linux/generic/patches-4.1/834-ledtrig-libata.patch
@@ -69,7 +69,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  /**
   *	ata_build_rw_tf - Build ATA taskfile for given read/write request
   *	@tf: Target ATA taskfile
-@@ -4774,6 +4787,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
+@@ -4789,6 +4802,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
  		if (tag < 0)
  			return NULL;
  	}
@@ -79,7 +79,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  
  	qc = __ata_qc_from_tag(ap, tag);
  	qc->tag = tag;
-@@ -5671,6 +5687,9 @@ struct ata_port *ata_port_alloc(struct a
+@@ -5686,6 +5702,9 @@ struct ata_port *ata_port_alloc(struct a
  	ap->stats.unhandled_irq = 1;
  	ap->stats.idle_irq = 1;
  #endif
@@ -89,7 +89,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  	ata_sff_port_init(ap);
  
  	return ap;
-@@ -5692,6 +5711,12 @@ static void ata_host_release(struct devi
+@@ -5707,6 +5726,12 @@ static void ata_host_release(struct devi
  
  		kfree(ap->pmp_link);
  		kfree(ap->slave_link);
@@ -102,7 +102,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  		kfree(ap);
  		host->ports[i] = NULL;
  	}
-@@ -6138,7 +6163,23 @@ int ata_host_register(struct ata_host *h
+@@ -6153,7 +6178,23 @@ int ata_host_register(struct ata_host *h
  		host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
  		host->ports[i]->local_port_no = i + 1;
  	}
@@ -138,7 +138,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  
  /*
   * Define if arch has non-standard setup.  This is a _PCI_ standard
-@@ -873,6 +876,12 @@ struct ata_port {
+@@ -876,6 +879,12 @@ struct ata_port {
  #ifdef CONFIG_ATA_ACPI
  	struct ata_acpi_gtm	__acpi_init_gtm; /* use ata_acpi_init_gtm() */
  #endif
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Tue Aug  4 19:00:02 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Wed,  5 Aug 2015 01:00:02 +0200
Subject: [OpenWrt-Devel] [PATCHv2] Fixes regarding bridge
	multicast-to-unicast feature
Message-ID: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>

Hi,

Here are a few patches to fix the issues the multicast-to-unicast
feature of the bridge has: IGMP/MLD report suppression could lead
to multicast packet loss. Also see ticket #17625 [0].

As previously discussed on this mailing list, AP-isolation together
with bridge-hairpinning is a way to make the multicast-to-unicast
feature usable even if listeners potentially suppressing reports
are present: That way the bridge will get all reports and will have
full control on where to forward them. For instance *not* to other
STAs (unless there is a multicast router).

Furthermore [PATCH netifd 2/3] introduces a netifd option to disable
the multicast-to-unicast feature.

[PATCH netifd 3/3] is not related to this issue but introduces a
handy option (which I would like to make use of for IGMP/MLD domain
segmentation).


The OpenWRT specific patches should be applied after the netifd
patches arrived in OpenWRT.

Cheers, Linus

[0]: https://dev.openwrt.org/ticket/17625

~~~

Changelog v2:
* Separated introduction of multicast_to_unicast configuration option
  in separate patch
* passing multicast_to_unicast to netifd scripts via json from netifd
  instead of external uci command calls
* Moved multicast_to_unicast uci option to be a bridge instead of
  bridge member option
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Tue Aug  4 19:00:03 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Wed,  5 Aug 2015 01:00:03 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 1/3] bridge: Fix
 multicast_to_unicast feature by hairpin+isolate
In-Reply-To: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1438729208-3556-2-git-send-email-linus.luessing@c0d3.blue>

All IGMP and MLD versions suffer from a specific limitation (from a
snooping switch perspective): Report suppression.

Once a listener hears an IGMPv2/3 or MLDv1 report for the same group
itself participates in then it might (if this listener is an IGMPv3 or
MLDv2 listener) or will (if this is an IGMPv1/2 or MLDv1 listener)
refrain from sending its own report.

Therefore we might currently miss such surpressing listeners as they
won't receive the multicast packet with the mangled, unicasted
destination.

Fixing this by first isolating the STAs and giving the bridge more
control over traffic forwarding. E.g. refraining to forward listener
reports to other STAs.

For broadcast and unicast traffic to an STA on the same AP, the hairpin
feature of the bridge will reflect such traffic back to the AP
interface. However, if the AP interface is actually configured to
isolate STAs, then hairpin is kept disabled.

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 device.h       |    1 +
 system-linux.c |   26 ++++++++++++++++++++------
 wireless.c     |   12 +++++++++++-
 wireless.h     |    1 +
 4 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/device.h b/device.h
index ce135ba..373445c 100644
--- a/device.h
+++ b/device.h
@@ -173,6 +173,7 @@ struct device {
 	bool iface_config;
 	bool default_config;
 	bool wireless;
+	bool wireless_isolate;
 
 	struct interface *config_iface;
 
diff --git a/system-linux.c b/system-linux.c
index 9ba13fd..9c4bea6 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -315,6 +315,16 @@ static void system_set_dadtransmits(struct device *dev, const char *val)
 	system_set_dev_sysctl("/proc/sys/net/ipv6/conf/%s/dad_transmits", dev->ifname, val);
 }
 
+static void system_bridge_set_multicast_to_unicast(struct device *dev, const char *val)
+{
+	system_set_dev_sysctl("/sys/class/net/%s/brport/multicast_to_unicast", dev->ifname, val);
+}
+
+static void system_bridge_set_hairpin_mode(struct device *dev, const char *val)
+{
+	system_set_dev_sysctl("/sys/class/net/%s/brport/hairpin_mode", dev->ifname, val);
+}
+
 static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz)
 {
 	int fd = -1, ret = -1;
@@ -556,12 +566,16 @@ static char *system_get_bridge(const char *name, char *buf, int buflen)
 	return path + 1;
 }
 
-static void system_bridge_set_wireless(const char *bridge, const char *dev)
+static void
+system_bridge_set_wireless(struct device *dev)
 {
-	snprintf(dev_buf, sizeof(dev_buf),
-		 "/sys/devices/virtual/net/%s/brif/%s/multicast_to_unicast",
-		 bridge, dev);
-	system_set_sysctl(dev_buf, "1");
+	bool hairpin = true;
+
+	if (dev->wireless_isolate)
+		hairpin = false;
+
+	system_bridge_set_multicast_to_unicast(dev, "1");
+	system_bridge_set_hairpin_mode(dev, hairpin ? "1" : "0");
 }
 
 int system_bridge_addif(struct device *bridge, struct device *dev)
@@ -574,7 +588,7 @@ int system_bridge_addif(struct device *bridge, struct device *dev)
 		ret = system_bridge_if(bridge->ifname, dev, SIOCBRADDIF, NULL);
 
 	if (dev->wireless)
-		system_bridge_set_wireless(bridge->ifname, dev->ifname);
+		system_bridge_set_wireless(dev);
 
 	return ret;
 }
diff --git a/wireless.c b/wireless.c
index fbd6191..337f563 100644
--- a/wireless.c
+++ b/wireless.c
@@ -35,12 +35,14 @@ static const struct uci_blob_param_list wdev_param = {
 enum {
 	VIF_ATTR_DISABLED,
 	VIF_ATTR_NETWORK,
+	VIF_ATTR_ISOLATE,
 	__VIF_ATTR_MAX,
 };
 
 static const struct blobmsg_policy vif_policy[__VIF_ATTR_MAX] = {
 	[VIF_ATTR_DISABLED] = { .name = "disabled", .type = BLOBMSG_TYPE_BOOL },
 	[VIF_ATTR_NETWORK] = { .name = "network", .type = BLOBMSG_TYPE_ARRAY },
+	[VIF_ATTR_ISOLATE] = { .name = "isolate", .type = BLOBMSG_TYPE_BOOL },
 };
 
 static const struct uci_blob_param_list vif_param = {
@@ -204,8 +206,10 @@ static void wireless_interface_handle_link(struct wireless_interface *vif, bool
 
 	if (up) {
 		struct device *dev = device_get(vif->ifname, 2);
-		if (dev)
+		if (dev) {
+			dev->wireless_isolate = vif->isolate;
 			dev->wireless = true;
+		}
 	}
 
 	blobmsg_for_each_attr(cur, vif->network, rem) {
@@ -700,6 +704,12 @@ void wireless_interface_create(struct wireless_device *wdev, struct blob_attr *d
 	vif->wdev = wdev;
 	vif->config = data;
 	vif->section = section;
+	vif->isolate = false;
+
+	cur = tb[VIF_ATTR_ISOLATE];
+	if (cur && blobmsg_get_bool(cur))
+		vif->isolate = blobmsg_get_bool(cur);
+
 	vlist_add(&wdev->interfaces, &vif->node, vif->name);
 }
 
diff --git a/wireless.h b/wireless.h
index c5dbb88..476c63e 100644
--- a/wireless.h
+++ b/wireless.h
@@ -77,6 +77,7 @@ struct wireless_interface {
 
 	const char *ifname;
 	struct blob_attr *network;
+	bool isolate;
 };
 
 struct wireless_process {
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Tue Aug  4 19:00:04 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Wed,  5 Aug 2015 01:00:04 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 2/3] bridge: Allow setting
	multicast_to_unicast option
In-Reply-To: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1438729208-3556-3-git-send-email-linus.luessing@c0d3.blue>

With this patch the multicast_to_unicast feature can be disabled for all
wireless interfaces via an according option on the uci bridge interface.

This patch also exports the setting information to wireless handler
scripts. The hostapd script will need that information to determine
whether to enable or disable ap-isolation, for instance.

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 device.c                   |    9 +++++++++
 device.h                   |    3 +++
 scripts/netifd-wireless.sh |    1 +
 system-linux.c             |   13 +++++++++----
 wireless.c                 |    4 ++++
 5 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/device.c b/device.c
index b5bee11..b44ccb8 100644
--- a/device.c
+++ b/device.c
@@ -48,6 +48,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = {
 	[DEV_ATTR_RPS] = { .name = "rps", .type = BLOBMSG_TYPE_BOOL },
 	[DEV_ATTR_XPS] = { .name = "xps", .type = BLOBMSG_TYPE_BOOL },
 	[DEV_ATTR_DADTRANSMITS] = { .name = "dadtransmits", .type = BLOBMSG_TYPE_INT32 },
+	[DEV_ATTR_MULTICAST_TO_UNICAST] = { .name = "multicast_to_unicast", .type = BLOBMSG_TYPE_BOOL },
 };
 
 const struct uci_blob_param_list device_attr_list = {
@@ -174,6 +175,7 @@ device_merge_settings(struct device *dev, struct device_settings *n)
 		s->neigh6reachabletime : os->neigh6reachabletime;
 	n->dadtransmits = s->flags & DEV_OPT_DADTRANSMITS ?
 		s->dadtransmits : os->dadtransmits;
+	n->multicast_to_unicast = s->multicast_to_unicast;
 	n->flags = s->flags | os->flags;
 }
 
@@ -274,6 +276,11 @@ device_init_settings(struct device *dev, struct blob_attr **tb)
 		s->flags |= DEV_OPT_DADTRANSMITS;
 	}
 
+	if ((cur = tb[DEV_ATTR_MULTICAST_TO_UNICAST])) {
+		s->multicast_to_unicast = blobmsg_get_bool(cur);
+		s->flags |= DEV_OPT_MULTICAST_TO_UNICAST;
+	}
+
 	device_set_disabled(dev, disabled);
 }
 
@@ -884,6 +891,8 @@ device_dump_status(struct blob_buf *b, struct device *dev)
 		}
 		if (st.flags & DEV_OPT_DADTRANSMITS)
 			blobmsg_add_u32(b, "dadtransmits", st.dadtransmits);
+		if (st.flags & DEV_OPT_MULTICAST_TO_UNICAST)
+			blobmsg_add_u8(b, "multicast_to_unicast", st.multicast_to_unicast);
 	}
 
 	s = blobmsg_open_table(b, "statistics");
diff --git a/device.h b/device.h
index 373445c..4344d8a 100644
--- a/device.h
+++ b/device.h
@@ -42,6 +42,7 @@ enum {
 	DEV_ATTR_RPS,
 	DEV_ATTR_XPS,
 	DEV_ATTR_DADTRANSMITS,
+	DEV_ATTR_MULTICAST_TO_UNICAST,
 	__DEV_ATTR_MAX,
 };
 
@@ -84,6 +85,7 @@ enum {
 	DEV_OPT_XPS			= (1 << 11),
 	DEV_OPT_MTU6			= (1 << 12),
 	DEV_OPT_DADTRANSMITS		= (1 << 13),
+	DEV_OPT_MULTICAST_TO_UNICAST	= (1 << 14),
 };
 
 /* events broadcasted to all users of a device */
@@ -141,6 +143,7 @@ struct device_settings {
 	bool rps;
 	bool xps;
 	unsigned int dadtransmits;
+	bool multicast_to_unicast;
 };
 
 /*
diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh
index c5d8a96..4d81929 100644
--- a/scripts/netifd-wireless.sh
+++ b/scripts/netifd-wireless.sh
@@ -260,6 +260,7 @@ for_each_interface() {
 		json_select "$_w_iface"
 		if [ -n "$_w_types" ]; then
 			json_get_var network_bridge bridge
+			json_get_var multicast_to_unicast multicast_to_unicast
 			json_select config
 			json_get_var _w_type mode
 			json_select ..
diff --git a/system-linux.c b/system-linux.c
index 9c4bea6..944245c 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -567,14 +567,19 @@ static char *system_get_bridge(const char *name, char *buf, int buflen)
 }
 
 static void
-system_bridge_set_wireless(struct device *dev)
+system_bridge_set_wireless(struct device *bridge, struct device *dev)
 {
+	bool mcast_to_ucast = true;
 	bool hairpin = true;
 
-	if (dev->wireless_isolate)
+	if (bridge->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST &&
+	    !bridge->settings.multicast_to_unicast)
+		mcast_to_ucast = false;
+
+	if (!mcast_to_ucast || dev->wireless_isolate)
 		hairpin = false;
 
-	system_bridge_set_multicast_to_unicast(dev, "1");
+	system_bridge_set_multicast_to_unicast(dev, mcast_to_ucast ? "1" : "0");
 	system_bridge_set_hairpin_mode(dev, hairpin ? "1" : "0");
 }
 
@@ -588,7 +593,7 @@ int system_bridge_addif(struct device *bridge, struct device *dev)
 		ret = system_bridge_if(bridge->ifname, dev, SIOCBRADDIF, NULL);
 
 	if (dev->wireless)
-		system_bridge_set_wireless(dev);
+		system_bridge_set_wireless(bridge, dev);
 
 	return ret;
 }
diff --git a/wireless.c b/wireless.c
index 337f563..d0d2942 100644
--- a/wireless.c
+++ b/wireless.c
@@ -92,6 +92,10 @@ vif_config_add_bridge(struct blob_buf *buf, struct blob_attr *networks, bool pre
 		dev->hotplug_ops->prepare(dev);
 
 	blobmsg_add_string(buf, "bridge", dev->ifname);
+
+	if (dev->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST)
+		blobmsg_add_u8(buf, "multicast_to_unicast",
+			       dev->settings.multicast_to_unicast);
 }
 
 static void
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Tue Aug  4 19:00:05 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Wed,  5 Aug 2015 01:00:05 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 3/3] bridge: Allow setting
	multicast_router option
In-Reply-To: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1438729208-3556-4-git-send-email-linus.luessing@c0d3.blue>

The multicast_router option of a bridge allows to control the forwarding
behaviour of multicast packets independant of the listener state:

* 0: Only forward if specific listener is present
* 1 (default): Forward if specific listener or a multicast router
  was detected (currently only learned via query messages, no MRD
  support yet)
* 2: Always forward any multicast traffic on this port

Since MRD is not mandated you might end up with silent multicast routers
(e.g. if your link has more than one multicast router; only one can
become the selected, "noisy" querier). Here you might need a manual
configuration option like the "multicast_router" option.

Other scenarios where this can be useful are for instance:
* Segmentation of IGMP/MLD domains together with ebtables
* Dedicated bridge port for monitoring/debugging purposes

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 device.c       |   12 ++++++++++++
 device.h       |    3 +++
 system-linux.c |   18 ++++++++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/device.c b/device.c
index b44ccb8..d6e288c 100644
--- a/device.c
+++ b/device.c
@@ -49,6 +49,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = {
 	[DEV_ATTR_XPS] = { .name = "xps", .type = BLOBMSG_TYPE_BOOL },
 	[DEV_ATTR_DADTRANSMITS] = { .name = "dadtransmits", .type = BLOBMSG_TYPE_INT32 },
 	[DEV_ATTR_MULTICAST_TO_UNICAST] = { .name = "multicast_to_unicast", .type = BLOBMSG_TYPE_BOOL },
+	[DEV_ATTR_MULTICAST_ROUTER] = { .name = "multicast_router", .type = BLOBMSG_TYPE_INT32 },
 };
 
 const struct uci_blob_param_list device_attr_list = {
@@ -176,6 +177,7 @@ device_merge_settings(struct device *dev, struct device_settings *n)
 	n->dadtransmits = s->flags & DEV_OPT_DADTRANSMITS ?
 		s->dadtransmits : os->dadtransmits;
 	n->multicast_to_unicast = s->multicast_to_unicast;
+	n->multicast_router = s->multicast_router;
 	n->flags = s->flags | os->flags;
 }
 
@@ -281,6 +283,14 @@ device_init_settings(struct device *dev, struct blob_attr **tb)
 		s->flags |= DEV_OPT_MULTICAST_TO_UNICAST;
 	}
 
+	if ((cur = tb[DEV_ATTR_MULTICAST_ROUTER])) {
+		s->multicast_router = blobmsg_get_u32(cur);
+		if (s->multicast_router >= 0 && s->multicast_router <= 2)
+			s->flags |= DEV_OPT_MULTICAST_ROUTER;
+		else
+			DPRINTF("Invalid value: %d - (Use 0: never, 1: learn, 2: always)\n", blobmsg_get_u32(cur));
+	}
+
 	device_set_disabled(dev, disabled);
 }
 
@@ -893,6 +903,8 @@ device_dump_status(struct blob_buf *b, struct device *dev)
 			blobmsg_add_u32(b, "dadtransmits", st.dadtransmits);
 		if (st.flags & DEV_OPT_MULTICAST_TO_UNICAST)
 			blobmsg_add_u8(b, "multicast_to_unicast", st.multicast_to_unicast);
+		if (st.flags & DEV_OPT_MULTICAST_ROUTER)
+			blobmsg_add_u32(b, "multicast_router", st.multicast_router);
 	}
 
 	s = blobmsg_open_table(b, "statistics");
diff --git a/device.h b/device.h
index 4344d8a..86a1628 100644
--- a/device.h
+++ b/device.h
@@ -43,6 +43,7 @@ enum {
 	DEV_ATTR_XPS,
 	DEV_ATTR_DADTRANSMITS,
 	DEV_ATTR_MULTICAST_TO_UNICAST,
+	DEV_ATTR_MULTICAST_ROUTER,
 	__DEV_ATTR_MAX,
 };
 
@@ -86,6 +87,7 @@ enum {
 	DEV_OPT_MTU6			= (1 << 12),
 	DEV_OPT_DADTRANSMITS		= (1 << 13),
 	DEV_OPT_MULTICAST_TO_UNICAST	= (1 << 14),
+	DEV_OPT_MULTICAST_ROUTER	= (1 << 15),
 };
 
 /* events broadcasted to all users of a device */
@@ -144,6 +146,7 @@ struct device_settings {
 	bool xps;
 	unsigned int dadtransmits;
 	bool multicast_to_unicast;
+	unsigned int multicast_router;
 };
 
 /*
diff --git a/system-linux.c b/system-linux.c
index 944245c..01500a5 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -325,6 +325,13 @@ static void system_bridge_set_hairpin_mode(struct device *dev, const char *val)
 	system_set_dev_sysctl("/sys/class/net/%s/brport/hairpin_mode", dev->ifname, val);
 }
 
+static void system_bridge_set_multicast_router(struct device *dev, const char *val, bool bridge)
+{
+	system_set_dev_sysctl(bridge ? "/sys/class/net/%s/bridge/multicast_router" :
+				       "/sys/class/net/%s/brport/multicast_router",
+			      dev->ifname, val);
+}
+
 static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz)
 {
 	int fd = -1, ret = -1;
@@ -585,6 +592,7 @@ system_bridge_set_wireless(struct device *bridge, struct device *dev)
 
 int system_bridge_addif(struct device *bridge, struct device *dev)
 {
+	char buf[64];
 	char *oldbr;
 	int ret = 0;
 
@@ -595,6 +603,11 @@ int system_bridge_addif(struct device *bridge, struct device *dev)
 	if (dev->wireless)
 		system_bridge_set_wireless(bridge, dev);
 
+	if (dev->settings.flags & DEV_OPT_MULTICAST_ROUTER) {
+		snprintf(buf, sizeof(buf), "%i", dev->settings.multicast_router);
+		system_bridge_set_multicast_router(dev, buf, false);
+	}
+
 	return ret;
 }
 
@@ -845,6 +858,11 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg)
 	system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/hash_max",
 		bridge->ifname, buf);
 
+	if (bridge->settings.flags & DEV_OPT_MULTICAST_ROUTER) {
+		snprintf(buf, sizeof(buf), "%i", bridge->settings.multicast_router);
+		system_bridge_set_multicast_router(bridge, buf, true);
+	}
+
 	args[0] = BRCTL_SET_BRIDGE_PRIORITY;
 	args[1] = cfg->priority;
 	system_bridge_if(bridge->ifname, NULL, SIOCDEVPRIVATE, &args);
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From leroi.lists at gmail.com  Tue Aug  4 19:00:06 2015
From: leroi.lists at gmail.com (Roman Yeryomin)
Date: Wed, 5 Aug 2015 02:00:06 +0300
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <55C11F77.6050809@harvestai.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
Message-ID: <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>

On 4 August 2015 at 23:24, Joshua Judson Rosen <jrosen at harvestai.com> wrote:
> On 2015-08-04 14:14, Roman Yeryomin wrote:
>> On 4 August 2015 at 17:58, Joshua Judson Rosen <jrosen at harvestai.com> wrote:
>>> On 2015-08-04 02:26, David Lang wrote:
>>>> A given radio can be either an AP or a client, but not both at once.
>>>>
>>>> so if you use a radio to connect to another AP, you are making it a client, and
>>>> in client mode all it can do is connect to that other AP as shows up as the SSID
>>>> of that other AP.
>>>>
>>>> you can do this with one radio, while using the other radio (assuming you have
>>>> two) to act as an AP for local clients.
>>>
>>>
>>> This is not necessarily true: with at least some hardware/drivers, it's
>>> possible to create multiple virtual interfaces on top of a single radio--
>>> and separate virtual interfaces can in fact operate in different modes
>>> (e.g.: one in STA mode, two in AP mode, one in mesh mode...).
>>>
>>> Assuming that your hardware/driver is capable of supporting multiple
>>> virtual interfaces on top of the single physical radio,
>>> you can create these interfaces by adding "wifi-iface" stanzas
>>> in /etc/config/wireless, e.g:
>>>
>>>         config wifi-device 'radio0'
>>>                 option type 'mac80211'
>>>                 option channel '11'
>>>                 option hwmode '11g'
>>>                 option path 'platform/ar933x_wmac'
>>>                 option htmode 'HT20'
>>>                 option country 'US'
>>>                 option txpower '20'
>>>
>>>         config wifi-iface 'ap1'
>>>                 option device 'radio0'
>>>                 option mode 'ap'
>>>                 option wds '1'
>>>                 option ssid 'my AP'
>>>                 option network 'lan'
>>>
>>>         config wifi-iface 'mesh1'
>>>                 option device 'radio0'
>>>                 option mode 'mesh'
>>>                 option mesh_id 'my mesh'
>>>                 option network 'lan'
>>>
>>>
>>> That creates two virtual interfaces using the same physical radio,
>>> and bridges them together onto the OpenWrt "lan network"
>>> (which is itself defined in /etc/config/network).
>>>
>>>
>>> I believe you could also have an interface with "mode 'sta'", but note
>>> that it would also need to use the same channel as the other interfaces--
>>> which means that the external AP to which you connect it would also
>>> need to use that same channel (11, in the example above).
>>> That's where having multiple *radios* helps: you can run them on
>>> different frequencies (either completely different bands [2.4 GHz vs. 5 GHz],
>>> or on different channels within the same band [e.g. 2.427 GHz = channel 4
>>> vs. 2.472 GHz = channel 13]) to increase efficiency by multiplexing
>>> less data over a single radio, or to increase compatibility with other
>>> APs outside of your control that you might want to connect to.
>>>
>>> Also note that, if you want to bridge a STA interface onto anything else,
>>> it'll need to be in "WDS" mode _and_ the the AP to which it's connecting
>>> will also need to be in "WDS" mode (note the "option wds '1'",
>>> in my example above), because the standard "3-address mode" of Wi-Fi
>>> isn't bridgeable (and note that WDS "4-address mode" is bridgeable,
>>> but not standardised across different platforms--so you're probably
>>> OK so long as all of your equipment is running Linux and using
>>> the same Wi-Fi driver, but don't expect to bridge a STA interface
>>> that's connected non-Linux Wi-Fi router).
>>>
>>> At least, I've seen this work with Atheros chips. There are some
>>> notes in the wiki about how Broadcom chips have their own, different
>>> solution implemented in hardware; and about how some drivers
>>> don't support this stuff at all....
>>
>> Actually 3-address mode bridging is possible with the help of relayd
>
> That's not actually "3-address mode bridging", though--
> it's relaying (done entirely through a userspace daemon,
> which AFAICT actually relays only IPv4, ARP, and DHCP packets).

OK, yes technically it's not bridging :)

>> and it even works quite good.
>> But there is an issue (also mentioned in a parallel thread): when
>> client interface cannot connect then AP interface doesn't come up
>> also. Which may not be a problem unless you want to bridge ethernet
>> there also.
>> On the other hand you may not be able to switch the main AP into
>> 4-address mode so relayd is a way out.
>
> It may be a solution.
>
> When I tried it a few months back (in Barrier Breaker),
> relayd wasn't really working for me....
>
> I know that's a terrible (non-)description; I don't specifically
> remember what seemed to be going wrong, except that there was
> a lot of traffic not reliably getting through to where it was supposed to,
> and that it was confusing, and that I was able to slightly improve
> the situation by fiddling with some of the options that the init-script
> passed to relayd (IIRC, I had some success using "-I" on only one interface
> and "-i" on the other), but I didn't have time to dig in and actually
> understand what wasn't working--just switching to 4-address mode and having
> OpenWrt set up a kernel-level bridge w/ brctl was a more expedient
> path for me to get something working reliably at the time.
>
> Actually, if anyone can offer guesses as to what my issues
> with relayd might have actually been, I'd be glad to hear them :)
>
> I'm not specifically aware of a reason why IPv4+ARP+DHCP relaying
> should have been insufficient for what I was doing (I wasn't
> running any weird non-IP protocols...).
>
> Maybe someone can point me to a basic explanation of what
> sort of "ARP cache and host route management" the "-I" option
> is actually doing--and why I might need to disable it on one
> of my interfaces?
>

I was using trunk around March-April this year and didn't have any
problems. So I would suggest just trying newer version.


Regards,
Roman
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Tue Aug  4 19:00:06 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Wed,  5 Aug 2015 01:00:06 +0200
Subject: [OpenWrt-Devel] [PATCHv2 openwrt 1/3] hostapd: Always isolate if
 brport->multicast_to_unicast is enabled
In-Reply-To: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1438729208-3556-5-git-send-email-linus.luessing@c0d3.blue>

For the multicast-to-unicast feature of a bridge to function correctly,
it is necessary that all STAs are always isolated on the AP level. The
bridge will take care of reflecting packets back to the AP interface
if necessary and/or no STA isolation wanted by using the hairpin feature
of the bridge.

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 package/network/services/hostapd/files/netifd.sh |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index a3ffd93..b987a63 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -1,3 +1,6 @@
+. /lib/network/config.sh
+. /lib/config/uci.sh
+
 wpa_supplicant_add_rate() {
 	local var="$1"
 	local val="$(($2 / 1000))"
@@ -194,9 +197,15 @@ hostapd_set_bss_options() {
 	set_default uapsd 1
 
 	append bss_conf "ctrl_interface=/var/run/hostapd"
+
+	[ -n "$multicast_to_unicast" ] || multicast_to_unicast=1
+
 	if [ "$isolate" -gt 0 ]; then
 		append bss_conf "ap_isolate=$isolate" "$N"
+	elif [ -n "$network_bridge" -a $multicast_to_unicast -gt 0 ]; then
+		append bss_conf "ap_isolate=1" "$N"
 	fi
+
 	if [ "$maxassoc" -gt 0 ]; then
 		append bss_conf "max_num_sta=$maxassoc" "$N"
 	fi
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Tue Aug  4 19:00:07 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Wed,  5 Aug 2015 01:00:07 +0200
Subject: [OpenWrt-Devel] [PATCHv2 openwrt 2/3] Revert "kernel: disable
 multicast-to-unicast translation for ipv6 neighbor solicitation (#17625)"
In-Reply-To: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1438729208-3556-6-git-send-email-linus.luessing@c0d3.blue>

This reverts commit a080e8e1943156168913d0353a2e99d1151102aa.

It did not fix the problem but just hid some symptom. The real issue was
that IGMP/MLD report suppression was not considered for the
multicast-to-unicast feature. A recent netifd which isolates IGMP/MLD
reports between STAs by utilizing AP-isolation and bridge-hairpinning
should have fixed this.

It is perfectly fine to apply multicast-to-unicast to IPv6 Neighbor
Solicitations, too (once that feature is configured correctly).

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 .../645-bridge_multicast_to_unicast.patch          |   37 +++++++++-----------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
index 00ad14f..e8be1fd 100644
--- a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
+++ b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
@@ -87,19 +87,16 @@
  {
  	struct br_ip br_group;
  
-@@ -736,7 +758,10 @@ static int br_ip6_multicast_add_group(st
+@@ -736,7 +758,7 @@ static int br_ip6_multicast_add_group(st
  	br_group.proto = htons(ETH_P_IPV6);
  	br_group.vid = vid;
  
 -	return br_multicast_add_group(br, port, &br_group);
-+	if (ipv6_addr_is_solict_mult(group))
-+		src = NULL;
-+
 +	return br_multicast_add_group(br, port, &br_group, src);
  }
  #endif
  
-@@ -965,6 +990,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -965,6 +987,7 @@ static int br_ip4_multicast_igmp3_report
  					 struct sk_buff *skb,
  					 u16 vid)
  {
@@ -107,7 +104,7 @@
  	struct igmpv3_report *ih;
  	struct igmpv3_grec *grec;
  	int i;
-@@ -1008,7 +1034,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -1008,7 +1031,7 @@ static int br_ip4_multicast_igmp3_report
  			continue;
  		}
  
@@ -116,7 +113,7 @@
  		if (err)
  			break;
  	}
-@@ -1022,6 +1048,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1022,6 +1045,7 @@ static int br_ip6_multicast_mld2_report(
  					struct sk_buff *skb,
  					u16 vid)
  {
@@ -124,7 +121,7 @@
  	struct icmp6hdr *icmp6h;
  	struct mld2_grec *grec;
  	int i;
-@@ -1070,7 +1097,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1070,7 +1094,7 @@ static int br_ip6_multicast_mld2_report(
  		}
  
  		err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
@@ -133,7 +130,7 @@
  		if (err)
  			break;
  	}
-@@ -1406,7 +1433,8 @@ br_multicast_leave_group(struct net_brid
+@@ -1407,7 +1431,8 @@ br_multicast_leave_group(struct net_brid
  			 struct net_bridge_port *port,
  			 struct br_ip *group,
  			 struct bridge_mcast_other_query *other_query,
@@ -143,7 +140,7 @@
  {
  	struct net_bridge_mdb_htable *mdb;
  	struct net_bridge_mdb_entry *mp;
-@@ -1456,7 +1484,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1457,7 +1482,7 @@ br_multicast_leave_group(struct net_brid
  		for (pp = &mp->ports;
  		     (p = mlock_dereference(*pp, br)) != NULL;
  		     pp = &p->next) {
@@ -152,7 +149,7 @@
  				continue;
  
  			rcu_assign_pointer(*pp, p->next);
-@@ -1490,7 +1518,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1491,7 +1516,7 @@ br_multicast_leave_group(struct net_brid
  	for (p = mlock_dereference(mp->ports, br);
  	     p != NULL;
  	     p = mlock_dereference(p->next, br)) {
@@ -161,7 +158,7 @@
  			continue;
  
  		if (!hlist_unhashed(&p->mglist) &&
-@@ -1508,8 +1536,8 @@ out:
+@@ -1509,8 +1534,8 @@ out:
  
  static void br_ip4_multicast_leave_group(struct net_bridge *br,
  					 struct net_bridge_port *port,
@@ -172,7 +169,7 @@
  {
  	struct br_ip br_group;
  	struct bridge_mcast_own_query *own_query;
-@@ -1524,14 +1552,14 @@ static void br_ip4_multicast_leave_group
+@@ -1525,14 +1550,14 @@ static void br_ip4_multicast_leave_group
  	br_group.vid = vid;
  
  	br_multicast_leave_group(br, port, &br_group, &br->ip4_other_query,
@@ -189,7 +186,7 @@
  {
  	struct br_ip br_group;
  	struct bridge_mcast_own_query *own_query;
-@@ -1546,7 +1574,7 @@ static void br_ip6_multicast_leave_group
+@@ -1547,7 +1572,7 @@ static void br_ip6_multicast_leave_group
  	br_group.vid = vid;
  
  	br_multicast_leave_group(br, port, &br_group, &br->ip6_other_query,
@@ -198,7 +195,7 @@
  }
  #endif
  
-@@ -1555,6 +1583,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1556,6 +1581,7 @@ static int br_multicast_ipv4_rcv(struct
  				 struct sk_buff *skb,
  				 u16 vid)
  {
@@ -206,7 +203,7 @@
  	struct sk_buff *skb2 = skb;
  	const struct iphdr *iph;
  	struct igmphdr *ih;
-@@ -1628,7 +1657,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1629,7 +1655,7 @@ static int br_multicast_ipv4_rcv(struct
  	case IGMP_HOST_MEMBERSHIP_REPORT:
  	case IGMPV2_HOST_MEMBERSHIP_REPORT:
  		BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
@@ -215,7 +212,7 @@
  		break;
  	case IGMPV3_HOST_MEMBERSHIP_REPORT:
  		err = br_ip4_multicast_igmp3_report(br, port, skb2, vid);
-@@ -1637,7 +1666,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1638,7 +1664,7 @@ static int br_multicast_ipv4_rcv(struct
  		err = br_ip4_multicast_query(br, port, skb2, vid);
  		break;
  	case IGMP_HOST_LEAVE_MESSAGE:
@@ -224,7 +221,7 @@
  		break;
  	}
  
-@@ -1655,6 +1684,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1656,6 +1682,7 @@ static int br_multicast_ipv6_rcv(struct
  				 struct sk_buff *skb,
  				 u16 vid)
  {
@@ -232,7 +229,7 @@
  	struct sk_buff *skb2;
  	const struct ipv6hdr *ip6h;
  	u8 icmp6_type;
-@@ -1764,7 +1794,8 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1765,7 +1792,8 @@ static int br_multicast_ipv6_rcv(struct
  		}
  		mld = (struct mld_msg *)skb_transport_header(skb2);
  		BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
@@ -242,7 +239,7 @@
  		break;
  	    }
  	case ICMPV6_MLD2_REPORT:
-@@ -1781,7 +1812,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1782,7 +1810,7 @@ static int br_multicast_ipv6_rcv(struct
  			goto out;
  		}
  		mld = (struct mld_msg *)skb_transport_header(skb2);
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Tue Aug  4 19:00:08 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Wed,  5 Aug 2015 01:00:08 +0200
Subject: [OpenWrt-Devel] [PATCHv2 openwrt 3/3] kernel: bridge,
 multicast-to-unicast: assign src after pskb_may_pull()
In-Reply-To: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1438729208-3556-7-git-send-email-linus.luessing@c0d3.blue>

A call to pskb_may_pull() might reallocate skb->data. Therefore we
should only assign the src-pointer after any potential reallocations.

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 .../645-bridge_multicast_to_unicast.patch          |   45 +++++++++++---------
 1 file changed, 26 insertions(+), 19 deletions(-)

diff --git a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
index e8be1fd..83f2475 100644
--- a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
+++ b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
@@ -100,37 +100,40 @@
  					 struct sk_buff *skb,
  					 u16 vid)
  {
-+	const unsigned char *src = eth_hdr(skb)->h_source;
++	unsigned char *src;
  	struct igmpv3_report *ih;
  	struct igmpv3_grec *grec;
  	int i;
-@@ -1008,7 +1031,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -1008,7 +1031,8 @@ static int br_ip4_multicast_igmp3_report
  			continue;
  		}
  
 -		err = br_ip4_multicast_add_group(br, port, group, vid);
++		src = eth_hdr(skb)->h_source;
 +		err = br_ip4_multicast_add_group(br, port, group, vid, src);
  		if (err)
  			break;
  	}
-@@ -1022,6 +1045,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1022,6 +1046,7 @@ static int br_ip6_multicast_mld2_report(
  					struct sk_buff *skb,
  					u16 vid)
  {
-+	const unsigned char *src = eth_hdr(skb)->h_source;
++	unsigned char *src;
  	struct icmp6hdr *icmp6h;
  	struct mld2_grec *grec;
  	int i;
-@@ -1070,7 +1094,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1069,8 +1094,9 @@ static int br_ip6_multicast_mld2_report(
+ 			continue;
  		}
  
++		src = eth_hdr(skb)->h_source;
  		err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
 -						 vid);
 +						 vid, src);
  		if (err)
  			break;
  	}
-@@ -1407,7 +1431,8 @@ br_multicast_leave_group(struct net_brid
+@@ -1407,7 +1433,8 @@ br_multicast_leave_group(struct net_brid
  			 struct net_bridge_port *port,
  			 struct br_ip *group,
  			 struct bridge_mcast_other_query *other_query,
@@ -140,7 +143,7 @@
  {
  	struct net_bridge_mdb_htable *mdb;
  	struct net_bridge_mdb_entry *mp;
-@@ -1457,7 +1482,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1457,7 +1484,7 @@ br_multicast_leave_group(struct net_brid
  		for (pp = &mp->ports;
  		     (p = mlock_dereference(*pp, br)) != NULL;
  		     pp = &p->next) {
@@ -149,7 +152,7 @@
  				continue;
  
  			rcu_assign_pointer(*pp, p->next);
-@@ -1491,7 +1516,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1491,7 +1518,7 @@ br_multicast_leave_group(struct net_brid
  	for (p = mlock_dereference(mp->ports, br);
  	     p != NULL;
  	     p = mlock_dereference(p->next, br)) {
@@ -158,7 +161,7 @@
  			continue;
  
  		if (!hlist_unhashed(&p->mglist) &&
-@@ -1509,8 +1534,8 @@ out:
+@@ -1509,8 +1536,8 @@ out:
  
  static void br_ip4_multicast_leave_group(struct net_bridge *br,
  					 struct net_bridge_port *port,
@@ -169,7 +172,7 @@
  {
  	struct br_ip br_group;
  	struct bridge_mcast_own_query *own_query;
-@@ -1525,14 +1550,14 @@ static void br_ip4_multicast_leave_group
+@@ -1525,14 +1552,14 @@ static void br_ip4_multicast_leave_group
  	br_group.vid = vid;
  
  	br_multicast_leave_group(br, port, &br_group, &br->ip4_other_query,
@@ -186,7 +189,7 @@
  {
  	struct br_ip br_group;
  	struct bridge_mcast_own_query *own_query;
-@@ -1547,7 +1572,7 @@ static void br_ip6_multicast_leave_group
+@@ -1547,7 +1574,7 @@ static void br_ip6_multicast_leave_group
  	br_group.vid = vid;
  
  	br_multicast_leave_group(br, port, &br_group, &br->ip6_other_query,
@@ -195,55 +198,59 @@
  }
  #endif
  
-@@ -1556,6 +1581,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1556,6 +1583,7 @@ static int br_multicast_ipv4_rcv(struct
  				 struct sk_buff *skb,
  				 u16 vid)
  {
-+	const unsigned char *src = eth_hdr(skb)->h_source;
++	unsigned char *src;
  	struct sk_buff *skb2 = skb;
  	const struct iphdr *iph;
  	struct igmphdr *ih;
-@@ -1629,7 +1655,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1629,7 +1657,8 @@ static int br_multicast_ipv4_rcv(struct
  	case IGMP_HOST_MEMBERSHIP_REPORT:
  	case IGMPV2_HOST_MEMBERSHIP_REPORT:
  		BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
 -		err = br_ip4_multicast_add_group(br, port, ih->group, vid);
++		src = eth_hdr(skb)->h_source;
 +		err = br_ip4_multicast_add_group(br, port, ih->group, vid, src);
  		break;
  	case IGMPV3_HOST_MEMBERSHIP_REPORT:
  		err = br_ip4_multicast_igmp3_report(br, port, skb2, vid);
-@@ -1638,7 +1664,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1638,7 +1667,8 @@ static int br_multicast_ipv4_rcv(struct
  		err = br_ip4_multicast_query(br, port, skb2, vid);
  		break;
  	case IGMP_HOST_LEAVE_MESSAGE:
 -		br_ip4_multicast_leave_group(br, port, ih->group, vid);
++		src = eth_hdr(skb)->h_source;
 +		br_ip4_multicast_leave_group(br, port, ih->group, vid, src);
  		break;
  	}
  
-@@ -1656,6 +1682,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1656,6 +1686,7 @@ static int br_multicast_ipv6_rcv(struct
  				 struct sk_buff *skb,
  				 u16 vid)
  {
-+	const unsigned char *src = eth_hdr(skb)->h_source;
++	unsigned char *src;
  	struct sk_buff *skb2;
  	const struct ipv6hdr *ip6h;
  	u8 icmp6_type;
-@@ -1765,7 +1792,8 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1765,7 +1796,9 @@ static int br_multicast_ipv6_rcv(struct
  		}
  		mld = (struct mld_msg *)skb_transport_header(skb2);
  		BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
 -		err = br_ip6_multicast_add_group(br, port, &mld->mld_mca, vid);
++		src = eth_hdr(skb)->h_source;
 +		err = br_ip6_multicast_add_group(br, port, &mld->mld_mca, vid,
 +						 src);
  		break;
  	    }
  	case ICMPV6_MLD2_REPORT:
-@@ -1782,7 +1810,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1782,7 +1815,8 @@ static int br_multicast_ipv6_rcv(struct
  			goto out;
  		}
  		mld = (struct mld_msg *)skb_transport_header(skb2);
 -		br_ip6_multicast_leave_group(br, port, &mld->mld_mca, vid);
++		src = eth_hdr(skb)->h_source;
 +		br_ip6_multicast_leave_group(br, port, &mld->mld_mca, vid, src);
  	    }
  	}
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Tue Aug  4 19:04:33 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Wed, 5 Aug 2015 01:04:33 +0200
Subject: [OpenWrt-Devel] [PATCH 3/4] ipq806x: fix pcie pinmux naming in
	ipq806x dts
In-Reply-To: <1438725332-19984-3-git-send-email-mathieu@codeaurora.org>
References: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>
 <1438725332-19984-3-git-send-email-mathieu@codeaurora.org>
Message-ID: <55C14501.2030108@openwrt.org>

On 2015-08-04 23:55, Mathieu Olivari wrote:
> PCIe controller nodes are numbers 0/1/2 in the chipset dtsi file, but
> the pinmux nodes are numbers 1/2/3. We'll make it consistent by changing
> the pinmux numbering to match the controller's one.
> 
> Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
> ---
> diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
> index cce30b0..8d6e77a 100644
> --- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
> +++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
> @@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
>  
>  --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
>  +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> -@@ -64,6 +64,16 @@
> +@@ -69,6 +69,16 @@
>   					bias-disable;
>   				};
>   			};
> @@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
>   		};
>   
>   		gsbi at 16300000 {
> -@@ -201,5 +211,26 @@
> +@@ -206,5 +216,26 @@
>   				reg = <4>;
>   			};
>   		};
> @@ -116,9 +116,9 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
>   };
>  --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
>  +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> -@@ -638,5 +638,91 @@
> - 				dr_mode = "host";
> - 			};
> +@@ -87,6 +87,92 @@
> + 			clock-frequency = <32768>;
> + 			#clock-cells = <0>;
>   		};
>  +
>  +		nss_common: syscon at 03000000 {
> @@ -207,4 +207,5 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
>  +			status = "disabled";
>  +		};
>   	};
> - };
> + 
> + 	kraitcc: clock-controller {
FYI, this part completely messed up the patch, as it moved the gmac
device tree nodes from /soc to /clocks. I've fixed it up locally and I
will commit the fixed version.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Tue Aug  4 19:10:52 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Tue, 4 Aug 2015 16:10:52 -0700
Subject: [OpenWrt-Devel] [PATCH 3/4] ipq806x: fix pcie pinmux naming in
	ipq806x dts
In-Reply-To: <55C14501.2030108@openwrt.org>
References: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org>
 <1438725332-19984-3-git-send-email-mathieu@codeaurora.org>
 <55C14501.2030108@openwrt.org>
Message-ID: <017001d0cf0a$cf5aa070$6e0fe150$@codeaurora.org>

Rah; sorry about that, it happens fairly often actually. I reworked the
patch list a couple of times and I thought I tried it after the last one.
Thanks for the fix.

-----Original Message-----
From: Felix Fietkau [mailto:nbd at openwrt.org] 
Sent: Tuesday, August 04, 2015 4:05 PM
To: Mathieu Olivari; jogo at openwrt.org; blogic at openwrt.org
Cc: openwrt-devel at lists.openwrt.org
Subject: Re: [PATCH 3/4] ipq806x: fix pcie pinmux naming in ipq806x dts

On 2015-08-04 23:55, Mathieu Olivari wrote:
> PCIe controller nodes are numbers 0/1/2 in the chipset dtsi file, but 
> the pinmux nodes are numbers 1/2/3. We'll make it consistent by 
> changing the pinmux numbering to match the controller's one.
> 
> Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
> ---
> diff --git 
> a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to
> -ipq806x-platforms.patch 
> b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to
> -ipq806x-platforms.patch
> index cce30b0..8d6e77a 100644
> --- 
> a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to
> -ipq806x-platforms.patch
> +++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-node
> +++ s-to-ipq806x-platforms.patch
> @@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari 
> <mathieu at codeaurora.org>
>  
>  --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
>  +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> -@@ -64,6 +64,16 @@
> +@@ -69,6 +69,16 @@
>   					bias-disable;
>   				};
>   			};
> @@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
>   		};
>   
>   		gsbi at 16300000 {
> -@@ -201,5 +211,26 @@
> +@@ -206,5 +216,26 @@
>   				reg = <4>;
>   			};
>   		};
> @@ -116,9 +116,9 @@ Signed-off-by: Mathieu Olivari
<mathieu at codeaurora.org>
>   };
>  --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
>  +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> -@@ -638,5 +638,91 @@
> - 				dr_mode = "host";
> - 			};
> +@@ -87,6 +87,92 @@
> + 			clock-frequency = <32768>;
> + 			#clock-cells = <0>;
>   		};
>  +
>  +		nss_common: syscon at 03000000 {
> @@ -207,4 +207,5 @@ Signed-off-by: Mathieu Olivari
<mathieu at codeaurora.org>
>  +			status = "disabled";
>  +		};
>   	};
> - };
> + 
> + 	kraitcc: clock-controller {
FYI, this part completely messed up the patch, as it moved the gmac device
tree nodes from /soc to /clocks. I've fixed it up locally and I will commit
the fixed version.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bapclenet at gmail.com  Wed Aug  5 04:09:43 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Wed, 5 Aug 2015 10:09:43 +0200
Subject: [OpenWrt-Devel] package libcoap for OpenWRT, Makefile
Message-ID: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>

Hi,

I'm trying to add a package for libcoap and then compile it with my
target Ralink MT7628.

Here is the Makefile:
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=libcoap
PKG_VERSION:=4.1.1
PKG_RELEASE:=1

PKG_SOURCE:=libcoap-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/libcoap
PKG_BUILD_DIR:=$(BUILD_DIR)/libcoap-$(PKG_VERSION)
PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/libcoap
  SECTION:=libs
  CATEGORY:=Libraries
  DEPENDS:=
  TITLE:=CoAP static library and example utilities
  URL:=http://libcoap.sourceforge.net/
endef

define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)" \
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR) -lcoap"
endef

define Build/Install
endef

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/coap.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libcoap.a $(1)/usr/lib/
endef

define Package/libcoap/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/coap-server $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/coap-client $(1)/usr/bin/
endef

$(eval $(call BuildPackage,libcoap))







I'm getting those errors with make V=s :


config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating doc/Doxyfile
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating config.h
configure: WARNING: unrecognized options: --disable-nls

// long make lines...

In file included from net.h:44:0,
                 from async.h:19,
                 from net.c:41:
address.h:134:19: error: unknown type name 'coap_address_t'
 coap_address_init(coap_address_t *addr) {
                   ^
address.h:149:1: error: unknown type name 'coap_address_t'
 coap_address_equals(const coap_address_t *a, const coap_address_t *b) {
 ^
address.h:149:1: error: unknown type name 'coap_address_t'
address.h:159:1: error: unknown type name 'coap_address_t'
 coap_is_mcast(const coap_address_t *a) {
 ^
In file included from net.h:47:0,
                 from async.h:19,
                 from net.c:41:
coap_time.h: In function 'coap_clock_init_impl':
coap_time.h:111:3: error: 'clock_offset' undeclared (first use in this function)
   clock_offset = time(NULL);
   ^
coap_time.h:111:3: note: each undeclared identifier is reported only
once for each function it appears in
coap_time.h: At top level:
coap_time.h:126:17: error: unknown type name 'coap_tick_t'
 coap_ticks_impl(coap_tick_t *t) {
                 ^
coap_time.h:144:18: error: unknown type name 'coap_tick_t'
 int coap_time_lt(coap_tick_t a, coap_tick_t b) {
                  ^
coap_time.h:144:33: error: unknown type name 'coap_tick_t'
 int coap_time_lt(coap_tick_t a, coap_tick_t b) {
                                 ^
coap_time.h:153:18: error: unknown type name 'coap_tick_t'
 int coap_time_le(coap_tick_t a, coap_tick_t b) {
                  ^
coap_time.h:153:33: error: unknown type name 'coap_tick_t'
 int coap_time_le(coap_tick_t a, coap_tick_t b) {
                                 ^
In file included from async.h:19:0,
                 from net.c:41:
net.h:54:3: error: unknown type name 'coap_tick_t'
   coap_tick_t t;         /**< when to send PDU for the next time */
   ^
net.h:58:3: error: unknown type name 'coap_address_t'
   coap_address_t local;  /**< local address */
   ^
net.h:59:3: error: unknown type name 'coap_address_t'
   coap_address_t remote; /**< remote address */
   ^
net.h:85:6: error: unknown type name 'coap_address_t'
      const coap_address_t *remote,
      ^
net.h:109:3: error: unknown type name 'coap_tick_t'
   coap_tick_t sendqueue_basetime;
   ^
In file included from async.h:19:0,
                 from net.c:41:
net.h:177:56: error: unknown type name 'coap_tick_t'
 unsigned int coap_adjust_basetime(coap_context_t *ctx, coap_tick_t now);
                                                        ^
net.h:186:1: error: unknown type name 'coap_address_t'
 coap_context_t *coap_new_context(const coap_address_t *listen_addr);
 ^
net.h:220:11: error: unknown type name 'coap_address_t'
           const coap_address_t *dst,
           ^
net.h:254:8: error: unknown type name 'coap_address_t'
        const coap_address_t *dst,
        ^
net.h:276:7: error: unknown type name 'coap_address_t'
       const coap_address_t *dst,
       ^
net.h:293:10: error: unknown type name 'coap_address_t'
          const coap_address_t *dst,
          ^
net.h:309:5: error: unknown type name 'coap_address_t'
     const coap_address_t *dst,
     ^
net.h:326:8: error: unknown type name 'coap_address_t'
        const coap_address_t *dst,
        ^
net.h:349:1: error: unknown type name 'coap_address_t'
 void coap_transaction_id(const coap_address_t *peer, const coap_pdu_t *pdu,
 ^
net.h:411:10: error: unknown type name 'coap_address_t'
          const coap_address_t *dst,
          ^
net.h:425:17: error: unknown type name 'coap_tick_t'
 void coap_ticks(coap_tick_t *);
                 ^
In file included from net.c:41:0:
async.h:40:3: error: unknown type name 'coap_tick_t'
   coap_tick_t created;
   ^
async.h:52:3: error: unknown type name 'coap_address_t'
   coap_address_t peer;  /**< the peer to notify */
   ^
async.h:88:46: error: unknown type name 'coap_address_t'
 coap_register_async(coap_context_t *context, coap_address_t *peer,
                                              ^
In file included from resource.h:42:0,
                 from net.c:42:
subscribe.h:43:3: error: unknown type name 'coap_address_t'
   coap_address_t subscriber;     /**< address and port of subscriber */
   ^
In file included from net.c:42:0:
resource.h:46:49: error: unknown type name 'coap_address_t'
   (coap_context_t  *, struct coap_resource_t *, coap_address_t *, coap_pdu_t *,
                                                 ^
resource.h:73:3: error: unknown type name 'coap_method_handler_t'
   coap_method_handler_t handler[4];
   ^
resource.h:228:31: error: unknown type name 'coap_method_handler_t'
         unsigned char method, coap_method_handler_t handler) {
                               ^
resource.h:275:12: error: unknown type name 'coap_address_t'
            const coap_address_t *observer,
            ^
resource.h:288:6: error: unknown type name 'coap_address_t'
      const coap_address_t *peer,
      ^
resource.h:300:5: error: unknown type name 'coap_address_t'
     const coap_address_t *observer,
     ^
resource.h:313:6: error: unknown type name 'coap_address_t'
      const coap_address_t *observer,
      ^
net.c:139:1: error: unknown type name 'coap_address_t'
 void coap_handle_failed_notify(coap_context_t *, const coap_address_t *,
 ^
net.c:143:43: error: unknown type name 'coap_tick_t'
 coap_adjust_basetime(coap_context_t *ctx, coap_tick_t now) {
                                           ^
net.c: In function 'coap_new_node':
net.c:239:8: warning: assignment makes pointer from integer without a
cast [enabled by default]
   node = coap_malloc_node();
        ^
net.c: At top level:
net.c:297:3: error: unknown type name 'coap_address_t'
   const coap_address_t *listen_addr) {
   ^
In file included from net.h:45:0,
                 from async.h:19,
                 from net.c:41:
net.c: In function 'coap_new_context':
net.c:321:42: error: 'clock_offset' undeclared (first use in this function)
   prng_init((unsigned long)listen_addr ^ clock_offset);
                                          ^
prng.h:80:48: note: in definition of macro 'prng_init'
 #define prng_init(Value) srand((unsigned long)(Value))
                                                ^
net.c:325:9: error: 'c' undeclared (first use in this function)
   if ( !c ) {
         ^
net.c: At top level:
net.c:498:1: error: unknown type name 'coap_address_t'
 coap_transaction_id(const coap_address_t *peer, const coap_pdu_t *pdu,
 ^
net.c:535:8: error: unknown type name 'coap_address_t'
        const coap_address_t *dst,
        ^
net.c:654:4: error: unknown type name 'coap_address_t'
    const coap_address_t *dst,
    ^
net.c:662:3: error: unknown type name 'coap_address_t'
   const coap_address_t *dst,
   ^
net.c:682:10: error: unknown type name 'coap_address_t'
          const coap_address_t *dst,
          ^
net.c:700:7: error: unknown type name 'coap_address_t'
       const coap_address_t *dst,
       ^
net.c: In function 'coap_send_confirmed':
net.c:703:3: error: unknown type name 'coap_tick_t'
   coap_tick_t now;
   ^
net.c:722:51: error: 'COAP_TICKS_PER_SECOND' undeclared (first use in
this function)
   node->timeout = COAP_DEFAULT_RESPONSE_TIMEOUT * COAP_TICKS_PER_SECOND +
                                                   ^
net.c:726:37: error: 'coap_address_t' undeclared (first use in this function)
   memcpy(&node->remote, dst, sizeof(coap_address_t));
                                     ^
net.c: In function 'coap_read':
net.c:840:3: error: unknown type name 'coap_address_t'
   coap_address_t src, dst;
   ^
net.c:852:23: error: 'buf' undeclared (first use in this function)
   pdu = (coap_hdr_t *)buf;
                       ^
net.c:910:37: error: 'coap_address_t' undeclared (first use in this function)
   memcpy(&node->local, &dst, sizeof(coap_address_t));
                                     ^
net.c:929:5: warning: passing argument 1 of 'coap_print_addr' from
incompatible pointer type [enabled by default]
     if (coap_print_addr(&src, addr, INET6_ADDRSTRLEN+8))
     ^
In file included from net.c:38:0:
debug.h:61:8: note: expected 'const struct coap_address_t *' but
argument is of type 'int *'
 size_t coap_print_addr(const struct coap_address_t *, unsigned char *, size_t);
        ^
net.c: At top level:
net.c:1002:1: error: unknown type name 'coap_address_t'
 coap_cancel_all_messages(coap_context_t *context, const coap_address_t *dst,
 ^
net.c: In function 'handle_request':
net.c:1284:3: error: unknown type name 'coap_method_handler_t'
   coap_method_handler_t h = NULL;
   ^
net.c:1337:40: error: 'coap_method_handler_t' undeclared (first use in
this function)
       sizeof(resource->handler)/sizeof(coap_method_handler_t))
                                        ^
net.c:1354:8: error: called object 'h' is not a function or function pointer
       h(context, resource, &node->remote,
        ^
net.c:1284:25: note: declared here
   coap_method_handler_t h = NULL;
                         ^
make[3]: *** [net.o] Error 1
make[3]: Leaving directory
`/home/xsoen/Documents/Developpement/OPENWRT/trunk-linux4.1/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.10/libcoap-4.1.1'
make[2]: *** [/home/xsoen/Documents/Developpement/OPENWRT/trunk-linux4.1/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.10/libcoap-4.1.1/.built]
Error 2
make[2]: Leaving directory
`/home/xsoen/Documents/Developpement/OPENWRT/trunk-linux4.1/trunk/package/libs/libcoap'
make[1]: *** [package/libs/libcoap/compile] Error 2
make[1]: Leaving directory
`/home/xsoen/Documents/Developpement/OPENWRT/trunk-linux4.1/trunk'
make: *** [package/libcoap/compile] Erreur 2


coap_address_t is defined in address.h inside some #ifdef (#ifdef
WITH_LWIP or #ifdef WITH_CONTIKI or #ifdef WITH_POSIX)

I don't know if WITH_POSIX is defined.

Regards,

-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kevin at darbyshire-bryant.me.uk  Wed Aug  5 05:18:08 2015
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Wed, 5 Aug 2015 10:18:08 +0100
Subject: [OpenWrt-Devel] [PATCH] dnsmasq: dns rebind protection improvements
Message-ID: <1438766288-9281-1-git-send-email-kevin@darbyshire-bryant.me.uk>

From upstream dnsmasq pre 2.76 release.
Include 0.0.0.0/8 in DNS rebind checks.

Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile          |  2 +-
 .../patches/300-dns-rebind-improvements.patch      | 42 ++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 package/network/services/dnsmasq/patches/300-dns-rebind-improvements.patch

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 444459b..864914e 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.75
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
diff --git a/package/network/services/dnsmasq/patches/300-dns-rebind-improvements.patch b/package/network/services/dnsmasq/patches/300-dns-rebind-improvements.patch
new file mode 100644
index 0000000..ab84b58
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/300-dns-rebind-improvements.patch
@@ -0,0 +1,42 @@
+From d2aa7dfbb6d1088dcbea9fecc61b9293b320eb95 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon at thekelleys.org.uk>
+Date: Mon, 3 Aug 2015 21:52:12 +0100
+Subject: [PATCH] Include 0.0.0.0/8 in DNS rebind checks.
+
+---
+ CHANGELOG     |    7 +++++++
+ src/rfc1035.c |    3 ++-
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 901da47..3f4026d 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -1,3 +1,10 @@
++version 2.76
++            Include 0.0.0.0/8 in DNS rebind checks. This range 
++	    translates to hosts on  the local network, or, at 
++	    least, 0.0.0.0 accesses the local host, so could
++	    be targets for DNS rebinding. See RFC 5735 section 3 
++	    for details. Thanks to Stephen R??ttger for the bug report.
++	    
+ version 2.75
+             Fix reversion on 2.74 which caused 100% CPU use when a 
+ 	    dhcp-script is configured. Thanks to Adrian Davey for
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index 56647b0..29e9e65 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -728,7 +728,8 @@ int private_net(struct in_addr addr, int ban_localhost)
+   in_addr_t ip_addr = ntohl(addr.s_addr);
+ 
+   return
+-    (((ip_addr & 0xFF000000) == 0x7F000000) && ban_localhost)  /* 127.0.0.0/8    (loopback) */ || 
++    (((ip_addr & 0xFF000000) == 0x7F000000) && ban_localhost)  /* 127.0.0.0/8    (loopback) */ ||
++    ((ip_addr & 0xFF000000) == 0x00000000)  /* RFC 5735 section 3. "here" network */ ||
+     ((ip_addr & 0xFFFF0000) == 0xC0A80000)  /* 192.168.0.0/16 (private)  */ ||
+     ((ip_addr & 0xFF000000) == 0x0A000000)  /* 10.0.0.0/8     (private)  */ ||
+     ((ip_addr & 0xFFF00000) == 0xAC100000)  /* 172.16.0.0/12  (private)  */ ||
+-- 
+1.7.10.4
+
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From dirkneukirchen at web.de  Wed Aug  5 06:57:16 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Wed, 5 Aug 2015 12:57:16 +0200
Subject: [OpenWrt-Devel] package libcoap for OpenWRT, Makefile
In-Reply-To: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>
References: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>
Message-ID: <55C1EC0C.2000604@web.de>

On 05.08.2015 10:09, Baptiste Clenet wrote:
> Hi,
> 
> I'm trying to add a package for libcoap and then compile it with my
> target Ralink MT7628.
> 
> Here is the Makefile:
> #

> 
> coap_address_t is defined in address.h inside some #ifdef (#ifdef
> WITH_LWIP or #ifdef WITH_CONTIKI or #ifdef WITH_POSIX)
> 
> I don't know if WITH_POSIX is defined.
> 
> Regards,
> 

- You can check for WITH_POSIX (or other CFLAGS etc. in config.log
- configure always sets -DWITH_POSIX in CPPFLAGS (see configure.in)
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Wed Aug  5 07:28:23 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Wed, 5 Aug 2015 13:28:23 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 1/3] bridge: Fix
 multicast_to_unicast feature by hairpin+isolate
In-Reply-To: <1438729208-3556-2-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
 <1438729208-3556-2-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <55C1F357.7010801@openwrt.org>

On 2015-08-05 01:00, Linus L?ssing wrote:
> All IGMP and MLD versions suffer from a specific limitation (from a
> snooping switch perspective): Report suppression.
> 
> Once a listener hears an IGMPv2/3 or MLDv1 report for the same group
> itself participates in then it might (if this listener is an IGMPv3 or
> MLDv2 listener) or will (if this is an IGMPv1/2 or MLDv1 listener)
> refrain from sending its own report.
> 
> Therefore we might currently miss such surpressing listeners as they
> won't receive the multicast packet with the mangled, unicasted
> destination.
> 
> Fixing this by first isolating the STAs and giving the bridge more
> control over traffic forwarding. E.g. refraining to forward listener
> reports to other STAs.
> 
> For broadcast and unicast traffic to an STA on the same AP, the hairpin
> feature of the bridge will reflect such traffic back to the AP
> interface. However, if the AP interface is actually configured to
> isolate STAs, then hairpin is kept disabled.
> 
> Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
This patch turns on hairpin mode and assumes that the driver script
checks the multicast_to_unicast flag.
This is somewhat broken, since you only consider the hostapd.sh script,
but there are other driver implementations out there (including some
out-of-tree ones).
I think a better approach would be to check the conditions that are used
to enable hairpin mode and use them to alter the vif isolate options in
the json data.
You could do this from within netifd-wireless.sh, and drop the hostapd
change entirely.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Wed Aug  5 07:38:28 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Wed, 5 Aug 2015 13:38:28 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 2/3] bridge: Allow setting
 multicast_to_unicast option
In-Reply-To: <1438729208-3556-3-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
 <1438729208-3556-3-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <55C1F5B4.10007@openwrt.org>

On 2015-08-05 01:00, Linus L?ssing wrote:
> With this patch the multicast_to_unicast feature can be disabled for all
> wireless interfaces via an according option on the uci bridge interface.
> 
> This patch also exports the setting information to wireless handler
> scripts. The hostapd script will need that information to determine
> whether to enable or disable ap-isolation, for instance.
> 
> Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
I think it would be better to store these flags in the bridge config
instead of the generic device config, and either add a blob_buf argument
in struct device_hotplug_ops -> prepare, or add a new callback get_info,
which adds the bridge info for use in the wireless json.

I would like to avoid polluting the generic device options with bridge
specific stuff.

This patch should probably be merged with the previous one afterwards,
since the first one without any other changes will cause regressions.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Wed Aug  5 07:39:05 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Wed, 5 Aug 2015 13:39:05 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 3/3] bridge: Allow setting
 multicast_router option
In-Reply-To: <1438729208-3556-4-git-send-email-linus.luessing@c0d3.blue>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
 <1438729208-3556-4-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <55C1F5D9.5040506@openwrt.org>

On 2015-08-05 01:00, Linus L?ssing wrote:
> The multicast_router option of a bridge allows to control the forwarding
> behaviour of multicast packets independant of the listener state:
> 
> * 0: Only forward if specific listener is present
> * 1 (default): Forward if specific listener or a multicast router
>   was detected (currently only learned via query messages, no MRD
>   support yet)
> * 2: Always forward any multicast traffic on this port
> 
> Since MRD is not mandated you might end up with silent multicast routers
> (e.g. if your link has more than one multicast router; only one can
> become the selected, "noisy" querier). Here you might need a manual
> configuration option like the "multicast_router" option.
> 
> Other scenarios where this can be useful are for instance:
> * Segmentation of IGMP/MLD domains together with ebtables
> * Dedicated bridge port for monitoring/debugging purposes
> 
> Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
This should also be stored in the bridge specific config instead of
generic device config.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From bapclenet at gmail.com  Wed Aug  5 07:43:17 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Wed, 5 Aug 2015 13:43:17 +0200
Subject: [OpenWrt-Devel] package libcoap for OpenWRT, Makefile
In-Reply-To: <55C1EC0C.2000604@web.de>
References: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>
 <55C1EC0C.2000604@web.de>
Message-ID: <CAPpUg6N6F+RCNvaKhZARKhRdadphZmwUFgOz7qmFR0rwj7sQxg@mail.gmail.com>

2015-08-05 12:57 GMT+02:00 Dirk Neukirchen <dirkneukirchen at web.de>:
> On 05.08.2015 10:09, Baptiste Clenet wrote:
>> Hi,
>>
>> I'm trying to add a package for libcoap and then compile it with my
>> target Ralink MT7628.
>>
>> Here is the Makefile:
>> #
>
>>
>> coap_address_t is defined in address.h inside some #ifdef (#ifdef
>> WITH_LWIP or #ifdef WITH_CONTIKI or #ifdef WITH_POSIX)
>>
>> I don't know if WITH_POSIX is defined.
>>
>> Regards,
>>
>
> - You can check for WITH_POSIX (or other CFLAGS etc. in config.log
Check it and it is defined.
> - configure always sets -DWITH_POSIX in CPPFLAGS (see configure.in)
Yes, it is set also.

Don't know where the problem comes from. It works well with older
version of libcoap.
Other ideas?

> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Wed Aug  5 08:39:59 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Wed, 5 Aug 2015 14:39:59 +0200
Subject: [OpenWrt-Devel] [PATCH] kernel: update 4.1 to 4.1.4
In-Reply-To: <20150804225142.GA6286@makrotopia.org>
References: <20150804225142.GA6286@makrotopia.org>
Message-ID: <CAOiHx=nF+OOcx9TFk+sEyU+eJE44qWwx9X=aoQkjxd1MSxaAuw@mail.gmail.com>

Hi,

On Wed, Aug 5, 2015 at 12:53 AM, Daniel Golle <daniel at makrotopia.org> wrote:
> Changelog:
>  * https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.1.4
>
> Signed-off-by: Daniel Golle <daniel at makrotopia.org>
> ---
>  include/kernel-version.mk                          |   4 +-
>  ...79-add-gpio-func-register-for-QCA955x-SoC.patch |   2 +-
>  .../813-MIPS-ath79-add-ap147-support.patch         |   6 +-
>  .../140-overlayfs_readdir_locking_fix.patch        | 148 ---------------------
>  .../generic/patches-4.1/834-ledtrig-libata.patch   |  10 +-
>  5 files changed, 11 insertions(+), 159 deletions(-)
>  delete mode 100644 target/linux/generic/patches-4.1/140-overlayfs_readdir_locking_fix.patch
>
> diff --git a/include/kernel-version.mk b/include/kernel-version.mk
> index e03590f..9f68716 100644
> --- a/include/kernel-version.mk
> +++ b/include/kernel-version.mk
> @@ -4,11 +4,11 @@ LINUX_RELEASE?=1
>
>  LINUX_VERSION-3.18 = .19
>  LINUX_VERSION-4.0 = .9
> -LINUX_VERSION-4.1 = .3
> +LINUX_VERSION-4.1 = .4
>
>  LINUX_KERNEL_MD5SUM-3.18.19 = a143f9421bd8413752609d0d771c2955
>  LINUX_KERNEL_MD5SUM-4.0.9 = 40fc5f6e2d718e539b45e6601c71985b
> -LINUX_KERNEL_MD5SUM-4.1.3 = 96c2c77b1c54ba01cfd8fc2d13fbf828
> +LINUX_KERNEL_MD5SUM-4.1.4 = 32cb4dd9f14d37bf71bafa6ed368f769

this breaks at least brcm2708:

Applying patch platform/0119-Merge-pull-request-1059-from-pelwell-rpi-4.0.y.patch
patching file Documentation/ABI/stable/sysfs-driver-w1_ds28ea00
patching file Documentation/w1/slaves/w1_therm
patching file drivers/w1/slaves/w1_therm.c
Hunk #1 FAILED at 59.
Hunk #2 succeeded at 92 (offset 16 lines).
Hunk #3 succeeded at 117 (offset 16 lines).
Hunk #4 succeeded at 140 (offset 16 lines).
Hunk #5 FAILED at 211.
Hunk #6 FAILED at 247.
Hunk #7 FAILED at 286.

I will take a stab at fixing this up locally, but in the future please
try to ensure that target patches still apply.


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


From yszhou4tech at gmail.com  Wed Aug  5 08:50:38 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Wed, 5 Aug 2015 20:50:38 +0800
Subject: [OpenWrt-Devel] package libcoap for OpenWRT, Makefile
In-Reply-To: <CAPpUg6N6F+RCNvaKhZARKhRdadphZmwUFgOz7qmFR0rwj7sQxg@mail.gmail.com>
References: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>
 <55C1EC0C.2000604@web.de>
 <CAPpUg6N6F+RCNvaKhZARKhRdadphZmwUFgOz7qmFR0rwj7sQxg@mail.gmail.com>
Message-ID: <CAECwjAjivbqQ9JiR73rEmhZ7+DSoF2xik69JbVty1qFTxfkY0w@mail.gmail.com>

On 5 August 2015 at 19:43, Baptiste Clenet <bapclenet at gmail.com> wrote:
>> - You can check for WITH_POSIX (or other CFLAGS etc. in config.log
> Check it and it is defined.
>> - configure always sets -DWITH_POSIX in CPPFLAGS (see configure.in)
> Yes, it is set also.
>
> Don't know where the problem comes from. It works well with older
> version of libcoap.
> Other ideas?

The "-DWITH_POSIX" definition within libcoap Makefile is defined as
part of CPPFLAGS variable which will be overridden by the
corresponding make argument.  Try adding the macro definition to
EXTRA_CFLAGS.

                yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From florian.siebertz at inf.h-brs.de  Wed Aug  5 08:53:22 2015
From: florian.siebertz at inf.h-brs.de (Florian Siebertz)
Date: Wed, 05 Aug 2015 14:53:22 +0200
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
In-Reply-To: <CA+U=Dsony4dUX2zK3cM07v7v=saskAcW8qh8GswZBRcrXDVKfg@mail.gmail.com>
References: <55C08938.6030507@inf.h-brs.de>
 <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>
 <CA+U=Dsony4dUX2zK3cM07v7v=saskAcW8qh8GswZBRcrXDVKfg@mail.gmail.com>
Message-ID: <55C20742.6000607@inf.h-brs.de>

Thank you for your work, i really appreciate it. 
Now the package is back, but at compilation it fails when 
checking against the kernel version:

(cd /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/./; if [ -x ./configure ]; then find /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/ -name config.guess | xargs -r chmod u+w; find /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/ -name config.guess | xargs -r -n1 cp --remove-destination /home/administrator/openwrt/scripts/config.guess; find /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/ -name config.sub | xargs -r chmod u+w; find /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/ -name config.sub | xargs -r -n1 cp --remove-destination /home/administrator/openwrt/scripts/config.sub; AR="mips-openwrt-linux-musl-gcc-ar" AS="mips-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Wformat !
 -Werror=fo
rmat-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99" LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm" CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc" CXX="mips-openwrt-linux-musl-g++" RANLIB="mips-openwrt-linux-musl-gcc-ranlib" STRIP=mips-openwrt-linux-musl-strip OBJCOPY=mips-openwrt-linux-musl-objcopy OBJDUMP=mips-openwrt-linux-musl-objdump SIZE=mips-openwrt-linux-musl-size CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99 " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1!
  -Wl,-z,no
w -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99 " CPPFLAGS="-I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/include -I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/include -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/include -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/fortify -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include " LDFLAGS="-L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/lib -L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/lib -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/lib -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/lib -znow -zrelro "   ./configure --target=mips-openwrt-linux --host=mips-openwrt-linux --build!
 =x86_64-li
nux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls   _python_sysroot="/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10" _python_prefix="/usr" _python_exec_prefix="/usr" --with-linux=/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3 --with-rundir=/var/run --enable-ndebug --disable-ssl --enable-shared ; fi; )

[...] (a bunch of checks)

checking for kernel version... 4.1.3
configure: error: Linux kernel in /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3 is version 4.1.3, but version newer than 4.0.x is not supported (please refer to the FAQ for advice)
make[3]: *** [/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/.configured_yyyyyyyy] Error 1
make[3]: Leaving directory `/home/administrator/openwrt/feeds/packages/net/openvswitch'
make[2]: *** [package/feeds/packages/openvswitch/compile] Error 2
make[2]: Leaving directory `/home/administrator/openwrt'
make[1]: *** [/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/administrator/openwrt'
make: *** [world] Error 2



Am 04.08.2015 um 16:08 schrieb Alexandru Ardelean:
> Took some 20-30 minutes to upgrade OVS and test it (with kernel 4.1).
> Seems to work fine so far.
> 
> Please monitor this PR; after it's merged it should appear.
> 
> On Tue, Aug 4, 2015 at 1:37 PM, Alexandru Ardelean <ardeleanalex at gmail.com>
> wrote:
> 
>> Well, OpenVSwitch is a bit behind on kernel support.
>> It's at 3.18 currently.
>> OpenWRT is at 4.1
>>
>> We'd need to do an upgrade of OVS to get it up to speed.
>>
>>
>>
>>
>> On Tue, Aug 4, 2015 at 12:43 PM, Florian Siebertz <
>> florian.siebertz at inf.h-brs.de> wrote:
>>
>>> Hi,
>>>
>>> i noticed that the openvswitch package is not available in trunk at the
>>> moment. It is not in the precompiled snapshots, neither can it be
>>> choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
>>> [update|install] -a).
>>>
>>> Does anyone know why and when it will be back?
>>>
>>> Thanks!
>>>
>>> Florian Siebertz
>>> _______________________________________________
>>> openwrt-devel mailing list
>>> openwrt-devel at lists.openwrt.org
>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>
>>
>>
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From yszhou4tech at gmail.com  Wed Aug  5 08:58:59 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Wed, 5 Aug 2015 20:58:59 +0800
Subject: [OpenWrt-Devel] package libcoap for OpenWRT, Makefile
In-Reply-To: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>
References: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>
Message-ID: <CAECwjAiz97XNPpNMZxau=w5RcWOh4iS_fqe6eTNAdyc53ABWpQ@mail.gmail.com>

On 5 August 2015 at 16:09, Baptiste Clenet <bapclenet at gmail.com> wrote:
>
> define Build/Compile
> $(MAKE) -C $(PKG_BUILD_DIR) \
> $(TARGET_CONFIGURE_OPTS) \
> CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)" \
> CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)" \
> LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR) -lcoap"
> endef
>

Ahh, this should be the cause.  Just dropping this section then the
package should compile.

                yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bapclenet at gmail.com  Wed Aug  5 09:03:00 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Wed, 5 Aug 2015 15:03:00 +0200
Subject: [OpenWrt-Devel] package libcoap for OpenWRT, Makefile
In-Reply-To: <CAECwjAiz97XNPpNMZxau=w5RcWOh4iS_fqe6eTNAdyc53ABWpQ@mail.gmail.com>
References: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>
 <CAECwjAiz97XNPpNMZxau=w5RcWOh4iS_fqe6eTNAdyc53ABWpQ@mail.gmail.com>
Message-ID: <CAPpUg6MXrBtJ2xQ7gAaucpBu2jKswOUuOTUn9sQ2bbkao9dWVg@mail.gmail.com>

2015-08-05 14:58 GMT+02:00 Yousong Zhou <yszhou4tech at gmail.com>:
> On 5 August 2015 at 16:09, Baptiste Clenet <bapclenet at gmail.com> wrote:
>>
>> define Build/Compile
>> $(MAKE) -C $(PKG_BUILD_DIR) \
>> $(TARGET_CONFIGURE_OPTS) \
>> CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)" \
>> CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)" \
>> LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR) -lcoap"
>> endef
>>
>
> Ahh, this should be the cause.  Just dropping this section then the
> package should compile.
>
>                 yousong

Yes it was, thanks!
Could give details why it didn't work then?
If I am right, the compilation is done by libcoap itself so we don't
need Build/Compile?
It's not totally clear for me.


-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From yszhou4tech at gmail.com  Wed Aug  5 09:20:01 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Wed, 5 Aug 2015 21:20:01 +0800
Subject: [OpenWrt-Devel] package libcoap for OpenWRT, Makefile
In-Reply-To: <CAPpUg6MXrBtJ2xQ7gAaucpBu2jKswOUuOTUn9sQ2bbkao9dWVg@mail.gmail.com>
References: <CAPpUg6MunyanSUoU0cpAE8oLbg9yLF7WutjRWgA-1tfjiOjG3w@mail.gmail.com>
 <CAECwjAiz97XNPpNMZxau=w5RcWOh4iS_fqe6eTNAdyc53ABWpQ@mail.gmail.com>
 <CAPpUg6MXrBtJ2xQ7gAaucpBu2jKswOUuOTUn9sQ2bbkao9dWVg@mail.gmail.com>
Message-ID: <CAECwjAhJEUXM3_OdFM0P-mP5GsSVC-PKYrWz3T1VQ4b12-VCqA@mail.gmail.com>

On 5 August 2015 at 21:03, Baptiste Clenet <bapclenet at gmail.com> wrote:
> 2015-08-05 14:58 GMT+02:00 Yousong Zhou <yszhou4tech at gmail.com>:
>> On 5 August 2015 at 16:09, Baptiste Clenet <bapclenet at gmail.com> wrote:
>>>
>>> define Build/Compile
>>> $(MAKE) -C $(PKG_BUILD_DIR) \
>>> $(TARGET_CONFIGURE_OPTS) \
>>> CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)" \
>>> CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)" \
>>> LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR) -lcoap"
>>> endef
>>>
>>
>> Ahh, this should be the cause.  Just dropping this section then the
>> package should compile.
>>
>>                 yousong
>
> Yes it was, thanks!
> Could give details why it didn't work then?
> If I am right, the compilation is done by libcoap itself so we don't
> need Build/Compile?
> It's not totally clear for me.
>

The problem is that values of variables from command line has higher
precedence over assignment within Makefile itself (the "override"
directive is an exception).  The configure step run prior to compile
correctly set WITH_POSIX macro with CPPFLAGS within the generated
Makefile.  But the way Build/Compile was defined preciously will
override the CPPFLAGS with a value without the -DWITH_POSIX.

                yousong


>
> --
> Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From cardoe at cardoe.com  Wed Aug  5 09:30:04 2015
From: cardoe at cardoe.com (Doug Goldstein)
Date: Wed,  5 Aug 2015 08:30:04 -0500
Subject: [OpenWrt-Devel] [PATCH] kmod-crypto-manager: autoload aead module
Message-ID: <1438781404-1995-1-git-send-email-cardoe@cardoe.com>

This package provides the aead module which other modules need loaded
when they depend on this package.

Signed-off-by: Doug Goldstein <cardoe at cardoe.com>
---
 package/kernel/linux/modules/crypto.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
index efa69b7..7295b98 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -58,6 +58,7 @@ define KernelPackage/crypto-manager
 	CONFIG_CRYPTO_MANAGER \
 	$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_confvar,$(mod)))
   FILES:=$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_file,$(mod)))
+  AUTOLOAD:=$(call AutoLoad,08,aead)
   $(call AddDepends/crypto)
 endef
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Wed Aug  5 10:18:26 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Wed, 5 Aug 2015 17:18:26 +0300
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
In-Reply-To: <55C20742.6000607@inf.h-brs.de>
References: <55C08938.6030507@inf.h-brs.de>
 <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>
 <CA+U=Dsony4dUX2zK3cM07v7v=saskAcW8qh8GswZBRcrXDVKfg@mail.gmail.com>
 <55C20742.6000607@inf.h-brs.de>
Message-ID: <CA+U=DspR42pDEe+aqZgoNgbuKCLjHaWfH=RBXyziUmrdxHD6Fg@mail.gmail.com>

I will admit I only tested with x86.
I ASSumed that it's on kernel 4.1.

Will check again and try to spin up a patch for kernel 4.1.

On Wed, Aug 5, 2015 at 3:53 PM, Florian Siebertz <
florian.siebertz at inf.h-brs.de> wrote:

> Thank you for your work, i really appreciate it.
> Now the package is back, but at compilation it fails when
> checking against the kernel version:
>
> (cd
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/./;
> if [ -x ./configure ]; then find
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
> -name config.guess | xargs -r chmod u+w; find
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
> -name config.guess | xargs -r -n1 cp --remove-destination
> /home/administrator/openwrt/scripts/config.guess; find
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
> -name config.sub | xargs -r chmod u+w; find
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
> -name config.sub | xargs -r -n1 cp --remove-destination
> /home/administrator/openwrt/scripts/config.sub;
> AR="mips-openwrt-linux-musl-gcc-ar" AS="mips-openwrt-linux-musl-gcc -c -Os
> -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves
> -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Wformat !
>  -Werror=fo
> rmat-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now
> -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99"
> LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm"
> CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc"
> CXX="mips-openwrt-linux-musl-g++"
> RANLIB="mips-openwrt-linux-musl-gcc-ranlib"
> STRIP=mips-openwrt-linux-musl-strip OBJCOPY=mips-openwrt-linux-musl-objcopy
> OBJDUMP=mips-openwrt-linux-musl-objdump SIZE=mips-openwrt-linux-musl-size
> CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc
> -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable
> -msoft-float -Wformat -Werror=format-security -fstack-protector
> -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -mno-mips16
> -mno-interlink-mips16 -flto -std=gnu99 " CXXFLAGS="-Os -pipe
> -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts
> -Wno-error=unused-but-set-variable -msoft-float -Wformat
> -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1!
>   -Wl,-z,no
> w -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99 "
> CPPFLAGS="-I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/include
> -I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/include
> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/include
> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/fortify
> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include
> "
> LDFLAGS="-L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/lib
> -L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/lib
> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/lib
> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/lib
> -znow -zrelro "   ./configure --target=mips-openwrt-linux
> --host=mips-openwrt-linux --build!
>  =x86_64-li
> nux-gnu --program-prefix="" --program-suffix="" --prefix=/usr
> --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
> --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share
> --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls
>  _python_sysroot="/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10"
> _python_prefix="/usr" _python_exec_prefix="/usr"
> --with-linux=/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
> --with-rundir=/var/run --enable-ndebug --disable-ssl --enable-shared ; fi; )
>
> [...] (a bunch of checks)
>
> checking for kernel version... 4.1.3
> configure: error: Linux kernel in
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
> is version 4.1.3, but version newer than 4.0.x is not supported (please
> refer to the FAQ for advice)
> make[3]: ***
> [/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/.configured_yyyyyyyy]
> Error 1
> make[3]: Leaving directory
> `/home/administrator/openwrt/feeds/packages/net/openvswitch'
> make[2]: *** [package/feeds/packages/openvswitch/compile] Error 2
> make[2]: Leaving directory `/home/administrator/openwrt'
> make[1]: ***
> [/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile]
> Error 2
> make[1]: Leaving directory `/home/administrator/openwrt'
> make: *** [world] Error 2
>
>
>
> Am 04.08.2015 um 16:08 schrieb Alexandru Ardelean:
> > Took some 20-30 minutes to upgrade OVS and test it (with kernel 4.1).
> > Seems to work fine so far.
> >
> > Please monitor this PR; after it's merged it should appear.
> >
> > On Tue, Aug 4, 2015 at 1:37 PM, Alexandru Ardelean <
> ardeleanalex at gmail.com>
> > wrote:
> >
> >> Well, OpenVSwitch is a bit behind on kernel support.
> >> It's at 3.18 currently.
> >> OpenWRT is at 4.1
> >>
> >> We'd need to do an upgrade of OVS to get it up to speed.
> >>
> >>
> >>
> >>
> >> On Tue, Aug 4, 2015 at 12:43 PM, Florian Siebertz <
> >> florian.siebertz at inf.h-brs.de> wrote:
> >>
> >>> Hi,
> >>>
> >>> i noticed that the openvswitch package is not available in trunk at the
> >>> moment. It is not in the precompiled snapshots, neither can it be
> >>> choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
> >>> [update|install] -a).
> >>>
> >>> Does anyone know why and when it will be back?
> >>>
> >>> Thanks!
> >>>
> >>> Florian Siebertz
> >>> _______________________________________________
> >>> openwrt-devel mailing list
> >>> openwrt-devel at lists.openwrt.org
> >>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> >>>
> >>
> >>
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150805/f11faaf2/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kevin at darbyshire-bryant.me.uk  Wed Aug  5 10:43:57 2015
From: kevin at darbyshire-bryant.me.uk (Kevin Darbyshire-Bryant)
Date: Wed, 5 Aug 2015 15:43:57 +0100
Subject: [OpenWrt-Devel] [PATCH] samba36: preserve smbpasswd across
	sysupgrade
Message-ID: <1438785837-12639-1-git-send-email-kevin@darbyshire-bryant.me.uk>

Add /etc/samba/smbpasswd to list of samba conffiles
thus preserving samba passwords across sysupgrade
by default.

Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/samba36/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile
index d8b930c..9e282f0 100644
--- a/package/network/services/samba36/Makefile
+++ b/package/network/services/samba36/Makefile
@@ -129,6 +129,7 @@ MAKE_FLAGS += DYNEXP= PICFLAG= MODULES=
 define Package/samba36-server/conffiles
 /etc/config/samba
 /etc/samba/smb.conf.template
+/etc/samba/smbpasswd
 endef
 
 define Package/samba36-server/install
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From drasko.draskovic at gmail.com  Wed Aug  5 13:56:16 2015
From: drasko.draskovic at gmail.com (Drasko DRASKOVIC)
Date: Wed,  5 Aug 2015 19:56:16 +0200
Subject: [OpenWrt-Devel] [PATCH] [SIGNED-OFF] Add WeIO board
	(http://we-io.net) profile. This patch adds support for WeIO
	board, which is based on Carambola2 board from 8Devices.
Message-ID: <1438797376-9669-1-git-send-email-drasko.draskovic@gmail.com>

Signed-off-by: Drasko DRASKOVIC <drasko.draskovic at gmail.com>
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   3 +-
 target/linux/ar71xx/config-4.1                     |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-weio.c | 146 +++++++++++++++++++++
 target/linux/ar71xx/generic/profiles/weio.mk       |  17 +++
 target/linux/ar71xx/image/Makefile                 |   8 ++
 .../700-MIPS-ath79-openwrt-machines.patch          |  21 ++-
 7 files changed, 193 insertions(+), 6 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
 create mode 100644 target/linux/ar71xx/generic/profiles/weio.mk

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..80af14b 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -823,6 +823,9 @@ ar71xx_board_detect() {
 	*"UniFi AP Pro")
 		name="uap-pro"
 		;;
+ 	*"WeIO")
+		name="weio"
+		;;       
 	*WHR-G301N)
 		name="whr-g301n"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..57df672 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -250,7 +250,8 @@ platform_check_image() {
 	nbg460n_550n_550nh | \
 	unifi | \
 	unifi-outdoor | \
-	carambola2 )
+	carambola2 | \
+	weio )
 		[ "$magic" != "2705" ] && {
 			echo "Invalid image type."
 			return 1
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 1e31a01..0f80804 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -137,6 +137,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y
 CONFIG_ATH79_MACH_TUBE2H=y
 CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_XM=y
+CONFIG_ATH79_MACH_WEIO=y
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
 CONFIG_ATH79_MACH_WLAE_AG300N=y
 CONFIG_ATH79_MACH_WLR8100=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
new file mode 100644
index 0000000..5c707ec
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
@@ -0,0 +1,146 @@
+/**
+ * WEIO Web Of Things Platform
+ *
+ * Copyright (C) 2013 Drasko DRASKOVIC and Uros PETREVSKI
+ *
+ *              ##      ## ######## ####  #######  
+ *              ##  ##  ## ##        ##  ##     ## 
+ *              ##  ##  ## ##        ##  ##     ## 
+ *              ##  ##  ## ######    ##  ##     ## 
+ *              ##  ##  ## ##        ##  ##     ## 
+ *              ##  ##  ## ##        ##  ##     ## 
+ *               ###  ###  ######## ####  #######
+ *
+ *                   Web Of Things Platform
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors : 
+ * Drasko DRASKOVIC <drasko.draskovic at gmail.com>
+ * Uros PETREVSKI <uros at nodesign.net>
+ */
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-spi.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+#include "linux/i2c-gpio.h"
+#include "linux/platform_device.h"
+
+#define WEIO_GPIO_LED_STA		1
+#define WEIO_GPIO_LED_AP		16
+//#define WEIO_GPIO_LED_ETH0	13
+
+#define WEIO_GPIO_BTN_AP	    20
+#define WEIO_GPIO_BTN_RESET		23
+
+#define WEIO_KEYS_POLL_INTERVAL		20	/* msecs */
+#define WEIO_KEYS_DEBOUNCE_INTERVAL	(3 * WEIO_KEYS_POLL_INTERVAL)
+
+#define WEIO_MAC0_OFFSET			0x0000
+#define WEIO_MAC1_OFFSET			0x0006
+#define WEIO_CALDATA_OFFSET		    0x1000
+#define WEIO_WMAC_MAC_OFFSET		0x1002
+
+static struct gpio_led weio_leds_gpio[] __initdata = {
+	{
+		.name		= "weio:green:sta",
+		.gpio		= WEIO_GPIO_LED_STA,
+		.active_low	= 1,
+        .default_state = LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "weio:green:ap",
+		.gpio		= WEIO_GPIO_LED_AP,
+		.active_low	= 1,
+        .default_state = LEDS_GPIO_DEFSTATE_ON,
+	}
+};
+
+static struct gpio_keys_button weio_gpio_keys[] __initdata = {
+	{
+		.desc		= "ap button",
+		.type		= EV_KEY,
+		.code		= BTN_0,
+		.debounce_interval = WEIO_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= WEIO_GPIO_BTN_AP,
+		.active_low	= 1,
+	},
+	{
+		.desc		= "soft-reset button",
+		.type		= EV_KEY,
+		.code		= BTN_1,
+		.debounce_interval = WEIO_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= WEIO_GPIO_BTN_RESET,
+		.active_low	= 1,
+	}
+};
+
+static struct i2c_gpio_platform_data weio_i2c_gpio_data = {
+	.sda_pin        = 18,
+	.scl_pin        = 19,
+};
+
+static struct platform_device weio_i2c_gpio = {
+	.name           = "i2c-gpio",
+	.id             = 0,
+	.dev     = {
+		.platform_data  = &weio_i2c_gpio_data,
+	},
+};
+
+static struct platform_device *weio_devices[] __initdata = {
+        &weio_i2c_gpio
+};
+
+static void __init weio_common_setup(void)
+{
+	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+
+	ath79_register_m25p80(NULL);
+	ath79_register_wmac(art + WEIO_CALDATA_OFFSET,
+			    art + WEIO_WMAC_MAC_OFFSET);
+}
+
+static void __init weio_setup(void)
+{
+	weio_common_setup();
+
+    
+	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+				AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+				AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+				AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+                AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
+    platform_add_devices(weio_devices, ARRAY_SIZE(weio_devices));
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(weio_leds_gpio),
+				 weio_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, WEIO_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(weio_gpio_keys),
+					weio_gpio_keys);
+	ath79_register_usb();
+}
+
+MIPS_MACHINE(ATH79_MACH_WEIO, "WEIO", "WeIO board from Drasko DRASKOVIC and Uros PETREVSKI",
+		weio_setup);
diff --git a/target/linux/ar71xx/generic/profiles/weio.mk b/target/linux/ar71xx/generic/profiles/weio.mk
new file mode 100644
index 0000000..227cec9
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/weio.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/WEIO
+        NAME:=WeIO
+        PACKAGES:=kmod-usb-core kmod-usb2
+endef
+
+define Profile/WEIO/Description
+        Package set optimized for the WeIO board.
+endef
+
+$(eval $(call Profile,WEIO))
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e894d78..d750745 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -180,6 +180,14 @@ define Device/carambola2
 endef
 TARGET_DEVICES += carambola2
 
+define Device/weio
+  BOARDNAME = WEIO
+  IMAGE_SIZE = 16000k
+  CONSOLE = ttyATH0,115200
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += weio
+
 define Device/wndr3700
   BOARDNAME = WNDR3700
   NETGEAR_KERNEL_MAGIC = 0x33373030
diff --git a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
index 02ebd1b..fa9fd0ad 100644
--- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
+++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,24 +16,207 @@
+@@ -16,24 +16,208 @@
  
  enum ath79_mach_type {
  	ATH79_MACH_GENERIC = 0,
@@ -176,6 +176,7 @@
  	ATH79_MACH_UBNT_UNIFI_OUTDOOR,	/* Ubiquiti UnifiAP Outdoor */
 +	ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
  	ATH79_MACH_UBNT_XM,		/* Ubiquiti Networks XM board rev 1.0 */
++	ATH79_MACH_WEIO,		    /* WeIO board */
 +	ATH79_MACH_WHR_G301N,		/* Buffalo WHR-G301N */
 +	ATH79_MACH_WHR_HP_G300N,	/* Buffalo WHR-HP-G300N */
 +	ATH79_MACH_WHR_HP_GN,		/* Buffalo WHR-HP-GN */
@@ -1437,7 +1438,7 @@
  
  config ATH79_MACH_UBNT_XM
  	bool "Ubiquiti Networks XM/UniFi boards"
-@@ -83,6 +1212,97 @@ config ATH79_MACH_UBNT_XM
+@@ -83,6 +1212,106 @@ config ATH79_MACH_UBNT_XM
  	  Say 'Y' here if you want your kernel to support the
  	  Ubiquiti Networks XM (rev 1.0) board.
  
@@ -1511,6 +1512,15 @@
 +	select ATH79_DEV_USB
 +	select ATH79_DEV_WMAC
 +
++config ATH79_MACH_WEIO
++	bool "WeIO board"
++	select SOC_AR933X
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
 +config ATH79_MACH_BHU_BXU2000N2_A
 +	bool "BHU BXU2000n-2 rev. A support"
 +	select SOC_AR934X
@@ -1535,7 +1545,7 @@
  endmenu
  
  config SOC_AR71XX
-@@ -134,7 +1354,10 @@ config ATH79_DEV_DSA
+@@ -134,7 +1363,10 @@ config ATH79_DEV_DSA
  config ATH79_DEV_ETH
  	def_bool n
  
@@ -1547,7 +1557,7 @@
  	def_bool n
  
  config ATH79_DEV_GPIO_BUTTONS
-@@ -164,6 +1387,11 @@ config ATH79_PCI_ATH9K_FIXUP
+@@ -164,6 +1396,11 @@ config ATH79_PCI_ATH9K_FIXUP
  	def_bool n
  
  config ATH79_ROUTERBOOT
@@ -1561,7 +1571,7 @@
  endif
 --- a/arch/mips/ath79/Makefile
 +++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,133 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
+@@ -38,9 +38,134 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
  #
  # Machines
  #
@@ -1670,6 +1680,7 @@
 +obj-$(CONFIG_ATH79_MACH_TUBE2H)		+= mach-tube2h.o
 +obj-$(CONFIG_ATH79_MACH_UBNT)		+= mach-ubnt.o
  obj-$(CONFIG_ATH79_MACH_UBNT_XM)	+= mach-ubnt-xm.o
++obj-$(CONFIG_ATH79_MACH_WEIO)		+= mach-weio.o
 +obj-$(CONFIG_ATH79_MACH_WHR_HP_G300N)	+= mach-whr-hp-g300n.o
 +obj-$(CONFIG_ATH79_MACH_WLAE_AG300N)	+= mach-wlae-ag300n.o
 +obj-$(CONFIG_ATH79_MACH_WLR8100)	+= mach-wlr8100.o
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From drasko.draskovic at gmail.com  Wed Aug  5 13:58:27 2015
From: drasko.draskovic at gmail.com (Drasko DRASKOVIC)
Date: Wed, 5 Aug 2015 19:58:27 +0200
Subject: [OpenWrt-Devel] [PATCH] Add WeIO board (http://we-io.net)
 profile. This patch adds support for WeIO board,
 which is based on Carambola2 board from 8Devices.
In-Reply-To: <20150727020459-31735-9340-mailpile@palmtree-beeroclock-net>
References: <1437865957-30803-1-git-send-email-drasko.draskovic@gmail.com>
 <20150727020459-31735-9340-mailpile@palmtree-beeroclock-net>
Message-ID: <CAEk6gTBth1C00WaLsZv7sA5vOLQYL0LX1U1mO0B16gTmGGiXnQ@mail.gmail.com>

On Mon, Jul 27, 2015 at 4:10 AM, Karl Palsson <karlp at tweak.net.au> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Just one more, I promise :)
>
> Drasko DRASKOVIC <drasko.draskovic at gmail.com> wrote:
>> +
>> +static void __init weio_common_setup(void)
>> +{
>> +     u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
>> +
>> +     ath79_register_m25p80(NULL);
>> +     ath79_register_wmac(art + WEIO_CALDATA_OFFSET,
>> +                         art + WEIO_WMAC_MAC_OFFSET);
>> +
>> +    /** WeIO uses only WiFi by default (no ETH). If ETH jack is soldered, uncomment following lines  */
>> +#if 0
>> +     ath79_setup_ar933x_phy4_switch(true, true);
>> +
>> +     ath79_init_mac(ath79_eth0_data.mac_addr, art + WEIO_MAC0_OFFSET, 0);
>> +     ath79_init_mac(ath79_eth1_data.mac_addr, art + WEIO_MAC1_OFFSET, 0);
>> +
>> +     ath79_register_mdio(0, 0x0);
>> +
>> +     /* LAN ports */
>> +     ath79_register_eth(1);
>> +
>> +     /* WAN port */
>> +     ath79_register_eth(0);
>> +#endif /** commented out ETH */
>> +}
>> +
>
>
> I still think this #ifdefed code should be removed.  None of the product
> literature on your site shows any way of this being added.  It's not
> like there is a two port ethernet footprint that's simply not mounted,
> you'd have to connect it to the breadboard headers on the side of the
> board, by the time someone's done that, it's not really the weio board
> anymore is it?

Patch re-sent with #ifdefs removed, as suggested.

I hope it is OK now.

BR,
Drasko
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hackpascal at gmail.com  Wed Aug  5 14:07:38 2015
From: hackpascal at gmail.com (Weijie Gao)
Date: Thu,  6 Aug 2015 02:07:38 +0800
Subject: [OpenWrt-Devel] [PATCH 1/3] tools/firmware-utils: add header
	version 2 support for mktplinkfw
Message-ID: <1438798058-31119-1-git-send-email-hackpascal@gmail.com>

Signed-off-by: Weijie Gao <hackpascal at gmail.com>

This patch adds header version 2 option for mktplinkfw.

The version 2 header is used for AR/QCA firmwares and is not the same as
the header generated by mktplinkfw2.
Instead, it is nearly the same as version 1 header except for the header
version and the RSA signature.

The header version 2 support is used for newer TP-Link routers which have
only a 64kb bootloader part, e.g. TL-WDR6500 v2.
---
 tools/firmware-utils/src/mktplinkfw.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index 12420ad..1302d46 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -30,6 +30,7 @@
 #define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); })
 
 #define HEADER_VERSION_V1	0x01000000
+#define HEADER_VERSION_V2	0x02000000
 #define HWID_ANTMINER_S1	0x04440001
 #define HWID_ANTMINER_S3	0x04440003
 #define HWID_GL_INET_V1		0x08000001
@@ -130,6 +131,7 @@ static char *progname;
 static char *vendor = "TP-LINK Technologies";
 static char *version = "ver. 1.0";
 static char *fw_ver = "0.0.0";
+static uint32_t hdr_ver = HEADER_VERSION_V1;
 
 static char *board_id;
 static struct board_info *board;
@@ -139,6 +141,7 @@ static char *opt_hw_id;
 static uint32_t hw_id;
 static char *opt_hw_rev;
 static uint32_t hw_rev;
+static uint32_t opt_hdr_ver = 1;
 static int fw_ver_lo;
 static int fw_ver_mid;
 static int fw_ver_hi;
@@ -526,6 +529,7 @@ static void usage(int status)
 "  -N <vendor>     set image vendor to <vendor>\n"
 "  -V <version>    set image version to <version>\n"
 "  -v <version>    set firmware version to <version>\n"
+"  -m <version>    set header version to <version>\n"
 "  -i <file>       inspect given firmware file <file>\n"
 "  -x              extract kernel and rootfs while inspecting (requires -i)\n"
 "  -X <size>       reserve <size> bytes in the firmware image (hexval prefixed with 0x)\n"
@@ -723,6 +727,15 @@ static int check_options(void)
 		return -1;
 	}
 
+	if (opt_hdr_ver == 1) {
+		hdr_ver = HEADER_VERSION_V1;
+	} else if (opt_hdr_ver == 2) {
+		hdr_ver = HEADER_VERSION_V2;
+	} else {
+		ERR("invalid header version '%u'", opt_hdr_ver);
+		return -1;
+	}
+
 	return 0;
 }
 
@@ -732,7 +745,7 @@ static void fill_header(char *buf, int len)
 
 	memset(hdr, 0, sizeof(struct fw_header));
 
-	hdr->version = htonl(HEADER_VERSION_V1);
+	hdr->version = htonl(hdr_ver);
 	strncpy(hdr->vendor_name, vendor, sizeof(hdr->vendor_name));
 	strncpy(hdr->fw_version, version, sizeof(hdr->fw_version));
 	hdr->hw_id = htonl(hw_id);
@@ -972,8 +985,9 @@ static int inspect_fw(void)
 	inspect_fw_pstr("File name", inspect_info.file_name);
 	inspect_fw_phexdec("File size", inspect_info.file_size);
 
-	if (ntohl(hdr->version) != HEADER_VERSION_V1) {
-		ERR("file does not seem to have V1 header!\n");
+	if ((ntohl(hdr->version) != HEADER_VERSION_V1) &&
+	    (ntohl(hdr->version) != HEADER_VERSION_V2)) {
+		ERR("file does not seem to have V1/V2 header!\n");
 		goto out_free_buf;
 	}
 
@@ -1108,7 +1122,7 @@ int main(int argc, char *argv[])
 	while ( 1 ) {
 		int c;
 
-		c = getopt(argc, argv, "a:B:H:E:F:L:V:N:W:ci:k:r:R:o:xX:hsSjv:");
+		c = getopt(argc, argv, "a:B:H:E:F:L:m:V:N:W:ci:k:r:R:o:xX:hsSjv:");
 		if (c == -1)
 			break;
 
@@ -1134,6 +1148,9 @@ int main(int argc, char *argv[])
 		case 'L':
 			sscanf(optarg, "0x%x", &kernel_la);
 			break;
+		case 'm':
+			sscanf(optarg, "%u", &opt_hdr_ver);
+			break;
 		case 'V':
 			version = optarg;
 			break;
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hackpascal at gmail.com  Wed Aug  5 14:07:57 2015
From: hackpascal at gmail.com (Weijie Gao)
Date: Thu,  6 Aug 2015 02:07:57 +0800
Subject: [OpenWrt-Devel] [PATCH 2/3] ar71xx: add 64kb bootloader mtd parser
	for tplinkpart
Message-ID: <1438798077-31163-1-git-send-email-hackpascal@gmail.com>

Signed-off-by: Weijie Gao <hackpascal at gmail.com>

This patch adds flash layout parser for TP-Link firmwares which have a 64kb
bootloader.

This is used for TP-Link TL-WDR6500 v2.
---
 target/linux/ar71xx/files/drivers/mtd/tplinkpart.c | 35 ++++++++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/target/linux/ar71xx/files/drivers/mtd/tplinkpart.c b/target/linux/ar71xx/files/drivers/mtd/tplinkpart.c
index ab952b6..b967e25 100644
--- a/target/linux/ar71xx/files/drivers/mtd/tplinkpart.c
+++ b/target/linux/ar71xx/files/drivers/mtd/tplinkpart.c
@@ -18,10 +18,12 @@
 
 #define TPLINK_NUM_PARTS	5
 #define TPLINK_HEADER_V1	0x01000000
+#define TPLINK_HEADER_V2	0x02000000
 #define MD5SUM_LEN		16
 
 #define TPLINK_ART_LEN		0x10000
 #define TPLINK_KERNEL_OFFS	0x20000
+#define TPLINK_64K_KERNEL_OFFS	0x10000
 
 struct tplink_fw_header {
 	uint32_t	version;	/* header version */
@@ -70,7 +72,7 @@ tplink_read_header(struct mtd_info *mtd, size_t offset)
 
 	/* sanity checks */
 	t = be32_to_cpu(header->version);
-	if (t != TPLINK_HEADER_V1)
+	if ((t != TPLINK_HEADER_V1) && (t != TPLINK_HEADER_V2))
 		goto err_free_header;
 
 	t = be32_to_cpu(header->kernel_ofs);
@@ -106,14 +108,14 @@ static int tplink_check_rootfs_magic(struct mtd_info *mtd, size_t offset)
 	return 0;
 }
 
-static int tplink_parse_partitions(struct mtd_info *master,
+static int tplink_parse_partitions_offset(struct mtd_info *master,
 				   struct mtd_partition **pparts,
-				   struct mtd_part_parser_data *data)
+				   struct mtd_part_parser_data *data,
+				   size_t offset)
 {
 	struct mtd_partition *parts;
 	struct tplink_fw_header *header;
 	int nr_parts;
-	size_t offset;
 	size_t art_offset;
 	size_t rootfs_offset;
 	size_t squashfs_offset;
@@ -126,8 +128,6 @@ static int tplink_parse_partitions(struct mtd_info *master,
 		goto err;
 	}
 
-	offset = TPLINK_KERNEL_OFFS;
-
 	header = tplink_read_header(master, offset);
 	if (!header) {
 		pr_notice("%s: no TP-Link header found\n", master->name);
@@ -180,15 +180,38 @@ err:
 	return ret;
 }
 
+static int tplink_parse_partitions(struct mtd_info *master,
+				   struct mtd_partition **pparts,
+				   struct mtd_part_parser_data *data)
+{
+	return tplink_parse_partitions_offset(master, pparts, data,
+		                              TPLINK_KERNEL_OFFS);
+}
+
+static int tplink_parse_64k_partitions(struct mtd_info *master,
+				   struct mtd_partition **pparts,
+				   struct mtd_part_parser_data *data)
+{
+	return tplink_parse_partitions_offset(master, pparts, data,
+		                              TPLINK_64K_KERNEL_OFFS);
+}
+
 static struct mtd_part_parser tplink_parser = {
 	.owner		= THIS_MODULE,
 	.parse_fn	= tplink_parse_partitions,
 	.name		= "tp-link",
 };
 
+static struct mtd_part_parser tplink_64k_parser = {
+	.owner		= THIS_MODULE,
+	.parse_fn	= tplink_parse_64k_partitions,
+	.name		= "tp-link-64k",
+};
+
 static int __init tplink_parser_init(void)
 {
 	register_mtd_parser(&tplink_parser);
+	register_mtd_parser(&tplink_64k_parser);
 
 	return 0;
 }
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hackpascal at gmail.com  Wed Aug  5 14:08:09 2015
From: hackpascal at gmail.com (Weijie Gao)
Date: Thu,  6 Aug 2015 02:08:09 +0800
Subject: [OpenWrt-Devel] [PATCH 3/3] ar71xx: add support for TP-Link
	TL-WDR6500 v2
Message-ID: <1438798089-31207-1-git-send-email-hackpascal@gmail.com>

Signed-off-by: Weijie Gao <hackpascal at gmail.com>

This patch adds support for TP-Link TL-WDR6500 v2.

The firmware has a U-Boot header for kernel, and a TP-LINK v2 header for
the whole firmware, so I have to create a new firmware creation method.
---
 target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |   4 +
 .../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       |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |  11 +-
 target/linux/ar71xx/config-4.1                     |   1 +
 .../files/arch/mips/ath79/mach-tl-wdr6500-v2.c     | 141 +++++++++++++++++++++
 target/linux/ar71xx/generic/profiles/tp-link.mk    |  11 ++
 target/linux/ar71xx/image/Makefile                 |  33 +++++
 ...PS-ath79-add-tplink-tl-wdr6500-v2-support.patch |  40 ++++++
 11 files changed, 258 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v2.c
 create mode 100644 target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-tplink-tl-wdr6500-v2-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..80f4ccd 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -286,6 +286,9 @@ get_status_led() {
 	tl-wr2543n)
 		status_led="tp-link:green:wps"
 		;;
+	tl-wdr6500-v2)
+		status_led="tp-link:white:system"
+		;;
 	tube2h)
 		status_led="alfa:green:signal4"
 		;;
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 7111630..a79643e 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
@@ -54,6 +54,10 @@ case "$FIRMWARE" in
 		ath10kcal_extract "art" 20480 2116
 		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1)
 		;;
+	tl-wdr6500-v2)
+		ath10kcal_extract "art" 20480 2116
+		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
+		;;
 	r6100)
 		ath10kcal_extract "caldata" 20480 2116
 		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2)
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 2aced37..51c3b9a 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -439,6 +439,14 @@ tl-wdr4900-v2)
 	ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy1tpt"
 	;;
 
+tl-wdr6500-v2)
+	ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
+	ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04"
+	ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08"
+	ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10"
+	;;
+
 archer-c5|\
 archer-c7)
 	ucidef_set_led_usbdev "usb1" "USB1" "tp-link:green:usb1" "1-1"
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 2893e62..d81145c 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -227,6 +227,7 @@ tl-mr3420-v2 |\
 tl-wr841n-v8 |\
 tl-wr842n-v2 |\
 tl-wr941nd-v5 |\
+tl-wdr6500-v2 |\
 wnr2000-v3 |\
 wnr2000-v4 |\
 wnr2200 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..b59ad96 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -240,6 +240,9 @@ tplink_board_detect() {
 	"49000002")
 		model="TP-Link TL-WDR4900"
 		;;
+	"65000002")
+		model="TP-Link TL-WDR6500"
+		;;
 	"453000"*)
 		model="MERCURY MW4530R"
 		;;
@@ -766,6 +769,9 @@ ar71xx_board_detect() {
 	*"TL-WDR4900 v2")
 		name="tl-wdr4900-v2"
 		;;
+	*"TL-WDR6500 v2")
+		name="tl-wdr6500-v2"
+		;;
 	*TL-WR741ND)
 		name="tl-wr741nd"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..8d76cb3 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -340,6 +340,7 @@ platform_check_image() {
 	tl-wdr3500 | \
 	tl-wdr4300 | \
 	tl-wdr4900-v2 | \
+	tl-wdr6500-v2 | \
 	tl-wr703n | \
 	tl-wr710n | \
 	tl-wr720n-v3 | \
@@ -357,7 +358,15 @@ platform_check_image() {
 	tl-wr1043nd | \
 	tl-wr1043nd-v2 | \
 	tl-wr2543n)
-		[ "$magic" != "0100" ] && {
+		local magic_ver="0100"
+
+		case "$board" in
+		tl-wdr6500-v2)
+			magic_ver="0200"
+			;;
+		esac
+
+		[ "$magic" != "$magic_ver" ] && {
 			echo "Invalid image type."
 			return 1
 		}
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 1e31a01..341187c 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -122,6 +122,7 @@ CONFIG_ATH79_MACH_TL_WA901ND_V2=y
 CONFIG_ATH79_MACH_TL_WAX50RE=y
 CONFIG_ATH79_MACH_TL_WDR3500=y
 CONFIG_ATH79_MACH_TL_WDR4300=y
+CONFIG_ATH79_MACH_TL_WDR6500_V2=y
 CONFIG_ATH79_MACH_TL_WR1041N_V2=y
 CONFIG_ATH79_MACH_TL_WR1043ND=y
 CONFIG_ATH79_MACH_TL_WR1043ND_V2=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v2.c
new file mode 100644
index 0000000..aec336c
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v2.c
@@ -0,0 +1,141 @@
+/*
+ *  TP-LINK TL-WDR6500 v2
+ *
+ *  Copyright (C) 2015 Weijie Gao <hackpascal at gmail.com>
+ *
+ *  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.
+ */
+
+#include <linux/pci.h>
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-ap9x-pci.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+#include "pci.h"
+
+#define TL_WDR6500_V2_GPIO_LED_SYS	21
+#define TL_WDR6500_V2_GPIO_LED_WAN	18
+#define TL_WDR6500_V2_GPIO_LED_LAN1	17
+#define TL_WDR6500_V2_GPIO_LED_LAN2	16
+#define TL_WDR6500_V2_GPIO_LED_LAN3	15
+#define TL_WDR6500_V2_GPIO_LED_LAN4	14
+
+#define TL_WDR6500_V2_GPIO_BTN_RESET	1
+
+#define TL_WDR6500_V2_KEYS_POLL_INTERVAL	20	/* msecs */
+#define TL_WDR6500_V2_KEYS_DEBOUNCE_INTERVAL	(3 * TL_WDR6500_V2_KEYS_POLL_INTERVAL)
+
+#define TL_WDR6500_V2_WMAC_CALDATA_OFFSET	0x1000
+#define TL_WDR6500_V2_PCIE_CALDATA_OFFSET	0x5000
+
+static const char *tl_wdr6500_v2_part_probes[] = {
+	"tp-link-64k",
+	NULL,
+};
+
+static struct flash_platform_data tl_wdr6500_v2_flash_data = {
+	.part_probes	= tl_wdr6500_v2_part_probes,
+};
+
+static struct gpio_led tl_wdr6500_v2_leds_gpio[] __initdata = {
+	{
+		.name		= "tp-link:green:lan1",
+		.gpio		= TL_WDR6500_V2_GPIO_LED_LAN1,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:green:lan2",
+		.gpio		= TL_WDR6500_V2_GPIO_LED_LAN2,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:green:lan3",
+		.gpio		= TL_WDR6500_V2_GPIO_LED_LAN3,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:green:lan4",
+		.gpio		= TL_WDR6500_V2_GPIO_LED_LAN4,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:green:wan",
+		.gpio		= TL_WDR6500_V2_GPIO_LED_WAN,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:white:system",
+		.gpio		= TL_WDR6500_V2_GPIO_LED_SYS,
+		.active_low	= 0,
+	},
+};
+
+static struct gpio_keys_button tl_wdr6500_v2_gpio_keys[] __initdata = {
+	{
+		.desc		= "Reset button",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = TL_WDR6500_V2_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= TL_WDR6500_V2_GPIO_BTN_RESET,
+		.active_low	= 1,
+	}
+};
+
+
+static void __init tl_ap151_setup(void)
+{
+	u8 *mac = (u8 *) KSEG1ADDR(0x1f00fc00);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff0000);
+	u8 tmpmac[ETH_ALEN];
+
+	ath79_register_m25p80(&tl_wdr6500_v2_flash_data);
+
+	ath79_setup_ar933x_phy4_switch(false, false);
+
+	ath79_register_mdio(0, 0x0);
+
+	/* WAN */
+	ath79_switch_data.phy4_mii_en = 1;
+	ath79_switch_data.phy_poll_mask = BIT(4);
+	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+	ath79_eth0_data.phy_mask = BIT(4);
+	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
+	ath79_register_eth(0);
+
+	/* LAN */
+	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+	ath79_eth1_data.duplex = DUPLEX_FULL;
+	ath79_eth1_data.speed = SPEED_1000;
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
+	ath79_register_eth(1);
+
+	ath79_init_mac(tmpmac, mac, -1);
+	ath79_register_wmac(ee + TL_WDR6500_V2_WMAC_CALDATA_OFFSET, tmpmac);
+
+	ath79_register_pci();
+
+	ath79_register_usb();
+}
+
+static void __init tl_wdr6500_v2_setup(void)
+{
+	tl_ap151_setup();
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wdr6500_v2_leds_gpio),
+				 tl_wdr6500_v2_leds_gpio);
+
+	ath79_register_gpio_keys_polled(1, TL_WDR6500_V2_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(tl_wdr6500_v2_gpio_keys),
+					tl_wdr6500_v2_gpio_keys);
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_WDR6500_V2, "TL-WDR6500-v2", "TP-LINK TL-WDR6500 v2",
+	     tl_wdr6500_v2_setup);
diff --git a/target/linux/ar71xx/generic/profiles/tp-link.mk b/target/linux/ar71xx/generic/profiles/tp-link.mk
index 0174a43..05d1019 100644
--- a/target/linux/ar71xx/generic/profiles/tp-link.mk
+++ b/target/linux/ar71xx/generic/profiles/tp-link.mk
@@ -277,6 +277,17 @@ endef
 $(eval $(call Profile,TLWDR4900V2))
 
 
+define Profile/TLWDR6500V2
+	NAME:=TP-LINK TL-WDR6500v2
+	PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev kmod-ath10k
+endef
+
+define Profile/TLWDR6500V2/Description
+	Package set optimized for the TP-LINK TL-WDR6500v2.
+endef
+$(eval $(call Profile,TLWDR6500V2))
+
+
 define Profile/TLWR740
 	NAME:=TP-LINK TL-WR740N/ND
 	PACKAGES:=
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e894d78..83042fa 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1738,6 +1738,37 @@ define Image/Build/TPLINK-LZMA/initramfs
 		-o $(call imgname,$(1),$(2))-uImage.bin
 endef
 
+Image/Build/TPLINK-64K/buildkernel=$(call PatchKernelLzma,$(2),$(3))
+
+define Image/Build/TPLINK-64K
+	-$(STAGING_DIR_HOST)/bin/mkimage \
+		-A mips -O linux -T kernel -a 0x80060000 -C lzma \
+		-e 0x80060000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
+		-d $$(KDIR_TMP)/vmlinux-$(2).bin.lzma $(KDIR_TMP)/vmlinux-$(2).bin.lzma.img
+	-$(STAGING_DIR_HOST)/bin/mktplinkfw \
+		-H $(4) -W $(5) -F $(6) -N OpenWrt -m 2 -V $(REVISION) $(7) \
+		-X 0x20000 \
+		-k $(KDIR_TMP)/vmlinux-$(2).bin.lzma.img \
+		-r $(KDIR)/root.$(1) \
+		-a $(call rootfs_align,$(1)) -j \
+		-o $(call factoryname,$(1),$(2))
+	-$(STAGING_DIR_HOST)/bin/mktplinkfw \
+		-H $(4) -W $(5) -F $(6) -N OpenWrt -m 2 -V $(REVISION) $(7) -s \
+		-X 0x20000 \
+		-k $(KDIR_TMP)/vmlinux-$(2).bin.lzma.img \
+		-r $(KDIR)/root.$(1) \
+		-a $(call rootfs_align,$(1)) -j \
+		-o $(call sysupname,$(1),$(2))
+endef
+
+define Image/Build/TPLINK-64K/initramfs
+	$(call PatchKernelLzma,$(2),$(3),,-initramfs)
+	-$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
+		-H $(4) -W $(5) -F $(6) -N OpenWrt -m 2 -V $(REVISION) $(7) -s \
+		-k $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma.img \
+		-o $(call imgname,$(1),$(2))-uImage.bin
+endef
+
 
 Image/Build/TPLINK-SAFELOADER/loader = $(call Image/BuildLoaderPatched,$(1),elf,$(2) $(3))
 
@@ -2166,6 +2197,8 @@ $(eval $(call SingleProfile,TPLINK,64kraw,TLWR1043V1,tl-wr1043nd-v1,TL-WR1043ND,
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M))
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
 
+$(eval $(call SingleProfile,TPLINK-64K,64kraw,TLWDR6500V2,tl-wdr6500-v2,TL-WDR6500-v2,ttyS0,115200,0x65000002,1,8Mlzma))
+
 $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
 
 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
diff --git a/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-tplink-tl-wdr6500-v2-support.patch b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-tplink-tl-wdr6500-v2-support.patch
new file mode 100644
index 0000000..9ddb740
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-tplink-tl-wdr6500-v2-support.patch
@@ -0,0 +1,40 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -1043,6 +1043,17 @@
+ 	select ATH79_DEV_USB
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_TL_WDR6500_V2
++	bool "TP-LINK TL-WDR6500 v2 board support"
++	select SOC_QCA956X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_TL_WR703N
+ 	bool "TP-LINK TL-WR703N/TL-WR710N/TL-MR10U support"
+ 	select SOC_AR933X
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -153,6 +153,7 @@
+ 	ATH79_MACH_TL_WA901ND_V3,	/* TP-LINK TL-WA901ND v3 */
+ 	ATH79_MACH_TL_WDR3500,		/* TP-LINK TL-WDR3500 */
+ 	ATH79_MACH_TL_WDR4300,		/* TP-LINK TL-WDR4300 */
++	ATH79_MACH_TL_WDR6500_V2,	/* TP-LINK TL-WDR6500 v2 */
+ 	ATH79_MACH_TL_WDR4900_V2,	/* TP-LINK TL-WDR4900 v2 */
+ 	ATH79_MACH_TL_WR1041N_V2,	/* TP-LINK TL-WR1041N v2 */
+ 	ATH79_MACH_TL_WR1043ND,		/* TP-LINK TL-WR1043ND */
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -129,6 +129,7 @@
+ obj-$(CONFIG_ATH79_MACH_TL_WA901ND_V2)	+= mach-tl-wa901nd-v2.o
+ obj-$(CONFIG_ATH79_MACH_TL_WDR3500)     += mach-tl-wdr3500.o
+ obj-$(CONFIG_ATH79_MACH_TL_WDR4300)     += mach-tl-wdr4300.o
++obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V2)  += mach-tl-wdr6500-v2.o
+ obj-$(CONFIG_ATH79_MACH_TL_WR741ND)	+= mach-tl-wr741nd.o
+ obj-$(CONFIG_ATH79_MACH_TL_WR741ND_V4)	+= mach-tl-wr741nd-v4.o
+ obj-$(CONFIG_ATH79_MACH_TL_WR841N_V1)	+= mach-tl-wr841n.o
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:01 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:01 +0200
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
Message-ID: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>

The following changes fix different mistakes in ramips target and try to make the code more clean and consistent.

The patches affect:
 * dts{,i} files
 * base-files/* scripts
 * image Makefile
 * subtargets *.mk profile files

Changes in v2 of the series:
 * rebased to r46566
 * use the upstream convention for LED naming
 * more fixes in dts{,i} files
 * patches are now ordered more logically
 * patches are now better described
 * additional fixes related with devices names
 * big patches related with particular devices are not combined together, for easy review

Piotr Dymacz (25):
  ramips: fix indentation and other mistakes in .dts{,i} files
  ramips: fix Zbtlink ZBT-WR8305RT board name
  ramips: fix Asus WL-330N{,3G} boards names
  ramips: fix Asus RP-N53 and Lenovo Y1{,S} image names
  ramips: fix Xiaomi MiWiFi Mini board, image and profile names
  ramips: fix UPVEL model names
  ramips: fix Asus RT-N56U dts filename
  ramips: fix Belkin F7C027 image name
  ramips: fix Argus ATP-52B board and image names
  ramips: fix Sitecom WL-341v3 board and image names
  ramips: fix Olimex models, images and profiles names
  ramips: fix Aigale Ai-BR100 dts and profile names
  ramips: fix Tenda W150M model name
  ramips: fix Edimax BR-6425 board name
  ramips: fix Omnima models, images and profiles names
  ramips: fix Buffalo WMR-300 dts, board, image and profile names
  ramips: fix 7Links PX-4885 dts{,i}, board, image and profile names
  ramips: remove old code for Edimax BR-6524N
  ramips: fix various mistakes in subtargets *.mk profiles
  ramips: remove leading spaces, sort boards and optimize
    base-files/lib/ramips.sh
  ramips: be consistent with case statement in
    base-files/lib/upgrade/platform.sh
  ramips: fix indentation, case statements structure and optimize
    base-files/etc/board.d/02_network
  ramips: remove unnecessary LED declaration for WT1520 in diag.sh
  ramips: use consistent naming scheme for LEDs
  ramips: base-files: optimize etc/diag.sh and etc/board.d/01_leds
    scripts

 target/linux/ramips/base-files/etc/board.d/01_leds | 480 ++++++++++-----------
 .../linux/ramips/base-files/etc/board.d/02_network | 391 ++++++++---------
 target/linux/ramips/base-files/etc/diag.sh         | 338 ++++++---------
 target/linux/ramips/base-files/lib/ramips.sh       | 436 +++++++++----------
 .../ramips/base-files/lib/upgrade/platform.sh      | 234 +++++-----
 target/linux/ramips/dts/3G-6200N.dts               |  12 +-
 target/linux/ramips/dts/3G-6200NL.dts              |   5 +-
 target/linux/ramips/dts/3G150B.dts                 |  10 +-
 target/linux/ramips/dts/3G300M.dts                 |  21 +-
 target/linux/ramips/dts/A5-V11.dts                 |   6 +
 target/linux/ramips/dts/AI-BR100.dts               | 109 +++++
 target/linux/ramips/dts/AIBR100.dts                | 106 -----
 target/linux/ramips/dts/AIR3GII.dts                |   8 +-
 target/linux/ramips/dts/ALL0239-3G.dts             |  16 +-
 target/linux/ramips/dts/ALL0256N-4M.dts            |   5 +
 target/linux/ramips/dts/ALL0256N-8M.dts            |   5 +
 target/linux/ramips/dts/ALL5002.dts                |   8 +-
 target/linux/ramips/dts/ALL5003.dts                |   8 +-
 target/linux/ramips/dts/AR670W.dts                 |   4 +-
 target/linux/ramips/dts/AR725W.dts                 |   4 +-
 target/linux/ramips/dts/ARGUS_ATP52B.dts           |  93 ----
 target/linux/ramips/dts/ASL26555-16M.dts           |  17 +
 target/linux/ramips/dts/ASL26555-8M.dts            |  16 +
 target/linux/ramips/dts/ATP-52B.dts                |  96 +++++
 target/linux/ramips/dts/AWAPN2403.dts              |   7 +-
 target/linux/ramips/dts/AWM002-EVB-4M.dts          |   5 +
 target/linux/ramips/dts/AWM002-EVB-8M.dts          |   5 +
 target/linux/ramips/dts/AWM002.dtsi                |   7 +-
 target/linux/ramips/dts/AWM003-EVB.dts             |  11 +-
 target/linux/ramips/dts/ArcherC20i.dts             |   1 -
 target/linux/ramips/dts/BC2.dts                    |   3 +-
 target/linux/ramips/dts/BR-6425.dts                |   9 +-
 target/linux/ramips/dts/BR-6475ND.dts              |  15 +-
 target/linux/ramips/dts/BROADWAY.dts               |   8 +-
 target/linux/ramips/dts/CARAMBOLA.dts              |   2 -
 target/linux/ramips/dts/CF-WR800N.dts              |  31 +-
 target/linux/ramips/dts/CY-SWR1100.dts             |  17 +-
 target/linux/ramips/dts/D105.dts                   |   4 +-
 target/linux/ramips/dts/DAP-1350.dts               |  14 +-
 target/linux/ramips/dts/DCS-930.dts                |  11 +-
 target/linux/ramips/dts/DCS-930L-B1.dts            |  11 +-
 target/linux/ramips/dts/DIR-300-B1.dts             |  18 +-
 target/linux/ramips/dts/DIR-300-B7.dts             |  74 ++--
 target/linux/ramips/dts/DIR-320-B1.dts             |  32 +-
 target/linux/ramips/dts/DIR-600-B1.dts             |  18 +-
 target/linux/ramips/dts/DIR-600-B2.dts             |  18 +-
 target/linux/ramips/dts/DIR-610-A1.dts             |  29 +-
 target/linux/ramips/dts/DIR-615-D.dts              |  18 +-
 target/linux/ramips/dts/DIR-615-H1.dts             |  20 +-
 target/linux/ramips/dts/DIR-620-A1.dts             |  21 +-
 target/linux/ramips/dts/DIR-620-D1.dts             |  10 +-
 target/linux/ramips/dts/DIR-645.dts                |  15 +-
 target/linux/ramips/dts/DIR-810L.dts               |  12 +-
 target/linux/ramips/dts/DIR-860L-B1.dts            |   1 +
 target/linux/ramips/dts/E1700.dts                  |  15 +-
 target/linux/ramips/dts/ESR-9753.dts               |   5 +-
 target/linux/ramips/dts/F5D8235_V1.dts             |   9 +-
 target/linux/ramips/dts/F5D8235_V2.dts             |  28 +-
 target/linux/ramips/dts/F7C027.dts                 |  17 +-
 target/linux/ramips/dts/FIREWRT.dts                |   5 +-
 target/linux/ramips/dts/FONERA20N.dts              |  10 +-
 target/linux/ramips/dts/FREESTATION5.dts           |  11 +-
 target/linux/ramips/dts/HG255D.dts                 |  22 +-
 target/linux/ramips/dts/HLKRM04.dts                |   3 +
 target/linux/ramips/dts/HPM.dts                    | 149 +++++++
 target/linux/ramips/dts/HT-TM02.dts                |  11 +-
 target/linux/ramips/dts/HW550-3G.dts               |   8 +-
 target/linux/ramips/dts/IP2202.dts                 |   4 +-
 target/linux/ramips/dts/M2M.dts                    |   5 +
 target/linux/ramips/dts/M3.dts                     |   4 +
 target/linux/ramips/dts/M4-4M.dts                  |   3 +
 target/linux/ramips/dts/M4-8M.dts                  |   3 +
 target/linux/ramips/dts/MINIEMBPLUG.dts            | 120 ++++++
 target/linux/ramips/dts/MINIEMBWIFI.dts            |  92 ++++
 target/linux/ramips/dts/MIWIFI-MINI.dts            | 150 +++++++
 target/linux/ramips/dts/MLW221.dts                 |   9 +-
 target/linux/ramips/dts/MLWG2.dts                  |   8 +-
 target/linux/ramips/dts/MOFI3500-3GN.dts           |   8 +-
 target/linux/ramips/dts/MPRA1.dts                  |  10 +-
 target/linux/ramips/dts/MPRA2.dts                  |   9 +-
 target/linux/ramips/dts/MR-102N.dts                |   6 +-
 target/linux/ramips/dts/MT7620a.dts                |   4 +-
 target/linux/ramips/dts/MT7620a_MT7530.dts         |   7 +-
 target/linux/ramips/dts/MT7620a_MT7610e.dts        |   4 +-
 target/linux/ramips/dts/MT7620a_V22SG.dts          |  11 +-
 target/linux/ramips/dts/MZK-750DHP.dts             |   9 +-
 target/linux/ramips/dts/MZK-DP150N.dts             |   4 +-
 target/linux/ramips/dts/MZK-W300NH2.dts            |  13 +-
 target/linux/ramips/dts/MicroWRT.dts               |   4 +-
 target/linux/ramips/dts/NA930.dts                  |  14 +-
 target/linux/ramips/dts/NBG-419N.dts               |   5 +-
 target/linux/ramips/dts/NCS601W.dts                |  41 +-
 target/linux/ramips/dts/NW718.dts                  |   6 +
 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts  | 101 -----
 target/linux/ramips/dts/OLINUXINO-RT5350F.dts      |  79 ----
 target/linux/ramips/dts/OMNI-EMB-HPM.dts           | 142 ------
 target/linux/ramips/dts/OMNI-EMB.dts               |  90 ----
 target/linux/ramips/dts/OMNI-PLUG.dts              | 113 -----
 target/linux/ramips/dts/OY-0001.dts                |  14 +-
 target/linux/ramips/dts/PBR-M1.dts                 |  12 +-
 target/linux/ramips/dts/PSR-680W.dts               |   3 +-
 target/linux/ramips/dts/PWH2004.dts                |   4 +-
 target/linux/ramips/dts/PX-4885-4M.dts             |  43 ++
 target/linux/ramips/dts/PX-4885-8M.dts             |  43 ++
 target/linux/ramips/dts/PX-4885.dtsi               |  54 +++
 target/linux/ramips/dts/PX4885-4M.dts              |  42 --
 target/linux/ramips/dts/PX4885-8M.dts              |  42 --
 target/linux/ramips/dts/PX4885.dtsi                |  51 ---
 target/linux/ramips/dts/RE6500.dts                 |   8 +-
 target/linux/ramips/dts/RP-N53.dts                 |  30 +-
 target/linux/ramips/dts/RT-G32-B1.dts              |   3 +
 target/linux/ramips/dts/RT-N10-PLUS.dts            |   6 +-
 target/linux/ramips/dts/RT-N13U.dts                |   9 +-
 target/linux/ramips/dts/RT-N14U.dts                |  17 +-
 target/linux/ramips/dts/RT-N15.dts                 |   9 +-
 target/linux/ramips/dts/RT-N56U.dts                | 151 +++++++
 target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts  | 102 +++++
 target/linux/ramips/dts/RT5350F-OLINUXINO.dts      |  80 ++++
 target/linux/ramips/dts/RTN56U.dts                 | 146 -------
 target/linux/ramips/dts/RUT5XX.dts                 |   9 +-
 target/linux/ramips/dts/SAP-G3200U3.dts            |   4 +-
 target/linux/ramips/dts/SL-R7205.dts               |   4 +-
 target/linux/ramips/dts/TEW-691GR.dts              |   9 +-
 target/linux/ramips/dts/TEW-692GR.dts              |  13 +-
 target/linux/ramips/dts/UR-326N4G.dts              |  20 +-
 target/linux/ramips/dts/UR-336UN.dts               |  20 +-
 target/linux/ramips/dts/V11STFE.dts                |   2 +-
 target/linux/ramips/dts/V22RW-2X2.dts              |   5 +-
 target/linux/ramips/dts/VOCORE.dts                 |  15 +
 target/linux/ramips/dts/W150M.dts                  |  25 +-
 target/linux/ramips/dts/W306R_V20.dts              |   4 +-
 target/linux/ramips/dts/W502U.dts                  |   9 +-
 target/linux/ramips/dts/WCR150GN.dts               |   9 +-
 target/linux/ramips/dts/WHR-1166D.dts              |  27 +-
 target/linux/ramips/dts/WHR-300HP2.dts             |  27 +-
 target/linux/ramips/dts/WHR-600D.dts               |  28 +-
 target/linux/ramips/dts/WHR-G300N.dts              |   8 +-
 target/linux/ramips/dts/WIZARD8800.dts             |   1 +
 target/linux/ramips/dts/WL-330N.dts                | 100 +++++
 target/linux/ramips/dts/WL-330N3G.dts              | 109 +++++
 target/linux/ramips/dts/WL-341V3.dts               | 123 ++++++
 target/linux/ramips/dts/WL-351.dts                 |   6 +-
 target/linux/ramips/dts/WL341V3.dts                | 115 -----
 target/linux/ramips/dts/WLI-TX4-AG300N.dts         |  17 +-
 target/linux/ramips/dts/WL_330N.dts                |  95 ----
 target/linux/ramips/dts/WL_330N3G.dts              | 103 -----
 target/linux/ramips/dts/WMR-300.dts                | 106 +++++
 target/linux/ramips/dts/WMR300.dts                 | 101 -----
 target/linux/ramips/dts/WNCE2001.dts               |  17 +-
 target/linux/ramips/dts/WR512-3GN-4M.dts           |  18 +-
 target/linux/ramips/dts/WR512-3GN-8M.dts           |  18 +-
 target/linux/ramips/dts/WR6202.dts                 |   5 +-
 target/linux/ramips/dts/WR8305RT.dts               | 112 -----
 target/linux/ramips/dts/WRTNODE.dts                |   1 +
 target/linux/ramips/dts/WSR-1166.dts               |  30 +-
 target/linux/ramips/dts/WSR-600.dts                |  31 +-
 target/linux/ramips/dts/WT1520-4M.dts              |   1 +
 target/linux/ramips/dts/WT1520-8M.dts              |   1 +
 target/linux/ramips/dts/WT3020-4M.dts              |  28 +-
 target/linux/ramips/dts/WT3020-8M.dts              |  28 +-
 target/linux/ramips/dts/WZR-AGL300NH.dts           |  22 +-
 target/linux/ramips/dts/X5.dts                     |   9 +
 target/linux/ramips/dts/X8.dts                     |   3 +
 target/linux/ramips/dts/XDXRN502J.dts              |   4 +-
 target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts     | 149 -------
 target/linux/ramips/dts/Y1.dts                     |  20 +-
 target/linux/ramips/dts/Y1.dtsi                    |   2 +
 target/linux/ramips/dts/Y1S.dts                    |  22 +-
 target/linux/ramips/dts/ZBT-WA05.dts               |  10 +-
 target/linux/ramips/dts/ZBT-WR8305RT.dts           | 117 +++++
 target/linux/ramips/dts/ZTE-Q7.dts                 |   8 +-
 target/linux/ramips/dts/mt7620a.dtsi               |  14 +-
 target/linux/ramips/dts/mt7620n.dtsi               |   5 +-
 target/linux/ramips/dts/mt7621.dtsi                |  20 +-
 target/linux/ramips/dts/mt7628an.dtsi              |   9 +-
 target/linux/ramips/dts/rt2880.dtsi                |   3 +-
 target/linux/ramips/dts/rt3050.dtsi                |   2 +-
 target/linux/ramips/dts/rt3352.dtsi                |   1 +
 target/linux/ramips/dts/rt3883.dtsi                |   1 +
 target/linux/ramips/dts/rt5350.dtsi                |   5 +
 target/linux/ramips/image/Makefile                 |  80 ++--
 target/linux/ramips/mt7620/profiles/aigale.mk      |   6 +-
 target/linux/ramips/mt7620/profiles/mediatek.mk    |   2 +-
 target/linux/ramips/mt7620/profiles/microduino.mk  |  16 +
 target/linux/ramips/mt7620/profiles/microwrt.mk    |   9 -
 .../ramips/mt7620/profiles/xiaomi-miwifi-mini.mk   |  18 -
 target/linux/ramips/mt7620/profiles/xiaomi.mk      |  18 +
 target/linux/ramips/mt7621/profiles/firefly.mk     |  12 +-
 target/linux/ramips/mt7621/profiles/misc.mk        |  20 +
 target/linux/ramips/mt7621/profiles/pbr-m1.mk      |  22 -
 target/linux/ramips/mt7621/profiles/sap-g3200u3.mk |  18 -
 target/linux/ramips/mt7621/profiles/storylink.mk   |  18 +
 target/linux/ramips/rt288x/profiles/asus.mk        |   8 +-
 target/linux/ramips/rt288x/profiles/belkin.mk      |  10 +-
 target/linux/ramips/rt288x/profiles/edimax.mk      |  18 -
 target/linux/ramips/rt305x/profiles/allnet.mk      |   7 +-
 target/linux/ramips/rt305x/profiles/alpha.mk       |   1 -
 target/linux/ramips/rt305x/profiles/arcwireless.mk |  17 +
 target/linux/ramips/rt305x/profiles/asiarf.mk      |  23 +-
 target/linux/ramips/rt305x/profiles/asus.mk        |   8 +-
 target/linux/ramips/rt305x/profiles/aximcom.mk     |   1 -
 target/linux/ramips/rt305x/profiles/aztech.mk      |   1 -
 target/linux/ramips/rt305x/profiles/belkin.mk      |  10 +-
 target/linux/ramips/rt305x/profiles/broadway.mk    |   1 -
 target/linux/ramips/rt305x/profiles/d-link.mk      |  68 +++
 target/linux/ramips/rt305x/profiles/dlink.mk       |  69 ---
 target/linux/ramips/rt305x/profiles/easyacc.mk     |   1 -
 target/linux/ramips/rt305x/profiles/engenius.mk    |  10 +-
 target/linux/ramips/rt305x/profiles/fon.mk         |   1 -
 .../linux/ramips/rt305x/profiles/freestation5.mk   |  18 -
 target/linux/ramips/rt305x/profiles/hame.mk        |   4 +-
 target/linux/ramips/rt305x/profiles/hg255d.mk      |  17 -
 target/linux/ramips/rt305x/profiles/hilink.mk      |   2 -
 target/linux/ramips/rt305x/profiles/hootoo.mk      |   2 -
 target/linux/ramips/rt305x/profiles/huawei.mk      |  16 +
 target/linux/ramips/rt305x/profiles/intenso.mk     |  19 +
 target/linux/ramips/rt305x/profiles/m2m.mk         |  20 -
 target/linux/ramips/rt305x/profiles/misc.mk        |   1 -
 target/linux/ramips/rt305x/profiles/nexx.mk        |   1 -
 target/linux/ramips/rt305x/profiles/olimex.mk      |  33 ++
 .../rt305x/profiles/olinuxino-rt5350f-evb.mk       |  21 -
 .../ramips/rt305x/profiles/olinuxino-rt5350f.mk    |  20 -
 target/linux/ramips/rt305x/profiles/planex.mk      |   1 -
 target/linux/ramips/rt305x/profiles/poray.mk       |  12 +-
 target/linux/ramips/rt305x/profiles/sevenlinks.mk  |   8 +-
 target/linux/ramips/rt305x/profiles/tenda.mk       |   5 +-
 target/linux/ramips/rt305x/profiles/upvel.mk       |  17 +-
 target/linux/ramips/rt305x/profiles/vocore.mk      |   1 -
 target/linux/ramips/rt305x/profiles/wansview.mk    |   3 +-
 target/linux/ramips/rt3883/profiles/omnima.mk      |  10 +-
 target/linux/ramips/rt3883/profiles/trendnet.mk    |   1 +
 231 files changed, 4070 insertions(+), 3600 deletions(-)
 create mode 100644 target/linux/ramips/dts/AI-BR100.dts
 delete mode 100644 target/linux/ramips/dts/AIBR100.dts
 delete mode 100644 target/linux/ramips/dts/ARGUS_ATP52B.dts
 create mode 100644 target/linux/ramips/dts/ATP-52B.dts
 create mode 100644 target/linux/ramips/dts/HPM.dts
 create mode 100644 target/linux/ramips/dts/MINIEMBPLUG.dts
 create mode 100644 target/linux/ramips/dts/MINIEMBWIFI.dts
 create mode 100644 target/linux/ramips/dts/MIWIFI-MINI.dts
 delete mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
 delete mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F.dts
 delete mode 100644 target/linux/ramips/dts/OMNI-EMB-HPM.dts
 delete mode 100644 target/linux/ramips/dts/OMNI-EMB.dts
 delete mode 100644 target/linux/ramips/dts/OMNI-PLUG.dts
 create mode 100644 target/linux/ramips/dts/PX-4885-4M.dts
 create mode 100644 target/linux/ramips/dts/PX-4885-8M.dts
 create mode 100644 target/linux/ramips/dts/PX-4885.dtsi
 delete mode 100644 target/linux/ramips/dts/PX4885-4M.dts
 delete mode 100644 target/linux/ramips/dts/PX4885-8M.dts
 delete mode 100644 target/linux/ramips/dts/PX4885.dtsi
 create mode 100644 target/linux/ramips/dts/RT-N56U.dts
 create mode 100644 target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts
 create mode 100644 target/linux/ramips/dts/RT5350F-OLINUXINO.dts
 delete mode 100644 target/linux/ramips/dts/RTN56U.dts
 create mode 100644 target/linux/ramips/dts/WL-330N.dts
 create mode 100644 target/linux/ramips/dts/WL-330N3G.dts
 create mode 100644 target/linux/ramips/dts/WL-341V3.dts
 delete mode 100644 target/linux/ramips/dts/WL341V3.dts
 delete mode 100644 target/linux/ramips/dts/WL_330N.dts
 delete mode 100644 target/linux/ramips/dts/WL_330N3G.dts
 create mode 100644 target/linux/ramips/dts/WMR-300.dts
 delete mode 100644 target/linux/ramips/dts/WMR300.dts
 delete mode 100644 target/linux/ramips/dts/WR8305RT.dts
 delete mode 100644 target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts
 create mode 100644 target/linux/ramips/dts/ZBT-WR8305RT.dts
 create mode 100644 target/linux/ramips/mt7620/profiles/microduino.mk
 delete mode 100644 target/linux/ramips/mt7620/profiles/microwrt.mk
 delete mode 100644 target/linux/ramips/mt7620/profiles/xiaomi-miwifi-mini.mk
 create mode 100644 target/linux/ramips/mt7620/profiles/xiaomi.mk
 create mode 100644 target/linux/ramips/mt7621/profiles/misc.mk
 delete mode 100644 target/linux/ramips/mt7621/profiles/pbr-m1.mk
 delete mode 100644 target/linux/ramips/mt7621/profiles/sap-g3200u3.mk
 create mode 100644 target/linux/ramips/mt7621/profiles/storylink.mk
 delete mode 100644 target/linux/ramips/rt288x/profiles/edimax.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/arcwireless.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/d-link.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/dlink.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/freestation5.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/hg255d.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/huawei.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/intenso.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/m2m.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/olimex.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f-evb.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f.mk

-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:02 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:02 +0200
Subject: [OpenWrt-Devel] [PATCH v2 01/25] ramips: fix indentation and other
	mistakes in .dts{, i} files
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-2-git-send-email-pepe2k@gmail.com>

The following patch fixes:
 * wrong indentations
 * doubled gpio-keys-polled nodes (DIR-300-B7, DIR-320-B1, DIR-610-A1)
 * duplicate spacings
 * empty lines at end of files and after last child nodes
 * trailing and leading whitespace
 * unnecessary and commented-out code
 * missing empty lines between nodes and between properties and nodes
 * unnecessary empty lines between nodes properties [1]

in .dts{,i} files, for ramips target.

[1] Some of empty lines in SOCs dtsi files were left untouched, because they seem to be there for a reason (readability?).

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---

Changes in v2:
 * more mistakes fixed
 * fixes also dts{,i} structure (cosmetic)

 target/linux/ramips/dts/3G-6200N.dts              |   6 +-
 target/linux/ramips/dts/3G-6200NL.dts             |   3 +-
 target/linux/ramips/dts/3G150B.dts                |   6 +-
 target/linux/ramips/dts/3G300M.dts                |   9 +
 target/linux/ramips/dts/A5-V11.dts                |   6 +
 target/linux/ramips/dts/AIBR100.dts               |   3 +
 target/linux/ramips/dts/AIR3GII.dts               |   4 +
 target/linux/ramips/dts/ALL0239-3G.dts            |   8 +-
 target/linux/ramips/dts/ALL0256N-4M.dts           |   5 +
 target/linux/ramips/dts/ALL0256N-8M.dts           |   5 +
 target/linux/ramips/dts/ALL5002.dts               |   4 +-
 target/linux/ramips/dts/ALL5003.dts               |   4 +-
 target/linux/ramips/dts/AR670W.dts                |   4 +-
 target/linux/ramips/dts/AR725W.dts                |   4 +-
 target/linux/ramips/dts/ARGUS_ATP52B.dts          |   5 +-
 target/linux/ramips/dts/ASL26555-16M.dts          |  17 ++
 target/linux/ramips/dts/ASL26555-8M.dts           |  16 ++
 target/linux/ramips/dts/AWAPN2403.dts             |   5 +-
 target/linux/ramips/dts/AWM002-EVB-4M.dts         |   5 +
 target/linux/ramips/dts/AWM002-EVB-8M.dts         |   5 +
 target/linux/ramips/dts/AWM002.dtsi               |   3 +
 target/linux/ramips/dts/AWM003-EVB.dts            |   5 +
 target/linux/ramips/dts/ArcherC20i.dts            |   1 -
 target/linux/ramips/dts/BC2.dts                   |   3 +-
 target/linux/ramips/dts/BR-6425.dts               |   5 +-
 target/linux/ramips/dts/BR-6475ND.dts             |   9 +-
 target/linux/ramips/dts/BROADWAY.dts              |   4 +-
 target/linux/ramips/dts/CARAMBOLA.dts             |   2 -
 target/linux/ramips/dts/CF-WR800N.dts             |  25 +--
 target/linux/ramips/dts/CY-SWR1100.dts            |  13 +-
 target/linux/ramips/dts/D105.dts                  |   4 +-
 target/linux/ramips/dts/DAP-1350.dts              |   8 +-
 target/linux/ramips/dts/DCS-930.dts               |   5 +-
 target/linux/ramips/dts/DCS-930L-B1.dts           |   7 +-
 target/linux/ramips/dts/DIR-300-B1.dts            |   8 +-
 target/linux/ramips/dts/DIR-300-B7.dts            |  74 +++++----
 target/linux/ramips/dts/DIR-320-B1.dts            |  26 +--
 target/linux/ramips/dts/DIR-600-B1.dts            |   8 +-
 target/linux/ramips/dts/DIR-600-B2.dts            |   8 +-
 target/linux/ramips/dts/DIR-610-A1.dts            |  25 +--
 target/linux/ramips/dts/DIR-615-D.dts             |   8 +-
 target/linux/ramips/dts/DIR-615-H1.dts            |  10 ++
 target/linux/ramips/dts/DIR-620-A1.dts            |   9 +-
 target/linux/ramips/dts/DIR-620-D1.dts            |   6 +
 target/linux/ramips/dts/DIR-645.dts               |  11 ++
 target/linux/ramips/dts/DIR-810L.dts              |   6 +-
 target/linux/ramips/dts/DIR-860L-B1.dts           |   1 +
 target/linux/ramips/dts/E1700.dts                 |  11 +-
 target/linux/ramips/dts/ESR-9753.dts              |   5 +-
 target/linux/ramips/dts/F5D8235_V1.dts            |   9 +-
 target/linux/ramips/dts/F5D8235_V2.dts            |  10 +-
 target/linux/ramips/dts/F7C027.dts                |   9 +
 target/linux/ramips/dts/FIREWRT.dts               |   5 +-
 target/linux/ramips/dts/FONERA20N.dts             |  10 +-
 target/linux/ramips/dts/FREESTATION5.dts          |   5 +-
 target/linux/ramips/dts/HG255D.dts                |  10 +-
 target/linux/ramips/dts/HLKRM04.dts               |   3 +
 target/linux/ramips/dts/HT-TM02.dts               |  11 +-
 target/linux/ramips/dts/HW550-3G.dts              |   8 +-
 target/linux/ramips/dts/IP2202.dts                |   4 +-
 target/linux/ramips/dts/M2M.dts                   |   5 +
 target/linux/ramips/dts/M3.dts                    |   4 +
 target/linux/ramips/dts/M4-4M.dts                 |   3 +
 target/linux/ramips/dts/M4-8M.dts                 |   3 +
 target/linux/ramips/dts/MLW221.dts                |   5 +-
 target/linux/ramips/dts/MLWG2.dts                 |   4 +
 target/linux/ramips/dts/MOFI3500-3GN.dts          |   8 +-
 target/linux/ramips/dts/MPRA1.dts                 |   6 +
 target/linux/ramips/dts/MPRA2.dts                 |   5 +
 target/linux/ramips/dts/MR-102N.dts               |   6 +-
 target/linux/ramips/dts/MT7620a.dts               |   4 +-
 target/linux/ramips/dts/MT7620a_MT7530.dts        |   7 +-
 target/linux/ramips/dts/MT7620a_MT7610e.dts       |   4 +-
 target/linux/ramips/dts/MT7620a_V22SG.dts         |  11 +-
 target/linux/ramips/dts/MZK-750DHP.dts            |   5 +-
 target/linux/ramips/dts/MZK-DP150N.dts            |   2 +
 target/linux/ramips/dts/MZK-W300NH2.dts           |   7 +-
 target/linux/ramips/dts/MicroWRT.dts              |   4 +-
 target/linux/ramips/dts/NA930.dts                 |  14 +-
 target/linux/ramips/dts/NBG-419N.dts              |   5 +-
 target/linux/ramips/dts/NCS601W.dts               |  41 +----
 target/linux/ramips/dts/NW718.dts                 |   6 +
 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts | 191 +++++++++++-----------
 target/linux/ramips/dts/OLINUXINO-RT5350F.dts     | 123 +++++++-------
 target/linux/ramips/dts/OMNI-EMB-HPM.dts          |   9 +-
 target/linux/ramips/dts/OMNI-EMB.dts              |   4 +-
 target/linux/ramips/dts/OMNI-PLUG.dts             |  15 +-
 target/linux/ramips/dts/OY-0001.dts               |  10 +-
 target/linux/ramips/dts/PBR-M1.dts                |  12 +-
 target/linux/ramips/dts/PSR-680W.dts              |   3 +-
 target/linux/ramips/dts/PWH2004.dts               |   4 +-
 target/linux/ramips/dts/PX4885-4M.dts             |   1 +
 target/linux/ramips/dts/PX4885-8M.dts             |   1 +
 target/linux/ramips/dts/PX4885.dtsi               |   3 +
 target/linux/ramips/dts/RE6500.dts                |   4 +
 target/linux/ramips/dts/RP-N53.dts                |  14 +-
 target/linux/ramips/dts/RT-G32-B1.dts             |   3 +
 target/linux/ramips/dts/RT-N10-PLUS.dts           |   4 +-
 target/linux/ramips/dts/RT-N13U.dts               |   5 +-
 target/linux/ramips/dts/RT-N14U.dts               |   7 +
 target/linux/ramips/dts/RT-N15.dts                |   9 +-
 target/linux/ramips/dts/RTN56U.dts                |  21 ++-
 target/linux/ramips/dts/RUT5XX.dts                |   9 +-
 target/linux/ramips/dts/SAP-G3200U3.dts           |   2 +
 target/linux/ramips/dts/SL-R7205.dts              |   4 +-
 target/linux/ramips/dts/TEW-691GR.dts             |   7 +-
 target/linux/ramips/dts/TEW-692GR.dts             |   9 +-
 target/linux/ramips/dts/UR-326N4G.dts             |   8 +-
 target/linux/ramips/dts/UR-336UN.dts              |   8 +-
 target/linux/ramips/dts/V11STFE.dts               |   2 +-
 target/linux/ramips/dts/V22RW-2X2.dts             |   5 +-
 target/linux/ramips/dts/VOCORE.dts                |  15 ++
 target/linux/ramips/dts/W150M.dts                 |   9 +-
 target/linux/ramips/dts/W306R_V20.dts             |   4 +-
 target/linux/ramips/dts/W502U.dts                 |   5 +-
 target/linux/ramips/dts/WCR150GN.dts              |   5 +-
 target/linux/ramips/dts/WHR-1166D.dts             |  13 +-
 target/linux/ramips/dts/WHR-300HP2.dts            |  13 +-
 target/linux/ramips/dts/WHR-600D.dts              |  14 +-
 target/linux/ramips/dts/WHR-G300N.dts             |   8 +-
 target/linux/ramips/dts/WIZARD8800.dts            |   1 +
 target/linux/ramips/dts/WL-351.dts                |   6 +-
 target/linux/ramips/dts/WL341V3.dts               |  10 +-
 target/linux/ramips/dts/WLI-TX4-AG300N.dts        |  11 +-
 target/linux/ramips/dts/WL_330N.dts               |   5 +
 target/linux/ramips/dts/WL_330N3G.dts             |   6 +
 target/linux/ramips/dts/WMR300.dts                |   5 +
 target/linux/ramips/dts/WNCE2001.dts              |   9 +
 target/linux/ramips/dts/WR512-3GN-4M.dts          |   8 +-
 target/linux/ramips/dts/WR512-3GN-8M.dts          |   8 +-
 target/linux/ramips/dts/WR6202.dts                |   5 +-
 target/linux/ramips/dts/WR8305RT.dts              |   7 +-
 target/linux/ramips/dts/WRTNODE.dts               |   1 +
 target/linux/ramips/dts/WSR-1166.dts              |  14 ++
 target/linux/ramips/dts/WSR-600.dts               |  15 ++
 target/linux/ramips/dts/WT1520-4M.dts             |   1 +
 target/linux/ramips/dts/WT1520-8M.dts             |   1 +
 target/linux/ramips/dts/WT3020-4M.dts             |  28 ++--
 target/linux/ramips/dts/WT3020-8M.dts             |  28 ++--
 target/linux/ramips/dts/WZR-AGL300NH.dts          |  14 +-
 target/linux/ramips/dts/X5.dts                    |   9 +
 target/linux/ramips/dts/X8.dts                    |   3 +
 target/linux/ramips/dts/XDXRN502J.dts             |   4 +-
 target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts    |   1 +
 target/linux/ramips/dts/Y1.dts                    |   8 +-
 target/linux/ramips/dts/Y1.dtsi                   |   2 +
 target/linux/ramips/dts/Y1S.dts                   |   8 +-
 target/linux/ramips/dts/ZBT-WA05.dts              |   4 +
 target/linux/ramips/dts/ZTE-Q7.dts                |   4 +-
 target/linux/ramips/dts/mt7620a.dtsi              |  14 +-
 target/linux/ramips/dts/mt7620n.dtsi              |   5 +-
 target/linux/ramips/dts/mt7621.dtsi               |  20 ++-
 target/linux/ramips/dts/mt7628an.dtsi             |   9 +-
 target/linux/ramips/dts/rt2880.dtsi               |   3 +-
 target/linux/ramips/dts/rt3050.dtsi               |   2 +-
 target/linux/ramips/dts/rt3352.dtsi               |   1 +
 target/linux/ramips/dts/rt3883.dtsi               |   1 +
 target/linux/ramips/dts/rt5350.dtsi               |   5 +
 158 files changed, 1113 insertions(+), 433 deletions(-)

diff --git a/target/linux/ramips/dts/3G-6200N.dts b/target/linux/ramips/dts/3G-6200N.dts
index a19ed45..3a79d46 100644
--- a/target/linux/ramips/dts/3G-6200N.dts
+++ b/target/linux/ramips/dts/3G-6200N.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -68,14 +67,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "edimax:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wlan {
 			label = "edimax:amber:wlan";
 			gpios = <&gpio0 14 1>;
 		};
+
 		3g {
 			label = "edimax:blue:3g";
 			gpios = <&gpio0 7 1>;
@@ -87,11 +89,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 12 1>;
 			linux,code = <0x211>;
 		};
+
 		wlanswitch {
 			label = "wlanswitch";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/3G-6200NL.dts b/target/linux/ramips/dts/3G-6200NL.dts
index 2dec318..eb6e7d4 100644
--- a/target/linux/ramips/dts/3G-6200NL.dts
+++ b/target/linux/ramips/dts/3G-6200NL.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -68,6 +67,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wlan {
 			label = "edimax:amber:wlan";
 			gpios = <&gpio0 14 1>;
@@ -79,6 +79,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 12 1>;
diff --git a/target/linux/ramips/dts/3G150B.dts b/target/linux/ramips/dts/3G150B.dts
index bdcca71..26f4ce6 100644
--- a/target/linux/ramips/dts/3G150B.dts
+++ b/target/linux/ramips/dts/3G150B.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -41,6 +42,7 @@
 				};
 			};
 		};
+
 		gpio1: gpio at 660 {
 			status = "okay";
 		};
@@ -78,10 +80,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		ap {
 			label = "tenda:blue:ap";
 			gpios = <&gpio0 7 1>;
 		};
+
 		3g {
 			label = "tenda:blue:3g";
 			gpios = <&gpio0 14 1>;
@@ -93,6 +97,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
@@ -110,5 +115,4 @@
 			gpios = <&gpio0 13 0>;
 		};
 	};
-
 };
diff --git a/target/linux/ramips/dts/3G300M.dts b/target/linux/ramips/dts/3G300M.dts
index 5095927..1f9d6f9 100644
--- a/target/linux/ramips/dts/3G300M.dts
+++ b/target/linux/ramips/dts/3G300M.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -54,26 +55,32 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		3grouter {
 			label = "tenda:blue:3grouter";
 			gpios = <&gpio0 11 1>;
 		};
+
 		ap {
 			label = "tenda:blue:ap";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wisprouter {
 			label = "tenda:blue:wisprouter";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wirelessrouter {
 			label = "tenda:blue:wirelessrouter";
 			gpios = <&gpio0 13 1>;
 		};
+
 		3g {
 			label = "tenda:blue:3g";
 			gpios = <&gpio0 7 1>;
 		};
+
 		wpsreset {
 			label = "tenda:blue:wpsreset";
 			gpios = <&gpio0 14 1>;
@@ -85,11 +92,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/A5-V11.dts b/target/linux/ramips/dts/A5-V11.dts
index 154074a..f1d0891 100644
--- a/target/linux/ramips/dts/A5-V11.dts
+++ b/target/linux/ramips/dts/A5-V11.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -41,6 +42,7 @@
 				};
 			};
 		};
+
 		gpio1: gpio at 660 {
 			status = "okay";
 		};
@@ -77,10 +79,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		system {
 			label = "a5-v11:blue:system";
 			gpios = <&gpio0 20 1>;
 		};
+
 		power {
 			label = "a5-v11:red:power";
 			gpios = <&gpio0 17 1>;
@@ -92,6 +96,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
@@ -108,6 +113,7 @@
 			gpio-export,output = <1>;
 			gpios = <&gpio0 7 0>;
 		};
+
 		root_hub {
 			gpio-export,name = "root_hub";
 			gpio-export,output = <1>;
diff --git a/target/linux/ramips/dts/AIBR100.dts b/target/linux/ramips/dts/AIBR100.dts
index 90f3a1e..963e835 100644
--- a/target/linux/ramips/dts/AIBR100.dts
+++ b/target/linux/ramips/dts/AIBR100.dts
@@ -82,10 +82,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wan {
 			label = "aigale:blue:wan";
 			gpios = <&gpio2 4 1>;
 		};
+
 		wlan {
 			label = "aigale:blue:wlan";
 			gpios = <&gpio3 0 1>;
@@ -97,6 +99,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 12 1>;
diff --git a/target/linux/ramips/dts/AIR3GII.dts b/target/linux/ramips/dts/AIR3GII.dts
index 4a26546..434b10b 100644
--- a/target/linux/ramips/dts/AIR3GII.dts
+++ b/target/linux/ramips/dts/AIR3GII.dts
@@ -13,6 +13,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -70,10 +71,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wlan {
 			label = "airlive:green:wlan";
 			gpios = <&gpio0 8 0>;
 		};
+
 		mobile {
 			label = "airlive:green:mobile";
 			gpios = <&gpio0 9 1>;
@@ -85,6 +88,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 7 1>;
diff --git a/target/linux/ramips/dts/ALL0239-3G.dts b/target/linux/ramips/dts/ALL0239-3G.dts
index 4da69a7..ac8a4e9 100644
--- a/target/linux/ramips/dts/ALL0239-3G.dts
+++ b/target/linux/ramips/dts/ALL0239-3G.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -63,18 +62,22 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		usb {
 			label = "hw550-3g:green:usb";
 			gpios = <&gpio0 8 1>;
 		};
+
 		3g {
 			label = "hw550-3g:green:3g";
 			gpios = <&gpio0 11 1>;
 		};
+
 		status {
 			label = "hw550-3g:green:status";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "hw550-3g:green:wps";
 			gpios = <&gpio0 14 1>;
@@ -86,16 +89,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		connect {
 			label = "connect";
 			gpios = <&gpio0 7 1>;
 			linux,code = <0xda>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/ALL0256N-4M.dts b/target/linux/ramips/dts/ALL0256N-4M.dts
index 581934a..d0fbb89 100644
--- a/target/linux/ramips/dts/ALL0256N-4M.dts
+++ b/target/linux/ramips/dts/ALL0256N-4M.dts
@@ -13,6 +13,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -70,14 +71,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		rssilow {
 			label = "all0256n:green:rssilow";
 			gpios = <&gpio0 14 1>;
 		};
+
 		rssimed {
 			label = "all0256n:green:rssimed";
 			gpios = <&gpio0 12 1>;
 		};
+
 		rssihigh {
 			label = "all0256n:green:rssihigh";
 			gpios = <&gpio0 13 1>;
@@ -89,6 +93,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/ALL0256N-8M.dts b/target/linux/ramips/dts/ALL0256N-8M.dts
index c4815d9..c788869 100644
--- a/target/linux/ramips/dts/ALL0256N-8M.dts
+++ b/target/linux/ramips/dts/ALL0256N-8M.dts
@@ -13,6 +13,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -70,14 +71,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		rssilow {
 			label = "all0256n:green:rssilow";
 			gpios = <&gpio0 14 1>;
 		};
+
 		rssimed {
 			label = "all0256n:green:rssimed";
 			gpios = <&gpio0 12 1>;
 		};
+
 		rssihigh {
 			label = "all0256n:green:rssihigh";
 			gpios = <&gpio0 13 1>;
@@ -89,6 +93,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/ALL5002.dts b/target/linux/ramips/dts/ALL5002.dts
index 7c19571..06f892b 100644
--- a/target/linux/ramips/dts/ALL5002.dts
+++ b/target/linux/ramips/dts/ALL5002.dts
@@ -13,6 +13,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -78,7 +79,6 @@
 
 	i2c-gpio {
 		compatible = "i2c-gpio";
-
 		gpios = <&gpio0 1 0 &gpio0 2 0>;
 		i2c-gpio,delay-us = <10>;
 
@@ -97,10 +97,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		ld1 {
 			label = "allnet:green:ld1";
 			gpios = <&pcf0 0 1>;
 		};
+
 		ld2 {
 			label = "allnet:green:ld2";
 			gpios = <&pcf0 1 1>;
diff --git a/target/linux/ramips/dts/ALL5003.dts b/target/linux/ramips/dts/ALL5003.dts
index 1d58b6a..d14b1f9 100644
--- a/target/linux/ramips/dts/ALL5003.dts
+++ b/target/linux/ramips/dts/ALL5003.dts
@@ -13,6 +13,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -78,7 +79,6 @@
 
 	i2c-gpio {
 		compatible = "i2c-gpio";
-
 		gpios = <&gpio0 1 0 &gpio0 2 0>;
 		i2c-gpio,delay-us = <10>;
 
@@ -97,10 +97,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		ld1 {
 			label = "allnet:green:ld1";
 			gpios = <&pcf0 0 1>;
 		};
+
 		ld2 {
 			label = "allnet:green:ld2";
 			gpios = <&pcf0 1 1>;
diff --git a/target/linux/ramips/dts/AR670W.dts b/target/linux/ramips/dts/AR670W.dts
index 07497cb..0e29d89 100644
--- a/target/linux/ramips/dts/AR670W.dts
+++ b/target/linux/ramips/dts/AR670W.dts
@@ -32,6 +32,7 @@
 
 		mdio-bus {
 			status = "okay";
+
 			phy0: ethernet-phy at 0 {
 				phy-mode = "mii";
 				reg = <0>;
@@ -47,7 +48,6 @@
 	cfi at bdc00000 {
 		compatible = "cfi-flash";
 		reg = <0xbc400000 0x800000>;
-
 		bank-width = <2>;
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -89,11 +89,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 9 1>;
diff --git a/target/linux/ramips/dts/AR725W.dts b/target/linux/ramips/dts/AR725W.dts
index 87f2553..6f66c3f 100644
--- a/target/linux/ramips/dts/AR725W.dts
+++ b/target/linux/ramips/dts/AR725W.dts
@@ -32,6 +32,7 @@
 
 		mdio-bus {
 			status = "okay";
+
 			phy0: ethernet-phy at 0 {
 				phy-mode = "mii";
 				reg = <0>;
@@ -47,7 +48,6 @@
 	cfi at bdc00000 {
 		compatible = "cfi-flash";
 		reg = <0xbc400000 0x800000>;
-
 		bank-width = <2>;
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -99,11 +99,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 9 1>;
diff --git a/target/linux/ramips/dts/ARGUS_ATP52B.dts b/target/linux/ramips/dts/ARGUS_ATP52B.dts
index 66108b1..f94d740 100644
--- a/target/linux/ramips/dts/ARGUS_ATP52B.dts
+++ b/target/linux/ramips/dts/ARGUS_ATP52B.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -48,10 +47,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		run {
 			label = "argus-atp52b:green:run";
 			gpios = <&gpio0 9 1>;
 		};
+
 		net {
 			label = "argus-atp52b:amber:net";
 			gpios = <&gpio0 13 1>;
@@ -63,11 +64,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/ASL26555-16M.dts b/target/linux/ramips/dts/ASL26555-16M.dts
index 74163c2..2cf1ac6 100644
--- a/target/linux/ramips/dts/ASL26555-16M.dts
+++ b/target/linux/ramips/dts/ASL26555-16M.dts
@@ -13,6 +13,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -26,30 +27,36 @@
 					reg = <0x0 0x30000>;
 					read-only;
 				};
+
 				partition at 30000 {
 					label = "uboot-env";
 					reg = <0x30000 0x10000>;
 					read-only;
 				};
+
 				partition at 40000 {
 					label = "factory";
 					reg = <0x40000 0x10000>;
 					read-only;
 				};
+
 				partition at 50000 {
 					label = "firmware";
 					reg = <0x50000 0xf80000>;
 				};
+
 				partition at fd0000 {
 					label = "cert";
 					reg = <0xfd0000 0x10000>;
 					read-only;
 				};
+
 				partition at fe0000 {
 					label = "langpack";
 					reg = <0xfe0000 0x10000>;
 					read-only;
 				};
+
 				devdata: partition at ff0000 {
 					label = "devdata";
 					reg = <0xff0000 0x10000>;
@@ -89,11 +96,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 0>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 12 0>;
@@ -103,34 +112,42 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		eth {
 			label = "asl26555:green:eth";
 			gpios = <&gpio0 0 1>;
 		};
+
 		wan-red {
 			label = "asl26555:red:wan";
 			gpios = <&gpio0 1 0>;
 		};
+
 		wan-green {
 			label = "asl26555:green:wan";
 			gpios = <&gpio0 2 0>;
 		};
+
 		wlan {
 			label = "asl26555:green:wlan";
 			gpios = <&gpio0 7 0>;
 		};
+
 		power-green {
 			label = "asl26555:green:power";
 			gpios = <&gpio0 8 0>;
 		};
+
 		power-red {
 			label = "asl26555:red:power";
 			gpios = <&gpio0 9 0>;
 		};
+
 		3g-green {
 			label = "asl26555:green:3g";
 			gpios = <&gpio0 14 1>;
 		};
+
 		3g-red {
 			label = "asl26555:red:3g";
 			gpios = <&gpio0 17 1>;
diff --git a/target/linux/ramips/dts/ASL26555-8M.dts b/target/linux/ramips/dts/ASL26555-8M.dts
index 506f147..80cf4a4 100644
--- a/target/linux/ramips/dts/ASL26555-8M.dts
+++ b/target/linux/ramips/dts/ASL26555-8M.dts
@@ -13,6 +13,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -26,25 +27,30 @@
 					reg = <0x0 0x30000>;
 					read-only;
 				};
+
 				ubootenv: partition at 30000 {
 					label = "uboot-env";
 					reg = <0x30000 0x10000>;
 					read-only;
 				};
+
 				partition at 40000 {
 					label = "rgdb";
 					reg = <0x40000 0x10000>;
 					read-only;
 				};
+
 				partition at 50000 {
 					label = "firmware";
 					reg = <0x50000 0x790000>;
 				};
+
 				partition at 7e0000 {
 					label = "cert";
 					reg = <0x7e0000 0x10000>;
 					read-only;
 				};
+
 				partition at 7f0000 {
 					label = "langpack";
 					reg = <0x7f0000 0x10000>;
@@ -84,11 +90,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 0>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 12 0>;
@@ -98,34 +106,42 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		eth {
 			label = "asl26555:green:eth";
 			gpios = <&gpio0 0 1>;
 		};
+
 		wan-red {
 			label = "asl26555:red:wan";
 			gpios = <&gpio0 1 0>;
 		};
+
 		wan-green {
 			label = "asl26555:green:wan";
 			gpios = <&gpio0 2 0>;
 		};
+
 		wlan {
 			label = "asl26555:green:wlan";
 			gpios = <&gpio0 7 0>;
 		};
+
 		power-green {
 			label = "asl26555:green:power";
 			gpios = <&gpio0 8 0>;
 		};
+
 		power-red {
 			label = "asl26555:red:power";
 			gpios = <&gpio0 9 0>;
 		};
+
 		3g-green {
 			label = "asl26555:green:3g";
 			gpios = <&gpio0 14 1>;
 		};
+
 		3g-red {
 			label = "asl26555:red:3g";
 			gpios = <&gpio0 17 1>;
diff --git a/target/linux/ramips/dts/AWAPN2403.dts b/target/linux/ramips/dts/AWAPN2403.dts
index 2de0402..754f9f7 100644
--- a/target/linux/ramips/dts/AWAPN2403.dts
+++ b/target/linux/ramips/dts/AWAPN2403.dts
@@ -4,11 +4,12 @@
 
 / {
 	compatible = "AWAPN2403", "ralink,rt3052-soc";
-	model =  "AsiaRF AWAPN2403";
+	model = "AsiaRF AWAPN2403";
 
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -62,6 +63,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		link {
 			label = "asiarf:green:wps";
 			gpios = <&gpio0 14 1>;
@@ -73,6 +75,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/AWM002-EVB-4M.dts b/target/linux/ramips/dts/AWM002-EVB-4M.dts
index 0738f04..fe2ff1a 100644
--- a/target/linux/ramips/dts/AWM002-EVB-4M.dts
+++ b/target/linux/ramips/dts/AWM002-EVB-4M.dts
@@ -15,14 +15,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		tx {
 			label = "awm002-evb:green:tx";
 			gpios = <&gpio0 15 1>;
 		};
+
 		rx {
 			label = "awm002-evb:green:rx";
 			gpios = <&gpio0 16 1>;
 		};
+
 		wps {
 			label = "awm002-evb:green:wps";
 			gpios = <&gpio0 21 1>;
@@ -34,11 +37,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 20 1>;
diff --git a/target/linux/ramips/dts/AWM002-EVB-8M.dts b/target/linux/ramips/dts/AWM002-EVB-8M.dts
index ebc4085..d4de3f1 100644
--- a/target/linux/ramips/dts/AWM002-EVB-8M.dts
+++ b/target/linux/ramips/dts/AWM002-EVB-8M.dts
@@ -15,14 +15,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		tx {
 			label = "awm002-evb:green:tx";
 			gpios = <&gpio0 15 1>;
 		};
+
 		rx {
 			label = "awm002-evb:green:rx";
 			gpios = <&gpio0 16 1>;
 		};
+
 		wps {
 			label = "awm002-evb:green:wps";
 			gpios = <&gpio0 21 1>;
@@ -34,11 +37,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 20 1>;
diff --git a/target/linux/ramips/dts/AWM002.dtsi b/target/linux/ramips/dts/AWM002.dtsi
index 3b87995..ce45bd3 100644
--- a/target/linux/ramips/dts/AWM002.dtsi
+++ b/target/linux/ramips/dts/AWM002.dtsi
@@ -7,6 +7,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -62,10 +63,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		ld1 {
 			label = "asiarf:green:ld1";
 			gpios = <&gpio0 0 1>;
 		};
+
 		ld2 {
 			label = "asiarf:green:ld2";
 			gpios = <&gpio0 1 1>;
diff --git a/target/linux/ramips/dts/AWM003-EVB.dts b/target/linux/ramips/dts/AWM003-EVB.dts
index 35d4886..02de20d 100644
--- a/target/linux/ramips/dts/AWM003-EVB.dts
+++ b/target/linux/ramips/dts/AWM003-EVB.dts
@@ -30,14 +30,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		tx {
 			label = "awm002-evb:green:tx";
 			gpios = <&gpio0 15 1>;
 		};
+
 		rx {
 			label = "awm002-evb:green:rx";
 			gpios = <&gpio0 16 1>;
 		};
+
 		wps {
 			label = "awm002-evb:green:wps";
 			gpios = <&gpio0 21 1>;
@@ -49,11 +52,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 20 1>;
diff --git a/target/linux/ramips/dts/ArcherC20i.dts b/target/linux/ramips/dts/ArcherC20i.dts
index cc3d5c1..0ad4d12 100644
--- a/target/linux/ramips/dts/ArcherC20i.dts
+++ b/target/linux/ramips/dts/ArcherC20i.dts
@@ -72,7 +72,6 @@
 	ethernet at 10100000 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&ephy_pins>;
-
 		mtd-mac-address = <&rom 0xf100>;
 		ralink,port-map = "wllll";
 	};
diff --git a/target/linux/ramips/dts/BC2.dts b/target/linux/ramips/dts/BC2.dts
index 0524f2d..d920b6e 100644
--- a/target/linux/ramips/dts/BC2.dts
+++ b/target/linux/ramips/dts/BC2.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -50,6 +49,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		usb {
 			label = "bc2:blue:usb";
 			gpios = <&gpio0 20 1>;
@@ -61,6 +61,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 17 1>;
diff --git a/target/linux/ramips/dts/BR-6425.dts b/target/linux/ramips/dts/BR-6425.dts
index 6f836c8..2d62615 100644
--- a/target/linux/ramips/dts/BR-6425.dts
+++ b/target/linux/ramips/dts/BR-6425.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -39,10 +38,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "edimax:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wlan {
 			label = "edimax:orange:wlan";
 			gpios = <&gpio0 14 1>;
@@ -54,11 +55,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 12 1>;
 			linux,code = <0x198>;
 		};
+
 		rfkill {
 			label = "RFKILL switch";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/BR-6475ND.dts b/target/linux/ramips/dts/BR-6475ND.dts
index 1907028..ce8bd61 100644
--- a/target/linux/ramips/dts/BR-6475ND.dts
+++ b/target/linux/ramips/dts/BR-6475ND.dts
@@ -45,9 +45,9 @@
 
 	pci at 10140000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&pci_pins>;
+
 		pci_pins: pci {
 			pci {
 				ralink,group = "pci";
@@ -58,6 +58,7 @@
 		host-bridge {
 			pci-bridge at 1 {
 				status = "okay";
+
 				wmac at 0,0 {
 					ralink,5ghz = <0>;
 					compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
@@ -79,7 +80,6 @@
 	nor-flash at 1c000000 {
 		compatible = "cfi-flash";
 		reg = <0x1c000000 0x800000>;
-
 		bank-width = <2>;
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -131,11 +131,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 7 1>;
 			linux,code = <0x198>;
 		};
+
 		rfkill {
 			label = "rfkill";
 			gpios = <&gpio0 9 1>;
@@ -151,10 +153,12 @@
 			label = "edimax:green:power";
 			gpios = <&gpio0 10 1>;
 		};
+
 		wlan {
 			label = "edimax:amber:wlan";
 			gpios = <&gpio0 11 1>;
 		};
+
 		wlan_5ghz {
 			label = "edimax:amber:wlan_5ghz";
 			gpios = <&gpio0 14 1>;
@@ -168,6 +172,7 @@
 	gpio_export {
 		compatible = "gpio-export";
 		#size-cells = <0>;
+
 		usb {
 			gpio-export,name="usb";
 			gpio-export,output=<0>;
diff --git a/target/linux/ramips/dts/BROADWAY.dts b/target/linux/ramips/dts/BROADWAY.dts
index db86f97..34696ad 100644
--- a/target/linux/ramips/dts/BROADWAY.dts
+++ b/target/linux/ramips/dts/BROADWAY.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -62,10 +61,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		diskmounted {
 			label = "red:diskmounted";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wps_active {
 			label = "red:wps_active";
 			gpios = <&gpio0 14 1>;
@@ -77,6 +78,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		factory {
 			label = "Factory Reset button";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/CARAMBOLA.dts b/target/linux/ramips/dts/CARAMBOLA.dts
index c33ed42..ea3623d 100644
--- a/target/linux/ramips/dts/CARAMBOLA.dts
+++ b/target/linux/ramips/dts/CARAMBOLA.dts
@@ -22,7 +22,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -70,7 +69,6 @@
 
 	i2c-gpio {
 		compatible = "i2c-gpio";
-
 		gpios = <&gpio0 1 0 &gpio0 2 0>;
 		i2c-gpio,delay-us = <10>;
 	};
diff --git a/target/linux/ramips/dts/CF-WR800N.dts b/target/linux/ramips/dts/CF-WR800N.dts
index 5db6c83..beb2805 100644
--- a/target/linux/ramips/dts/CF-WR800N.dts
+++ b/target/linux/ramips/dts/CF-WR800N.dts
@@ -8,7 +8,7 @@
 
 	chosen {
 		bootargs = "console=ttyS0,115200";
-        };
+	};
 
 	palmbus at 10000000 {
 		gpio0: gpio at 600 {
@@ -100,15 +100,16 @@
 		};
 	};
 
-        gpio-keys-polled {
-                compatible = "gpio-keys-polled";
-                #address-cells = <1>;
-                #size-cells = <0>;
-                poll-interval = <20>;
-                reset {
-                        label = "reset";
-                        gpios = <&gpio0 2 1>;
-                        linux,code = <0x198>;
-                };
-        };
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x198>;
+		};
+	};
 };
diff --git a/target/linux/ramips/dts/CY-SWR1100.dts b/target/linux/ramips/dts/CY-SWR1100.dts
index adea081..acccfdb 100644
--- a/target/linux/ramips/dts/CY-SWR1100.dts
+++ b/target/linux/ramips/dts/CY-SWR1100.dts
@@ -30,9 +30,9 @@
 
 	pci at 10140000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&pci_pins>;
+
 		pci_pins: pci {
 			pci {
 				ralink,group = "pci";
@@ -43,6 +43,7 @@
 		host-bridge {
 			pci-bridge at 1 {
 				status = "okay";
+
 				wmac at 0,0 {
 					ralink,5ghz = <0>;
 					compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
@@ -70,7 +71,6 @@
 	nor-flash at 1c000000 {
 		compatible = "cfi-flash";
 		reg = <0x1c000000 0x800000>;
-
 		bank-width = <2>;
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -80,25 +80,30 @@
 			reg = <0x0 0x30000>;
 			read-only;
 		};
+
 		partition at 30000 {
 			label = "uboot-env";
 			reg = <0x30000 0x4000>;
 			read-only;
 		};
+
 		factory: partition at 34000 {
 			label = "factory";
 			reg = <0x34000 0x4000>;
 			read-only;
 		};
+
 		partition at 38000 {
 			label = "nvram";
 			reg = <0x38000 0x8000>;
 			read-only;
 		};
+
 		partition at 40000 {
 			label = "devdata";
 			reg = <0x40000 0x10000>;
 		};
+
 		partition at 50000 {
 			label = "firmware";
 			reg = <0x50000 0x7b0000>;
@@ -117,11 +122,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 6 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 3 1>;
@@ -131,10 +138,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wps {
 			label = "samsung:blue:wps";
 			gpios = <&gpio0 0 1>;
 		};
+
 		usb {
 			label = "samsung:blue:usb";
 			gpios = <&gpio1 1 1>;
diff --git a/target/linux/ramips/dts/D105.dts b/target/linux/ramips/dts/D105.dts
index 42f6fd3..5ef625c 100644
--- a/target/linux/ramips/dts/D105.dts
+++ b/target/linux/ramips/dts/D105.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -50,10 +49,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "d105:red:power";
 			gpios = <&gpio0 0 1>;
 		};
+
 		wps {
 			label = "d105:green:usb";
 			gpios = <&gpio0 13 1>;
@@ -65,6 +66,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/DAP-1350.dts b/target/linux/ramips/dts/DAP-1350.dts
index ee53e5e..ae36baf 100644
--- a/target/linux/ramips/dts/DAP-1350.dts
+++ b/target/linux/ramips/dts/DAP-1350.dts
@@ -22,7 +22,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -72,14 +71,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "d-link:blue:power";
 			gpios = <&gpio0 8 1>;
 		};
+
 		power2 {
 			label = "d-link:red:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 14 1>;
@@ -91,21 +93,25 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		rt {
 			label = "rt";
 			gpios = <&gpio0 11 1>;
 			linux,code = <0x100>;
 		};
+
 		ap {
 			label = "ap";
 			gpios = <&gpio0 7 1>;
diff --git a/target/linux/ramips/dts/DCS-930.dts b/target/linux/ramips/dts/DCS-930.dts
index 3d0cf1d..d544d21 100644
--- a/target/linux/ramips/dts/DCS-930.dts
+++ b/target/linux/ramips/dts/DCS-930.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x400000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -60,14 +59,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wifi {
 			label = "d-link:red:alert";
 			gpios = <&gpio0 8 1>;
 		};
+
 		power {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 13 1>;
@@ -85,6 +87,7 @@
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x101>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/DCS-930L-B1.dts b/target/linux/ramips/dts/DCS-930L-B1.dts
index f73a997..7b54d8c 100644
--- a/target/linux/ramips/dts/DCS-930L-B1.dts
+++ b/target/linux/ramips/dts/DCS-930L-B1.dts
@@ -3,12 +3,13 @@
 /include/ "rt5350.dtsi"
 
 / {
-	compatible =  "DCS-930L-B1", "ralink,rt5350-soc";
+	compatible = "DCS-930L-B1", "ralink,rt5350-soc";
 	model = "D-Link DCS-930L B1";
 
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -74,10 +75,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "d-link:red:power";
 			gpios = <&gpio0 17 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 19 1>;
@@ -89,11 +92,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 20 1>;
diff --git a/target/linux/ramips/dts/DIR-300-B1.dts b/target/linux/ramips/dts/DIR-300-B1.dts
index 4c5b80f..e1962d5 100644
--- a/target/linux/ramips/dts/DIR-300-B1.dts
+++ b/target/linux/ramips/dts/DIR-300-B1.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -65,11 +64,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
@@ -79,22 +80,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
+
 		status2 {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wan {
 			label = "d-link:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
+
 		wan2 {
 			label = "d-link:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/DIR-300-B7.dts b/target/linux/ramips/dts/DIR-300-B7.dts
index c1a1385..c143d6e 100644
--- a/target/linux/ramips/dts/DIR-300-B7.dts
+++ b/target/linux/ramips/dts/DIR-300-B7.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -56,41 +57,43 @@
 		mtd-mac-address = <&factory 0x4>;
 	};
 
-        esw at 10110000 {
-                ralink,portmap = <0x2f>;
-                ralink,led_polarity = <0x17>;
-        };
-
-        gpio-leds {
-                compatible = "gpio-leds";
-                status {
-                        label = "d-link:green:status";
-                        gpios = <&gpio0 9 1>;
-                };
-                wps {
-                        label = "d-link:blue:wps";
-                        gpios = <&gpio0 13 1>;
-                };
-        };
-
-        gpio-keys-polled {
-                gpio-keys-polled {
-                compatible = "gpio-keys-polled";
-                #address-cells = <1>;
-                #size-cells = <0>;
-                poll-interval = <20>;
-                        reset {
-                                label = "reset";
-                                gpios = <&gpio0 10 1>;
-                                linux,code = <0x198>;
-                        };
-                        wps {
-                                label = "wps";
-                                gpios = <&gpio0 0 1>;
-                                linux,code = <0x211>;
-                        };
-                };
-        };
+	esw at 10110000 {
+		ralink,portmap = <0x2f>;
+		ralink,led_polarity = <0x17>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		status {
+			label = "d-link:green:status";
+			gpios = <&gpio0 9 1>;
+		};
+
+		wps {
+			label = "d-link:blue:wps";
+			gpios = <&gpio0 13 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
+		};
+	};
 
 	wmac at 10180000 {
 		status = "okay";
@@ -98,4 +101,3 @@
 		ralink,mtd-eeprom = <&factory 0>;
 	};
 };
-
diff --git a/target/linux/ramips/dts/DIR-320-B1.dts b/target/linux/ramips/dts/DIR-320-B1.dts
index 8ec07c2..958fdee 100644
--- a/target/linux/ramips/dts/DIR-320-B1.dts
+++ b/target/linux/ramips/dts/DIR-320-B1.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -67,14 +68,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		usb {
 			label = "d-link:green:usb";
 			gpios = <&gpio0 14 1>;
 		};
+
 		wps {
 			label = "d-link:green:wps";
 			gpios = <&gpio0 13 1>;
@@ -82,21 +86,21 @@
 	};
 
 	gpio-keys-polled {
-		gpio-keys-polled {
 		compatible = "gpio-keys-polled";
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
-			reset {
-				label = "reset";
-				gpios = <&gpio0 10 1>;
-				linux,code = <0x198>;
-			};
-			wps {
-				label = "wps";
-				gpios = <&gpio0 0 1>;
-				linux,code = <0x211>;
-			};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
 		};
 	};
 
diff --git a/target/linux/ramips/dts/DIR-600-B1.dts b/target/linux/ramips/dts/DIR-600-B1.dts
index 120a7fc..7201532 100644
--- a/target/linux/ramips/dts/DIR-600-B1.dts
+++ b/target/linux/ramips/dts/DIR-600-B1.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -65,11 +64,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
@@ -79,22 +80,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
+
 		status2 {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wan {
 			label = "d-link:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
+
 		wan2 {
 			label = "d-link:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/DIR-600-B2.dts b/target/linux/ramips/dts/DIR-600-B2.dts
index 70e4a50..0f05ad7 100644
--- a/target/linux/ramips/dts/DIR-600-B2.dts
+++ b/target/linux/ramips/dts/DIR-600-B2.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -61,11 +60,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
@@ -75,22 +76,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
+
 		status2 {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wan {
 			label = "d-link:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
+
 		wan2 {
 			label = "d-link:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/DIR-610-A1.dts b/target/linux/ramips/dts/DIR-610-A1.dts
index e345250..cd7b19d 100644
--- a/target/linux/ramips/dts/DIR-610-A1.dts
+++ b/target/linux/ramips/dts/DIR-610-A1.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -70,10 +71,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wps {
 			label = "d-link:green:wps";
 			gpios = <&gpio0 13 1>;
@@ -81,21 +84,21 @@
 	};
 
 	gpio-keys-polled {
-		gpio-keys-polled {
 		compatible = "gpio-keys-polled";
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
-			reset {
-				label = "reset";
-				gpios = <&gpio0 10 1>;
-				linux,code = <0x198>;
-			};
-			wps {
-				label = "wps";
-				gpios = <&gpio0 0 1>;
-				linux,code = <0x211>;
-			};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/DIR-615-D.dts b/target/linux/ramips/dts/DIR-615-D.dts
index 1a67b2d..d95c077 100644
--- a/target/linux/ramips/dts/DIR-615-D.dts
+++ b/target/linux/ramips/dts/DIR-615-D.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -61,11 +60,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
@@ -75,22 +76,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
+
 		status2 {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wan {
 			label = "d-link:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
+
 		wan2 {
 			label = "d-link:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/DIR-615-H1.dts b/target/linux/ramips/dts/DIR-615-H1.dts
index 1165ff1..e76d6ee 100644
--- a/target/linux/ramips/dts/DIR-615-H1.dts
+++ b/target/linux/ramips/dts/DIR-615-H1.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -49,10 +50,12 @@
 				ralink,group = "i2c", "jtag", "uartf";
 				ralink,function = "gpio";
 			};
+
 			rgmii {
 				ralink,group = "rgmii";
 				ralink,function = "rgmii";
 			};
+
 			mdio {
 				ralink,group = "mdio";
 				ralink,function = "mdio";
@@ -74,22 +77,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:amber:status";
 			gpios = <&gpio0 7 0>;
 		};
+
 		status2 {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 0>;
 		};
+
 		wan {
 			label = "d-link:amber:wan";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wan2 {
 			label = "d-link:green:wan";
 			gpios = <&gpio0 13 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 14 1>;
@@ -101,11 +109,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/DIR-620-A1.dts b/target/linux/ramips/dts/DIR-620-A1.dts
index 1ffa829..1655982 100644
--- a/target/linux/ramips/dts/DIR-620-A1.dts
+++ b/target/linux/ramips/dts/DIR-620-A1.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -65,11 +64,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
@@ -79,26 +80,32 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
+
 		status2 {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wan {
 			label = "d-link:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
+
 		wan2 {
 			label = "d-link:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "d-link:blue:wps";
 			gpios = <&gpio0 13 0>;
 		};
+
 		wps2 {
 			label = "d-link:amber:wps";
 			gpios = <&gpio0 11 0>;
diff --git a/target/linux/ramips/dts/DIR-620-D1.dts b/target/linux/ramips/dts/DIR-620-D1.dts
index e4eeb3e..8a5b057 100644
--- a/target/linux/ramips/dts/DIR-620-D1.dts
+++ b/target/linux/ramips/dts/DIR-620-D1.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -49,10 +50,12 @@
 				ralink,group = "i2c", "jtag", "uartf";
 				ralink,function = "gpio";
 			};
+
 			rgmii {
 				ralink,group = "rgmii";
 				ralink,function = "rgmii";
 			};
+
 			mdio {
 				ralink,group = "mdio";
 				ralink,function = "mdio";
@@ -74,10 +77,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "d-link:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wifi {
 			label = "d-link:green:wifi";
 			gpios = <&gpio0 17 1>;
@@ -89,6 +94,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 7 1>;
diff --git a/target/linux/ramips/dts/DIR-645.dts b/target/linux/ramips/dts/DIR-645.dts
index 60e7f46..ab83901 100644
--- a/target/linux/ramips/dts/DIR-645.dts
+++ b/target/linux/ramips/dts/DIR-645.dts
@@ -21,30 +21,36 @@
 				reg = <0 0>;
 				linux,modalias = "m25p80";
 				spi-max-frequency = <25000000>;
+
 				partition at 0 {
 					label = "uboot";
 					reg = <0x0 0x30000>;
 					read-only;
 				};
+
 				partition at 30000 {
 					label = "uboot-env";
 					reg = <0x30000 0x4000>;
 					read-only;
 				};
+
 				factory: partition at 34000 {
 					label = "factory";
 					reg = <0x34000 0x4000>;
 					read-only;
 				};
+
 				partition at 38000 {
 					label = "nvram";
 					reg = <0x38000 0x8000>;
 					read-only;
 				};
+
 				partition at 40000 {
 					label = "devdata";
 					reg = <0x40000 0x10000>;
 				};
+
 				partition at 50000 {
 					label = "firmware";
 					reg = <0x50000 0x7b0000>;
@@ -64,6 +70,7 @@
 
 	ethernet at 10100000 {
 		mtd-mac-address = <&factory 0x4>;
+
 		port at 0 {
 			ralink,fixed-link = <1000 1 1 0>;
 		};
@@ -94,11 +101,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 9 0>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 14 0>;
@@ -113,6 +122,7 @@
 			label = "d-link:green:inet";
 			gpios = <&gpio0 0 1>;
 		};
+
 		wps {
 			label = "d-link:green:wps";
 			gpios = <&gpio1 2 0>;
@@ -122,6 +132,7 @@
 	gpio_export {
 		compatible = "gpio-export";
 		#size-cells = <0>;
+
 		usb {
 			gpio-export,name = "usb";
 			gpio-export,output = <1>;
diff --git a/target/linux/ramips/dts/DIR-810L.dts b/target/linux/ramips/dts/DIR-810L.dts
index dd0d39c..ae74500 100644
--- a/target/linux/ramips/dts/DIR-810L.dts
+++ b/target/linux/ramips/dts/DIR-810L.dts
@@ -84,7 +84,6 @@
 
 	gsw at 10110000 {
 		ralink,port4 = "ephy";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&ephy_pins>;
 	};
@@ -102,11 +101,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x100>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 2 1>;
@@ -116,14 +117,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "d-link:green:power";
 			gpios = <&gpio0 9 0>;
 		};
+
 		wan {
 			label = "d-link:orange:wan";
 			gpios = <&gpio0 12 0>;
 		};
+
 		status {
 			label = "d-link:orange:power";
 			gpios = <&gpio0 13 0>;
diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts b/target/linux/ramips/dts/DIR-860L-B1.dts
index 23ec114..cae93c4 100644
--- a/target/linux/ramips/dts/DIR-860L-B1.dts
+++ b/target/linux/ramips/dts/DIR-860L-B1.dts
@@ -76,6 +76,7 @@
 				mediatek,2ghz = <0>;
 			};
 		};
+
 		pcie1 {
 			mt76 at 1,0 {
 				reg = <0x0000 0 0 0 0>;
diff --git a/target/linux/ramips/dts/E1700.dts b/target/linux/ramips/dts/E1700.dts
index c9d03cd..7689b17 100644
--- a/target/linux/ramips/dts/E1700.dts
+++ b/target/linux/ramips/dts/E1700.dts
@@ -65,9 +65,7 @@
 
 	ethernet at 10100000 {
 		status = "okay";
-
 		mtd-mac-address = <&factory 0x28>;
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
 
@@ -84,22 +82,27 @@
 				reg = <0>;
 				phy-mode = "rgmii";
 			};
+
 			phy1: ethernet-phy at 1 {
 				reg = <1>;
 				phy-mode = "rgmii";
 			};
+
 			phy2: ethernet-phy at 2 {
 				reg = <2>;
 				phy-mode = "rgmii";
 			};
+
 			phy3: ethernet-phy at 3 {
 				reg = <3>;
 				phy-mode = "rgmii";
 			};
+
 			phy4: ethernet-phy at 4 {
 				reg = <4>;
 				phy-mode = "rgmii";
 			};
+
 			phy1f: ethernet-phy at 1f {
 				reg = <0x1f>;
 				phy-mode = "rgmii";
@@ -121,11 +124,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 0>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 2 0>;
@@ -135,10 +140,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "linksys:green:power";
 			gpios = <&gpio0 10 1>;
 		};
+
 		wan {
 			label = "linksys:green:wps";
 			gpios = <&gpio0 12 1>;
diff --git a/target/linux/ramips/dts/ESR-9753.dts b/target/linux/ramips/dts/ESR-9753.dts
index 444ce93..b0f9046 100644
--- a/target/linux/ramips/dts/ESR-9753.dts
+++ b/target/linux/ramips/dts/ESR-9753.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -50,10 +49,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "esr-9753:orange:power";
 			gpios = <&gpio0 8 1>;
 		};
+
 		wps {
 			label = "esr-9753:orange:wps";
 			gpios = <&gpio0 14 1>;
@@ -65,11 +66,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/F5D8235_V1.dts b/target/linux/ramips/dts/F5D8235_V1.dts
index 2e88abd..2f51025 100644
--- a/target/linux/ramips/dts/F5D8235_V1.dts
+++ b/target/linux/ramips/dts/F5D8235_V1.dts
@@ -26,7 +26,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -37,16 +36,19 @@
 			reg = <0x0 0x30000>;
 			read-only;
 		};
+
 		partition at 30000 {
 			label = "uboot-env";
 			reg = <0x30000 0x10000>;
 			read-only;
 		};
+
 		factory: partition at 40000 {
 			label = "factory";
 			reg = <0x40000 0x10000>;
 			read-only;
 		};
+
 		partition at 50000 {
 			label = "linux";
 			reg = <0x50000 0x3b0000>;
@@ -57,7 +59,7 @@
 		status = "okay";
 		mtd-mac-address = <&factory 0x4>;
 
-                port at 0 {
+		port at 0 {
 			ralink,fixed-link = <1000 1 1 1>;
 		};
 	};
@@ -79,11 +81,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 9 1>;
@@ -98,6 +102,7 @@
 			label = "f5d8235-v1:blue:storage";
 			gpios = <&gpio0 7 1>;
 		};
+
 		storage2 {
 			label = "f5d8235-v1:orange:storage";
 			gpios = <&gpio0 8 1>;
diff --git a/target/linux/ramips/dts/F5D8235_V2.dts b/target/linux/ramips/dts/F5D8235_V2.dts
index 792249c..45f7d69 100644
--- a/target/linux/ramips/dts/F5D8235_V2.dts
+++ b/target/linux/ramips/dts/F5D8235_V2.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -70,38 +69,47 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		internet {
 			label = "f5d8235v2:blue:internet";
 			gpios = <&gpio0 5 1>;
 		};
+
 		internet2 {
 			label = "f5d8235v2:amber:internet";
 			gpios = <&gpio0 6 1>;
 		};
+
 		modem {
 			label = "f5d8235v2:blue:modem";
 			gpios = <&gpio0 11 1>;
 		};
+
 		modem2 {
 			label = "f5d8235v2:amber:modem";
 			gpios = <&gpio0 8 1>;
 		};
+
 		router {
 			label = "f5d8235v2:blue:router";
 			gpios = <&gpio0 9 1>;
 		};
+
 		storage {
 			label = "f5d8235v2:blue:storage";
 			gpios = <&gpio0 23 1>;
 		};
+
 		storage2 {
 			label = "f5d8235v2:amber:storage";
 			gpios = <&gpio0 22 1>;
 		};
+
 		security {
 			label = "f5d8235v2:blue:security";
 			gpios = <&gpio0 13 1>;
 		};
+
 		security2 {
 			label = "f5d8235v2:amber:security";
 			gpios = <&gpio0 12 1>;
diff --git a/target/linux/ramips/dts/F7C027.dts b/target/linux/ramips/dts/F7C027.dts
index f660ff8..874d606 100644
--- a/target/linux/ramips/dts/F7C027.dts
+++ b/target/linux/ramips/dts/F7C027.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -83,38 +84,46 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "belkin:blue:status";
 			gpios = <&gpio0 7 1>;
 		};
+
 		power {
 			label = "belkin:blue:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		orange {
 			label = "belkin:orange:status";
 			gpios = <&gpio0 11 1>;
 		};
+
 		relay {
 			label = "belkin:device:relay";
 			gpios = <&gpio0 13 0>;
 		};
 	};
+
 	gpio-keys-polled {
 		compatible = "gpio-keys-polled";
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		top {
 			label = "top";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		power {
 			label = "power";
 			gpios = <&gpio0 12 1>;
 			linux,code = <0x100>;
 		};
+
 		sensor {
 			label = "sensor";
 			gpios = <&gpio0 14 1>;
diff --git a/target/linux/ramips/dts/FIREWRT.dts b/target/linux/ramips/dts/FIREWRT.dts
index bfe1456..b72066a 100644
--- a/target/linux/ramips/dts/FIREWRT.dts
+++ b/target/linux/ramips/dts/FIREWRT.dts
@@ -53,7 +53,6 @@
 					label = "firmware";
 					reg = <0x50000 0xfb0000>;
 				};
-
 			};
 		};
 	};
@@ -98,11 +97,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 18 1>;
 			linux,code = <0x211>;
 		};
+
 		power {
 			label = "power";
 			gpios = <&gpio0 23 1>;
@@ -112,7 +113,7 @@
 
 	pinctrl {
 		state_default: pinctrl0 {
-		gpio {
+			gpio {
 				ralink,group = "wdt", "rgmii2";
 				ralink,function = "gpio";
 			};
diff --git a/target/linux/ramips/dts/FONERA20N.dts b/target/linux/ramips/dts/FONERA20N.dts
index 2e01457..d3479b1 100644
--- a/target/linux/ramips/dts/FONERA20N.dts
+++ b/target/linux/ramips/dts/FONERA20N.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -50,14 +49,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wifi {
 			label = "fonera20n:orange:wifi";
 			gpios = <&gpio0 7 1>;
 		};
+
 		power {
 			label = "fonera20n:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		usb {
 			label = "fonera20n:orange:usb";
 			gpios = <&gpio0 14 1>;
@@ -69,11 +71,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 12 1>;
 			linux,code = <0x198>;
 		};
+
 		switch {
 			label = "switch";
 			gpios = <&gpio0 13 1>;
@@ -94,21 +98,25 @@
 			swconfig,segment = "lan";
 			swconfig,portmap = <0 4>;
 		};
+
 		port at 1 {
 			compatible = "swconfig,port";
 			swconfig,segment = "lan";
 			swconfig,portmap = <1 3>;
 		};
+
 		port at 2 {
 			compatible = "swconfig,port";
 			swconfig,segment = "lan";
 			swconfig,portmap = <2 2>;
 		};
+
 		port at 3 {
 			compatible = "swconfig,port";
 			swconfig,segment = "lan";
 			swconfig,portmap = <3 1>;
 		};
+
 		port at 4 {
 			compatible = "swconfig,port";
 			swconfig,segment = "wan";
diff --git a/target/linux/ramips/dts/FREESTATION5.dts b/target/linux/ramips/dts/FREESTATION5.dts
index e2c8d72..1febfb5 100644
--- a/target/linux/ramips/dts/FREESTATION5.dts
+++ b/target/linux/ramips/dts/FREESTATION5.dts
@@ -22,7 +22,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -70,6 +69,7 @@
 
 	gpio-export {
 		compatible = "gpio-export";
+
 		// Used to enable power-over-ethernet passthrough from port0 to port1.
 		// Disable passthrough by default to prevent accidental equipment damage.
 		poe {
@@ -81,16 +81,19 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		// The following leds are defined in the ArcOS firmware, but reportedly
 		// not present in the Freestation5 device.
 		wifi {
 			label = "freestation:unknown:wifi";
 			gpios = <&gpio0 7 1>;
 		};
+
 		powerg {
 			label = "freestation:unknown:powerg";
 			gpios = <&gpio0 9 1>;
 		};
+
 		usb {
 			label = "freestation:unknown:usb";
 			gpios = <&gpio0 14 1>;
diff --git a/target/linux/ramips/dts/HG255D.dts b/target/linux/ramips/dts/HG255D.dts
index 41b7ddd..2aa3cc9 100644
--- a/target/linux/ramips/dts/HG255D.dts
+++ b/target/linux/ramips/dts/HG255D.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x1000000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -56,26 +55,32 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "hg255d:power";
 			gpios = <&gpio0 8 1>;
 		};
+
 		internet {
 			label = "hg255d:internet";
 			gpios = <&gpio0 13 1>;
 		};
+
 		wifi {
 			label = "hg255d:wlan";
 			gpios = <&gpio0 14 1>;
 		};
+
 		usb {
 			label = "hg255d:usb";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wps {
 			label = "hg255d:wps";
 			gpios = <&gpio0 12 1>;
 		};
+
 		voice {
 			label = "hg255d:voice";
 			gpios = <&gpio0 5 1>;
@@ -87,16 +92,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <10>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 4 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x211>;
 		};
+
 		rfkill {
 			label = "rfkill";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/HLKRM04.dts b/target/linux/ramips/dts/HLKRM04.dts
index 13597dc..e4a652e 100644
--- a/target/linux/ramips/dts/HLKRM04.dts
+++ b/target/linux/ramips/dts/HLKRM04.dts
@@ -22,6 +22,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -86,6 +87,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "reset";
 			gpios = <&gpio0 14 1>;
@@ -95,6 +97,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "hlk-rm04:red:power";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/HT-TM02.dts b/target/linux/ramips/dts/HT-TM02.dts
index 40d9e01..72feaa9 100644
--- a/target/linux/ramips/dts/HT-TM02.dts
+++ b/target/linux/ramips/dts/HT-TM02.dts
@@ -10,8 +10,10 @@
 		gpio0: gpio at 600 {
 			status = "okay";
 		};
+
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -19,21 +21,25 @@
 				reg = <0 0>;
 				linux,modalias = "m25p80", "mx25l6405d";
 				spi-max-frequency = <10000000>;
+
 				partition at 0 {
 					label = "u-boot";
 					reg = <0x0 0x30000>;
 					read-only;
 				};
+
 				partition at 30000 {
 					label = "u-boot-env";
 					reg = <0x30000 0x10000>;
 					read-only;
 				};
+
 				factory: partition at 40000 {
 					label = "factory";
 					reg = <0x40000 0x10000>;
 					read-only;
 				};
+
 				partition at 50000 {
 					label = "firmware";
 					reg = <0x50000 0x7b0000>;
@@ -73,15 +79,16 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wlan {
 			label = "ht-tm02:blue:wlan";
 			gpios = <&gpio0 7 1>;
 		};
+
 		lan {
 			label = "ht-tm02:green:lan";
 			gpios = <&gpio0 12 1>;
 		};
-
 	};
 
 	gpio-keys-polled {
@@ -89,11 +96,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		modeswitch {
 			label = "modeswitch";
 			gpios = <&gpio0 14 1>;
diff --git a/target/linux/ramips/dts/HW550-3G.dts b/target/linux/ramips/dts/HW550-3G.dts
index 9cd09c4..8dbd82b 100644
--- a/target/linux/ramips/dts/HW550-3G.dts
+++ b/target/linux/ramips/dts/HW550-3G.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -62,18 +61,22 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		usb {
 			label = "hw550-3g:green:usb";
 			gpios = <&gpio0 8 1>;
 		};
+
 		3g {
 			label = "hw550-3g:green:3g";
 			gpios = <&gpio0 11 1>;
 		};
+
 		status {
 			label = "hw550-3g:green:status";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "hw550-3g:green:wps";
 			gpios = <&gpio0 14 1>;
@@ -85,16 +88,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		connect {
 			label = "connect";
 			gpios = <&gpio0 7 1>;
 			linux,code = <0xda>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/IP2202.dts b/target/linux/ramips/dts/IP2202.dts
index 47cbb97..9eecad6 100644
--- a/target/linux/ramips/dts/IP2202.dts
+++ b/target/linux/ramips/dts/IP2202.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -58,10 +57,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		run {
 			label = "ip2202:green:run";
 			gpios = <&gpio0 9 1>;
 		};
+
 		net {
 			label = "ip2202:amber:net";
 			gpios = <&gpio0 13 1>;
@@ -73,6 +74,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/M2M.dts b/target/linux/ramips/dts/M2M.dts
index 4191037..dbe36da 100644
--- a/target/linux/ramips/dts/M2M.dts
+++ b/target/linux/ramips/dts/M2M.dts
@@ -13,6 +13,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -58,10 +59,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wifi {
 			label = "m2m:blue:wifi";
 			gpios = <&gpio0 7 1>;
 		};
+
 		wan {
 			label = "m2m:green:wan";
 			gpios = <&gpio0 12 1>;
@@ -73,11 +76,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		power {
 			label = "power";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x116>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/M3.dts b/target/linux/ramips/dts/M3.dts
index f3c3aa4..c10bf3b 100644
--- a/target/linux/ramips/dts/M3.dts
+++ b/target/linux/ramips/dts/M3.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -63,6 +64,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "m3:blue:status";
 			gpios = <&gpio0 9 1>;
@@ -74,11 +76,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 17 1>;
diff --git a/target/linux/ramips/dts/M4-4M.dts b/target/linux/ramips/dts/M4-4M.dts
index 2d2ebc4..2443187 100644
--- a/target/linux/ramips/dts/M4-4M.dts
+++ b/target/linux/ramips/dts/M4-4M.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -63,6 +64,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "m4:blue:status";
 			gpios = <&gpio0 9 1>;
@@ -74,6 +76,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/M4-8M.dts b/target/linux/ramips/dts/M4-8M.dts
index 23d8449..e7e5058 100644
--- a/target/linux/ramips/dts/M4-8M.dts
+++ b/target/linux/ramips/dts/M4-8M.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -63,6 +64,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "m4:blue:status";
 			gpios = <&gpio0 9 1>;
@@ -74,6 +76,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/MLW221.dts b/target/linux/ramips/dts/MLW221.dts
index 83467dc..1c41f6c 100644
--- a/target/linux/ramips/dts/MLW221.dts
+++ b/target/linux/ramips/dts/MLW221.dts
@@ -56,7 +56,6 @@
 				partition at fb0000 {
 					label = "user-config";
 					reg = <0xfb0000 0x50000>;
-
 				};
 			};
 		};
@@ -90,10 +89,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		system {
 			label = "kingston:blue:system";
 			gpios = <&gpio2 3 1>;
 		};
+
 		wifi {
 			label = "kingston:blue:wifi";
 			gpios = <&gpio3 0 1>;
@@ -105,11 +106,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x198>;
 		};
+
 		system {
 			label = "system";
 			gpios = <&gpio0 2 1>;
diff --git a/target/linux/ramips/dts/MLWG2.dts b/target/linux/ramips/dts/MLWG2.dts
index a2b0033..c1b5276 100644
--- a/target/linux/ramips/dts/MLWG2.dts
+++ b/target/linux/ramips/dts/MLWG2.dts
@@ -89,10 +89,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		system {
 			label = "kingston:blue:system";
 			gpios = <&gpio2 3 1>;
 		};
+
 		wifi {
 			label = "kingston:blue:wifi";
 			gpios = <&gpio3 0 1>;
@@ -104,11 +106,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x198>;
 		};
+
 		system {
 			label = "system";
 			gpios = <&gpio0 2 1>;
diff --git a/target/linux/ramips/dts/MOFI3500-3GN.dts b/target/linux/ramips/dts/MOFI3500-3GN.dts
index b988dd0..27c9e83 100644
--- a/target/linux/ramips/dts/MOFI3500-3GN.dts
+++ b/target/linux/ramips/dts/MOFI3500-3GN.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -54,18 +53,22 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		usb {
 			label = "mofi3500-3gn:green:usb";
 			gpios = <&gpio0 8 1>;
 		};
+
 		3g {
 			label = "mofi3500-3gn:green:3g";
 			gpios = <&gpio0 11 1>;
 		};
+
 		status {
 			label = "mofi3500-3gn:green:status";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "mofi3500-3gn:green:wps";
 			gpios = <&gpio0 14 1>;
@@ -77,16 +80,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		connect {
 			label = "connect";
 			gpios = <&gpio0 7 1>;
 			linux,code = <0xda>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/MPRA1.dts b/target/linux/ramips/dts/MPRA1.dts
index 58f36fe..1389b807 100644
--- a/target/linux/ramips/dts/MPRA1.dts
+++ b/target/linux/ramips/dts/MPRA1.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -41,6 +42,7 @@
 				};
 			};
 		};
+
 		gpio1: gpio at 660 {
 			status = "okay";
 		};
@@ -77,10 +79,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		system {
 			label = "hame:blue:system";
 			gpios = <&gpio0 20 1>;
 		};
+
 		power {
 			label = "hame:red:power";
 			gpios = <&gpio0 17 1>;
@@ -92,6 +96,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
@@ -108,6 +113,7 @@
 			gpio-export,output = <1>;
 			gpios = <&gpio0 7 0>;
 		};
+
 		root_hub {
 			gpio-export,name = "root_hub";
 			gpio-export,output = <1>;
diff --git a/target/linux/ramips/dts/MPRA2.dts b/target/linux/ramips/dts/MPRA2.dts
index 4f5e1c3..849e911 100644
--- a/target/linux/ramips/dts/MPRA2.dts
+++ b/target/linux/ramips/dts/MPRA2.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -74,10 +75,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		system {
 			label = "hame:blue:system";
 			gpios = <&gpio0 20 1>;
 		};
+
 		power {
 			label = "hame:red:power";
 			gpios = <&gpio0 17 1>;
@@ -89,6 +92,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
@@ -105,6 +109,7 @@
 			gpio-export,output = <1>;
 			gpios = <&gpio0 7 0>;
 		};
+
 		root_hub {
 			gpio-export,name = "root_hub";
 			gpio-export,output = <1>;
diff --git a/target/linux/ramips/dts/MR-102N.dts b/target/linux/ramips/dts/MR-102N.dts
index c2a6e24..3c392e4 100644
--- a/target/linux/ramips/dts/MR-102N.dts
+++ b/target/linux/ramips/dts/MR-102N.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -74,14 +73,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		usb {
 			label = "mr-102n:green:usb";
 			gpios = <&gpio0 8 1>;
 		};
+
 		status {
 			label = "mr-102n:amber:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wlan {
 			label = "mr-102n:green:wlan";
 			gpios = <&gpio0 11 1>;
@@ -93,11 +95,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 13 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 18 1>;
diff --git a/target/linux/ramips/dts/MT7620a.dts b/target/linux/ramips/dts/MT7620a.dts
index 826441e..71b30bd 100644
--- a/target/linux/ramips/dts/MT7620a.dts
+++ b/target/linux/ramips/dts/MT7620a.dts
@@ -55,10 +55,8 @@
 
 	ethernet at 10100000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
-
 		ralink,port-map = "llllw";
 
 		port at 4 {
@@ -105,11 +103,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		s2 {
 			label = "S2";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x100>;
 		};
+
 		s3 {
 			label = "S3";
 			gpios = <&gpio0 2 1>;
diff --git a/target/linux/ramips/dts/MT7620a_MT7530.dts b/target/linux/ramips/dts/MT7620a_MT7530.dts
index 4f31144..ac01fd2 100644
--- a/target/linux/ramips/dts/MT7620a_MT7530.dts
+++ b/target/linux/ramips/dts/MT7620a_MT7530.dts
@@ -55,10 +55,8 @@
 
 	ethernet at 10100000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
-
 		ralink,port-map = "llllw";
 
 		port at 5 {
@@ -74,22 +72,27 @@
 				reg = <0>;
 				phy-mode = "rgmii";
 			};
+
 			phy1: ethernet-phy at 1 {
 				reg = <1>;
 				phy-mode = "rgmii";
 			};
+
 			phy2: ethernet-phy at 2 {
 				reg = <2>;
 				phy-mode = "rgmii";
 			};
+
 			phy3: ethernet-phy at 3 {
 				reg = <3>;
 				phy-mode = "rgmii";
 			};
+
 			phy4: ethernet-phy at 4 {
 				reg = <4>;
 				phy-mode = "rgmii";
 			};
+
 			phy1f: ethernet-phy at 1f {
 				reg = <0x1f>;
 				phy-mode = "rgmii";
diff --git a/target/linux/ramips/dts/MT7620a_MT7610e.dts b/target/linux/ramips/dts/MT7620a_MT7610e.dts
index 4cff8dc..ba57fae 100644
--- a/target/linux/ramips/dts/MT7620a_MT7610e.dts
+++ b/target/linux/ramips/dts/MT7620a_MT7610e.dts
@@ -50,10 +50,8 @@
 
 	ethernet at 10100000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&ephy_pins>;
-
 		ralink,port-map = "llllw";
 	};
 
@@ -74,11 +72,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 12 1>;
 			linux,code = <0x100>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/MT7620a_V22SG.dts b/target/linux/ramips/dts/MT7620a_V22SG.dts
index cec912d..ef30195 100644
--- a/target/linux/ramips/dts/MT7620a_V22SG.dts
+++ b/target/linux/ramips/dts/MT7620a_V22SG.dts
@@ -6,9 +6,6 @@
 	compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
 	model = "Ralink MT7620a V22SG High Power evaluation board";
 
-	/*palmbus at 10000000 {
-	};*/
-
 	pinctrl {
 		state_default: pinctrl0 {
 			gpio {
@@ -20,10 +17,8 @@
 
 	ethernet at 10100000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
-
 		ralink,port-map = "llllw";
 
 		port at 4 {
@@ -74,11 +69,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x198>;
 		};
+
 		aoss {
 			label = "aoss";
 			gpios = <&gpio0 2 1>;
@@ -90,21 +87,25 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "mtk,mt7620-nand";
+
 		partition at 0 {
 			label = "u-boot";
 			reg = <0x0 0x40000>;
 			read-only;
 		};
+
 		partition at 40000 {
 			label = "u-boot-env";
 			reg = <0x40000 0x20000>;
 			read-only;
 		};
+
 		factory: partition at 60000 {
 			label = "factory";
 			reg = <0x60000 0x20000>;
 			read-only;
 		};
+
 		partition at 80000 {
 			label = "firmware";
 			reg = <0x80000 0x7f80000>;
diff --git a/target/linux/ramips/dts/MZK-750DHP.dts b/target/linux/ramips/dts/MZK-750DHP.dts
index ff664ac..2502874 100644
--- a/target/linux/ramips/dts/MZK-750DHP.dts
+++ b/target/linux/ramips/dts/MZK-750DHP.dts
@@ -60,7 +60,6 @@
 	ethernet at 10100000 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&ephy_pins>;
-
 		mtd-mac-address = <&factory 0x4>;
 		ralink,port-map = "llllw";
 	};
@@ -79,10 +78,12 @@
 	
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wps {
 			label = "mzk750:green:wps";
 			gpios = <&gpio1 11 1>;
 		};
+
 		power {
 			label = "mzk750:green:power";
 			gpios = <&gpio1 15 1>;
@@ -94,11 +95,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		s1 {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x100>;
 		};
+
 		s2 {
 			label = "wps";
 			gpios = <&gpio0 2 1>;
diff --git a/target/linux/ramips/dts/MZK-DP150N.dts b/target/linux/ramips/dts/MZK-DP150N.dts
index ae986f7..4b7b925 100644
--- a/target/linux/ramips/dts/MZK-DP150N.dts
+++ b/target/linux/ramips/dts/MZK-DP150N.dts
@@ -78,6 +78,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "mzkdp150n:green:power";
 			gpios = <&gpio0 9 1>;
@@ -89,6 +90,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/MZK-W300NH2.dts b/target/linux/ramips/dts/MZK-W300NH2.dts
index 790092e..7195253 100644
--- a/target/linux/ramips/dts/MZK-W300NH2.dts
+++ b/target/linux/ramips/dts/MZK-W300NH2.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -68,14 +67,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "mzkw300nh2:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wlan {
 			label = "mzkw300nh2:amber:wlan";
 			gpios = <&gpio0 14 1>;
 		};
+
 		wps {
 			label = "mzkw300nh2:amber:wps";
 			gpios = <&gpio0 11 1>;
@@ -87,16 +89,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 12 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x198>;
 		};
+
 		rt {
 			label = "rt";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/MicroWRT.dts b/target/linux/ramips/dts/MicroWRT.dts
index f6e81dd..ac660d4 100644
--- a/target/linux/ramips/dts/MicroWRT.dts
+++ b/target/linux/ramips/dts/MicroWRT.dts
@@ -93,15 +93,17 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 2 1>;
 			linux,code = <0x211>;
 		};
 	};
-   };
+};
diff --git a/target/linux/ramips/dts/NA930.dts b/target/linux/ramips/dts/NA930.dts
index 6fe9964..4397b2c 100644
--- a/target/linux/ramips/dts/NA930.dts
+++ b/target/linux/ramips/dts/NA930.dts
@@ -16,6 +16,7 @@
 				ralink,group = "i2c", "rgmii2", "spi", "ephy";
 				ralink,function = "gpio";
 			};
+
 			uartf_gpio {
 				ralink,group = "uartf";
 				ralink,function = "gpio uartf";
@@ -41,21 +42,25 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "mtk,mt7620-nand";
+
 		partition at 0 {
 			label = "u-boot";
 			reg = <0x0 0x20000>;
 			read-only;
 		};
+
 		partition at 200000 {
 			label = "factory";
 			reg = <0x200000 0x40000>;
 			read-only;
 		};
+
 		partition at 240000 {
 			label = "Config";
 			reg = <0x240000 0x400000>;
 			read-only;
 		};
+
 		partition at 640000 {
 			label = "firmware";
 			reg = <0x640000 0x1400000>;
@@ -64,10 +69,8 @@
 
 	ethernet at 10100000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&rgmii1_pins &mdio_pins>;
-
 		ralink,port-map = "llllw";
 
 		port at 4 {
@@ -102,16 +105,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 11 1>;
 			linux,code = <0x198>;
 		};
+
 		zwave {
 			label = "zwave";
 			gpios = <&gpio0 12 1>;
 			linux,code = <0x100>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 14 1>;
@@ -121,18 +127,22 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		zwave {
 			label = "na930:blue:zwave";
 			gpios = <&gpio2 0 1>;
 		};
+
 		status {
 			label = "na930:blue:status";
 			gpios = <&gpio2 26 1>;
 		};
+
 		service {
 			label = "na930:blue:service";
 			gpios = <&gpio2 28 1>;
 		};
+
 		power {
 			label = "na930:blue:power";
 			gpios = <&gpio2 29 1>;
diff --git a/target/linux/ramips/dts/NBG-419N.dts b/target/linux/ramips/dts/NBG-419N.dts
index 1a826bd..50a12cb 100644
--- a/target/linux/ramips/dts/NBG-419N.dts
+++ b/target/linux/ramips/dts/NBG-419N.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -62,10 +61,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "nbg-419n:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wps {
 			label = "nbg-419n:green:wps";
 			gpios = <&gpio0 14 1>;
@@ -77,11 +78,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/NCS601W.dts b/target/linux/ramips/dts/NCS601W.dts
index 9f3121b..dfc47b2 100644
--- a/target/linux/ramips/dts/NCS601W.dts
+++ b/target/linux/ramips/dts/NCS601W.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -71,44 +72,4 @@
 	ohci at 101c1000 {
 		status = "okay";
 	};
-
-/*	gpio-leds {
-		compatible = "gpio-leds";
-		system {
-			label = "mpr-a1:blue:system";
-			gpios = <&gpio0 20 1>;
-		};
-		power {
-			label = "mpr-a1:red:power";
-			gpios = <&gpio0 17 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-		wps {
-			label = "reset";
-			gpios = <&gpio0 0 1>;
-			linux,code = <0x198>;
-		};
-	};
-
-	gpio_export {
-		compatible = "gpio-export";
-		#size-cells = <0>;
-
-		usb {
-			gpio-export,name = "usb";
-			gpio-export,output = <1>;
-			gpios = <&gpio0 7 0>;
-		};
-		root_hub {
-			gpio-export,name = "root_hub";
-			gpio-export,output = <1>;
-			gpios = <&gpio0 12 0>;
-		};
-	}; */
 };
diff --git a/target/linux/ramips/dts/NW718.dts b/target/linux/ramips/dts/NW718.dts
index fa49bf1..f6411c8 100644
--- a/target/linux/ramips/dts/NW718.dts
+++ b/target/linux/ramips/dts/NW718.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -66,14 +67,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		cpu {
 			label = "nw718:amber:cpu";
 			gpios = <&gpio0 13 1>;
 		};
+
 		usb {
 			label = "nw718:amber:usb";
 			gpios = <&gpio0 8 1>;
 		};
+
 		wps {
 			label = "nw718:amber:wps";
 			gpios = <&gpio0 14 1>;
@@ -85,11 +89,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts b/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
index a644d4a..0a7d748 100644
--- a/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
+++ b/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
@@ -3,99 +3,100 @@
 /include/ "rt5350.dtsi"
 
 / {
-        compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
-        model = "RT5350F-OLINUXINO";
-
-        palmbus at 10000000 {
-                spi at b00 {
-                        status = "okay";
-                        m25p80 at 0 {
-                                #address-cells = <1>;
-                                #size-cells = <1>;
-                                compatible = "s25fl064k";
-                                reg = <0 0>;
-                                linux,modalias = "m25p80", "s25fl064k";
-                                spi-max-frequency = <10000000>;
-
-                                partition at 0 {
-                                        label = "u-boot";
-                                        reg = <0x0 0x30000>;
-                                        read-only;
-                                };
-
-                                partition at 30000 {
-                                        label = "u-boot-env";
-                                        reg = <0x30000 0x10000>;
-                                        read-only;
-                                };
-
-                                factory: partition at 40000 {
-                                        label = "factory";
-                                        reg = <0x40000 0x10000>;
-                                        read-only;
-                                };
-
-                                partition at 50000 {
-                                        label = "firmware";
-                                        reg = <0x50000 0x3b0000>;
-                                };
-                        };
-                };
-                gpio1: gpio at 660 {
-                        status = "okay";
-                };
-        };
-
-        pinctrl {
-                state_default: pinctrl0 {
-                        gpio {
-                                ralink,group = "jtag", "rgmii", "mdio", "uartf";
-                                ralink,function = "gpio";
-                        };
-                };
-        };
-
-        ethernet at 10100000 {
-                mtd-mac-address = <&factory 0x4>;
-        };
-
-        esw at 10110000 {
-                ralink,portmap = <0x2f>;
-                ralink,led_polarity = <0x17>;
-        };
-
-        wmac at 10180000 {
-                ralink,mtd-eeprom = <&factory 0>;
-        };
-
-        ehci at 101c0000 {
-                status = "okay";
-        };
-
-        ohci at 101c1000 {
-                status = "okay";
-        };
-
-        gpio_export {
-                compatible = "gpio-export";
-                #size-cells = <0>;
-
-                relay1 {
-                        gpio-export,name = "gpio12";
-                        gpio-export,output = <0>;
-                        gpios = <&gpio0 12 0>;
-                };
-
-                relay2 {
-                        gpio-export,name = "gpio14";
-                        gpio-export,output = <0>;
-                        gpios = <&gpio0 14 0>;
-                };
-
-                button {
-                        gpio-export,name = "button";
-                        gpios = <&gpio0 0 1>;
-                };
-
-        };
+	compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
+	model = "RT5350F-OLINUXINO";
+
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "s25fl064k";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "s25fl064k";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x3b0000>;
+				};
+			};
+		};
+
+		gpio1: gpio at 660 {
+			status = "okay";
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x2f>;
+		ralink,led_polarity = <0x17>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	gpio_export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+
+		relay1 {
+			gpio-export,name = "gpio12";
+			gpio-export,output = <0>;
+			gpios = <&gpio0 12 0>;
+		};
+
+		relay2 {
+			gpio-export,name = "gpio14";
+			gpio-export,output = <0>;
+			gpios = <&gpio0 14 0>;
+		};
+
+		button {
+			gpio-export,name = "button";
+			gpios = <&gpio0 0 1>;
+		};
+	};
 };
diff --git a/target/linux/ramips/dts/OLINUXINO-RT5350F.dts b/target/linux/ramips/dts/OLINUXINO-RT5350F.dts
index 984e701..a259693 100644
--- a/target/linux/ramips/dts/OLINUXINO-RT5350F.dts
+++ b/target/linux/ramips/dts/OLINUXINO-RT5350F.dts
@@ -3,77 +3,78 @@
 /include/ "rt5350.dtsi"
 
 / {
-        compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
-        model = "RT5350F-OLINUXINO";
+	compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
+	model = "RT5350F-OLINUXINO";
 
-        palmbus at 10000000 {
-                spi at b00 {
-                        status = "okay";
-                        m25p80 at 0 {
-                                #address-cells = <1>;
-                                #size-cells = <1>;
-                                compatible = "s25fl064k";
-                                reg = <0 0>;
-                                linux,modalias = "m25p80", "s25fl064k";
-                                spi-max-frequency = <10000000>;
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
 
-                                partition at 0 {
-                                        label = "u-boot";
-                                        reg = <0x0 0x30000>;
-                                        read-only;
-                                };
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "s25fl064k";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "s25fl064k";
+				spi-max-frequency = <10000000>;
 
-                                partition at 30000 {
-                                        label = "u-boot-env";
-                                        reg = <0x30000 0x10000>;
-                                        read-only;
-                                };
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
 
-                                factory: partition at 40000 {
-                                        label = "factory";
-                                        reg = <0x40000 0x10000>;
-                                        read-only;
-                                };
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
 
-                                partition at 50000 {
-                                        label = "firmware";
-                                        reg = <0x50000 0x3b0000>;
-                                };
-                        };
-                };
-                gpio1: gpio at 660 {
-                        status = "okay";
-                };
-        };
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
 
-        pinctrl {
-                state_default: pinctrl0 {
-                        gpio {
-                                ralink,group = "jtag", "rgmii", "mdio", "uartf";
-                                ralink,function = "gpio";
-                        };
-                };
-        };
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x3b0000>;
+				};
+			};
+		};
 
-        ethernet at 10100000 {
-                mtd-mac-address = <&factory 0x4>;
-        };
+		gpio1: gpio at 660 {
+			status = "okay";
+		};
+	};
 
-        esw at 10110000 {
-                ralink,portmap = <0x2f>;
-                ralink,led_polarity = <0x17>;
-        };
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
 
-        wmac at 10180000 {
-                ralink,mtd-eeprom = <&factory 0>;
-        };
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
 
-        ehci at 101c0000 {
-                status = "okay";
-        };
+	esw at 10110000 {
+		ralink,portmap = <0x2f>;
+		ralink,led_polarity = <0x17>;
+	};
 
-        ohci at 101c1000 {
-                status = "okay";
-        };
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
 
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
 };
diff --git a/target/linux/ramips/dts/OMNI-EMB-HPM.dts b/target/linux/ramips/dts/OMNI-EMB-HPM.dts
index 4f4ecd4..9540f4f 100644
--- a/target/linux/ramips/dts/OMNI-EMB-HPM.dts
+++ b/target/linux/ramips/dts/OMNI-EMB-HPM.dts
@@ -18,7 +18,6 @@
 				compatible = "macronix,mx25l12805d";
 				spi-max-frequency = <25000000>;
 				reg = <0>;
-
 				#address-cells = <1>;
 				#size-cells = <1>;
 
@@ -88,6 +87,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 14 0>;
@@ -102,22 +102,27 @@
 			label = "emb:orange:power";
 			gpios = <&gpio0 7 1>;
 		};
+
 		status {
 			label = "emb:green:status";
 			gpios = <&gpio0 21 1>;
 		};
+
 		eth {
 			label = "emb:green:eth";
 			gpios = <&gpio0 20 1>;
 		};
+
 		eth2 {
 			label = "emb:red:eth";
 			gpios = <&gpio0 18 1>;
 		};
+
 		wifi {
 			label = "emb:green:wifi";
 			gpios = <&gpio0 17 1>;
 		};
+
 		wifi2 {
 			label = "emb:red:wifi";
 			gpios = <&gpio0 19 1>;
@@ -128,11 +133,13 @@
 		compatible = "gpio-export";
 		#size-cells = <0>;
 		/* gpio 12 and 13 handle the OC input */
+
 		usb0 {
 			gpio-export,name = "usb0";
 			gpio-export,output = <1>;
 			gpios = <&gpio0 2 0>;
 		};
+
 		usb1 {
 			gpio-export,name = "usb1";
 			gpio-export,output = <1>;
diff --git a/target/linux/ramips/dts/OMNI-EMB.dts b/target/linux/ramips/dts/OMNI-EMB.dts
index d7c5c8a..aa3ddc4 100644
--- a/target/linux/ramips/dts/OMNI-EMB.dts
+++ b/target/linux/ramips/dts/OMNI-EMB.dts
@@ -17,10 +17,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "emb:green:status";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wlan {
 			label = "emb:green:wlan";
 			gpios = <&gpio0 14 1>;
@@ -32,6 +34,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 12 1>;
@@ -42,7 +45,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
diff --git a/target/linux/ramips/dts/OMNI-PLUG.dts b/target/linux/ramips/dts/OMNI-PLUG.dts
index ede0252..25f5bca 100644
--- a/target/linux/ramips/dts/OMNI-PLUG.dts
+++ b/target/linux/ramips/dts/OMNI-PLUG.dts
@@ -5,7 +5,7 @@
 / {
 	compatible = "OMNI-PLUG", "ralink,rt5350-soc";
 	model = "Omnima MiniPlug";
-	
+
 	pinctrl {
 		state_default: pinctrl0 {
 			gpio {
@@ -14,13 +14,15 @@
 			};
 		};
 	};
-	
+
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wlan {
 			label = "miniplug:red:wlan";
 			gpios = <&gpio0 9 0>;
 		};
+
 		mobile {
 			label = "miniplug:green:mobile";
 			gpios = <&gpio0 13 1>;
@@ -32,21 +34,25 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x211>;
 		};
+
 		mode-one {
 			label = "mode1";
 			gpios = <&gpio0 11 1>;
 			linux,code = <0x211>;
 		};
+
 		mode-two {
 			label = "mode2";
 			gpios = <&gpio0 12 1>;
@@ -61,6 +67,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -94,7 +101,7 @@
 			};
 		};
 	};
-	
+
 	ethernet at 10100000 {
 		mtd-mac-address = <&factory 0x4>;
 	};
@@ -106,7 +113,7 @@
 	wmac at 10180000 {
 		ralink,mtd-eeprom = <&factory 0>;
 	};
-	
+
 	otg at 101c0000 {
 		status = "okay";
 	};
diff --git a/target/linux/ramips/dts/OY-0001.dts b/target/linux/ramips/dts/OY-0001.dts
index 48b7099..b008afd 100644
--- a/target/linux/ramips/dts/OY-0001.dts
+++ b/target/linux/ramips/dts/OY-0001.dts
@@ -6,9 +6,9 @@
 	compatible = "ralink,mt7620a-soc";
 	model = "OY-0001";
 
-        chosen {
-                bootargs = "console=ttyS0,115200";
-        };
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
 
 	palmbus at 10000000 {
 		gpio2: gpio at 660 {
@@ -69,7 +69,6 @@
 	ethernet at 10100000 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&ephy_pins>;
-
 		ralink,port-map = "llllw";
 	};
 
@@ -83,10 +82,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		powerled {
 			label = "oy:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wifiled {
 			label = "oy:green:wifi";
 			gpios = <&gpio3 0 1>;
@@ -114,6 +115,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		s1 {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
diff --git a/target/linux/ramips/dts/PBR-M1.dts b/target/linux/ramips/dts/PBR-M1.dts
index 76eae93..7702d9c 100644
--- a/target/linux/ramips/dts/PBR-M1.dts
+++ b/target/linux/ramips/dts/PBR-M1.dts
@@ -60,22 +60,19 @@
 		i2c at 900 {
 			compatible = "ralink,i2c-mt7621";
 			reg = <0x900 0x100>;
-
 			#address-cells = <1>;
 			#size-cells = <0>;
-
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c_pins>;
-
 			status = "okay";
 
 			pcf8563: rtc at 51 {
 				status = "okay";
 				compatible = "nxp,pcf8563";
 				reg = <0x51>;
-            };
-        };
-    };
+			};
+		};
+	};
 
 	pcie at 1e140000 {
 		status = "okay";
@@ -132,6 +129,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 18 1>;
@@ -141,7 +139,7 @@
 
 	pinctrl {
 		state_default: pinctrl0 {
-		gpio {
+			gpio {
 				ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
 				ralink,function = "gpio";
 			};
diff --git a/target/linux/ramips/dts/PSR-680W.dts b/target/linux/ramips/dts/PSR-680W.dts
index 509787a..f583009 100644
--- a/target/linux/ramips/dts/PSR-680W.dts
+++ b/target/linux/ramips/dts/PSR-680W.dts
@@ -22,7 +22,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -66,6 +65,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wan {
 			label = "psr-680w:red:wan";
 			gpios = <&gpio0 19 1>;
@@ -77,6 +77,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/PWH2004.dts b/target/linux/ramips/dts/PWH2004.dts
index f94370f..fc51c09 100644
--- a/target/linux/ramips/dts/PWH2004.dts
+++ b/target/linux/ramips/dts/PWH2004.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -50,10 +49,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wifi {
 			label = "pwh2004:red:wifi";
 			gpios = <&gpio0 14 1>;
 		};
+
 		power {
 			label = "pwh2004:green:power";
 			gpios = <&gpio0 9 1>;
@@ -65,6 +66,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 12 1>;
diff --git a/target/linux/ramips/dts/PX4885-4M.dts b/target/linux/ramips/dts/PX4885-4M.dts
index 39bca1c..33f167d 100644
--- a/target/linux/ramips/dts/PX4885-4M.dts
+++ b/target/linux/ramips/dts/PX4885-4M.dts
@@ -6,6 +6,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
diff --git a/target/linux/ramips/dts/PX4885-8M.dts b/target/linux/ramips/dts/PX4885-8M.dts
index 03cb580..b8015ab 100644
--- a/target/linux/ramips/dts/PX4885-8M.dts
+++ b/target/linux/ramips/dts/PX4885-8M.dts
@@ -6,6 +6,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
diff --git a/target/linux/ramips/dts/PX4885.dtsi b/target/linux/ramips/dts/PX4885.dtsi
index 1f47a17..50f4b9e 100644
--- a/target/linux/ramips/dts/PX4885.dtsi
+++ b/target/linux/ramips/dts/PX4885.dtsi
@@ -30,6 +30,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
@@ -39,10 +40,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		orange {
 			label = "7links:orange:wifi";
 			gpios = <&gpio0 18 1>;
 		};
+
 		blue {
 			label = "7links:blue:storage";
 			gpios = <&gpio0 19 1>;
diff --git a/target/linux/ramips/dts/RE6500.dts b/target/linux/ramips/dts/RE6500.dts
index 36d6218..89029bf 100644
--- a/target/linux/ramips/dts/RE6500.dts
+++ b/target/linux/ramips/dts/RE6500.dts
@@ -86,10 +86,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wifi {
 			label = "linksys:orange:wifi";
 			gpios = <&gpio0 0 1>;
 		};
+
 		power {
 			label = "linksys:white:power";
 			gpios = <&gpio0 9 1>;
@@ -101,11 +103,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 11 0>;
diff --git a/target/linux/ramips/dts/RP-N53.dts b/target/linux/ramips/dts/RP-N53.dts
index e19639a..80ece00 100644
--- a/target/linux/ramips/dts/RP-N53.dts
+++ b/target/linux/ramips/dts/RP-N53.dts
@@ -17,7 +17,6 @@
 
 		i2s at a00 {
 			status = "okay";
-
 			pinctrl-names = "default";
 			pinctrl-0 = <&pcm_i2s_pins>;
 		};
@@ -78,7 +77,6 @@
 
 	gsw at 10110000 {
 		ralink,port4 = "ephy";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&ephy_pins>;
 	};
@@ -92,21 +90,25 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		touch {
 			label = "touch";
 			gpios = <&gpio1 0 1>;
 			linux,code = <0x100>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio1 1 1>;
 			linux,code = <0x100>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio1 2 1>;
 			linux,code = <0x100>;
 		};
+
 		audio {
 			label = "audio";
 			gpios = <&gpio1 3 0>;
@@ -116,34 +118,42 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		backlight {
 			label = "asus:white:back";
 			gpios = <&gpio1 4 1>;
 		};
+
 		wifi0 {
 			label = "asus:blue:5g3";
 			gpios = <&gpio1 5 1>;
 		};
+
 		wifi1 {
 			label = "asus:blue:5g2";
 			gpios = <&gpio1 6 1>;
 		};
+
 		wifi2 {
 			label = "asus:blue:5g1";
 			gpios = <&gpio1 7 1>;
 		};
+
 		wifi3 {
 			label = "asus:blue:wifi";
 			gpios = <&gpio1 8 1>;
 		};
+
 		wifi4 {
 			label = "asus:blue:2g1";
 			gpios = <&gpio1 9 1>;
 		};
+
 		wifi5 {
 			label = "asus:blue:2g2";
 			gpios = <&gpio1 10 1>;
 		};
+
 		wifi6 {
 			label = "asus:blue:2g3";
 			gpios = <&gpio1 11 1>;
diff --git a/target/linux/ramips/dts/RT-G32-B1.dts b/target/linux/ramips/dts/RT-G32-B1.dts
index 396e683..b0b7c07 100644
--- a/target/linux/ramips/dts/RT-G32-B1.dts
+++ b/target/linux/ramips/dts/RT-G32-B1.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -69,11 +70,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/RT-N10-PLUS.dts b/target/linux/ramips/dts/RT-N10-PLUS.dts
index a942af2..7bbd221 100644
--- a/target/linux/ramips/dts/RT-N10-PLUS.dts
+++ b/target/linux/ramips/dts/RT-N10-PLUS.dts
@@ -9,7 +9,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -53,6 +52,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wps {
 			label = "asus:green:wps";
 			gpios = <&gpio0 14 1>;
@@ -64,11 +64,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/RT-N13U.dts b/target/linux/ramips/dts/RT-N13U.dts
index 8642b88..4e1737e 100644
--- a/target/linux/ramips/dts/RT-N13U.dts
+++ b/target/linux/ramips/dts/RT-N13U.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -50,10 +49,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "rt-n13u:power";
 			gpios = <&gpio0 7 1>;
 		};
+
 		wifi {
 			label = "rt-n13u:wifi";
 			gpios = <&gpio0 8 1>;
@@ -65,11 +66,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <10>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/RT-N14U.dts b/target/linux/ramips/dts/RT-N14U.dts
index d95d32d..cd46bdf 100644
--- a/target/linux/ramips/dts/RT-N14U.dts
+++ b/target/linux/ramips/dts/RT-N14U.dts
@@ -81,22 +81,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wan {
 			label = "asus:blue:wan";
 			gpios = <&gpio2 0 1>;
 		};
+
 		lan {
 			label = "asus:blue:lan";
 			gpios = <&gpio2 1 1>;
 		};
+
 		usb {
 			label = "asus:blue:usb";
 			gpios = <&gpio2 2 1>;
 		};
+
 		power {
 			label = "asus:blue:power";
 			gpios = <&gpio2 3 1>;
 		};
+
 		air {
 			label = "asus:blue:air";
 			gpios = <&gpio3 0 1>;
@@ -108,11 +113,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 2 1>;
diff --git a/target/linux/ramips/dts/RT-N15.dts b/target/linux/ramips/dts/RT-N15.dts
index 23842d4..03821ca 100644
--- a/target/linux/ramips/dts/RT-N15.dts
+++ b/target/linux/ramips/dts/RT-N15.dts
@@ -26,7 +26,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -37,16 +36,19 @@
 			reg = <0x0 0x30000>;
 			read-only;
 		};
+
 		partition at 30000 {
 			label = "uboot-env";
 			reg = <0x30000 0x10000>;
 			read-only;
 		};
+
 		factory: partition at 40000 {
 			label = "factory";
 			reg = <0x40000 0x10000>;
 			read-only;
 		};
+
 		partition at 50000 {
 			label = "firmware";
 			reg = <0x50000 0x3b0000>;
@@ -57,12 +59,13 @@
 		status = "okay";
 		mtd-mac-address = <&factory 0x4>;
 
-                port at 0 {
+		port at 0 {
 			ralink,fixed-link = <1000 1 1 1>;
 		};
 
 		mdio-bus {
 			status = "okay";
+
 			phy0: ethernet-phy at 0 {
 				phy-mode = "mii";
 				reg = <0>;
@@ -85,11 +88,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 0>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 12 0>;
diff --git a/target/linux/ramips/dts/RTN56U.dts b/target/linux/ramips/dts/RTN56U.dts
index 4b72583..3ecd1b7 100644
--- a/target/linux/ramips/dts/RTN56U.dts
+++ b/target/linux/ramips/dts/RTN56U.dts
@@ -22,7 +22,8 @@
 	};
 
 	ethernet at 10100000 {
-       		mtd-mac-address = <&factory 0x4>;
+		mtd-mac-address = <&factory 0x4>;
+
 		port at 0 {
 			ralink,fixed-link = <1000 1 1 1>;
 		};
@@ -30,9 +31,9 @@
 
 	pci at 10140000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&pci_pins>;
+
 		pci_pins: pci {
 			pci {
 				ralink,group = "pci";
@@ -43,12 +44,12 @@
 		host-bridge {
 			pci-bridge at 1 {
 				status = "okay";
-				wmac at 0,0 {
-                                        compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
-                                        reg = < 0x10000 0 0 0 0 >;
-                                        ralink,eeprom = "rt2x00pci_1_0.eeprom";
-                                };
 
+				wmac at 0,0 {
+					compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
+					reg = < 0x10000 0 0 0 0 >;
+					ralink,eeprom = "rt2x00pci_1_0.eeprom";
+				};
 			};
 		};
 	};
@@ -70,7 +71,6 @@
 	nor-flash at 1c000000 {
 		compatible = "cfi-flash";
 		reg = <0x1c000000 0x800000>;
-
 		bank-width = <2>;
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -111,11 +111,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 13 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio1 2 1>;
@@ -130,14 +132,17 @@
 			label = "asus:blue:power";
 			gpios = <&gpio0 0 1>;
 		};
+
 		lan {
 			label = "asus:blue:lan";
 			gpios = <&gpio0 19 1>;
 		};
+
 		wan {
 			label = "asus:blue:wan";
 			gpios = <&gpio1 3 1>;
 		};
+
 		usb {
 			label = "asus:blue:usb";
 			gpios = <&gpio1 0 1>;
diff --git a/target/linux/ramips/dts/RUT5XX.dts b/target/linux/ramips/dts/RUT5XX.dts
index 9ae6997..0af4743 100644
--- a/target/linux/ramips/dts/RUT5XX.dts
+++ b/target/linux/ramips/dts/RUT5XX.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -52,9 +53,9 @@
 		};
 	};
 
-        ethernet at 10100000 {
-                mtd-mac-address = <&factory 0x28>;
-        };
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x28>;
+	};
 
 	esw at 10110000 {
 		ralink,portmap = <0x3e>;
@@ -66,6 +67,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			label = "rut5xx:green:status";
 			gpios = <&gpio0 14 1>;
@@ -77,6 +79,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/SAP-G3200U3.dts b/target/linux/ramips/dts/SAP-G3200U3.dts
index 06c2f23..d273559 100644
--- a/target/linux/ramips/dts/SAP-G3200U3.dts
+++ b/target/linux/ramips/dts/SAP-G3200U3.dts
@@ -99,11 +99,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 16 1>;
 			linux,code = <0x198>;
 		};
+
 		rfkill {
 			label = "rfkill";
 			gpios = <&gpio0 14 1>;
diff --git a/target/linux/ramips/dts/SL-R7205.dts b/target/linux/ramips/dts/SL-R7205.dts
index 574de55..a6d9cc8 100644
--- a/target/linux/ramips/dts/SL-R7205.dts
+++ b/target/linux/ramips/dts/SL-R7205.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -62,6 +61,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wifi {
 			label = "sl-r7205:green:wifi";
 			gpios = <&gpio0 7 1>;
@@ -73,11 +73,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/TEW-691GR.dts b/target/linux/ramips/dts/TEW-691GR.dts
index 33f8925..b56ff9f 100644
--- a/target/linux/ramips/dts/TEW-691GR.dts
+++ b/target/linux/ramips/dts/TEW-691GR.dts
@@ -23,10 +23,12 @@
 
 	ethernet at 10100000 {
 		mtd-mac-address = <&factory 0x28>;
+
 		port at 0 {
 			phy-handle = <&phy0>;
 			phy-mode = "rgmii";
 		};
+
 		mdio-bus {
 			status = "okay";
 
@@ -43,7 +45,6 @@
 	nor-flash at 1c000000 {
 		compatible = "cfi-flash";
 		reg = <0x1c000000 0x800000>;
-
 		bank-width = <2>;
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -77,16 +78,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio1 2 1>;
 			linux,code = <0x211>;
 		};
+
 		rfkill {
 			label = "rfkill";
 			gpios = <&gpio0 0 1>;
@@ -96,6 +100,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wps {
 			label = "trendnet:green:wps";
 			gpios = <&gpio0 9 1>;
diff --git a/target/linux/ramips/dts/TEW-692GR.dts b/target/linux/ramips/dts/TEW-692GR.dts
index 6e43c7c..d537e29 100644
--- a/target/linux/ramips/dts/TEW-692GR.dts
+++ b/target/linux/ramips/dts/TEW-692GR.dts
@@ -24,10 +24,12 @@
 	ethernet at 10100000 {
 		status = "okay";
 		mtd-mac-address = <&factory 0x28>;
+
 		port at 0 {
 			phy-handle = <&phy0>;
 			phy-mode = "rgmii";
 		};
+
 		mdio-bus {
 			status = "okay";
 
@@ -39,9 +41,9 @@
 
 	pci at 10140000 {
 		status = "okay";
-
 		pinctrl-names = "default";
 		pinctrl-0 = <&pci_pins>;
+
 		pci_pins: pci {
 			pci {
 				ralink,group = "pci";
@@ -63,7 +65,6 @@
 	nor-flash at 1c000000 {
 		compatible = "cfi-flash";
 		reg = <0x1c000000 0x800000>;
-
 		bank-width = <2>;
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -97,11 +98,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio1 2 1>;
@@ -111,10 +114,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wps {
 			label = "trendnet:orange:wps";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wps2 {
 			label = "trendnet:green:wps";
 			gpios = <&gpio1 4 1>;
diff --git a/target/linux/ramips/dts/UR-326N4G.dts b/target/linux/ramips/dts/UR-326N4G.dts
index 021efe5..6350bd7 100644
--- a/target/linux/ramips/dts/UR-326N4G.dts
+++ b/target/linux/ramips/dts/UR-326N4G.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -62,22 +61,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		3g {
 			label = "ur326:green:3g";
 			gpios = <&gpio0 9 1>;
 		};
+
 		gateway {
 			label = "ur326:green:gateway";
 			gpios = <&gpio0 11 1>;
 		};
+
 		ap {
 			label = "ur326:green:ap";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "ur326:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
+
 		station {
 			label = "ur326:green:station";
 			gpios = <&gpio0 13 1>;
@@ -89,11 +93,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 7 1>;
diff --git a/target/linux/ramips/dts/UR-336UN.dts b/target/linux/ramips/dts/UR-336UN.dts
index 81d0be0..896b6e6 100644
--- a/target/linux/ramips/dts/UR-336UN.dts
+++ b/target/linux/ramips/dts/UR-336UN.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -41,22 +40,27 @@
 */
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		3g {
 			label = "ur336:green:3g";
 			gpios = <&gpio0 9 1>;
 		};
+
 		gateway {
 			label = "ur336:green:gateway";
 			gpios = <&gpio0 11 1>;
 		};
+
 		ap {
 			label = "ur336:green:ap";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "ur336:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
+
 		station {
 			label = "ur336:green:station";
 			gpios = <&gpio0 13 1>;
@@ -68,11 +72,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 7 1>;
diff --git a/target/linux/ramips/dts/V11STFE.dts b/target/linux/ramips/dts/V11STFE.dts
index a0a7384..5a43e6d 100644
--- a/target/linux/ramips/dts/V11STFE.dts
+++ b/target/linux/ramips/dts/V11STFE.dts
@@ -33,7 +33,6 @@
 	nor-flash at 1c000000 {
 		compatible = "cfi-flash";
 		reg = <0x1c000000 0x800000>;
-
 		bank-width = <2>;
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -67,6 +66,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 0>;
diff --git a/target/linux/ramips/dts/V22RW-2X2.dts b/target/linux/ramips/dts/V22RW-2X2.dts
index 7eff596..e8fc4fe 100644
--- a/target/linux/ramips/dts/V22RW-2X2.dts
+++ b/target/linux/ramips/dts/V22RW-2X2.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -58,10 +57,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		security {
 			label = "v22rw-2x2:green:security";
 			gpios = <&gpio0 13 1>;
 		};
+
 		wps {
 			label = "v22rw-2x2:red:wps";
 			gpios = <&gpio0 14 1>;
@@ -73,11 +74,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/VOCORE.dts b/target/linux/ramips/dts/VOCORE.dts
index e6288b0..5e386e4 100644
--- a/target/linux/ramips/dts/VOCORE.dts
+++ b/target/linux/ramips/dts/VOCORE.dts
@@ -104,30 +104,35 @@
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 7 0>;
 		};
+
 		gpio8 {
 			/* UARTF_TXD */
 			gpio-export,name = "gpio8";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 8 0>;
 		};
+
 		gpio9 {
 			/* UARTF_CTS_N */
 			gpio-export,name = "gpio9";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 9 0>;
 		};
+
 		gpio12 {
 			/* UARTF_DCD_N */
 			gpio-export,name = "gpio12";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 12 0>;
 		};
+
 		gpio13 {
 			/* UARTF_DSR_N */
 			gpio-export,name = "gpio13";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 13 0>;
 		};
+
 		gpio14 {
 			/* UARTF_RIN */
 			gpio-export,name = "gpio14";
@@ -142,24 +147,28 @@
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 17 0>;
 		};
+
 		gpio18 {
 			/* JTAG_TDI */
 			gpio-export,name = "gpio18";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 18 0>;
 		};
+
 		gpio19 {
 			/* JTAG_TMS */
 			gpio-export,name = "gpio19";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 19 0>;
 		};
+
 		gpio20 {
 			/* JTAG_TCLK */
 			gpio-export,name = "gpio20";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio0 20 0>;
 		};
+
 		gpio21 {
 			/* JTAG_TRST_N */
 			gpio-export,name = "gpio21";
@@ -174,24 +183,28 @@
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio1 0 0>;
 		};
+
 		gpio23 {
 			/* ETH1_LED */
 			gpio-export,name = "gpio23";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio1 1 0>;
 		};
+
 		gpio24 {
 			/* ETH2_LED */
 			gpio-export,name = "gpio24";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio1 2 0>;
 		};
+
 		gpio25 {
 			/* ETH3_LED */
 			gpio-export,name = "gpio25";
 			gpio-export,direction_may_change = <1>;
 			gpios = <&gpio1 3 0>;
 		};
+
 		gpio26 {
 			/* ETH4_LED */
 			gpio-export,name = "gpio26";
@@ -202,11 +215,13 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		status {
 			/* UARTF_RXD */
 			label = "vocore:green:status";
 			gpios = <&gpio0 10 0>;
 		};
+
 		eth {
 			/* UARTF_DTR_N */
 			label = "vocore:orange:eth";
diff --git a/target/linux/ramips/dts/W150M.dts b/target/linux/ramips/dts/W150M.dts
index 915fb21..5f4d0e3 100644
--- a/target/linux/ramips/dts/W150M.dts
+++ b/target/linux/ramips/dts/W150M.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -50,26 +49,32 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		3grouter {
 			label = "tenda:blue:3grouter";
 			gpios = <&gpio0 11 1>;
 		};
+
 		ap {
 			label = "tenda:blue:ap";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wisprouter {
 			label = "tenda:blue:wisprouter";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wirelessrouter {
 			label = "tenda:blue:wirelessrouter";
 			gpios = <&gpio0 13 1>;
 		};
+
 		3g {
 			label = "tenda:blue:3g";
 			gpios = <&gpio0 7 1>;
 		};
+
 		wpsreset {
 			label = "tenda:blue:wpsreset";
 			gpios = <&gpio0 14 1>;
@@ -81,11 +86,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/W306R_V20.dts b/target/linux/ramips/dts/W306R_V20.dts
index fe505b4..72b6ed8 100644
--- a/target/linux/ramips/dts/W306R_V20.dts
+++ b/target/linux/ramips/dts/W306R_V20.dts
@@ -9,7 +9,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -62,10 +61,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		sys {
 			label = "w306r-v20:green:sys";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wps {
 			label = "w306r-v20:green:wps";
 			gpios = <&gpio0 13 1>;
@@ -77,6 +78,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "RESET/WPS";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/W502U.dts b/target/linux/ramips/dts/W502U.dts
index 6d3282e..8afe741 100644
--- a/target/linux/ramips/dts/W502U.dts
+++ b/target/linux/ramips/dts/W502U.dts
@@ -22,7 +22,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -66,10 +65,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		usb {
 			label = "alfa:blue:usb";
 			gpios = <&gpio0 13 1>;
 		};
+
 		wps {
 			label = "alfa:blue:wps";
 			gpios = <&gpio0 14 1>;
@@ -81,11 +82,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/WCR150GN.dts b/target/linux/ramips/dts/WCR150GN.dts
index 2a4fa11..66bf901 100644
--- a/target/linux/ramips/dts/WCR150GN.dts
+++ b/target/linux/ramips/dts/WCR150GN.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -50,10 +49,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		user {
 			label = "wcr150gn:amber:user";
 			gpios = <&gpio0 12 1>;
 		};
+
 		power {
 			label = "wcr150gn:amber:power";
 			gpios = <&gpio0 8 1>;
@@ -65,11 +66,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/WHR-1166D.dts b/target/linux/ramips/dts/WHR-1166D.dts
index 9c48d0c..756d180 100644
--- a/target/linux/ramips/dts/WHR-1166D.dts
+++ b/target/linux/ramips/dts/WHR-1166D.dts
@@ -97,33 +97,40 @@
 			};
 		};
 	};
-	
+
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "buffalo:red:power";
 			gpios = <&gpio0 7 1>;
 		};
+
 		wifi {
 			label = "buffalo:green:wifi";
 			gpios = <&gpio0 8 1>;
 		};
+
 		power2 {
 			label = "buffalo:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wifi2 {
 			label = "buffalo:orange:wifi";
 			gpios = <&gpio0 10 1>;
 		};
+
 		internet {
 			label = "buffalo:green:internet";
 			gpios = <&gpio2 17 1>;
 		};
+
 		router {
 			label = "buffalo:orange:router";
 			gpios = <&gpio2 18 1>;
 		};
+
 		router2 {
 			label = "buffalo:green:router";
 			gpios = <&gpio2 19 1>;
@@ -135,22 +142,26 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio2 12 1>;
 			linux,code = <0x198>;
 		};
+
 		aoss {
 			label = "aoss";
 			gpios = <&gpio2 13 1>;
 			linux,code = <0x211>;
 		};
+
 		ap {
 			label = "ap";
 			gpios = <&gpio2 14 1>;
 			linux,code = <0x100>;
 			linux,input-type = <5>; /* EV_SW */
 		};
+
 		bridge {
 			label = "bridge";
 			gpios = <&gpio2 15 1>;
diff --git a/target/linux/ramips/dts/WHR-300HP2.dts b/target/linux/ramips/dts/WHR-300HP2.dts
index b3b3a87..83bc407 100644
--- a/target/linux/ramips/dts/WHR-300HP2.dts
+++ b/target/linux/ramips/dts/WHR-300HP2.dts
@@ -54,6 +54,7 @@
 				ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd";
 				ralink,function = "gpio";
 			};
+
 			pa {
 				ralink,group = "pa";
 				ralink,function = "pa";
@@ -64,7 +65,6 @@
 	ethernet at 10100000 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&ephy_pins>;
-
 		ralink,port-map = "llllw";
 	};
 
@@ -78,30 +78,37 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "buffalo:red:power";
 			gpios = <&gpio0 7 1>;
 		};
+
 		wifi {
 			label = "buffalo:green:wifi";
 			gpios = <&gpio0 8 1>;
 		};
+
 		power2 {
 			label = "buffalo:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wifi2 {
 			label = "buffalo:orange:wifi";
 			gpios = <&gpio0 10 1>;
 		};
+
 		internet {
 			label = "buffalo:green:internet";
 			gpios = <&gpio2 17 1>;
 		};
+
 		router {
 			label = "buffalo:green:router";
 			gpios = <&gpio2 18 1>;
 		};
+
 		router2 {
 			label = "buffalo:orange:router";
 			gpios = <&gpio2 19 1>;
@@ -113,22 +120,26 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio2 12 1>;
 			linux,code = <0x198>;
 		};
+
 		aoss {
 			label = "aoss";
 			gpios = <&gpio2 13 1>;
 			linux,code = <0x211>;
 		};
+
 		ap {
 			label = "ap";
 			gpios = <&gpio2 14 1>;
 			linux,code = <0x100>;
 			linux,input-type = <5>; /* EV_SW */
 		};
+
 		bridge {
 			label = "bridge";
 			gpios = <&gpio2 15 1>;
diff --git a/target/linux/ramips/dts/WHR-600D.dts b/target/linux/ramips/dts/WHR-600D.dts
index 5775093..5e06060 100644
--- a/target/linux/ramips/dts/WHR-600D.dts
+++ b/target/linux/ramips/dts/WHR-600D.dts
@@ -60,7 +60,6 @@
 	ethernet at 10100000 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&ephy_pins>;
-
 		mtd-mac-address = <&factory 0x4>;
 		ralink,port-map = "llllw";
 	};
@@ -76,33 +75,40 @@
 	pcie at 10140000 {
 		status = "okay";
 	};
-	
+
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "buffalo:red:power";
 			gpios = <&gpio0 7 1>;
 		};
+
 		wifi {
 			label = "buffalo:green:wifi";
 			gpios = <&gpio0 8 1>;
 		};
+
 		power2 {
 			label = "buffalo:green:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wifi2 {
 			label = "buffalo:orange:wifi";
 			gpios = <&gpio0 10 1>;
 		};
+
 		internet {
 			label = "buffalo:green:internet";
 			gpios = <&gpio2 17 1>;
 		};
+
 		router {
 			label = "buffalo:green:router";
 			gpios = <&gpio2 18 1>;
 		};
+
 		router2 {
 			label = "buffalo:orange:router";
 			gpios = <&gpio2 19 1>;
@@ -114,22 +120,26 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio2 12 1>;
 			linux,code = <0x198>;
 		};
+
 		aoss {
 			label = "aoss";
 			gpios = <&gpio2 13 1>;
 			linux,code = <0x211>;
 		};
+
 		ap {
 			label = "ap";
 			gpios = <&gpio2 14 1>;
 			linux,code = <0x100>;
 			linux,input-type = <5>; /* EV_SW */
 		};
+
 		bridge {
 			label = "bridge";
 			gpios = <&gpio2 15 1>;
diff --git a/target/linux/ramips/dts/WHR-G300N.dts b/target/linux/ramips/dts/WHR-G300N.dts
index 3054131..1aa9f69 100644
--- a/target/linux/ramips/dts/WHR-G300N.dts
+++ b/target/linux/ramips/dts/WHR-G300N.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -36,14 +35,17 @@
 */
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		diag {
 			label = "whr-g300n:red:diag";
 			gpios = <&gpio0 7 1>;
 		};
+
 		router {
 			label = "whr-g300n:green:router";
 			gpios = <&gpio0 9 1>;
 		};
+
 		security {
 			label = "whr-g300n:amber:security";
 			gpios = <&gpio0 14 1>;
@@ -55,21 +57,25 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		aoss {
 			label = "aoss";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		router-off {
 			label = "router-off";
 			gpios = <&gpio0 11 1>;
 			linux,code = <0x102>;
 		};
+
 		router-on {
 			label = "router-on";
 			gpios = <&gpio0 8 1>;
diff --git a/target/linux/ramips/dts/WIZARD8800.dts b/target/linux/ramips/dts/WIZARD8800.dts
index a80b937..d89c0d5 100644
--- a/target/linux/ramips/dts/WIZARD8800.dts
+++ b/target/linux/ramips/dts/WIZARD8800.dts
@@ -17,6 +17,7 @@
 
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
diff --git a/target/linux/ramips/dts/WL-351.dts b/target/linux/ramips/dts/WL-351.dts
index 81c963b..3fcb222 100644
--- a/target/linux/ramips/dts/WL-351.dts
+++ b/target/linux/ramips/dts/WL-351.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -74,14 +73,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "wl-351:amber:power";
 			gpios = <&gpio0 8 1>;
 		};
+
 		unpopulated {
 			label = "wl-351:amber:unpopulated";
 			gpios = <&gpio0 12 1>;
 		};
+
 		unpopulated2 {
 			label = "wl-351:blue:unpopulated";
 			gpios = <&gpio0 13 1>;
@@ -93,11 +95,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/WL341V3.dts b/target/linux/ramips/dts/WL341V3.dts
index 64d0327..40ce630 100644
--- a/target/linux/ramips/dts/WL341V3.dts
+++ b/target/linux/ramips/dts/WL341V3.dts
@@ -9,7 +9,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -62,30 +61,37 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		first {
 			label = "wl341v3:amber:first";
 			gpios = <&gpio0 9 1>;
 		};
+
 		first2 {
 			label = "wl341v3:blue:first";
 			gpios = <&gpio0 13 1>;
 		};
+
 		third {
 			label = "wl341v3:amber:third";
 			gpios = <&gpio0 11 1>;
 		};
+
 		third2 {
 			label = "wl341v3:blue:third";
 			gpios = <&gpio0 14 1>;
 		};
+
 		fourth {
 			label = "wl341v3:blue:fourth";
 			gpios = <&gpio0 10 1>;
 		};
+
 		fifth {
 			label = "wl341v3:amber:fifth";
 			gpios = <&gpio0 12 1>;
 		};
+
 		fifth2 {
 			label = "wl341v3:blue:fifth";
 			gpios = <&gpio0 8 1>;
@@ -97,11 +103,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 7 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 5 1>;
diff --git a/target/linux/ramips/dts/WLI-TX4-AG300N.dts b/target/linux/ramips/dts/WLI-TX4-AG300N.dts
index 4d773da..e7e8e4a 100644
--- a/target/linux/ramips/dts/WLI-TX4-AG300N.dts
+++ b/target/linux/ramips/dts/WLI-TX4-AG300N.dts
@@ -17,7 +17,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -28,16 +27,19 @@
 			reg = <0x0 0x30000>;
 			read-only;
 		};
+
 		partition at 30000 {
 			label = "uboot-env";
 			reg = <0x30000 0x10000>;
 			read-only;
 		};
+
 		factory: partition at 40000 {
 			label = "factory";
 			reg = <0x40000 0x10000>;
 			read-only;
 		};
+
 		partition at 50000 {
 			label = "linux";
 			reg = <0x50000 0x3b0000>;
@@ -48,7 +50,7 @@
 		status = "okay";
 		mtd-mac-address = <&factory 0x4>;
 
-                port at 0 {
+		port at 0 {
 			ralink,fixed-link = <1000 1 1 1>;
 		};
 	};
@@ -62,16 +64,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		bandwidth {
 			label = "bandwidth";
 			gpios = <&gpio0 8 0>;
 			linux,code = <0x198>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 9 1>;
@@ -86,10 +91,12 @@
 			label = "buffalo:red:diag";
 			gpios = <&gpio0 10 1>;
 		};
+
 		power {
 			label = "buffalo:blue:power";
 			gpios = <&gpio0 12 1>;
 		};
+
 		security {
 			label = "buffalo:blue:security";
 			gpios = <&gpio0 13 1>;
diff --git a/target/linux/ramips/dts/WL_330N.dts b/target/linux/ramips/dts/WL_330N.dts
index e25535f..14c78db 100644
--- a/target/linux/ramips/dts/WL_330N.dts
+++ b/target/linux/ramips/dts/WL_330N.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -66,10 +67,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		link {
 			label = "asus:blue:link";
 			gpios = <&gpio0 9 1>;
 		};
+
 		power {
 			label = "asus:blue:power";
 			gpios = <&gpio0 11 1>;
@@ -81,11 +84,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/WL_330N3G.dts b/target/linux/ramips/dts/WL_330N3G.dts
index e1196c6..aa4c547 100644
--- a/target/linux/ramips/dts/WL_330N3G.dts
+++ b/target/linux/ramips/dts/WL_330N3G.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -66,14 +67,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		3g {
 			label = "asus:blue:3g";
 			gpios = <&gpio0 9 1>;
 		};
+
 		3g2 {
 			label = "asus:red:3g";
 			gpios = <&gpio0 13 1>;
 		};
+
 		power {
 			label = "asus:blue:power";
 			gpios = <&gpio0 11 1>;
@@ -85,11 +89,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
diff --git a/target/linux/ramips/dts/WMR300.dts b/target/linux/ramips/dts/WMR300.dts
index b6bce43..fbeec4c 100644
--- a/target/linux/ramips/dts/WMR300.dts
+++ b/target/linux/ramips/dts/WMR300.dts
@@ -68,14 +68,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		aoss1 {
 			label = "buffalo:red:aoss";
 			gpios = <&gpio2 1 1>;
 		};
+
 		aoss2 {
 			label = "buffalo:green:aoss";
 			gpios = <&gpio2 2 1>;
 		};
+
 		power {
 			label = "buffalo:green:status";
 			gpios = <&gpio2 4 1>;
@@ -87,11 +90,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
 			linux,code = <0x198>;
 		};
+
 		aoss {
 			label = "aoss";
 			gpios = <&gpio0 2 1>;
diff --git a/target/linux/ramips/dts/WNCE2001.dts b/target/linux/ramips/dts/WNCE2001.dts
index d8a3b0b..bd0d596 100644
--- a/target/linux/ramips/dts/WNCE2001.dts
+++ b/target/linux/ramips/dts/WNCE2001.dts
@@ -13,6 +13,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -83,18 +84,22 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power-green {
 			label = "netgear:green:power";
 			gpios = <&gpio0 8 1>;
 		};
+
 		power-red {
 			label = "netgear:red:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wlan-green {
 			label = "netgear:green:wlan";
 			gpios = <&gpio0 12 0>;
 		};
+
 		wlan-red {
 			label = "netgear:red:wlan";
 			gpios = <&gpio0 13 0>;
@@ -106,21 +111,25 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		rt {
 			label = "rt";
 			gpios = <&gpio0 11 1>;
 			linux,code = <0x100>;
 		};
+
 		ap {
 			label = "ap";
 			gpios = <&gpio0 7 1>;
diff --git a/target/linux/ramips/dts/WR512-3GN-4M.dts b/target/linux/ramips/dts/WR512-3GN-4M.dts
index 0098970..f5c1319 100644
--- a/target/linux/ramips/dts/WR512-3GN-4M.dts
+++ b/target/linux/ramips/dts/WR512-3GN-4M.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -58,22 +57,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		3g {
 			label = "wr512:green:3g";
 			gpios = <&gpio0 9 1>;
 		};
+
 		gateway {
 			label = "wr512:green:gateway";
 			gpios = <&gpio0 11 1>;
 		};
+
 		ap {
 			label = "wr512:green:ap";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "wr512:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
+
 		station {
 			label = "wr512:green:station";
 			gpios = <&gpio0 13 1>;
@@ -85,11 +89,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 7 1>;
diff --git a/target/linux/ramips/dts/WR512-3GN-8M.dts b/target/linux/ramips/dts/WR512-3GN-8M.dts
index 20a325c..d0cc0ef 100644
--- a/target/linux/ramips/dts/WR512-3GN-8M.dts
+++ b/target/linux/ramips/dts/WR512-3GN-8M.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -58,22 +57,27 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		3g {
 			label = "wr512:green:3g";
 			gpios = <&gpio0 9 1>;
 		};
+
 		gateway {
 			label = "wr512:green:gateway";
 			gpios = <&gpio0 11 1>;
 		};
+
 		ap {
 			label = "wr512:green:ap";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wps {
 			label = "wr512:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
+
 		station {
 			label = "wr512:green:station";
 			gpios = <&gpio0 13 1>;
@@ -85,11 +89,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset_wps {
 			label = "reset_wps";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 7 1>;
diff --git a/target/linux/ramips/dts/WR6202.dts b/target/linux/ramips/dts/WR6202.dts
index 430205e..614f696 100644
--- a/target/linux/ramips/dts/WR6202.dts
+++ b/target/linux/ramips/dts/WR6202.dts
@@ -21,10 +21,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wps {
 			label = "wr6202:blue:wps";
 			gpios = <&gpio0 14 1>;
 		};
+
 		3g {
 			label = "wr6202:blue:3g";
 			gpios = <&gpio0 13 1>;
@@ -36,11 +38,13 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
@@ -51,7 +55,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
diff --git a/target/linux/ramips/dts/WR8305RT.dts b/target/linux/ramips/dts/WR8305RT.dts
index c28e422..1f3c345 100644
--- a/target/linux/ramips/dts/WR8305RT.dts
+++ b/target/linux/ramips/dts/WR8305RT.dts
@@ -10,6 +10,7 @@
 		gpio1: gpio at 638 {
 			status = "okay";
 		};
+
 		gpio3: gpio at 688 {
 			status = "okay";
 		};
@@ -74,6 +75,7 @@
 				ralink,group = "ephy";
 				ralink,function = "ephy";
 			};
+
 			default {
 				ralink,group = "i2c", "uartf", "spi refclk", "wled";
 				ralink,function = "gpio";
@@ -83,14 +85,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		sys {
 			label = "wr8305rt:sys";
 			gpios = <&gpio1 14 1>;
 		};
+
 		lan {
 			label = "wr8305rt:usb";
 			gpios = <&gpio1 15 1>;
 		};
+
 		wifi {
 			label = "wr8305rt:wifi";
 			gpios = <&gpio3 0 1>;
@@ -102,6 +107,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
@@ -109,4 +115,3 @@
 		};
 	};
 };
-
diff --git a/target/linux/ramips/dts/WRTNODE.dts b/target/linux/ramips/dts/WRTNODE.dts
index 2a4dd19..23dbf5c 100644
--- a/target/linux/ramips/dts/WRTNODE.dts
+++ b/target/linux/ramips/dts/WRTNODE.dts
@@ -84,6 +84,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		indicator {
 			label = "wrtnode:blue:indicator";
 			gpios = <&gpio1 14 1>;
diff --git a/target/linux/ramips/dts/WSR-1166.dts b/target/linux/ramips/dts/WSR-1166.dts
index fc5896f..dd075db 100644
--- a/target/linux/ramips/dts/WSR-1166.dts
+++ b/target/linux/ramips/dts/WSR-1166.dts
@@ -69,34 +69,42 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		internet_g {
 			label = "buffalo:green:internet";
 			gpios = <&gpio1 9 1>;
 		};
+
 		router_g {
 			label = "buffalo:green:router";
 			gpios = <&gpio1 10 1>;
 		};
+
 		router_o {
 			label = "buffalo:orange:router";
 			gpios = <&gpio1 11 1>;
 		};
+
 		internet_o {
 			label = "buffalo:orange:internet";
 			gpios = <&gpio1 12 1>;
 		};
+
 		wifi_o {
 			label = "buffalo:orange:wifi";
 			gpios = <&gpio1 13 1>;
 		};
+
 		power {
 			label = "buffalo:green:power";
 			gpios = <&gpio1 14 1>;
 		};
+
 		diag {
 			label = "buffalo:orange:diag";
 			gpios = <&gpio1 15 1>;
 		};
+
 		wifi_g {
 			label = "buffalo:green:wifi";
 			gpios = <&gpio1 16 1>;
@@ -108,33 +116,39 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		power {
 			label = "power";
 			gpios = <&gpio0 18 1>;
 			linux,code = <0x74>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 3 1>;
 			linux,code = <0x198>;
 		};
+
 		aoss {
 			label = "aoss";
 			gpios = <&gpio0 6 1>;
 			linux,code = <0x211>;
 		};
+
 		auto {
 			label = "mode";
 			gpios = <&gpio0 7 0>;
 			linux,code = <0x100>;
 			linux,input-type = <5>; /* EV_SW */
 		};
+
 		ap {
 			label = "ap";
 			gpios = <&gpio0 10 0>;
 			linux,code = <0x100>;
 			linux,input-type = <5>; /* EV_SW */
 		};
+
 		router {
 			label = "router";
 			gpios = <&gpio0 12 0>;
diff --git a/target/linux/ramips/dts/WSR-600.dts b/target/linux/ramips/dts/WSR-600.dts
index 77e9935..7b4fd74 100644
--- a/target/linux/ramips/dts/WSR-600.dts
+++ b/target/linux/ramips/dts/WSR-600.dts
@@ -64,34 +64,42 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "buffalo:green:power";
 			gpios = <&gpio0 12 1>;
 		};
+
 		wifi_o {
 			label = "buffalo:orange:wifi";
 			gpios = <&gpio1 9 1>;
 		};
+
 		diag {
 			label = "buffalo:orange:diag";
 			gpios = <&gpio1 10 1>;
 		};
+
 		wifi_g {
 			label = "buffalo:green:wifi";
 			gpios = <&gpio1 12 1>;
 		};
+
 		router_o {
 			label = "buffalo:orange:router";
 			gpios = <&gpio1 13 1>;
 		};
+
 		router_g {
 			label = "buffalo:green:router";
 			gpios = <&gpio1 14 1>;
 		};
+
 		internet_o {
 			label = "buffalo:orange:internet";
 			gpios = <&gpio1 15 1>;
 		};
+
 		internet_g {
 			label = "buffalo:green:internet";
 			gpios = <&gpio1 16 1>;
@@ -103,33 +111,39 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		power {
 			label = "power";
 			gpios = <&gpio0 8 1>;
 			linux,code = <0x74>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 11 1>;
 			linux,code = <0x198>;
 		};
+
 		aoss {
 			label = "aoss";
 			gpios = <&gpio0 18 1>;
 			linux,code = <0x211>;
 		};
+
 		auto {
 			label = "mode";
 			gpios = <&gpio0 7 0>;
 			linux,code = <0x100>;
 			linux,input-type = <5>; /* EV_SW */
 		};
+
 		ap {
 			label = "ap";
 			gpios = <&gpio0 6 0>;
 			linux,code = <0x100>;
 			linux,input-type = <5>; /* EV_SW */
 		};
+
 		router {
 			label = "router";
 			gpios = <&gpio0 10 0>;
@@ -137,6 +151,7 @@
 			linux,input-type = <5>; /* EV_SW */
 		};
 	};
+
 	gpio_poweroff {
 		compatible = "gpio-poweroff";
 		gpios = <&gpio1 11 1>;
diff --git a/target/linux/ramips/dts/WT1520-4M.dts b/target/linux/ramips/dts/WT1520-4M.dts
index 97f03b5..1291320 100644
--- a/target/linux/ramips/dts/WT1520-4M.dts
+++ b/target/linux/ramips/dts/WT1520-4M.dts
@@ -6,6 +6,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
diff --git a/target/linux/ramips/dts/WT1520-8M.dts b/target/linux/ramips/dts/WT1520-8M.dts
index 32f0360..999c84d 100644
--- a/target/linux/ramips/dts/WT1520-8M.dts
+++ b/target/linux/ramips/dts/WT1520-8M.dts
@@ -6,6 +6,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
diff --git a/target/linux/ramips/dts/WT3020-4M.dts b/target/linux/ramips/dts/WT3020-4M.dts
index 7583680..4295939 100644
--- a/target/linux/ramips/dts/WT3020-4M.dts
+++ b/target/linux/ramips/dts/WT3020-4M.dts
@@ -7,13 +7,13 @@
 	model = "Nexx WT3020";
 
 	palmbus at 10000000 {
-                gpio2: gpio at 660 {
-                        status = "okay";
-                };
+		gpio2: gpio at 660 {
+			status = "okay";
+		};
 
-                gpio3: gpio at 688 {
-                        status = "okay";
-                };
+		gpio3: gpio at 688 {
+			status = "okay";
+		};
 
 		spi at b00 {
 			status = "okay";
@@ -83,6 +83,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
@@ -90,11 +91,12 @@
 		};
 	};
 
-        gpio-leds {
-                compatible = "gpio-leds";
-                power {
-                        label = "nexx:blue:power";
-                        gpios = <&gpio3 0 0>;
-                };
-        };
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power {
+			label = "nexx:blue:power";
+			gpios = <&gpio3 0 0>;
+		};
+	};
 };
diff --git a/target/linux/ramips/dts/WT3020-8M.dts b/target/linux/ramips/dts/WT3020-8M.dts
index 5fa7c92..122499d 100644
--- a/target/linux/ramips/dts/WT3020-8M.dts
+++ b/target/linux/ramips/dts/WT3020-8M.dts
@@ -7,13 +7,13 @@
 	model = "Nexx WT3020";
 
 	palmbus at 10000000 {
-                gpio2: gpio at 660 {
-                        status = "okay";
-                };
+		gpio2: gpio at 660 {
+			status = "okay";
+		};
 
-                gpio3: gpio at 688 {
-                        status = "okay";
-                };
+		gpio3: gpio at 688 {
+			status = "okay";
+		};
 
 		spi at b00 {
 			status = "okay";
@@ -83,6 +83,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
@@ -90,11 +91,12 @@
 		};
 	};
 
-        gpio-leds {
-                compatible = "gpio-leds";
-                power {
-                        label = "nexx:blue:power";
-                        gpios = <&gpio3 0 0>;
-                };
-        };
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power {
+			label = "nexx:blue:power";
+			gpios = <&gpio3 0 0>;
+		};
+	};
 };
diff --git a/target/linux/ramips/dts/WZR-AGL300NH.dts b/target/linux/ramips/dts/WZR-AGL300NH.dts
index 8e18e90..5d6c25d 100644
--- a/target/linux/ramips/dts/WZR-AGL300NH.dts
+++ b/target/linux/ramips/dts/WZR-AGL300NH.dts
@@ -26,7 +26,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -37,16 +36,19 @@
 			reg = <0x0 0x30000>;
 			read-only;
 		};
+
 		partition at 30000 {
 			label = "uboot-env";
 			reg = <0x30000 0x10000>;
 			read-only;
 		};
+
 		factory: partition at 40000 {
 			label = "factory";
 			reg = <0x40000 0x10000>;
 			read-only;
 		};
+
 		partition at 50000 {
 			label = "firmware";
 			reg = <0x50000 0x3b0000>;
@@ -57,12 +59,13 @@
 		status = "okay";
 		mtd-mac-address = <&factory 0x4>;
 
-                port at 0 {
+		port at 0 {
 			ralink,fixed-link = <1000 1 1 1>;
 		};
 
 		mdio-bus {
 			status = "okay";
+
 			phy0: ethernet-phy at 0 {
 				phy-mode = "mii";
 				reg = <0>;
@@ -85,16 +88,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <100>;
+
 		wps {
 			label = "wps";
 			gpios = <&gpio0 0 1>;
 			linux,code = <0x211>;
 		};
+
 		router {
 			label = "router_switch";
 			gpios = <&gpio0 7 0>;
 			linux,code = <0x100>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 9 1>;
@@ -109,14 +115,17 @@
 			label = "buffalo:green:router";
 			gpios = <&gpio0 8 1>;
 		};
+
 		diag {
 			label = "buffalo:red:diag";
 			gpios = <&gpio0 12 1>;
 		};
+
 		security_g {
 			label = "buffalo:orange:security_g";
 			gpios = <&gpio0 11 1>;
 		};
+
 		security_n {
 			label = "buffalo:orange:security_n";
 			gpios = <&gpio0 13 1>;
@@ -129,7 +138,6 @@
 		reg = <0x00440000 0x20000>;
 		#address-cells = <1>;
 		#size-cells = <1>;
-
 		status = "ok";
 	};
 };
diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/X5.dts
index a19bf4d..dfaef3b 100644
--- a/target/linux/ramips/dts/X5.dts
+++ b/target/linux/ramips/dts/X5.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -63,18 +64,22 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "x5:green:power";
 			gpios = <&gpio0 13 1>;
 		};
+
 		20 {
 			label = "x5:green:20";
 			gpios = <&gpio0 12 1>;
 		};
+
 		50 {
 			label = "x5:green:50";
 			gpios = <&gpio0 11 1>;
 		};
+
 		80 {
 			label = "x5:green:80";
 			gpios = <&gpio0 7 1>;
@@ -86,16 +91,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		bat {
 			label = "bat";
 			gpios = <&gpio0 9 1>;
 			linux,code = <0x211>;
 		};
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
 			linux,code = <0x198>;
 		};
+
 		mode {
 			label = "mode";
 			gpios = <&gpio0 14 1>;
@@ -107,6 +115,7 @@
 	gpio_export {
 		compatible = "gpio-export";
 		#size-cells = <0>;
+
 		usb-mode {
 			gpio-export,name = "usb-mode";
 			gpio-export,output = <0>;
diff --git a/target/linux/ramips/dts/X8.dts b/target/linux/ramips/dts/X8.dts
index cadbc3a..9c1c046 100644
--- a/target/linux/ramips/dts/X8.dts
+++ b/target/linux/ramips/dts/X8.dts
@@ -9,6 +9,7 @@
 	palmbus at 10000000 {
 		spi at b00 {
 			status = "okay";
+
 			m25p80 at 0 {
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -63,6 +64,7 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "x8:green:power";
 			gpios = <&gpio0 13 1>;
@@ -74,6 +76,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/XDXRN502J.dts b/target/linux/ramips/dts/XDXRN502J.dts
index d7ca6cd..25d3613 100644
--- a/target/linux/ramips/dts/XDXRN502J.dts
+++ b/target/linux/ramips/dts/XDXRN502J.dts
@@ -18,7 +18,6 @@
 	cfi at 1f000000 {
 		compatible = "cfi-flash";
 		reg = <0x1f000000 0x800000>;
-
 		bank-width = <2>;
 		device-width = <2>;
 		#address-cells = <1>;
@@ -62,10 +61,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		wifi {
 			label = "xdxrn502j:green:wifi";
 			gpios = <&gpio0 7 1>;
 		};
+
 		power {
 			label = "xdxrn502j:green:power";
 			gpios = <&gpio0 9 1>;
@@ -77,6 +78,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 10 1>;
diff --git a/target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts b/target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts
index 2cc5548..c1acab4 100644
--- a/target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts
+++ b/target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts
@@ -140,6 +140,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio1 6 0>;
diff --git a/target/linux/ramips/dts/Y1.dts b/target/linux/ramips/dts/Y1.dts
index 0b7b082..783cdaa 100644
--- a/target/linux/ramips/dts/Y1.dts
+++ b/target/linux/ramips/dts/Y1.dts
@@ -12,29 +12,35 @@
 		mtd-mac-address = <&factory 0x4>;
 		ralink,port-map = "llllw";
 	};
-	
+
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power1 {
 			label = "lenovo:blue:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wlan1 {
 			label = "lenovo:blue:wifi";
 			gpios = <&gpio3 0 1>;
 		};
+
 		wlan2 {
 			label = "lenovo:blue:wifi5g";
 			gpios = <&gpio2 10 1>;
 		};
+
 		usb {
 			label = "lenovo:blue:usb";
 			gpios = <&gpio2 12 1>;
 		};
+
 		lan {
 			label = "lenovo:blue:lan";
 			gpios = <&gpio2 15 1>;
 		};
+
 		internet {
 			label = "lenovo:blue:internet";
 			gpios = <&gpio2 11 1>;
diff --git a/target/linux/ramips/dts/Y1.dtsi b/target/linux/ramips/dts/Y1.dtsi
index 0f31af2..62e37fc 100644
--- a/target/linux/ramips/dts/Y1.dtsi
+++ b/target/linux/ramips/dts/Y1.dtsi
@@ -86,6 +86,7 @@
 				ralink,group = "uartf", "wled", "nd_sd";
 				ralink,function = "gpio";
 			};
+
 			pa {
 				ralink,group = "pa";
 				ralink,function = "pa";
@@ -98,6 +99,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 11 1>;
diff --git a/target/linux/ramips/dts/Y1S.dts b/target/linux/ramips/dts/Y1S.dts
index 9ecac37..b8c6ad0 100644
--- a/target/linux/ramips/dts/Y1S.dts
+++ b/target/linux/ramips/dts/Y1S.dts
@@ -11,7 +11,6 @@
 		mtd-mac-address = <&factory 0x4>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
-
 		ralink,port-map = "wllll";
 
 		port at 4 {
@@ -47,30 +46,37 @@
 	
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power1 {
 			label = "lenovo:yellow:power";
 			gpios = <&gpio0 14 1>;
 		};
+
 		power2 {
 			label = "lenovo:blue:power";
 			gpios = <&gpio0 9 1>;
 		};
+
 		wlan1 {
 			label = "lenovo:yellow:wifi";
 			gpios = <&gpio3 0 1>;
 		};
+
 		wlan2 {
 			label = "lenovo:blue:wifi";
 			gpios = <&gpio2 10 1>;
 		};
+
 		usb1 {
 			label = "lenovo:yellow:usb";
 			gpios = <&gpio2 13 1>;
 		};
+
 		usb2 {
 			label = "lenovo:blue:usb";
 			gpios = <&gpio2 12 1>;
 		};
+
 		internet {
 			label = "lenovo:blue:internet";
 			gpios = <&gpio2 11 1>;
diff --git a/target/linux/ramips/dts/ZBT-WA05.dts b/target/linux/ramips/dts/ZBT-WA05.dts
index 13c78c7..69060a3 100644
--- a/target/linux/ramips/dts/ZBT-WA05.dts
+++ b/target/linux/ramips/dts/ZBT-WA05.dts
@@ -88,14 +88,17 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		power {
 			label = "zbtlink:blue:power";
 			gpios = <&gpio1 14 1>;
 		};
+
 		usb {
 			label = "zbtlink:blue:usb";
 			gpios = <&gpio1 15 0>;
 		};
+
 		air {
 			label = "zbtlink:blue:air";
 			gpios = <&gpio3 0 1>;
@@ -107,6 +110,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio0 1 1>;
diff --git a/target/linux/ramips/dts/ZTE-Q7.dts b/target/linux/ramips/dts/ZTE-Q7.dts
index 9efc35e..62af06a 100644
--- a/target/linux/ramips/dts/ZTE-Q7.dts
+++ b/target/linux/ramips/dts/ZTE-Q7.dts
@@ -7,7 +7,6 @@
 	model = "ZTE Q7";
 
 	palmbus at 10000000 {
-
 		gpio0: gpio at 600 {
 			status = "okay";
 		};
@@ -87,10 +86,12 @@
 
 	gpio-leds {
 		compatible = "gpio-leds";
+
 		statred {
 			label = "zte:red:status";
 			gpios = <&gpio0 13 1>;
 		};
+
 		statblue {
 			label = "zte:blue:status";
 			gpios = <&gpio0 9 1>;
@@ -102,6 +103,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		poll-interval = <20>;
+
 		reset {
 			label = "reset";
 			gpios = <&gpio1 2 1>;
diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi
index c21ae0f..80e8977 100644
--- a/target/linux/ramips/dts/mt7620a.dtsi
+++ b/target/linux/ramips/dts/mt7620a.dtsi
@@ -23,7 +23,7 @@
 	palmbus at 10000000 {
 		compatible = "palmbus";
 		reg = <0x10000000 0x200000>;
-                ranges = <0x0 0x10000000 0x1FFFFF>;
+		ranges = <0x0 0x10000000 0x1FFFFF>;
 
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -280,68 +280,80 @@
 		compatible = "ralink,rt2880-pinmux";
 		pinctrl-names = "default";
 		pinctrl-0 = <&state_default>;
+
 		state_default: pinctrl0 {
 		};
+
 		pcm_i2s_pins: pcm_i2s {
 			pcm_i2s {
 				ralink,group = "uartf";
 				ralink,function = "pcm i2s";
 			};
 		};
+
 		uartf_gpio_pins: uartf_gpio {
 			uartf_gpio {
 				ralink,group = "uartf";
 				ralink,function = "gpio uartf";
 			};
 		};
+
 		spi_pins: spi {
 			spi {
 				ralink,group = "spi";
 				ralink,function = "spi";
 			};
 		};
+
 		i2c_pins: i2c {
 			i2c {
 				ralink,group = "i2c";
 				ralink,function = "i2c";
 			};
 		};
+
 		uartlite_pins: uartlite {
 			uart {
 				ralink,group = "uartlite";
 				ralink,function = "uartlite";
 			};
 		};
+
 		mdio_pins: mdio {
 			mdio {
 				ralink,group = "mdio";
 				ralink,function = "mdio";
 			};
 		};
+
 		ephy_pins: ephy {
 			ephy {
 				ralink,group = "ephy";
 				ralink,function = "ephy";
 			};
 		};
+
 		wled_pins: wled {
 			wled {
 				ralink,group = "wled";
 				ralink,function = "wled";
 			};
 		};
+
 		rgmii1_pins: rgmii1 {
 			rgmii1 {
 				ralink,group = "rgmii1";
 				ralink,function = "rgmii1";
 			};
 		};
+
 		rgmii2_pins: rgmii2 {
 			rgmii2 {
 				ralink,group = "rgmii2";
 				ralink,function = "rgmii2";
 			};
 		};
+
 		pcie_pins: pcie {
 			pcie {
 				ralink,group = "pcie";
diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi
index 83ab03a..e886c6f 100644
--- a/target/linux/ramips/dts/mt7620n.dtsi
+++ b/target/linux/ramips/dts/mt7620n.dtsi
@@ -23,7 +23,7 @@
 	palmbus at 10000000 {
 		compatible = "palmbus";
 		reg = <0x10000000 0x200000>;
-                ranges = <0x0 0x10000000 0x1FFFFF>;
+		ranges = <0x0 0x10000000 0x1FFFFF>;
 
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -202,14 +202,17 @@
 		compatible = "ralink,rt2880-pinmux";
 		pinctrl-names = "default";
 		pinctrl-0 = <&state_default>;
+
 		state_default: pinctrl0 {
 		};
+
 		spi_pins: spi {
 			spi {
 				ralink,group = "spi";
 				ralink,function = "spi";
 			};
 		};
+
 		uartlite_pins: uartlite {
 			uart {
 				ralink,group = "uartlite";
diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi
index 53b215f..e111c2b 100644
--- a/target/linux/ramips/dts/mt7621.dtsi
+++ b/target/linux/ramips/dts/mt7621.dtsi
@@ -23,7 +23,7 @@
 	palmbus at 1E000000 {
 		compatible = "palmbus";
 		reg = <0x1E000000 0x100000>;
-                ranges = <0x0 0x1E000000 0x0FFFFF>;
+		ranges = <0x0 0x1E000000 0x0FFFFF>;
 
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -113,72 +113,85 @@
 		compatible = "ralink,rt2880-pinmux";
 		pinctrl-names = "default";
 		pinctrl-0 = <&state_default>;
+
 		state_default: pinctrl0 {
 		};
+
 		spi_pins: spi {
 			spi {
 				ralink,group = "spi";
 				ralink,function = "spi";
 			};
 		};
+
 		i2c_pins: i2c {
 			i2c {
 				ralink,group = "i2c";
 				ralink,function = "i2c";
 			};
 		};
+
 		uart1_pins: uart1 {
 			uart1 {
 				ralink,group = "uart1";
 				ralink,function = "uart";
 			};
 		};
+
 		uart2_pins: uart2 {
 			uart2 {
 				ralink,group = "uart2";
 				ralink,function = "uart";
 			};
 		};
+
 		uart3_pins: uart3 {
 			uart3 {
 				ralink,group = "uart3";
 				ralink,function = "uart";
 			};
 		};
+
 		rgmii1_pins: rgmii1 {
 			rgmii1 {
 				ralink,group = "rgmii1";
 				ralink,function = "rgmii";
 			};
 		};
+
 		rgmii2_pins: rgmii2 {
 			rgmii2 {
 				ralink,group = "rgmii2";
 				ralink,function = "rgmii";
 			};
 		};
+
 		mdio_pins: mdio {
 			mdio {
 				ralink,group = "mdio";
 				ralink,function = "mdio";
 			};
 		};
+
 		pcie_pins: pcie {
 			pcie {
 				ralink,group = "pcie";
 				ralink,function = "pcie rst";
 			};
 		};
+
 		nand_pins: nand {
 			spi-nand {
 				ralink,group = "spi";
 				ralink,function = "nand";
 			};
+
 			sdhci-nand {
 				ralink,group = "sdhci";
 				ralink,function = "nand";
 			};
 		};
+
 		sdhci_pins: sdhci {
 			sdhci {
 				ralink,group = "sdhci";
@@ -233,14 +246,17 @@
 			label = "uboot";
 			reg = <0x00000 0x80000>; /* 64 KB */
 		};
+
 		partition at 80000 {
 			label = "uboot_env";
 			reg = <0x80000 0x80000>; /* 64 KB */
 		};
+
 		partition at 100000 {
 			label = "factory";
 			reg = <0x100000 0x40000>;
 		};
+
 		partition at 140000 {
 			label = "rootfs";
 			reg = <0x140000 0xec0000>;
@@ -275,7 +291,7 @@
 		compatible = "ralink,mt7620a-gsw";
 		reg = <0x1e110000 8000>;
 		interrupt-parent = <&gic>;
-		interrupts = <23>; 
+		interrupts = <23>;
 	};
 
 	pcie at 1e140000 {
diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi
index 754e04f..02f9df3 100644
--- a/target/linux/ramips/dts/mt7628an.dtsi
+++ b/target/linux/ramips/dts/mt7628an.dtsi
@@ -23,7 +23,7 @@
 	palmbus at 10000000 {
 		compatible = "palmbus";
 		reg = <0x10000000 0x200000>;
-                ranges = <0x0 0x10000000 0x1FFFFF>;
+		ranges = <0x0 0x10000000 0x1FFFFF>;
 
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -181,32 +181,38 @@
 		compatible = "ralink,rt2880-pinmux";
 		pinctrl-names = "default";
 		pinctrl-0 = <&state_default>;
+
 		state_default: pinctrl0 {
 		};
+
 		spi_pins: spi {
 			spi {
 				ralink,group = "spi";
 				ralink,function = "spi";
 			};
 		};
+
 		uart0_pins: uartlite {
 			uartlite {
 				ralink,group = "uart0";
 				ralink,function = "uart0";
 			};
 		};
+
 		uart1_pins: uart1 {
 			uart1 {
 				ralink,group = "uart1";
 				ralink,function = "uart1";
 			};
 		};
+
 		uart2_pins: uart2 {
 			uart2 {
 				ralink,group = "uart2";
 				ralink,function = "uart2";
 			};
 		};
+
 		sdxc_pins: sdxc {
 			sdxc {
 				ralink,group = "sdmode";
@@ -318,5 +324,4 @@
 			device_type = "pci";
 		};
 	};
-
 };
diff --git a/target/linux/ramips/dts/rt2880.dtsi b/target/linux/ramips/dts/rt2880.dtsi
index feabe42..c6dfe9a 100644
--- a/target/linux/ramips/dts/rt2880.dtsi
+++ b/target/linux/ramips/dts/rt2880.dtsi
@@ -23,7 +23,7 @@
 	palmbus at 300000 {
 		compatible = "palmbus";
 		reg = <0x300000 0x200000>;
-                ranges = <0x0 0x300000 0x1FFFFF>;
+		ranges = <0x0 0x300000 0x1FFFFF>;
 
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -191,5 +191,4 @@
 
 		ralink,eeprom = "soc_wmac.eeprom";
 	};
-
 };
diff --git a/target/linux/ramips/dts/rt3050.dtsi b/target/linux/ramips/dts/rt3050.dtsi
index e15a1cf..27e4179 100644
--- a/target/linux/ramips/dts/rt3050.dtsi
+++ b/target/linux/ramips/dts/rt3050.dtsi
@@ -175,7 +175,6 @@
 			pinctrl-names = "default";
 			pinctrl-0 = <&uartlite_pins>;
 		};
-
 	};
 
 	pinctrl {
@@ -197,6 +196,7 @@
 				ralink,function = "spi";
 			};
 		};
+
 		uartlite_pins: uartlite {
 			uart {
 				ralink,group = "uartlite";
diff --git a/target/linux/ramips/dts/rt3352.dtsi b/target/linux/ramips/dts/rt3352.dtsi
index 7dffddb..009277f 100644
--- a/target/linux/ramips/dts/rt3352.dtsi
+++ b/target/linux/ramips/dts/rt3352.dtsi
@@ -187,6 +187,7 @@
 				ralink,function = "spi";
 			};
 		};
+
 		uartlite_pins: uartlite {
 			uart {
 				ralink,group = "uartlite";
diff --git a/target/linux/ramips/dts/rt3883.dtsi b/target/linux/ramips/dts/rt3883.dtsi
index 0c6cedd..dc26782 100644
--- a/target/linux/ramips/dts/rt3883.dtsi
+++ b/target/linux/ramips/dts/rt3883.dtsi
@@ -201,6 +201,7 @@
 
 		pinctrl-names = "default";
 		pinctrl-0 = <&state_default>;
+
 		state_default: pinctrl0 {
 		};
 
diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi
index 456a937..5282e5b 100644
--- a/target/linux/ramips/dts/rt5350.dtsi
+++ b/target/linux/ramips/dts/rt5350.dtsi
@@ -206,30 +206,35 @@
 				ralink,function = "spi";
 			};
 		};
+
 		i2c_pins: i2c {
 			i2c {
 				ralink,group = "i2c";
 				ralink,function = "i2c";
 			};
 		};
+
 		phy_led_pins: phy_led {
 			phy_led {
 				ralink,group = "led";
 				ralink,function = "led";
 			};
 		};
+
 		uartlite_pins: uartlite {
 			uart {
 				ralink,group = "uartlite";
 				ralink,function = "uartlite";
 			};
 		};
+
 		uartf_pins: uartf {
 			uartf {
 				ralink,group = "uartf";
 				ralink,function = "uartf";
 			};
 		};
+
 		spi_cs1: spi1 {
 			spi1 {
 				ralink,group = "spi_cs1";
-- 
2.4.6

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:03 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:03 +0200
Subject: [OpenWrt-Devel] [PATCH v2 02/25] ramips: fix Zbtlink ZBT-WR8305RT
	board name
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-3-git-send-email-pepe2k@gmail.com>

There is another Zbtlink board (ZBT-WA05) supported in ramips target, so use the same naming scheme for ZBT-WR8305RT board and its dts file.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   8 +-
 .../linux/ramips/base-files/etc/board.d/02_network |   2 +-
 target/linux/ramips/base-files/etc/diag.sh         |   4 +-
 target/linux/ramips/base-files/lib/ramips.sh       |   4 +-
 .../ramips/base-files/lib/upgrade/platform.sh      |   2 +-
 target/linux/ramips/dts/WR8305RT.dts               | 117 ---------------------
 target/linux/ramips/dts/ZBT-WR8305RT.dts           | 117 +++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |   4 +-
 8 files changed, 129 insertions(+), 129 deletions(-)
 delete mode 100644 target/linux/ramips/dts/WR8305RT.dts
 create mode 100644 target/linux/ramips/dts/ZBT-WR8305RT.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index c6bfd7e..bb990c9 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -245,10 +245,10 @@ case $board in
 		ucidef_set_led_default "power" "power" "oy:green:power" "1"
 		set_wifi_led "oy:green:wifi"
 		;;
-	wr8305rt)
-		ucidef_set_led_default "power" "power" "wr8305rt:sys" "1"
-		set_usb_led "wr8305rt:usb"
-		set_wifi_led "wr8305rt:wifi"
+	zbt-wr8305rt)
+		ucidef_set_led_default "power" "power" "zbt-wr8305rt:sys" "1"
+		set_usb_led "zbt-wr8305rt:usb"
+		set_wifi_led "zbt-wr8305rt:wifi"
 		;;
 	wt1520)
 		set_wifi_led "rt2800pci-phy0::radio"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index da1854a..42447d4 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -228,7 +228,7 @@ ramips_setup_interfaces()
 		ucidef_add_switch_vlan "switch0" "2" "6t"
 		;;
 
-	wr8305rt)
+	zbt-wr8305rt)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
 		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 6t"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index e63f0df..019bbbb 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -196,8 +196,8 @@ get_status_led() {
 	wr512-3gn)
 		status_led="wr512:green:wps"
 		;;
-	wr8305rt)
-		status_led="wr8305rt:sys"
+	zbt-wr8305rt)
+		status_led="zbt-wr8305rt:sys"
 		;;
 	whr-300hp2 | \
 	whr-600d | \
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 7db6d37..436ed09 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -406,8 +406,8 @@ ramips_board_detect() {
 	*"OY-0001")
 		name="oy-0001"
 		;;
-	*"ZBT WR8305RT")
-		name="wr8305rt"
+	*"Zbtlink ZBT-WR8305RT")
+		name="zbt-wr8305rt"
 		;;
 	*"ZTE Q7")
 		name="zte-q7"
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 8221997..1021123 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -116,7 +116,7 @@ platform_check_image() {
 	wnce2001 | \
 	wr512-3gn |\
 	wr6202 |\
-	wr8305rt |\
+	zbt-wr8305rt |\
 	wrtnode |\
 	oy-0001 |\
 	wt1520 |\
diff --git a/target/linux/ramips/dts/WR8305RT.dts b/target/linux/ramips/dts/WR8305RT.dts
deleted file mode 100644
index 1f3c345..0000000
--- a/target/linux/ramips/dts/WR8305RT.dts
+++ /dev/null
@@ -1,117 +0,0 @@
-/dts-v1/;
-
-/include/ "mt7620n.dtsi"
-
-/ {
-	compatible = "wr8305rt", "ralink,mt7620n-soc";
-	model = "ZBT WR8305RT";
-
-	palmbus at 10000000 {
-		gpio1: gpio at 638 {
-			status = "okay";
-		};
-
-		gpio3: gpio at 688 {
-			status = "okay";
-		};
-
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "mx25l6405d";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "en25q64";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-					read-only;
-				};
-
-				partition at 30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "factory";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x7b0000>;
-				};
-			};
-		};
-	};
-
-	ehci at 101c0000 {
-		status = "okay";
-	};
-
-	ohci at 101c1000 {
-		status = "okay";
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-		ralink,port-map = "llllw";
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			ephy {
-				ralink,group = "ephy";
-				ralink,function = "ephy";
-			};
-
-			default {
-				ralink,group = "i2c", "uartf", "spi refclk", "wled";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		sys {
-			label = "wr8305rt:sys";
-			gpios = <&gpio1 14 1>;
-		};
-
-		lan {
-			label = "wr8305rt:usb";
-			gpios = <&gpio1 15 1>;
-		};
-
-		wifi {
-			label = "wr8305rt:wifi";
-			gpios = <&gpio3 0 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 1 1>;
-			linux,code = <0x198>;
-		};
-	};
-};
diff --git a/target/linux/ramips/dts/ZBT-WR8305RT.dts b/target/linux/ramips/dts/ZBT-WR8305RT.dts
new file mode 100644
index 0000000..8c56c15
--- /dev/null
+++ b/target/linux/ramips/dts/ZBT-WR8305RT.dts
@@ -0,0 +1,117 @@
+/dts-v1/;
+
+/include/ "mt7620n.dtsi"
+
+/ {
+	compatible = "zbtlink,zbt-wr8305rt", "ralink,mt7620n-soc";
+	model = "Zbtlink ZBT-WR8305RT";
+
+	palmbus at 10000000 {
+		gpio1: gpio at 638 {
+			status = "okay";
+		};
+
+		gpio3: gpio at 688 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l6405d";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "en25q64";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x7b0000>;
+				};
+			};
+		};
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+		ralink,port-map = "llllw";
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			ephy {
+				ralink,group = "ephy";
+				ralink,function = "ephy";
+			};
+
+			default {
+				ralink,group = "i2c", "uartf", "spi refclk", "wled";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		sys {
+			label = "zbt-wr8305rt:sys";
+			gpios = <&gpio1 14 1>;
+		};
+
+		lan {
+			label = "zbt-wr8305rt:usb";
+			gpios = <&gpio1 15 1>;
+		};
+
+		wifi {
+			label = "zbt-wr8305rt:wifi";
+			gpios = <&gpio3 0 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 1 1>;
+			linux,code = <0x198>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 409ff26..6071ae7 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -876,12 +876,12 @@ Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW2
 Image/Build/Profile/MLWG2=$(call BuildFirmware/Default16M/$(1),$(1),mlwg2,MLWG2)
 Image/Build/Profile/WMR300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR300)
 Image/Build/Profile/RT-N14U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n14u,RT-N14U)
-Image/Build/Profile/WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),wr8305rt,WR8305RT)
 Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WRTNODE)
 Image/Build/Profile/WT3020=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt3020,WT3020)
 Image/Build/Profile/XIAOMI-MIWIFI-MINI=$(call BuildFirmware/Default16M/$(1),$(1),xiaomi-miwifi-mini,XIAOMI-MIWIFI-MINI)
 Image/Build/Profile/ZTE-Q7=$(call BuildFirmware/Default8M/$(1),$(1),zte-q7,ZTE-Q7)
 Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05)
+Image/Build/Profile/ZBT-WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wr8305rt,ZBT-WR8305RT)
 Image/Build/Profile/ArcherC20i=$(call BuildFirmware/Tplink/$(1),$(1),ArcherC20i,ArcherC20i)
 microwrt_mtd_size=16515072
 Image/Build/Profile/MicroWRT=$(call BuildFirmware/CustomFlash/$(1),$(1),microwrt,MicroWRT,$(microwrt_mtd_size))
@@ -910,12 +910,12 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/MLWG2,$(1))
 	$(call Image/Build/Profile/WMR300,$(1))
 	$(call Image/Build/Profile/RT-N14U,$(1))
-	$(call Image/Build/Profile/WR8305RT,$(1))
 	$(call Image/Build/Profile/WRTNODE,$(1))
 	$(call Image/Build/Profile/WT3020,$(1))
 	$(call Image/Build/Profile/XIAOMI-MIWIFI-MINI,$(1))
 	$(call Image/Build/Profile/ZTE-Q7,$(1))
 	$(call Image/Build/Profile/ZBT-WA05,$(1))
+	$(call Image/Build/Profile/ZBT-WR8305RT,$(1))
 	$(call Image/Build/Profile/ArcherC20i,$(1))
 	$(call Image/Build/Profile/MicroWRT,$(1))
 endef
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:04 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:04 +0200
Subject: [OpenWrt-Devel] [PATCH v2 03/25] ramips: fix Asus WL-330N{,
	3G} boards names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-4-git-send-email-pepe2k@gmail.com>

There are other Asus boards supported in ramips target, so use the same naming scheme for WL-330N{,3G} boards and their dts files.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/dts/WL-330N.dts   | 100 +++++++++++++++++++++++++++++++
 target/linux/ramips/dts/WL-330N3G.dts | 109 ++++++++++++++++++++++++++++++++++
 target/linux/ramips/dts/WL_330N.dts   | 100 -------------------------------
 target/linux/ramips/dts/WL_330N3G.dts | 109 ----------------------------------
 target/linux/ramips/image/Makefile    |   8 +--
 5 files changed, 213 insertions(+), 213 deletions(-)
 create mode 100644 target/linux/ramips/dts/WL-330N.dts
 create mode 100644 target/linux/ramips/dts/WL-330N3G.dts
 delete mode 100644 target/linux/ramips/dts/WL_330N.dts
 delete mode 100644 target/linux/ramips/dts/WL_330N3G.dts

diff --git a/target/linux/ramips/dts/WL-330N.dts b/target/linux/ramips/dts/WL-330N.dts
new file mode 100644
index 0000000..0e7c027
--- /dev/null
+++ b/target/linux/ramips/dts/WL-330N.dts
@@ -0,0 +1,100 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+	compatible = "WL-330N", "ralink,rt3050-soc";
+	model = "Asus WL-330N";
+
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l3205d";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l3205d";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x3b0000>;
+				};
+			};
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x3e>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		link {
+			label = "asus:blue:link";
+			gpios = <&gpio0 9 1>;
+		};
+
+		power {
+			label = "asus:blue:power";
+			gpios = <&gpio0 11 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x198>;
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/WL-330N3G.dts b/target/linux/ramips/dts/WL-330N3G.dts
new file mode 100644
index 0000000..12a24b5
--- /dev/null
+++ b/target/linux/ramips/dts/WL-330N3G.dts
@@ -0,0 +1,109 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+	compatible = "WL-330N3G", "ralink,rt3050-soc";
+	model = "Asus WL-330N3G";
+
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l3205d";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l3205d";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x3b0000>;
+				};
+			};
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x3e>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		3g {
+			label = "asus:blue:3g";
+			gpios = <&gpio0 9 1>;
+		};
+
+		3g2 {
+			label = "asus:red:3g";
+			gpios = <&gpio0 13 1>;
+		};
+
+		power {
+			label = "asus:blue:power";
+			gpios = <&gpio0 11 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x198>;
+		};
+	};
+
+	otg at 101c0000 {
+		status = "okay";
+	};
+};
diff --git a/target/linux/ramips/dts/WL_330N.dts b/target/linux/ramips/dts/WL_330N.dts
deleted file mode 100644
index 14c78db..0000000
--- a/target/linux/ramips/dts/WL_330N.dts
+++ /dev/null
@@ -1,100 +0,0 @@
-/dts-v1/;
-
-/include/ "rt3050.dtsi"
-
-/ {
-	compatible = "WL_330N", "ralink,rt3050-soc";
-	model = "Asus WL-330N";
-
-	palmbus at 10000000 {
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "mx25l3205d";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "mx25l3205d";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-					read-only;
-				};
-
-				partition at 30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "factory";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x3b0000>;
-				};
-			};
-		};
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x3e>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		link {
-			label = "asus:blue:link";
-			gpios = <&gpio0 9 1>;
-		};
-
-		power {
-			label = "asus:blue:power";
-			gpios = <&gpio0 11 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 10 1>;
-			linux,code = <0x198>;
-		};
-
-		wps {
-			label = "wps";
-			gpios = <&gpio0 0 1>;
-			linux,code = <0x198>;
-		};
-	};
-};
diff --git a/target/linux/ramips/dts/WL_330N3G.dts b/target/linux/ramips/dts/WL_330N3G.dts
deleted file mode 100644
index aa4c547..0000000
--- a/target/linux/ramips/dts/WL_330N3G.dts
+++ /dev/null
@@ -1,109 +0,0 @@
-/dts-v1/;
-
-/include/ "rt3050.dtsi"
-
-/ {
-	compatible = "WL_330N3G", "ralink,rt3050-soc";
-	model = "Asus WL-330N3G";
-
-	palmbus at 10000000 {
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "mx25l3205d";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "mx25l3205d";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-					read-only;
-				};
-
-				partition at 30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "factory";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x3b0000>;
-				};
-			};
-		};
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x3e>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		3g {
-			label = "asus:blue:3g";
-			gpios = <&gpio0 9 1>;
-		};
-
-		3g2 {
-			label = "asus:red:3g";
-			gpios = <&gpio0 13 1>;
-		};
-
-		power {
-			label = "asus:blue:power";
-			gpios = <&gpio0 11 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 10 1>;
-			linux,code = <0x198>;
-		};
-
-		wps {
-			label = "wps";
-			gpios = <&gpio0 0 1>;
-			linux,code = <0x198>;
-		};
-	};
-
-	otg at 101c0000 {
-		status = "okay";
-	};
-};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 6071ae7..949c05e 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -631,9 +631,9 @@ Image/Build/Profile/WHRG300N=$(call BuildFirmware/WHRG300N/$(1),$(1))
 
 Image/Build/Profile/WIZARD8800=$(call BuildFirmware/Default8M/$(1),$(1),wizard-8800,WIZARD8800,Linux Kernel Image)
 
-Image/Build/Profile/WL_330N=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n,WL_330N)
+Image/Build/Profile/WL-330N=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n,WL-330N)
 
-Image/Build/Profile/WL_330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL_330N3G)
+Image/Build/Profile/WL-330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL-330N3G)
 
 kernel_size_wl341v3=917504
 rootfs_size_wl341v3=2949120
@@ -763,8 +763,8 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/WCR150GN,$(1))
 	$(call Image/Build/Profile/WHRG300N,$(1))
 	$(call Image/Build/Profile/WIZARD8800,$(1))
-	$(call Image/Build/Profile/WL_330N,$(1))
-	$(call Image/Build/Profile/WL_330N3G,$(1))
+	$(call Image/Build/Profile/WL-330N,$(1))
+	$(call Image/Build/Profile/WL-330N3G,$(1))
 	$(call Image/Build/Profile/WL341V3,$(1))
 	$(call Image/Build/Profile/WL-351,$(1))
 	$(call Image/Build/Profile/WNCE2001,$(1))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:05 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:05 +0200
Subject: [OpenWrt-Devel] [PATCH v2 04/25] ramips: fix Asus RP-N53 and Lenovo
	Y1{, S} image names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-5-git-send-email-pepe2k@gmail.com>

This patch:
 * fixes typo (rp_n53 -> rp-n53) in Asus RP-N53 image name
 * removes manufacturer from image names for Lenovo Y1{,S} devices

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/image/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 949c05e..79a97a5 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -857,7 +857,7 @@ Image/Build/Profile/MT7620a_MT7530=$(call BuildFirmware/Default8M/$(1),$(1),mt76
 Image/Build/Profile/MT7620a_V22SG=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_v22sg,MT7620a_V22SG)
 br100_mtd_size=8126464
 Image/Build/Profile/AIBR100=$(call BuildFirmware/CustomFlash/$(1),$(1),ai-br100,AIBR100,$(br100_mtd_size),Ai-BR)
-Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp_n53,RP-N53)
+Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp-n53,RP-N53)
 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))
@@ -870,8 +870,8 @@ na930_mtd_size=20971520
 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
 Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
 Image/Build/Profile/OY-0001=$(call BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001)
-Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1,Y1)
-Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1s,Y1S)
+Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),y1,Y1)
+Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),y1s,Y1S)
 Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW221)
 Image/Build/Profile/MLWG2=$(call BuildFirmware/Default16M/$(1),$(1),mlwg2,MLWG2)
 Image/Build/Profile/WMR300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR300)
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:06 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:06 +0200
Subject: [OpenWrt-Devel] [PATCH v2 05/25] ramips: fix Xiaomi MiWiFi Mini
	board, image and profile names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-6-git-send-email-pepe2k@gmail.com>

The following patch:
 * changes board name from "xiaomi-miwifi-mini" to "miwifi-mini"
 * changes filenames of dts and profile
 * fixes LED names in dts file and base-files scripts
 * removes manufacturer name from image filename

for Xiaomi MiWiFi Mini device.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   4 +-
 .../linux/ramips/base-files/etc/board.d/02_network |   2 +-
 target/linux/ramips/base-files/etc/diag.sh         |   4 +-
 target/linux/ramips/base-files/lib/ramips.sh       |   2 +-
 .../ramips/base-files/lib/upgrade/platform.sh      |   2 +-
 target/linux/ramips/dts/MIWIFI-MINI.dts            | 150 +++++++++++++++++++++
 target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts     | 150 ---------------------
 target/linux/ramips/image/Makefile                 |   4 +-
 .../ramips/mt7620/profiles/xiaomi-miwifi-mini.mk   |  18 ---
 target/linux/ramips/mt7620/profiles/xiaomi.mk      |  18 +++
 10 files changed, 177 insertions(+), 177 deletions(-)
 create mode 100644 target/linux/ramips/dts/MIWIFI-MINI.dts
 delete mode 100644 target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts
 delete mode 100644 target/linux/ramips/mt7620/profiles/xiaomi-miwifi-mini.mk
 create mode 100644 target/linux/ramips/mt7620/profiles/xiaomi.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index bb990c9..7bd52e1 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -256,8 +256,8 @@ case $board in
 	wt3020)
 		ucidef_set_led_default "power" "power" "nexx:blue:power" "0"
 		;;
-	xiaomi-miwifi-mini)
-		ucidef_set_led_default "power" "power" "xiaomi:red:status" "1"
+	miwifi-mini)
+		ucidef_set_led_default "power" "power" "miwifi-mini:red:status" "1"
 		;;
 	y1 |\
 	y1s)
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 42447d4..44aebcf 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -144,7 +144,7 @@ ramips_setup_interfaces()
 	wsr-600 | \
 	wsr-1166 | \
 	wt1520 | \
-	xiaomi-miwifi-mini |\
+	miwifi-mini |\
 	y1)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 019bbbb..cb3d851 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -233,8 +233,8 @@ get_status_led() {
 	xdxrn502j)
 		status_led="xdxrn502j:green:power"
 		;;
-	xiaomi-mini)
-		status_led="xiaomi:red:status"
+	miwifi-mini)
+		status_led="miwifi-mini:red:status"
 		;;
 	f7c027)
 		status_led="belkin:orange:status"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 436ed09..fa90243 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -395,7 +395,7 @@ ramips_board_detect() {
 		name="ncs601w"
 		;;
 	*"Xiaomi MiWiFi Mini")
-		name="xiaomi-miwifi-mini"
+		name="miwifi-mini"
 		;;
 	*"Sercomm NA930")
 		name="na930"
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 1021123..f46155f 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -123,7 +123,7 @@ platform_check_image() {
 	wt3020 |\
 	x5 |\
 	x8 |\
-	xiaomi-miwifi-mini |\
+	miwifi-mini |\
 	y1 |\
 	y1s |\
 	zte-q7 |\
diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts b/target/linux/ramips/dts/MIWIFI-MINI.dts
new file mode 100644
index 0000000..fa9846c
--- /dev/null
+++ b/target/linux/ramips/dts/MIWIFI-MINI.dts
@@ -0,0 +1,150 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+	compatible = "xiaomi,miwifi-mini", "ralink,mt7620a-soc";
+	model = "Xiaomi MiWiFi Mini";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	palmbus at 10000000 {
+		gpio0: gpio at 600 {
+			status = "okay";
+		};
+
+		gpio1: gpio at 638 {
+			status = "okay";
+		};
+
+		gpio2: gpio at 660 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "w25q128";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "w25q128";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0xf80000>;
+				};
+
+				partition at fd0000 {
+					label = "crash";
+					reg = <0xfd0000 0x10000>;
+				};
+
+				partition at fe0000 {
+					label = "reserved";
+					reg = <0xfe0000 0x10000>;
+					read-only;
+				};
+
+				partition at ff0000 {
+					label = "Bdata";
+					reg = <0xff0000 0x10000>;
+				};
+			};
+		};
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	ethernet at 10100000 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&ephy_pins>;
+		mtd-mac-address = <&factory 0x4>;
+		ralink,port-map = "llllw";
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	pcie at 10140000 {
+		status = "okay";
+
+		pcie-bridge {
+			mt76 at 0,0 {
+				reg = <0x0000 0 0 0 0>;
+				device_type = "pci";
+				mediatek,mtd-eeprom = <&factory 0x8000>;
+				mediatek,2ghz = <0>;
+			};
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "rgmii1";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		blue {
+			label = "miwifi-mini:blue:status";
+			gpios = <&gpio1 0 1>;
+		};
+
+		yellow {
+			label = "miwifi-mini:yellow:status";
+			gpios = <&gpio1 2 1>;
+		};
+
+		red {
+			label = "miwifi-mini:red:status";
+			gpios = <&gpio1 5 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 6 0>;
+			linux,code = <0x198>;
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts b/target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts
deleted file mode 100644
index c1acab4..0000000
--- a/target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts
+++ /dev/null
@@ -1,150 +0,0 @@
-/dts-v1/;
-
-/include/ "mt7620a.dtsi"
-
-/ {
-	compatible = "XIAOMI MIWIFI MINI", "ralink,mt7620a-soc";
-	model = "Xiaomi MiWiFi Mini";
-
-	chosen {
-		bootargs = "console=ttyS0,115200";
-	};
-
-	palmbus at 10000000 {
-		gpio0: gpio at 600 {
-			status = "okay";
-		};
-
-		gpio1: gpio at 638 {
-			status = "okay";
-		};
-
-		gpio2: gpio at 660 {
-			status = "okay";
-		};
-
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "w25q128";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "w25q128";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-				};
-
-				partition at 30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "factory";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0xf80000>;
-				};
-
-				partition at fd0000 {
-					label = "crash";
-					reg = <0xfd0000 0x10000>;
-				};
-
-				partition at fe0000 {
-					label = "reserved";
-					reg = <0xfe0000 0x10000>;
-					read-only;
-				};
-
-				partition at ff0000 {
-					label = "Bdata";
-					reg = <0xff0000 0x10000>;
-				};
-			};
-		};
-	};
-
-	ehci at 101c0000 {
-		status = "okay";
-	};
-
-	ohci at 101c1000 {
-		status = "okay";
-	};
-
-	ethernet at 10100000 {
-		pinctrl-names = "default";
-		pinctrl-0 = <&ephy_pins>;
-		mtd-mac-address = <&factory 0x4>;
-		ralink,port-map = "llllw";
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	pcie at 10140000 {
-		status = "okay";
-
-		pcie-bridge {
-			mt76 at 0,0 {
-				reg = <0x0000 0 0 0 0>;
-				device_type = "pci";
-				mediatek,mtd-eeprom = <&factory 0x8000>;
-				mediatek,2ghz = <0>;
-			};
-		};
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "rgmii1";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		blue {
-			label = "xiaomi:blue:status";
-			gpios = <&gpio1 0 1>;
-		};
-
-		yellow {
-			label = "xiaomi:yellow:status";
-			gpios = <&gpio1 2 1>;
-		};
-
-		red {
-			label = "xiaomi:red:status";
-			gpios = <&gpio1 5 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio1 6 0>;
-			linux,code = <0x198>;
-		};
-	};
-};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 79a97a5..232742c 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -878,7 +878,7 @@ Image/Build/Profile/WMR300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR3
 Image/Build/Profile/RT-N14U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n14u,RT-N14U)
 Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WRTNODE)
 Image/Build/Profile/WT3020=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt3020,WT3020)
-Image/Build/Profile/XIAOMI-MIWIFI-MINI=$(call BuildFirmware/Default16M/$(1),$(1),xiaomi-miwifi-mini,XIAOMI-MIWIFI-MINI)
+Image/Build/Profile/MIWIFI-MINI=$(call BuildFirmware/Default16M/$(1),$(1),miwifi-mini,MIWIFI-MINI)
 Image/Build/Profile/ZTE-Q7=$(call BuildFirmware/Default8M/$(1),$(1),zte-q7,ZTE-Q7)
 Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05)
 Image/Build/Profile/ZBT-WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wr8305rt,ZBT-WR8305RT)
@@ -912,7 +912,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/RT-N14U,$(1))
 	$(call Image/Build/Profile/WRTNODE,$(1))
 	$(call Image/Build/Profile/WT3020,$(1))
-	$(call Image/Build/Profile/XIAOMI-MIWIFI-MINI,$(1))
+	$(call Image/Build/Profile/MIWIFI-MINI,$(1))
 	$(call Image/Build/Profile/ZTE-Q7,$(1))
 	$(call Image/Build/Profile/ZBT-WA05,$(1))
 	$(call Image/Build/Profile/ZBT-WR8305RT,$(1))
diff --git a/target/linux/ramips/mt7620/profiles/xiaomi-miwifi-mini.mk b/target/linux/ramips/mt7620/profiles/xiaomi-miwifi-mini.mk
deleted file mode 100644
index 47819b2..0000000
--- a/target/linux/ramips/mt7620/profiles/xiaomi-miwifi-mini.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/XIAOMI-MIWIFI-MINI
- NAME:=Xiaomi MiWiFi Mini
- PACKAGES:=\
-	kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \
-	kmod-mt76
-endef
-
-define Profile/XIAOMI-MIWIFI-MINI/Description
- Support for Xiaomi MiWiFi Mini routers
-endef
-$(eval $(call Profile,XIAOMI-MIWIFI-MINI))
diff --git a/target/linux/ramips/mt7620/profiles/xiaomi.mk b/target/linux/ramips/mt7620/profiles/xiaomi.mk
new file mode 100644
index 0000000..47f6d49
--- /dev/null
+++ b/target/linux/ramips/mt7620/profiles/xiaomi.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/MIWIFI-MINI
+ NAME:=Xiaomi MiWiFi Mini
+ PACKAGES:=\
+	kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \
+	kmod-mt76
+endef
+
+define Profile/MIWIFI-MINI/Description
+ Support for Xiaomi MiWiFi Mini routers
+endef
+$(eval $(call Profile,MIWIFI-MINI))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:07 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:07 +0200
Subject: [OpenWrt-Devel] [PATCH v2 06/25] ramips: fix UPVEL model names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-7-git-send-email-pepe2k@gmail.com>

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/lib/ramips.sh | 4 ++--
 target/linux/ramips/dts/UR-326N4G.dts        | 2 +-
 target/linux/ramips/dts/UR-336UN.dts         | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index fa90243..9e7f4e5 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -370,10 +370,10 @@ ramips_board_detect() {
 	*"WR512-3GN-like router")
 		name="wr512-3gn"
 		;;
-	*"UR-326N4G Wireless N router")
+	*"UPVEL UR-326N4G")
 		name="ur-326n4g"
 		;;
-	*"UR-336UN Wireless N router")
+	*"UPVEL UR-336UN")
 		name="ur-336un"
 		;;
 	*"AWB WR6202")
diff --git a/target/linux/ramips/dts/UR-326N4G.dts b/target/linux/ramips/dts/UR-326N4G.dts
index 6350bd7..92a7a57 100644
--- a/target/linux/ramips/dts/UR-326N4G.dts
+++ b/target/linux/ramips/dts/UR-326N4G.dts
@@ -4,7 +4,7 @@
 
 / {
 	compatible = "UR-326N4G", "ralink,rt3052-soc";
-	model = "UR-326N4G Wireless N router";
+	model = "UPVEL UR-326N4G";
 
 	pinctrl {
 		state_default: pinctrl0 {
diff --git a/target/linux/ramips/dts/UR-336UN.dts b/target/linux/ramips/dts/UR-336UN.dts
index 896b6e6..a6ef6cd 100644
--- a/target/linux/ramips/dts/UR-336UN.dts
+++ b/target/linux/ramips/dts/UR-336UN.dts
@@ -4,7 +4,7 @@
 
 / {
 	compatible = "UR-336UN", "ralink,rt3052-soc";
-	model = "UR-336UN Wireless N router";
+	model = "UPVEL UR-336UN";
 
 	pinctrl {
 		state_default: pinctrl0 {
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:08 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:08 +0200
Subject: [OpenWrt-Devel] [PATCH v2 07/25] ramips: fix Asus RT-N56U dts
	filename
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-8-git-send-email-pepe2k@gmail.com>

Other Asus RT-N dts files are named "RT-N..." (not "RTN..."), so use the same for RT-N56U.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/dts/RT-N56U.dts | 151 ++++++++++++++++++++++++++++++++++++
 target/linux/ramips/dts/RTN56U.dts  | 151 ------------------------------------
 target/linux/ramips/image/Makefile  |   4 +-
 3 files changed, 153 insertions(+), 153 deletions(-)
 create mode 100644 target/linux/ramips/dts/RT-N56U.dts
 delete mode 100644 target/linux/ramips/dts/RTN56U.dts

diff --git a/target/linux/ramips/dts/RT-N56U.dts b/target/linux/ramips/dts/RT-N56U.dts
new file mode 100644
index 0000000..3ecd1b7
--- /dev/null
+++ b/target/linux/ramips/dts/RT-N56U.dts
@@ -0,0 +1,151 @@
+/dts-v1/;
+
+/include/ "rt3883.dtsi"
+
+/ {
+	compatible = "RT-N56U", "ralink,rt3883-soc";
+	model = "Asus RT-N56U";
+
+	palmbus at 10000000 {
+		gpio1: gpio at 638 {
+			status = "okay";
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "spi", "i2c", "jtag", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+
+		port at 0 {
+			ralink,fixed-link = <1000 1 1 1>;
+		};
+	};
+
+	pci at 10140000 {
+		status = "okay";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pci_pins>;
+
+		pci_pins: pci {
+			pci {
+				ralink,group = "pci";
+				ralink,function = "pci-fnc";
+			};
+		};
+
+		host-bridge {
+			pci-bridge at 1 {
+				status = "okay";
+
+				wmac at 0,0 {
+					compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
+					reg = < 0x10000 0 0 0 0 >;
+					ralink,eeprom = "rt2x00pci_1_0.eeprom";
+				};
+			};
+		};
+	};
+
+	wmac at 10180000 {
+		status = "okay";
+		ralink,2ghz = <0>;
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	nor-flash at 1c000000 {
+		compatible = "cfi-flash";
+		reg = <0x1c000000 0x800000>;
+		bank-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			reg = <0x0 0x0030000>;
+			label = "u-boot";
+			read-only;
+		};
+
+		partition at 30000 {
+			reg = <0x00030000 0x00010000>;
+			label = "u-boot-env";
+			read-only;
+		};
+
+		factory: partition at 40000 {
+			reg = <0x00040000 0x00010000>;
+			label = "factory";
+			read-only;
+		};
+
+		partition at 50000 {
+			reg = <0x00050000 0x007b0000>;
+			label = "firmware";
+		};
+	};
+
+	rtl8367 {
+		compatible = "realtek,rtl8367";
+		gpio-sda = <&gpio0 1 0>;
+		gpio-sck = <&gpio0 2 0>;
+		realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <100>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 13 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio1 2 1>;
+			linux,code = <0x211>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power {
+			label = "asus:blue:power";
+			gpios = <&gpio0 0 1>;
+		};
+
+		lan {
+			label = "asus:blue:lan";
+			gpios = <&gpio0 19 1>;
+		};
+
+		wan {
+			label = "asus:blue:wan";
+			gpios = <&gpio1 3 1>;
+		};
+
+		usb {
+			label = "asus:blue:usb";
+			gpios = <&gpio1 0 1>;
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/RTN56U.dts b/target/linux/ramips/dts/RTN56U.dts
deleted file mode 100644
index 3ecd1b7..0000000
--- a/target/linux/ramips/dts/RTN56U.dts
+++ /dev/null
@@ -1,151 +0,0 @@
-/dts-v1/;
-
-/include/ "rt3883.dtsi"
-
-/ {
-	compatible = "RT-N56U", "ralink,rt3883-soc";
-	model = "Asus RT-N56U";
-
-	palmbus at 10000000 {
-		gpio1: gpio at 638 {
-			status = "okay";
-		};
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "spi", "i2c", "jtag", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-
-		port at 0 {
-			ralink,fixed-link = <1000 1 1 1>;
-		};
-	};
-
-	pci at 10140000 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&pci_pins>;
-
-		pci_pins: pci {
-			pci {
-				ralink,group = "pci";
-				ralink,function = "pci-fnc";
-			};
-		};
-
-		host-bridge {
-			pci-bridge at 1 {
-				status = "okay";
-
-				wmac at 0,0 {
-					compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
-					reg = < 0x10000 0 0 0 0 >;
-					ralink,eeprom = "rt2x00pci_1_0.eeprom";
-				};
-			};
-		};
-	};
-
-	wmac at 10180000 {
-		status = "okay";
-		ralink,2ghz = <0>;
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	ehci at 101c0000 {
-		status = "okay";
-	};
-
-	ohci at 101c1000 {
-		status = "okay";
-	};
-
-	nor-flash at 1c000000 {
-		compatible = "cfi-flash";
-		reg = <0x1c000000 0x800000>;
-		bank-width = <2>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		partition at 0 {
-			reg = <0x0 0x0030000>;
-			label = "u-boot";
-			read-only;
-		};
-
-		partition at 30000 {
-			reg = <0x00030000 0x00010000>;
-			label = "u-boot-env";
-			read-only;
-		};
-
-		factory: partition at 40000 {
-			reg = <0x00040000 0x00010000>;
-			label = "factory";
-			read-only;
-		};
-
-		partition at 50000 {
-			reg = <0x00050000 0x007b0000>;
-			label = "firmware";
-		};
-	};
-
-	rtl8367 {
-		compatible = "realtek,rtl8367";
-		gpio-sda = <&gpio0 1 0>;
-		gpio-sck = <&gpio0 2 0>;
-		realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <100>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 13 1>;
-			linux,code = <0x198>;
-		};
-
-		wps {
-			label = "wps";
-			gpios = <&gpio1 2 1>;
-			linux,code = <0x211>;
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		power {
-			label = "asus:blue:power";
-			gpios = <&gpio0 0 1>;
-		};
-
-		lan {
-			label = "asus:blue:lan";
-			gpios = <&gpio0 19 1>;
-		};
-
-		wan {
-			label = "asus:blue:wan";
-			gpios = <&gpio1 3 1>;
-		};
-
-		usb {
-			label = "asus:blue:usb";
-			gpios = <&gpio1 0 1>;
-		};
-	};
-};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 232742c..5e749e6 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -819,12 +819,12 @@ omniembhpm_mtd_size=16449536
 Image/Build/Profile/OMNIEMBHPM=$(call BuildFirmware/CustomFlash/$(1),$(1),omni-emb-hpm,OMNI-EMB-HPM,$(omniembhpm_mtd_size))
 
 define BuildFirmware/RTN56U/squashfs
-	$(call BuildFirmware/Default8M/$(1),$(1),rt-n56u,RTN56U)
+	$(call BuildFirmware/Default8M/$(1),$(1),rt-n56u,RT-N56U)
 	-mkrtn56uimg -s $(call sysupname,$(1),rt-n56u)
 	-cp $(call sysupname,$(1),rt-n56u) $(call imgname,$(1),rt-n56u)-factory.bin
 	-mkrtn56uimg -f $(call imgname,$(1),rt-n56u)-factory.bin
 endef
-Image/Build/Profile/RTN56U=$(call BuildFirmware/RTN56U/$(1),$(1),rt-n56u,RTN56U)
+Image/Build/Profile/RTN56U=$(call BuildFirmware/RTN56U/$(1),$(1),rt-n56u,RT-N56U)
 
 Image/Build/Profile/TEW691GR=$(call BuildFirmware/UMedia/$(1),$(1),tew-691gr,TEW-691GR,0x026910)
 
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:09 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:09 +0200
Subject: [OpenWrt-Devel] [PATCH v2 08/25] ramips: fix Belkin F7C027 image
	name
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-9-git-send-email-pepe2k@gmail.com>

This patch removes manufacturer from Belkin F7C027 image name ("belkinf7c027" -> "f7c027").

Signed-off-by: Piotr Dymacz <pepe2k at 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 5e749e6..c8c60b0 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -525,7 +525,7 @@ Image/Build/Profile/F5D8235V2=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235
 
 # 0x770000
 belkin_f7c027_mtd_size=7798784
-Image/Build/Profile/F7C027=$(call BuildFirmware/CustomFlash/$(1),$(1),belkinf7c027,F7C027,$(belkin_f7c027_mtd_size))
+Image/Build/Profile/F7C027=$(call BuildFirmware/CustomFlash/$(1),$(1),f7c027,F7C027,$(belkin_f7c027_mtd_size))
 
 Image/Build/Profile/FONERA20N=$(call BuildFirmware/Edimax/$(1),$(1),fonera20n,FONERA20N,$(ralink_default_fw_size_8M),RSDK,NL1T,0x50000,0xc0000)
 
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:10 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:10 +0200
Subject: [OpenWrt-Devel] [PATCH v2 09/25] ramips: fix Argus ATP-52B board
	and image names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-10-git-send-email-pepe2k@gmail.com>

The following patch:
 * changes board name from "argus-atp52b" to "atp-52b"
 * changes dts filename
 * fixes LED names in dts file and base-files scripts
 * removes manufacturer name from image filename

for Argus ATP-52B device.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 .../linux/ramips/base-files/etc/board.d/02_network |  2 +-
 target/linux/ramips/base-files/etc/diag.sh         |  4 +-
 target/linux/ramips/base-files/lib/ramips.sh       |  2 +-
 target/linux/ramips/dts/ARGUS_ATP52B.dts           | 96 ----------------------
 target/linux/ramips/dts/ATP-52B.dts                | 96 ++++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |  4 +-
 6 files changed, 102 insertions(+), 102 deletions(-)
 delete mode 100644 target/linux/ramips/dts/ARGUS_ATP52B.dts
 create mode 100644 target/linux/ramips/dts/ATP-52B.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 44aebcf..8f6c813 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -161,7 +161,7 @@ ramips_setup_interfaces()
 
 	awm002-evb | \
 	awm003-evb | \
-	argus-atp52b | \
+	atp-52b | \
 	dir-645 | \
 	dir-860l-b1 | \
 	f5d8235-v1 | \
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index cb3d851..f8b7e89 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -27,8 +27,8 @@ get_status_led() {
 	awapn2403)
 		status_led="asiarf:green:wps"
 		;;
-	argus-atp52b)
-		status_led="argus-atp52b:green:run"
+	atp-52b)
+		status_led="atp-52b:green:run"
 		;;
 	asl26555)
 		status_led="asl26555:green:power"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 9e7f4e5..d25fa3a 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -62,7 +62,7 @@ ramips_board_detect() {
 		name="c20i"
 		;;
 	*"Argus ATP-52B")
-		name="argus-atp52b"
+		name="atp-52b"
 		;;
 	*"AsiaRF AWM002 EVB")
 		name="awm002-evb"
diff --git a/target/linux/ramips/dts/ARGUS_ATP52B.dts b/target/linux/ramips/dts/ARGUS_ATP52B.dts
deleted file mode 100644
index f94d740..0000000
--- a/target/linux/ramips/dts/ARGUS_ATP52B.dts
+++ /dev/null
@@ -1,96 +0,0 @@
-/dts-v1/;
-
-/include/ "rt3050.dtsi"
-
-/ {
-	compatible = "ARGUS_ATP52B", "ralink,rt3052-soc";
-	model = "Argus ATP-52B";
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	cfi at 1f000000 {
-		compatible = "cfi-flash";
-		reg = <0x1f000000 0x800000>;
-		bank-width = <2>;
-		device-width = <2>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		partition at 0 {
-			label = "bootloader";
-			reg = <0x0 0x30000>;
-			read-only;
-		};
-
-		partition at 30000 {
-			label = "config";
-			reg = <0x30000 0x10000>;
-		};
-
-		factory: partition at 40000 {
-			label = "factory";
-			reg = <0x40000 0x10000>;
-		};
-
-		partition at 50000 {
-			label = "firmware";
-			reg = <0x50000 0x7a0000>;
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		run {
-			label = "argus-atp52b:green:run";
-			gpios = <&gpio0 9 1>;
-		};
-
-		net {
-			label = "argus-atp52b:amber:net";
-			gpios = <&gpio0 13 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		wps {
-			label = "wps";
-			gpios = <&gpio0 0 1>;
-			linux,code = <0x211>;
-		};
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 10 1>;
-			linux,code = <0x198>;
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x3e>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	otg at 101c0000 {
-		status = "okay";
-	};
-};
diff --git a/target/linux/ramips/dts/ATP-52B.dts b/target/linux/ramips/dts/ATP-52B.dts
new file mode 100644
index 0000000..c3f42bf
--- /dev/null
+++ b/target/linux/ramips/dts/ATP-52B.dts
@@ -0,0 +1,96 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+	compatible = "ATP-52B", "ralink,rt3052-soc";
+	model = "Argus ATP-52B";
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	cfi at 1f000000 {
+		compatible = "cfi-flash";
+		reg = <0x1f000000 0x800000>;
+		bank-width = <2>;
+		device-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "bootloader";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition at 30000 {
+			label = "config";
+			reg = <0x30000 0x10000>;
+		};
+
+		factory: partition at 40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+		};
+
+		partition at 50000 {
+			label = "firmware";
+			reg = <0x50000 0x7a0000>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		run {
+			label = "atp-52b:green:run";
+			gpios = <&gpio0 9 1>;
+		};
+
+		net {
+			label = "atp-52b:amber:net";
+			gpios = <&gpio0 13 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
+		};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x3e>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	otg at 101c0000 {
+		status = "okay";
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index c8c60b0..78fffcd 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -442,7 +442,7 @@ Image/Build/Profile/ALL5002=$(call BuildFirmware/CustomFlash/$(1),$(1),all5002,A
 Image/Build/Profile/ALL5003=$(call BuildFirmware/CustomFlash/$(1),$(1),all5003,ALL5003,$(allnet_all5002_mtd_size))
 
 argus_atp52b_mtd_size=7995392
-Image/Build/Profile/ARGUS_ATP52B=$(call BuildFirmware/CustomFlash/$(1),$(1),argus_atp52b,ARGUS_ATP52B,$(argus_atp52b_mtd_size))
+Image/Build/Profile/ATP-52B=$(call BuildFirmware/CustomFlash/$(1),$(1),atp-52b,ATP-52B,$(argus_atp52b_mtd_size))
 
 asl26555_8mb_mtd_size=7929856
 asl26555_16mb_mtd_size=16252928
@@ -699,8 +699,8 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/ALL0256N,$(1))
 	$(call Image/Build/Profile/ALL5002,$(1))
 	$(call Image/Build/Profile/ALL5003,$(1))
-	$(call Image/Build/Profile/ARGUS_ATP52B,$(1))
 	$(call Image/Build/Profile/ASL26555,$(1))
+	$(call Image/Build/Profile/ATP-52B,$(1))
 	$(call Image/Build/Profile/AWM002EVB,$(1))
 	$(call Image/Build/Profile/AWAPN2403,$(1))
 	$(call Image/Build/Profile/BC2,$(1))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:11 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:11 +0200
Subject: [OpenWrt-Devel] [PATCH v2 10/25] ramips: fix Sitecom WL-341v3 board
	and image names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-11-git-send-email-pepe2k@gmail.com>

The following patch changes:
 * board name from "wl341v3" to "wl-341v3"
 * dts filename
 * LED names in dts file

for Sitecom WL-341v3 device.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/lib/ramips.sh       |   2 +-
 .../ramips/base-files/lib/upgrade/platform.sh      |   2 +-
 target/linux/ramips/dts/WL-341V3.dts               | 123 +++++++++++++++++++++
 target/linux/ramips/dts/WL341V3.dts                | 123 ---------------------
 target/linux/ramips/image/Makefile                 |  10 +-
 5 files changed, 130 insertions(+), 130 deletions(-)
 create mode 100644 target/linux/ramips/dts/WL-341V3.dts
 delete mode 100644 target/linux/ramips/dts/WL341V3.dts

diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index d25fa3a..aff380b 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -335,7 +335,7 @@ ramips_board_detect() {
 		name="whr-g300n"
 		;;
 	*"Sitecom WL-341 v3")
-		name="wl341v3"
+		name="wl-341v3"
 		;;
 	*"Sitecom WL-351 v1 002")
 		name="wl-351"
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index f46155f..f78bc22 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -109,7 +109,7 @@ platform_check_image() {
 	wl-330n | \
 	wl-330n3g | \
 	wl-351 | \
-	wl341v3 | \
+	wl-341v3 | \
 	wli-tx4-ag300n | \
 	wzr-agl300nh | \
 	wmr300 |\
diff --git a/target/linux/ramips/dts/WL-341V3.dts b/target/linux/ramips/dts/WL-341V3.dts
new file mode 100644
index 0000000..ce5e820
--- /dev/null
+++ b/target/linux/ramips/dts/WL-341V3.dts
@@ -0,0 +1,123 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+	compatible = "WL-341V3", "ralink,rt3052-soc";
+	model = "Sitecom WL-341 v3";
+
+	cfi at 1f000000 {
+		compatible = "cfi-flash";
+		reg = <0x1f000000 0x800000>;
+		bank-width = <2>;
+		device-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x20000>;
+			read-only;
+		};
+
+		boardnvram: partition at 20000 {
+			label = "board-nvram";
+			reg = <0x20000 0x10000>;
+			read-only;
+		};
+
+		partition at 30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+			read-only;
+		};
+
+		partition at 40000 {
+			label = "firmware";
+			reg = <0x40000 0x3b0000>;
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&boardnvram 0xffa0>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x3e>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&boardnvram 0xfd70>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		first {
+			label = "wl-341v3:amber:first";
+			gpios = <&gpio0 9 1>;
+		};
+
+		first2 {
+			label = "wl-341v3:blue:first";
+			gpios = <&gpio0 13 1>;
+		};
+
+		third {
+			label = "wl-341v3:amber:third";
+			gpios = <&gpio0 11 1>;
+		};
+
+		third2 {
+			label = "wl-341v3:blue:third";
+			gpios = <&gpio0 14 1>;
+		};
+
+		fourth {
+			label = "wl-341v3:blue:fourth";
+			gpios = <&gpio0 10 1>;
+		};
+
+		fifth {
+			label = "wl-341v3:amber:fifth";
+			gpios = <&gpio0 12 1>;
+		};
+
+		fifth2 {
+			label = "wl-341v3:blue:fifth";
+			gpios = <&gpio0 8 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 7 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 5 1>;
+			linux,code = <0x211>;
+		};
+	};
+
+	otg at 101c0000 {
+		status = "okay";
+	};
+};
diff --git a/target/linux/ramips/dts/WL341V3.dts b/target/linux/ramips/dts/WL341V3.dts
deleted file mode 100644
index 40ce630..0000000
--- a/target/linux/ramips/dts/WL341V3.dts
+++ /dev/null
@@ -1,123 +0,0 @@
-/dts-v1/;
-
-/include/ "rt3050.dtsi"
-
-/ {
-	compatible = "WL341V3", "ralink,rt3052-soc";
-	model = "Sitecom WL-341 v3";
-
-	cfi at 1f000000 {
-		compatible = "cfi-flash";
-		reg = <0x1f000000 0x800000>;
-		bank-width = <2>;
-		device-width = <2>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		partition at 0 {
-			label = "u-boot";
-			reg = <0x0 0x20000>;
-			read-only;
-		};
-
-		boardnvram: partition at 20000 {
-			label = "board-nvram";
-			reg = <0x20000 0x10000>;
-			read-only;
-		};
-
-		partition at 30000 {
-			label = "u-boot-env";
-			reg = <0x30000 0x10000>;
-			read-only;
-		};
-
-		partition at 40000 {
-			label = "firmware";
-			reg = <0x40000 0x3b0000>;
-		};
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&boardnvram 0xffa0>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x3e>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&boardnvram 0xfd70>;
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		first {
-			label = "wl341v3:amber:first";
-			gpios = <&gpio0 9 1>;
-		};
-
-		first2 {
-			label = "wl341v3:blue:first";
-			gpios = <&gpio0 13 1>;
-		};
-
-		third {
-			label = "wl341v3:amber:third";
-			gpios = <&gpio0 11 1>;
-		};
-
-		third2 {
-			label = "wl341v3:blue:third";
-			gpios = <&gpio0 14 1>;
-		};
-
-		fourth {
-			label = "wl341v3:blue:fourth";
-			gpios = <&gpio0 10 1>;
-		};
-
-		fifth {
-			label = "wl341v3:amber:fifth";
-			gpios = <&gpio0 12 1>;
-		};
-
-		fifth2 {
-			label = "wl341v3:blue:fifth";
-			gpios = <&gpio0 8 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 7 1>;
-			linux,code = <0x198>;
-		};
-
-		wps {
-			label = "wps";
-			gpios = <&gpio0 5 1>;
-			linux,code = <0x211>;
-		};
-	};
-
-	otg at 101c0000 {
-		status = "okay";
-	};
-};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 78fffcd..af09f27 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -637,8 +637,8 @@ Image/Build/Profile/WL-330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g
 
 kernel_size_wl341v3=917504
 rootfs_size_wl341v3=2949120
-define BuildFirmware/WL341V3/squashfs
-	$(call BuildFirmware/Default4M/$(1),$(1),wl341v3,WL341V3)
+define BuildFirmware/WL-341V3/squashfs
+	$(call BuildFirmware/Default4M/$(1),$(1),wl-341v3,WL-341V3)
 	# This code looks broken and really needs to be converted to C
 	if [ -e "$(call sysupname,$(1),$(2))" ]; then \
 		( \
@@ -654,8 +654,8 @@ define BuildFirmware/WL341V3/squashfs
 		) > $(call imgname,$(1),$(2))-factory.bin; \
 	fi
 endef
-BuildFirmware/WL341V3/initramfs=$(call BuildFirmware/OF/initramfs,$(1),wl341v3,WL341V3)
-Image/Build/Profile/WL341V3=$(call BuildFirmware/WL341V3/$(1),$(1))
+BuildFirmware/WL-341V3/initramfs=$(call BuildFirmware/OF/initramfs,$(1),wl-341v3,WL-341V3)
+Image/Build/Profile/WL-341V3=$(call BuildFirmware/WL-341V3/$(1),$(1))
 
 Image/Build/Profile/WL-351=$(call BuildFirmware/Default4M/$(1),$(1),wl-351,WL-351)
 
@@ -765,7 +765,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/WIZARD8800,$(1))
 	$(call Image/Build/Profile/WL-330N,$(1))
 	$(call Image/Build/Profile/WL-330N3G,$(1))
-	$(call Image/Build/Profile/WL341V3,$(1))
+	$(call Image/Build/Profile/WL-341V3,$(1))
 	$(call Image/Build/Profile/WL-351,$(1))
 	$(call Image/Build/Profile/WNCE2001,$(1))
 	$(call Image/Build/Profile/WR512-3GN,$(1))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:12 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:12 +0200
Subject: [OpenWrt-Devel] [PATCH v2 11/25] ramips: fix Olimex models,
	images and profiles names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-12-git-send-email-pepe2k@gmail.com>

Official names for RT5350F based OLinuXino products are "RT5350F-OLinuXino{,-EVB}" as on official manufacturer website.
The following patch:
 * changes board names from "olinuxino-rt5350f{,-evb}" to "rt5350f-olinuxino{,-evb}"
 * changes filenames of dts and profile files
 * changes image filenames

for Olimex RT5350F-OLinuXino{,-EVB} devices.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/lib/ramips.sh       |   8 +-
 .../ramips/base-files/lib/upgrade/platform.sh      |   4 +-
 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts  | 102 ---------------------
 target/linux/ramips/dts/OLINUXINO-RT5350F.dts      |  80 ----------------
 target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts  | 102 +++++++++++++++++++++
 target/linux/ramips/dts/RT5350F-OLINUXINO.dts      |  80 ++++++++++++++++
 target/linux/ramips/image/Makefile                 |  12 +--
 .../rt305x/profiles/olinuxino-rt5350f-evb.mk       |  21 -----
 .../ramips/rt305x/profiles/olinuxino-rt5350f.mk    |  20 ----
 .../rt305x/profiles/rt5350f-olinuxino-evb.mk       |  21 +++++
 .../ramips/rt305x/profiles/rt5350f-olinuxino.mk    |  20 ++++
 11 files changed, 235 insertions(+), 235 deletions(-)
 delete mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
 delete mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F.dts
 create mode 100644 target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts
 create mode 100644 target/linux/ramips/dts/RT5350F-OLINUXINO.dts
 delete mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f-evb.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/rt5350f-olinuxino-evb.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/rt5350f-olinuxino.mk

diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index aff380b..58d7fc9 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -247,11 +247,11 @@ ramips_board_detect() {
 	*"Omnima MiniPlug")
 		name="omni-plug"
 		;;
-	*"OLinuXino-RT5350F")
-		name="olinuxino-rt5350f"
+	*"Olimex RT5350F-OLinuXino")
+		name="rt5350f-olinuxino"
 		;;
-	*"OLinuXino-RT5350F-EVB")
-		name="olinuxino-rt5350f-evb"
+	*"Olimex RT5350F-OLinuXino-EVB")
+		name="rt5350f-olinuxino-evb"
 		;;
 	*"PBR-M1")
 		name="pbr-m1"
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index f78bc22..5242e46 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -77,8 +77,8 @@ platform_check_image() {
 	omni-emb | \
 	omni-emb-hpm | \
 	omni-plug | \
-	olinuxino-rt5350f | \
-	olinuxino-rt5350f-evb | \
+	rt5350f-olinuxino | \
+	rt5350f-olinuxino-evb | \
 	psr-680w | \
 	px4885 | \
 	re6500 | \
diff --git a/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts b/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
deleted file mode 100644
index 0a7d748..0000000
--- a/target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
+++ /dev/null
@@ -1,102 +0,0 @@
-/dts-v1/;
-
-/include/ "rt5350.dtsi"
-
-/ {
-	compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
-	model = "RT5350F-OLINUXINO";
-
-	palmbus at 10000000 {
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "s25fl064k";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "s25fl064k";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-					read-only;
-				};
-
-				partition at 30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "factory";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x3b0000>;
-				};
-			};
-		};
-
-		gpio1: gpio at 660 {
-			status = "okay";
-		};
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "jtag", "rgmii", "mdio", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x2f>;
-		ralink,led_polarity = <0x17>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	ehci at 101c0000 {
-		status = "okay";
-	};
-
-	ohci at 101c1000 {
-		status = "okay";
-	};
-
-	gpio_export {
-		compatible = "gpio-export";
-		#size-cells = <0>;
-
-		relay1 {
-			gpio-export,name = "gpio12";
-			gpio-export,output = <0>;
-			gpios = <&gpio0 12 0>;
-		};
-
-		relay2 {
-			gpio-export,name = "gpio14";
-			gpio-export,output = <0>;
-			gpios = <&gpio0 14 0>;
-		};
-
-		button {
-			gpio-export,name = "button";
-			gpios = <&gpio0 0 1>;
-		};
-	};
-};
diff --git a/target/linux/ramips/dts/OLINUXINO-RT5350F.dts b/target/linux/ramips/dts/OLINUXINO-RT5350F.dts
deleted file mode 100644
index a259693..0000000
--- a/target/linux/ramips/dts/OLINUXINO-RT5350F.dts
+++ /dev/null
@@ -1,80 +0,0 @@
-/dts-v1/;
-
-/include/ "rt5350.dtsi"
-
-/ {
-	compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
-	model = "RT5350F-OLINUXINO";
-
-	palmbus at 10000000 {
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "s25fl064k";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "s25fl064k";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-					read-only;
-				};
-
-				partition at 30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "factory";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x3b0000>;
-				};
-			};
-		};
-
-		gpio1: gpio at 660 {
-			status = "okay";
-		};
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "jtag", "rgmii", "mdio", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x2f>;
-		ralink,led_polarity = <0x17>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	ehci at 101c0000 {
-		status = "okay";
-	};
-
-	ohci at 101c1000 {
-		status = "okay";
-	};
-};
diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts b/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts
new file mode 100644
index 0000000..17fa66f
--- /dev/null
+++ b/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts
@@ -0,0 +1,102 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "RT5350F-OLINUXINO-EVB", "ralink,rt5350-soc";
+	model = "Olimex RT5350F-OLinuXino-EVB";
+
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "s25fl064k";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "s25fl064k";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x3b0000>;
+				};
+			};
+		};
+
+		gpio1: gpio at 660 {
+			status = "okay";
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x2f>;
+		ralink,led_polarity = <0x17>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	gpio_export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+
+		relay1 {
+			gpio-export,name = "gpio12";
+			gpio-export,output = <0>;
+			gpios = <&gpio0 12 0>;
+		};
+
+		relay2 {
+			gpio-export,name = "gpio14";
+			gpio-export,output = <0>;
+			gpios = <&gpio0 14 0>;
+		};
+
+		button {
+			gpio-export,name = "button";
+			gpios = <&gpio0 0 1>;
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts b/target/linux/ramips/dts/RT5350F-OLINUXINO.dts
new file mode 100644
index 0000000..40caa6b
--- /dev/null
+++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dts
@@ -0,0 +1,80 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
+	model = "Olimex RT5350F-OLinuXino";
+
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "s25fl064k";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "s25fl064k";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x3b0000>;
+				};
+			};
+		};
+
+		gpio1: gpio at 660 {
+			status = "okay";
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x2f>;
+		ralink,led_polarity = <0x17>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index af09f27..e3ff8e6 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -578,16 +578,16 @@ Image/Build/Profile/OMNI-EMB=$(call BuildFirmware/Default8M/$(1),$(1),omni-emb,O
 
 Image/Build/Profile/OMNI-PLUG=$(call BuildFirmware/Default8M/$(1),$(1),omni-plug,OMNI-PLUG)
 
-Image/Build/Profile/OLINUXINO-RT5350F=$(call BuildFirmware/Default8M/$(1),$(1),olinuxino-rt5350f,OLINUXINO-RT5350F)
-
-Image/Build/Profile/OLINUXINO-RT5350F-EVB=$(call BuildFirmware/Default8M/$(1),$(1),olinuxino-rt5350f-evb,OLINUXINO-RT5350F-EVB)
-
 Image/Build/Profile/PSR-680W=$(call BuildFirmware/Default4M/$(1),$(1),psr-680w,PSR-680W)
 
 Image/Build/Profile/PWH2004=$(call BuildFirmware/Default8M/$(1),$(1),pwh2004,PWH2004)
 
 Image/Build/Profile/PX4885=$(call BuildFirmware/DefaultDualSize/$(1),$(1),px4885,PX4885)
 
+Image/Build/Profile/RT5350F-OLINUXINO=$(call BuildFirmware/Default8M/$(1),$(1),rt5350f-olinuxino,RT5350F-OLINUXINO)
+
+Image/Build/Profile/RT5350F-OLINUXINO-EVB=$(call BuildFirmware/Default8M/$(1),$(1),rt5350f-olinuxino-evb,RT5350F-OLINUXINO-EVB)
+
 Image/Build/Profile/RTG32B1=$(call BuildFirmware/Default4M/$(1),$(1),rt-g32-b1,RT-G32-B1)
 
 Image/Build/Profile/RTN10PLUS=$(call BuildFirmware/Default4M/$(1),$(1),rt-n10-plus,RT-N10-PLUS)
@@ -744,11 +744,11 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/NW718,$(1))
 	$(call Image/Build/Profile/OMNI-EMB,$(1))
 	$(call Image/Build/Profile/OMNI-PLUG,$(1))
-	$(call Image/Build/Profile/OLINUXINO-RT5350F,$(1))
-	$(call Image/Build/Profile/OLINUXINO-RT5350F-EVB,$(1))
 	$(call Image/Build/Profile/PSR-680W,$(1))
 	$(call Image/Build/Profile/PWH2004,$(1))
 	$(call Image/Build/Profile/PX4885,$(1))
+	$(call Image/Build/Profile/RT5350F-OLINUXINO,$(1))
+	$(call Image/Build/Profile/RT5350F-OLINUXINO-EVB,$(1))
 	$(call Image/Build/Profile/RTG32B1,$(1))
 	$(call Image/Build/Profile/RTN10PLUS,$(1))
 	$(call Image/Build/Profile/RT-N13U,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/olinuxino-rt5350f-evb.mk b/target/linux/ramips/rt305x/profiles/olinuxino-rt5350f-evb.mk
deleted file mode 100644
index 1bf9829..0000000
--- a/target/linux/ramips/rt305x/profiles/olinuxino-rt5350f-evb.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/OLINUXINO-RT5350F-EVB
-	NAME:=OLinuXino-RT5350F-EVB
-	PACKAGES:=\
-		kmod-usb-core kmod-usb-ohci kmod-usb2 \
-		kmod-i2c-core kmod-i2c-ralink \
-		kmod-spi-dev
-endef
-
-define Profile/OLINUXINO-RT5350F/Description
-	Package set for OLinuXino-RT5350F-EVB board
-endef
-
-$(eval $(call Profile,OLINUXINO-RT5350F-EVB))
-
diff --git a/target/linux/ramips/rt305x/profiles/olinuxino-rt5350f.mk b/target/linux/ramips/rt305x/profiles/olinuxino-rt5350f.mk
deleted file mode 100644
index af24c58..0000000
--- a/target/linux/ramips/rt305x/profiles/olinuxino-rt5350f.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/OLINUXINO-RT5350F
-	NAME:=OLinuXino-RT5350F
-	PACKAGES:=\
-		kmod-usb-core kmod-usb-ohci kmod-usb2 \
-		kmod-i2c-core kmod-i2c-ralink \
-		kmod-spi-dev
-endef
-
-define Profile/OLINUXINO-RT5350F/Description
-	Package set for OLinuXino-RT5350F board
-endef
-
-$(eval $(call Profile,OLINUXINO-RT5350F))
diff --git a/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino-evb.mk b/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino-evb.mk
new file mode 100644
index 0000000..61f5ddb
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino-evb.mk
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/RT5350F-OLINUXINO-EVB
+	NAME:=RT5350F-OLinuXino-EVB
+	PACKAGES:=\
+		kmod-usb-core kmod-usb-ohci kmod-usb2 \
+		kmod-i2c-core kmod-i2c-ralink \
+		kmod-spi-dev
+endef
+
+define Profile/RT5350F-OLINUXINO-EVB/Description
+	Package set for RT5350F-OLinuXino-EVB board
+endef
+
+$(eval $(call Profile,RT5350F-OLINUXINO-EVB))
+
diff --git a/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino.mk b/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino.mk
new file mode 100644
index 0000000..3b20190
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/RT5350F-OLINUXINO
+	NAME:=RT5350F-OLinuXino
+	PACKAGES:=\
+		kmod-usb-core kmod-usb-ohci kmod-usb2 \
+		kmod-i2c-core kmod-i2c-ralink \
+		kmod-spi-dev
+endef
+
+define Profile/RT5350F-OLINUXINO/Description
+	Package set for RT5350F-OLinuXino board
+endef
+
+$(eval $(call Profile,RT5350F-OLINUXINO))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:13 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:13 +0200
Subject: [OpenWrt-Devel] [PATCH v2 12/25] ramips: fix Aigale Ai-BR100 dts
	and profile names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-13-git-send-email-pepe2k@gmail.com>

The following patch changes dts filename and profile name for Aigale Ai-BR100 (for consistency).

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/dts/AI-BR100.dts          | 109 ++++++++++++++++++++++++++
 target/linux/ramips/dts/AIBR100.dts           | 109 --------------------------
 target/linux/ramips/image/Makefile            |   4 +-
 target/linux/ramips/mt7620/profiles/aigale.mk |   6 +-
 4 files changed, 114 insertions(+), 114 deletions(-)
 create mode 100644 target/linux/ramips/dts/AI-BR100.dts
 delete mode 100644 target/linux/ramips/dts/AIBR100.dts

diff --git a/target/linux/ramips/dts/AI-BR100.dts b/target/linux/ramips/dts/AI-BR100.dts
new file mode 100644
index 0000000..90195b6
--- /dev/null
+++ b/target/linux/ramips/dts/AI-BR100.dts
@@ -0,0 +1,109 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+	compatible = "AI-BR100", "ralink,mt7620a-soc";
+	model = "Aigale Ai-BR100";
+
+	palmbus at 10000000 {
+		gpio2: gpio at 660 {
+			status = "okay";
+		};
+
+		gpio3: gpio at 688 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "en25q64";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "en25q64";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x20000>;
+					read-only;
+				};
+
+				partition at 20000 {
+					label = "u-boot-env";
+					reg = <0x20000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 30000 {
+					label = "factory";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				partition at 40000 {
+					label = "firmware";
+					reg = <0x40000 0x7c0000>;
+				};
+			};
+		};
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&ephy_pins>;
+		mtd-mac-address = <&factory 0x4>;
+		ralink,port-map = "llllw";
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		wan {
+			label = "aigale:blue:wan";
+			gpios = <&gpio2 4 1>;
+		};
+
+		wlan {
+			label = "aigale:blue:wlan";
+			gpios = <&gpio3 0 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 12 1>;
+			linux,code = <0x198>;
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/AIBR100.dts b/target/linux/ramips/dts/AIBR100.dts
deleted file mode 100644
index 963e835..0000000
--- a/target/linux/ramips/dts/AIBR100.dts
+++ /dev/null
@@ -1,109 +0,0 @@
-/dts-v1/;
-
-/include/ "mt7620a.dtsi"
-
-/ {
-	compatible = "AIBR100", "ralink,mt7620a-soc";
-	model = "Aigale Ai-BR100";
-
-	palmbus at 10000000 {
-		gpio2: gpio at 660 {
-			status = "okay";
-		};
-
-		gpio3: gpio at 688 {
-			status = "okay";
-		};
-
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "en25q64";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "en25q64";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x20000>;
-					read-only;
-				};
-
-				partition at 20000 {
-					label = "u-boot-env";
-					reg = <0x20000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 30000 {
-					label = "factory";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				partition at 40000 {
-					label = "firmware";
-					reg = <0x40000 0x7c0000>;
-				};
-			};
-		};
-	};
-
-	ehci at 101c0000 {
-		status = "okay";
-	};
-
-	ohci at 101c1000 {
-		status = "okay";
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		pinctrl-names = "default";
-		pinctrl-0 = <&ephy_pins>;
-		mtd-mac-address = <&factory 0x4>;
-		ralink,port-map = "llllw";
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		wan {
-			label = "aigale:blue:wan";
-			gpios = <&gpio2 4 1>;
-		};
-
-		wlan {
-			label = "aigale:blue:wlan";
-			gpios = <&gpio3 0 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 12 1>;
-			linux,code = <0x198>;
-		};
-	};
-};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index e3ff8e6..ae89d6c 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -856,7 +856,7 @@ Image/Build/Profile/MT7620a_MT7610e=$(call BuildFirmware/Default8M/$(1),$(1),mt7
 Image/Build/Profile/MT7620a_MT7530=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7530,MT7620a_MT7530)
 Image/Build/Profile/MT7620a_V22SG=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_v22sg,MT7620a_V22SG)
 br100_mtd_size=8126464
-Image/Build/Profile/AIBR100=$(call BuildFirmware/CustomFlash/$(1),$(1),ai-br100,AIBR100,$(br100_mtd_size),Ai-BR)
+Image/Build/Profile/AI-BR100=$(call BuildFirmware/CustomFlash/$(1),$(1),ai-br100,AI-BR100,$(br100_mtd_size),Ai-BR)
 Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp-n53,RP-N53)
 whr_300hp2_mtd_size=7012352
 Image/Build/Profile/WHR300HP2=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-300hp2,WHR-300HP2,$(whr_300hp2_mtd_size))
@@ -894,7 +894,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/MT7620a_MT7610e,$(1))
 	$(call Image/Build/Profile/MT7620a_MT7530,$(1))
 	$(call Image/Build/Profile/MT7620a_V22SG,$(1))
-	$(call Image/Build/Profile/AIBR100,$(1))
+	$(call Image/Build/Profile/AI-BR100,$(1))
 	$(call Image/Build/Profile/CF-WR800N,$(1))
 	$(call Image/Build/Profile/RP-N53,$(1))
 	$(call Image/Build/Profile/DIR-810L,$(1))
diff --git a/target/linux/ramips/mt7620/profiles/aigale.mk b/target/linux/ramips/mt7620/profiles/aigale.mk
index 475aac9..629a378 100644
--- a/target/linux/ramips/mt7620/profiles/aigale.mk
+++ b/target/linux/ramips/mt7620/profiles/aigale.mk
@@ -5,12 +5,12 @@
 # See /LICENSE for more information.
 #
 
-define Profile/AIBR100
+define Profile/AI-BR100
 	NAME:=Aigale Ai-BR100
 	PACKAGES:=kmod-usb-ohci kmod-usb2
 endef
 
-define Profile/AIBR100/Description
+define Profile/AI-BR100/Description
 	Default package set for Aigale Ai-BR100.
 endef
-$(eval $(call Profile,AIBR100))
+$(eval $(call Profile,AI-BR100))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:14 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:14 +0200
Subject: [OpenWrt-Devel] [PATCH v2 13/25] ramips: fix Tenda W150M model name
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-14-git-send-email-pepe2k@gmail.com>

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/dts/W150M.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/dts/W150M.dts b/target/linux/ramips/dts/W150M.dts
index 5f4d0e3..2309df6 100644
--- a/target/linux/ramips/dts/W150M.dts
+++ b/target/linux/ramips/dts/W150M.dts
@@ -3,8 +3,8 @@
 /include/ "rt3050.dtsi"
 
 / {
-	compatible = "3G300M", "ralink,rt3050-soc";
-	model = "Tenda 3G300M";
+	compatible = "W150M", "ralink,rt3050-soc";
+	model = "Tenda W150M";
 
 	pinctrl {
 		state_default: pinctrl0 {
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:15 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:15 +0200
Subject: [OpenWrt-Devel] [PATCH v2 14/25] ramips: fix Edimax BR-6425 board
	name
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-15-git-send-email-pepe2k@gmail.com>

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds | 2 +-
 target/linux/ramips/base-files/etc/diag.sh         | 2 +-
 target/linux/ramips/base-files/lib/ramips.sh       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 7bd52e1..1ae4510 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -60,7 +60,7 @@ case $board in
 	bc2)
 		set_usb_led "bc2:blue:usb"
 		;;
-	br6425)
+	br-6425)
 		set_wifi_led "edimax:orange:wlan"
 		;;
 	br-6475nd)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index f8b7e89..712e93c 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -36,7 +36,7 @@ get_status_led() {
 	br6524n)
 		status_led="edimax:blue:power"
 		;;
-	br6425 | br-6475nd)
+	br-6425 | br-6475nd)
 		status_led="edimax:green:power"
 		;;
 	cf-wr800n)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 58d7fc9..36ba3f2 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -41,7 +41,7 @@ ramips_board_detect() {
 		name="air3gii"
 		;;
 	*"Edimax BR-6425")
-		name="br6425"
+		name="br-6425"
 		;;
 	*"Allnet ALL0239-3G")
 		name="all0239-3g"
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:16 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:16 +0200
Subject: [OpenWrt-Devel] [PATCH v2 15/25] ramips: fix Omnima models,
	images and profiles names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-16-git-send-email-pepe2k@gmail.com>

Official names for supported Omnima products are (as on website):
 * Omnima HPM
 * Omnima MiniEMBWiFi
 * Omnima MiniEMBPlug

This patch changes:
 * board names
 * dts filenames
 * profile names
 * image filenames
 * LED names

for Omnima devices, for consistency.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |  16 +--
 .../linux/ramips/base-files/etc/board.d/02_network |   2 +-
 target/linux/ramips/base-files/etc/diag.sh         |   8 +-
 target/linux/ramips/base-files/lib/ramips.sh       |  10 +-
 .../ramips/base-files/lib/upgrade/platform.sh      |   6 +-
 target/linux/ramips/dts/HPM.dts                    | 149 +++++++++++++++++++++
 target/linux/ramips/dts/MINIEMBPLUG.dts            | 120 +++++++++++++++++
 target/linux/ramips/dts/MINIEMBWIFI.dts            |  92 +++++++++++++
 target/linux/ramips/dts/OMNI-EMB-HPM.dts           | 149 ---------------------
 target/linux/ramips/dts/OMNI-EMB.dts               |  92 -------------
 target/linux/ramips/dts/OMNI-PLUG.dts              | 120 -----------------
 target/linux/ramips/image/Makefile                 |  14 +-
 target/linux/ramips/rt3883/profiles/omnima.mk      |  10 +-
 13 files changed, 395 insertions(+), 393 deletions(-)
 create mode 100644 target/linux/ramips/dts/HPM.dts
 create mode 100644 target/linux/ramips/dts/MINIEMBPLUG.dts
 create mode 100644 target/linux/ramips/dts/MINIEMBWIFI.dts
 delete mode 100644 target/linux/ramips/dts/OMNI-EMB-HPM.dts
 delete mode 100644 target/linux/ramips/dts/OMNI-EMB.dts
 delete mode 100644 target/linux/ramips/dts/OMNI-PLUG.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 1ae4510..19e79a8 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -166,14 +166,14 @@ case $board in
 		set_wifi_led "m2m:blue:wifi"
 		ucidef_set_led_netdev "eth" "Ethernet" "m2m:green:wan" "eth0"
 		;;
-	omni-emb-hpm)
-		ucidef_set_led_default "power" "POWER" "emb:orange:power" "1"
-		ucidef_set_led_netdev "eth" "ETH" "emb:green:eth" "eth0"
-		set_wifi_led "emb:green:wifi"
-		;;
-	omni-plug)
-		set_wifi_led "miniplug:green:wlan"
-		set_usb_led "miniplug:green:mobile"
+	hpm)
+		ucidef_set_led_default "power" "POWER" "hpm:orange:power" "1"
+		ucidef_set_led_netdev "eth" "ETH" "hpm:green:eth" "eth0"
+		set_wifi_led "hpm:green:wifi"
+		;;
+	miniembplug)
+		set_wifi_led "miniembplug:green:wlan"
+		set_usb_led "miniembplug:green:mobile"
 		;;
 	px4885)
 		set_wifi_led "7links:orange:wifi"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 8f6c813..0fab232 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -243,7 +243,7 @@ ramips_setup_interfaces()
 		;;
 	d105 | \
 	na930 | \
-	omni-emb-hpm|\
+	hpm|\
 	wli-tx4-ag300n)
 		ucidef_set_interface_lan "eth0"
 		;;
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 712e93c..e7499a8 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -119,9 +119,11 @@ get_status_led() {
 	nw718)
 		status_led="nw718:amber:cpu"
 		;;
-	omni-emb|\
-	omni-emb-hpm)
-		status_led="emb:green:status"
+	miniembwifi)
+		status_led="miniembwifi:green:status"
+		;;
+	hpm)
+		status_led="hpm:green:status"
 		;;
 	pbr-m1)
 		status_led="pbr-m1:green:sys"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 36ba3f2..9b37ce6 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -238,14 +238,14 @@ ramips_board_detect() {
 	*"Intenso Memory 2 Move")
 		name="m2m"
 		;;
-	*"Omnima EMB HPM")
-		name="omni-emb-hpm"
+	*"Omnima HPM")
+		name="hpm"
 		;;
 	*"Omnima MiniEMBWiFi")
-		name="omni-emb"
+		name="miniembwifi"
 		;;
-	*"Omnima MiniPlug")
-		name="omni-plug"
+	*"Omnima MiniEMBPlug")
+		name="miniembplug"
 		;;
 	*"Olimex RT5350F-OLinuXino")
 		name="rt5350f-olinuxino"
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 5242e46..7249005 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -74,9 +74,9 @@ platform_check_image() {
 	mzk-dp150n | \
 	nbg-419n | \
 	nw718 | \
-	omni-emb | \
-	omni-emb-hpm | \
-	omni-plug | \
+	miniembwifi | \
+	hpm | \
+	miniembplug | \
 	rt5350f-olinuxino | \
 	rt5350f-olinuxino-evb | \
 	psr-680w | \
diff --git a/target/linux/ramips/dts/HPM.dts b/target/linux/ramips/dts/HPM.dts
new file mode 100644
index 0000000..03bf710
--- /dev/null
+++ b/target/linux/ramips/dts/HPM.dts
@@ -0,0 +1,149 @@
+/dts-v1/;
+
+/include/ "rt3883.dtsi"
+
+/ {
+	compatible = "HPM", "ralink,rt3883-soc";
+	model = "Omnima HPM";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				compatible = "macronix,mx25l12805d";
+				spi-max-frequency = <25000000>;
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				partition at 0 {
+					reg = <0x0 0x0030000>;
+					label = "u-boot";
+					read-only;
+				};
+
+				partition at 30000 {
+					reg = <0x00030000 0x00010000>;
+					label = "config";
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					reg = <0x00040000 0x00010000>;
+					label = "factory";
+					read-only;
+				};
+
+				partition at 50000 {
+					reg = <0x00050000 0x00fb0000>;
+					label = "firmware";
+				};
+			};
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		phy-handle = <&phy0>;
+		phy-mode = "rgmii";
+		mtd-mac-address = <&factory 0x28>;
+
+		mdio-bus {
+			status = "okay";
+
+			phy0: ethernet-phy at 4 {
+				reg = <4>;
+			};
+		};
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <100>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 14 0>;
+			linux,code = <0x198>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power {
+			label = "hpm:orange:power";
+			gpios = <&gpio0 7 1>;
+		};
+
+		status {
+			label = "hpm:green:status";
+			gpios = <&gpio0 21 1>;
+		};
+
+		eth {
+			label = "hpm:green:eth";
+			gpios = <&gpio0 20 1>;
+		};
+
+		eth2 {
+			label = "hpm:red:eth";
+			gpios = <&gpio0 18 1>;
+		};
+
+		wifi {
+			label = "hpm:green:wifi";
+			gpios = <&gpio0 17 1>;
+		};
+
+		wifi2 {
+			label = "hpm:red:wifi";
+			gpios = <&gpio0 19 1>;
+		};
+	};
+
+	gpio_export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+		/* gpio 12 and 13 handle the OC input */
+
+		usb0 {
+			gpio-export,name = "usb0";
+			gpio-export,output = <1>;
+			gpios = <&gpio0 2 0>;
+		};
+
+		usb1 {
+			gpio-export,name = "usb1";
+			gpio-export,output = <1>;
+			gpios = <&gpio0 1 0>;
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/MINIEMBPLUG.dts b/target/linux/ramips/dts/MINIEMBPLUG.dts
new file mode 100644
index 0000000..c94c3aa
--- /dev/null
+++ b/target/linux/ramips/dts/MINIEMBPLUG.dts
@@ -0,0 +1,120 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "MINIEMBPLUG", "ralink,rt5350-soc";
+	model = "Omnima MiniEMBPlug";
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		wlan {
+			label = "miniembplug:red:wlan";
+			gpios = <&gpio0 9 0>;
+		};
+
+		mobile {
+			label = "miniembplug:green:mobile";
+			gpios = <&gpio0 13 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
+		};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x211>;
+		};
+
+		mode-one {
+			label = "mode1";
+			gpios = <&gpio0 11 1>;
+			linux,code = <0x211>;
+		};
+
+		mode-two {
+			label = "mode2";
+			gpios = <&gpio0 12 1>;
+			linux,code = <0x211>;
+		};
+	};
+
+	palmbus at 10000000 {
+		gpio0: gpio at 600 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l6405d";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l6405d";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x7b0000>;
+				};
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x2f>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	otg at 101c0000 {
+		status = "okay";
+	};
+};
diff --git a/target/linux/ramips/dts/MINIEMBWIFI.dts b/target/linux/ramips/dts/MINIEMBWIFI.dts
new file mode 100644
index 0000000..b026f0c
--- /dev/null
+++ b/target/linux/ramips/dts/MINIEMBWIFI.dts
@@ -0,0 +1,92 @@
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+	compatible = "MINIEMBWIFI", "ralink,rt3052-soc";
+	model = "Omnima MiniEMBWiFi";
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		status {
+			label = "miniembwifi:green:status";
+			gpios = <&gpio0 9 1>;
+		};
+
+		wlan {
+			label = "miniembwifi:green:wlan";
+			gpios = <&gpio0 14 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 12 1>;
+			linux,code = <0x198>;
+		};
+	};
+
+	cfi at 1f000000 {
+		compatible = "cfi-flash";
+		reg = <0x1f000000 0x800000>;
+		bank-width = <2>;
+		device-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition at 30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+			read-only;
+		};
+
+		factory: partition at 40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+			read-only;
+		};
+
+		partition at 50000 {
+			label = "firmware";
+			reg = <0x50000 0x7b0000>;
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x28>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x2f>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	otg at 101c0000 {
+		status = "okay";
+	};
+};
diff --git a/target/linux/ramips/dts/OMNI-EMB-HPM.dts b/target/linux/ramips/dts/OMNI-EMB-HPM.dts
deleted file mode 100644
index 9540f4f..0000000
--- a/target/linux/ramips/dts/OMNI-EMB-HPM.dts
+++ /dev/null
@@ -1,149 +0,0 @@
-/dts-v1/;
-
-/include/ "rt3883.dtsi"
-
-/ {
-	compatible = "OMNI-EMB-HPM", "ralink,rt3883-soc";
-	model = "Omnima EMB HPM";
-
-	chosen {
-		bootargs = "console=ttyS0,115200";
-	};
-
-	palmbus at 10000000 {
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				compatible = "macronix,mx25l12805d";
-				spi-max-frequency = <25000000>;
-				reg = <0>;
-				#address-cells = <1>;
-				#size-cells = <1>;
-
-				partition at 0 {
-					reg = <0x0 0x0030000>;
-					label = "u-boot";
-					read-only;
-				};
-
-				partition at 30000 {
-					reg = <0x00030000 0x00010000>;
-					label = "config";
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					reg = <0x00040000 0x00010000>;
-					label = "factory";
-					read-only;
-				};
-
-				partition at 50000 {
-					reg = <0x00050000 0x00fb0000>;
-					label = "firmware";
-				};
-			};
-		};
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "jtag", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		phy-handle = <&phy0>;
-		phy-mode = "rgmii";
-		mtd-mac-address = <&factory 0x28>;
-
-		mdio-bus {
-			status = "okay";
-
-			phy0: ethernet-phy at 4 {
-				reg = <4>;
-			};
-		};
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	ehci at 101c0000 {
-		status = "okay";
-	};
-
-	ohci at 101c1000 {
-		status = "okay";
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <100>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 14 0>;
-			linux,code = <0x198>;
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		power {
-			label = "emb:orange:power";
-			gpios = <&gpio0 7 1>;
-		};
-
-		status {
-			label = "emb:green:status";
-			gpios = <&gpio0 21 1>;
-		};
-
-		eth {
-			label = "emb:green:eth";
-			gpios = <&gpio0 20 1>;
-		};
-
-		eth2 {
-			label = "emb:red:eth";
-			gpios = <&gpio0 18 1>;
-		};
-
-		wifi {
-			label = "emb:green:wifi";
-			gpios = <&gpio0 17 1>;
-		};
-
-		wifi2 {
-			label = "emb:red:wifi";
-			gpios = <&gpio0 19 1>;
-		};
-	};
-
-	gpio_export {
-		compatible = "gpio-export";
-		#size-cells = <0>;
-		/* gpio 12 and 13 handle the OC input */
-
-		usb0 {
-			gpio-export,name = "usb0";
-			gpio-export,output = <1>;
-			gpios = <&gpio0 2 0>;
-		};
-
-		usb1 {
-			gpio-export,name = "usb1";
-			gpio-export,output = <1>;
-			gpios = <&gpio0 1 0>;
-		};
-	};
-};
diff --git a/target/linux/ramips/dts/OMNI-EMB.dts b/target/linux/ramips/dts/OMNI-EMB.dts
deleted file mode 100644
index aa3ddc4..0000000
--- a/target/linux/ramips/dts/OMNI-EMB.dts
+++ /dev/null
@@ -1,92 +0,0 @@
-/dts-v1/;
-
-/include/ "rt3050.dtsi"
-
-/ {
-	compatible = "OMNI-EMB", "ralink,rt3052-soc";
-	model = "Omnima MiniEMBWiFi";
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		status {
-			label = "emb:green:status";
-			gpios = <&gpio0 9 1>;
-		};
-
-		wlan {
-			label = "emb:green:wlan";
-			gpios = <&gpio0 14 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 12 1>;
-			linux,code = <0x198>;
-		};
-	};
-
-	cfi at 1f000000 {
-		compatible = "cfi-flash";
-		reg = <0x1f000000 0x800000>;
-		bank-width = <2>;
-		device-width = <2>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		partition at 0 {
-			label = "u-boot";
-			reg = <0x0 0x30000>;
-			read-only;
-		};
-
-		partition at 30000 {
-			label = "u-boot-env";
-			reg = <0x30000 0x10000>;
-			read-only;
-		};
-
-		factory: partition at 40000 {
-			label = "factory";
-			reg = <0x40000 0x10000>;
-			read-only;
-		};
-
-		partition at 50000 {
-			label = "firmware";
-			reg = <0x50000 0x7b0000>;
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x28>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x2f>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	otg at 101c0000 {
-		status = "okay";
-	};
-};
diff --git a/target/linux/ramips/dts/OMNI-PLUG.dts b/target/linux/ramips/dts/OMNI-PLUG.dts
deleted file mode 100644
index 25f5bca..0000000
--- a/target/linux/ramips/dts/OMNI-PLUG.dts
+++ /dev/null
@@ -1,120 +0,0 @@
-/dts-v1/;
-
-/include/ "rt5350.dtsi"
-
-/ {
-	compatible = "OMNI-PLUG", "ralink,rt5350-soc";
-	model = "Omnima MiniPlug";
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "jtag", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		wlan {
-			label = "miniplug:red:wlan";
-			gpios = <&gpio0 9 0>;
-		};
-
-		mobile {
-			label = "miniplug:green:mobile";
-			gpios = <&gpio0 13 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		wps {
-			label = "wps";
-			gpios = <&gpio0 0 1>;
-			linux,code = <0x211>;
-		};
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 10 1>;
-			linux,code = <0x211>;
-		};
-
-		mode-one {
-			label = "mode1";
-			gpios = <&gpio0 11 1>;
-			linux,code = <0x211>;
-		};
-
-		mode-two {
-			label = "mode2";
-			gpios = <&gpio0 12 1>;
-			linux,code = <0x211>;
-		};
-	};
-
-	palmbus at 10000000 {
-		gpio0: gpio at 600 {
-			status = "okay";
-		};
-
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "mx25l6405d";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "mx25l6405d";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-					read-only;
-				};
-
-				partition at 30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "factory";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x7b0000>;
-				};
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x2f>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	otg at 101c0000 {
-		status = "okay";
-	};
-};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index ae89d6c..f3f40eb 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -574,9 +574,9 @@ Image/Build/Profile/NW718=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),nw71
 
 Image/Build/Profile/M2M=$(call BuildFirmware/Default8M/$(1),$(1),m2m,M2M,Linux Kernel Image)
 
-Image/Build/Profile/OMNI-EMB=$(call BuildFirmware/Default8M/$(1),$(1),omni-emb,OMNI-EMB)
+Image/Build/Profile/MINIEMBPLUG=$(call BuildFirmware/Default8M/$(1),$(1),miniembplug,MINIEMBPLUG)
 
-Image/Build/Profile/OMNI-PLUG=$(call BuildFirmware/Default8M/$(1),$(1),omni-plug,OMNI-PLUG)
+Image/Build/Profile/MINIEMBWIFI=$(call BuildFirmware/Default8M/$(1),$(1),miniembwifi,MINIEMBWIFI)
 
 Image/Build/Profile/PSR-680W=$(call BuildFirmware/Default4M/$(1),$(1),psr-680w,PSR-680W)
 
@@ -742,8 +742,8 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/NBG-419N,$(1))
 	$(call Image/Build/Profile/NCS601W,$(1))
 	$(call Image/Build/Profile/NW718,$(1))
-	$(call Image/Build/Profile/OMNI-EMB,$(1))
-	$(call Image/Build/Profile/OMNI-PLUG,$(1))
+	$(call Image/Build/Profile/MINIEMBWIFI,$(1))
+	$(call Image/Build/Profile/MINIEMBPLUG,$(1))
 	$(call Image/Build/Profile/PSR-680W,$(1))
 	$(call Image/Build/Profile/PWH2004,$(1))
 	$(call Image/Build/Profile/PX4885,$(1))
@@ -815,8 +815,8 @@ Image/Build/Profile/CYSWR1100=$(call BuildFirmware/Seama/$(1),$(1),cy-swr1100,CY
 
 Image/Build/Profile/DIR645=$(call BuildFirmware/Seama/$(1),$(1),dir-645,DIR-645,wrgn39_dlob.hans_dir645,$(ralink_default_fw_size_8M))
 
-omniembhpm_mtd_size=16449536
-Image/Build/Profile/OMNIEMBHPM=$(call BuildFirmware/CustomFlash/$(1),$(1),omni-emb-hpm,OMNI-EMB-HPM,$(omniembhpm_mtd_size))
+hpm_mtd_size=16449536
+Image/Build/Profile/HPM=$(call BuildFirmware/CustomFlash/$(1),$(1),hpm,HPM,$(hpm_mtd_size))
 
 define BuildFirmware/RTN56U/squashfs
 	$(call BuildFirmware/Default8M/$(1),$(1),rt-n56u,RT-N56U)
@@ -838,7 +838,7 @@ ifeq ($(SUBTARGET),rt3883)
 define Image/Build/Profile/Default
 	$(call Image/Build/Profile/CYSWR1100,$(1))
 	$(call Image/Build/Profile/DIR645,$(1))
-	$(call Image/Build/Profile/OMNIEMBHPM,$(1))
+	$(call Image/Build/Profile/HPM,$(1))
 	$(call Image/Build/Profile/RTN56U,$(1))
 	$(call Image/Build/Profile/BR6475ND,$(1))
 	$(call Image/Build/Profile/TEW691GR,$(1))
diff --git a/target/linux/ramips/rt3883/profiles/omnima.mk b/target/linux/ramips/rt3883/profiles/omnima.mk
index 2f31715..ce25999 100644
--- a/target/linux/ramips/rt3883/profiles/omnima.mk
+++ b/target/linux/ramips/rt3883/profiles/omnima.mk
@@ -5,12 +5,12 @@
 # See /LICENSE for more information.
 #
 
-define Profile/OMNIEMBHPM
-	NAME:=Omnima EMB-HPM board
+define Profile/HPM
+	NAME:=Omnima HPM
 	PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2
 endef
 
-define Profile/OMNIEMBHPM/Description
-	Package set compatible with the Omnima EMB-HPM board.
+define Profile/HPM/Description
+	Package set compatible with the Omnima HPM board.
 endef
-$(eval $(call Profile,OMNIEMBHPM))
+$(eval $(call Profile,HPM))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:17 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:17 +0200
Subject: [OpenWrt-Devel] [PATCH v2 16/25] ramips: fix Buffalo WMR-300 dts,
	board, image and profile names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-17-git-send-email-pepe2k@gmail.com>

The following patch changes Buffalo WMR-300 dts filename, board, image and profile names from "WMR300" to "WMR-300" (for consistency).

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 .../linux/ramips/base-files/etc/board.d/02_network |   2 +-
 target/linux/ramips/base-files/etc/diag.sh         |   4 +-
 target/linux/ramips/base-files/lib/ramips.sh       |   2 +-
 .../ramips/base-files/lib/upgrade/platform.sh      |   2 +-
 target/linux/ramips/dts/WMR-300.dts                | 106 +++++++++++++++++++++
 target/linux/ramips/dts/WMR300.dts                 | 106 ---------------------
 target/linux/ramips/image/Makefile                 |   4 +-
 7 files changed, 113 insertions(+), 113 deletions(-)
 create mode 100644 target/linux/ramips/dts/WMR-300.dts
 delete mode 100644 target/linux/ramips/dts/WMR300.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 0fab232..334003d 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -77,7 +77,7 @@ ramips_setup_interfaces()
 
 	wizard8800 | \
 	wl-330n | \
-	wmr300)
+	wmr-300)
 		ucidef_set_interface_lan "eth0.1"
 		;;
 
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index e7499a8..c8014bf 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -183,8 +183,8 @@ get_status_led() {
 	whr-g300n)
 		status_led="whr-g300n:green:router"
 		;;
-	wmr300)
-		status_led="buffalo:green:status"
+	wmr-300)
+		status_led="wmr-300:green:status"
 		;;
 	wli-tx4-ag300n)
 		status_led="buffalo:blue:power"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 9b37ce6..98bd094 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -320,7 +320,7 @@ ramips_board_detect() {
 		name="w502u"
 		;;
 	*"WMR-300")
-		name="wmr300"
+		name="wmr-300"
 		;;
 	*"WHR-300HP2")
 		name="whr-300hp2"
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 7249005..e347d6f 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -112,7 +112,7 @@ platform_check_image() {
 	wl-341v3 | \
 	wli-tx4-ag300n | \
 	wzr-agl300nh | \
-	wmr300 |\
+	wmr-300 |\
 	wnce2001 | \
 	wr512-3gn |\
 	wr6202 |\
diff --git a/target/linux/ramips/dts/WMR-300.dts b/target/linux/ramips/dts/WMR-300.dts
new file mode 100644
index 0000000..3dae3ae
--- /dev/null
+++ b/target/linux/ramips/dts/WMR-300.dts
@@ -0,0 +1,106 @@
+/dts-v1/;
+
+/include/ "mt7620n.dtsi"
+
+/ {
+	compatible = "buffalo,wmr-300", "ralink,mt7620n-soc";
+	model = "Buffalo WMR-300";
+
+	palmbus at 10000000 {
+		gpio2: gpio at 660 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l6405d";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "en25q64";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x7b0000>;
+				};
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+		ralink,port-map = "wllll";
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			default {
+				ralink,group = "i2c", "ephy";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		aoss1 {
+			label = "wmr-300:red:aoss";
+			gpios = <&gpio2 1 1>;
+		};
+
+		aoss2 {
+			label = "wmr-300:green:aoss";
+			gpios = <&gpio2 2 1>;
+		};
+
+		power {
+			label = "wmr-300:green:status";
+			gpios = <&gpio2 4 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 1 1>;
+			linux,code = <0x198>;
+		};
+
+		aoss {
+			label = "aoss";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x211>;
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/WMR300.dts b/target/linux/ramips/dts/WMR300.dts
deleted file mode 100644
index fbeec4c..0000000
--- a/target/linux/ramips/dts/WMR300.dts
+++ /dev/null
@@ -1,106 +0,0 @@
-/dts-v1/;
-
-/include/ "mt7620n.dtsi"
-
-/ {
-	compatible = "buffalo,wmr-300", "ralink,mt7620n-soc";
-	model = "Buffalo WMR-300";
-
-	palmbus at 10000000 {
-		gpio2: gpio at 660 {
-			status = "okay";
-		};
-
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "mx25l6405d";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "en25q64";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x30000>;
-					read-only;
-				};
-
-				partition at 30000 {
-					label = "u-boot-env";
-					reg = <0x30000 0x10000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "factory";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x7b0000>;
-				};
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x4>;
-		ralink,port-map = "wllll";
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	pinctrl {
-		state_default: pinctrl0 {
-			default {
-				ralink,group = "i2c", "ephy";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		aoss1 {
-			label = "buffalo:red:aoss";
-			gpios = <&gpio2 1 1>;
-		};
-
-		aoss2 {
-			label = "buffalo:green:aoss";
-			gpios = <&gpio2 2 1>;
-		};
-
-		power {
-			label = "buffalo:green:status";
-			gpios = <&gpio2 4 1>;
-		};
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 1 1>;
-			linux,code = <0x198>;
-		};
-
-		aoss {
-			label = "aoss";
-			gpios = <&gpio0 2 1>;
-			linux,code = <0x211>;
-		};
-	};
-};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index f3f40eb..2539b5a 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -874,7 +874,7 @@ Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),y1,Y1)
 Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),y1s,Y1S)
 Image/Build/Profile/MLW221=$(call BuildFirmware/Default16M/$(1),$(1),mlw221,MLW221)
 Image/Build/Profile/MLWG2=$(call BuildFirmware/Default16M/$(1),$(1),mlwg2,MLWG2)
-Image/Build/Profile/WMR300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR300)
+Image/Build/Profile/WMR-300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR-300)
 Image/Build/Profile/RT-N14U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n14u,RT-N14U)
 Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WRTNODE)
 Image/Build/Profile/WT3020=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt3020,WT3020)
@@ -908,7 +908,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/Y1S,$(1))
 	$(call Image/Build/Profile/MLW221,$(1))
 	$(call Image/Build/Profile/MLWG2,$(1))
-	$(call Image/Build/Profile/WMR300,$(1))
+	$(call Image/Build/Profile/WMR-300,$(1))
 	$(call Image/Build/Profile/RT-N14U,$(1))
 	$(call Image/Build/Profile/WRTNODE,$(1))
 	$(call Image/Build/Profile/WT3020,$(1))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:18 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:18 +0200
Subject: [OpenWrt-Devel] [PATCH v2 17/25] ramips: fix 7Links PX-4885 dts{, i},
	board, image and profile names
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-18-git-send-email-pepe2k@gmail.com>

The following patch changes 7Links PX-4885 dts{,i} filenames, board, image and profile names from "PX4885" to "PX-4885" (for consistency).

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |  6 +--
 target/linux/ramips/base-files/etc/diag.sh         |  4 +-
 target/linux/ramips/base-files/lib/ramips.sh       |  2 +-
 .../ramips/base-files/lib/upgrade/platform.sh      |  2 +-
 target/linux/ramips/dts/PX-4885-4M.dts             | 43 +++++++++++++++++
 target/linux/ramips/dts/PX-4885-8M.dts             | 43 +++++++++++++++++
 target/linux/ramips/dts/PX-4885.dtsi               | 54 ++++++++++++++++++++++
 target/linux/ramips/dts/PX4885-4M.dts              | 43 -----------------
 target/linux/ramips/dts/PX4885-8M.dts              | 43 -----------------
 target/linux/ramips/dts/PX4885.dtsi                | 54 ----------------------
 target/linux/ramips/image/Makefile                 |  4 +-
 target/linux/ramips/rt305x/profiles/sevenlinks.mk  |  8 ++--
 12 files changed, 152 insertions(+), 154 deletions(-)
 create mode 100644 target/linux/ramips/dts/PX-4885-4M.dts
 create mode 100644 target/linux/ramips/dts/PX-4885-8M.dts
 create mode 100644 target/linux/ramips/dts/PX-4885.dtsi
 delete mode 100644 target/linux/ramips/dts/PX4885-4M.dts
 delete mode 100644 target/linux/ramips/dts/PX4885-8M.dts
 delete mode 100644 target/linux/ramips/dts/PX4885.dtsi

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 19e79a8..1456be1 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -175,9 +175,9 @@ case $board in
 		set_wifi_led "miniembplug:green:wlan"
 		set_usb_led "miniembplug:green:mobile"
 		;;
-	px4885)
-		set_wifi_led "7links:orange:wifi"
-		set_usb_led "7links:blue:storage"
+	px-4885)
+		set_wifi_led "px-4885:orange:wifi"
+		set_usb_led "px-4885:blue:storage"
 		;;
     pbr-m1)
         ucidef_set_led_netdev "internet" "internet" "pbr-m1:green:internet" "eth0.2"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index c8014bf..f63cf31 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -134,8 +134,8 @@ get_status_led() {
 	pwh2004)
 		status_led="pwh2004:green:power"
 		;;
-	px4885)
-		status_led="7links:orange:wifi"
+	px-4885)
+		status_led="px-4885:orange:wifi"
 		;;
 	re6500)
 		status_led="linksys:orange:wifi"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 98bd094..9e7e73f 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -14,7 +14,7 @@ ramips_board_detect() {
 
 	case "$machine" in
 	*"7Links PX-4885")
-		name="px4885"
+		name="px-4885"
 		;;
 	*"8devices Carambola")
 		name="carambola"
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index e347d6f..b5e0f5f 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -80,7 +80,7 @@ platform_check_image() {
 	rt5350f-olinuxino | \
 	rt5350f-olinuxino-evb | \
 	psr-680w | \
-	px4885 | \
+	px-4885 | \
 	re6500 | \
 	rp-n53 | \
 	rt-g32-b1 | \
diff --git a/target/linux/ramips/dts/PX-4885-4M.dts b/target/linux/ramips/dts/PX-4885-4M.dts
new file mode 100644
index 0000000..1f79a3c
--- /dev/null
+++ b/target/linux/ramips/dts/PX-4885-4M.dts
@@ -0,0 +1,43 @@
+/dts-v1/;
+
+/include/ "PX-4885.dtsi"
+
+/ {
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l3205d";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l3205d";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x20000>;
+					read-only;
+				};
+
+				partition at 20000 {
+					label = "devdata";
+					reg = <0x20000 0x20000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "devconf";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x3b0000>;
+				};
+			};
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/PX-4885-8M.dts b/target/linux/ramips/dts/PX-4885-8M.dts
new file mode 100644
index 0000000..4c94a11
--- /dev/null
+++ b/target/linux/ramips/dts/PX-4885-8M.dts
@@ -0,0 +1,43 @@
+/dts-v1/;
+
+/include/ "PX-4885.dtsi"
+
+/ {
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l3205d";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l3205d";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x20000>;
+					read-only;
+				};
+
+				partition at 20000 {
+					label = "devdata";
+					reg = <0x20000 0x20000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "devconf";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x7b0000>;
+				};
+			};
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/PX-4885.dtsi b/target/linux/ramips/dts/PX-4885.dtsi
new file mode 100644
index 0000000..350c1a6
--- /dev/null
+++ b/target/linux/ramips/dts/PX-4885.dtsi
@@ -0,0 +1,54 @@
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "PX-4885", "ralink,rt5350-soc";
+	model = "7Links PX-4885";
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x28>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x3f>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		orange {
+			label = "px-4885:orange:wifi";
+			gpios = <&gpio0 18 1>;
+		};
+
+		blue {
+			label = "px-4885:blue:storage";
+			gpios = <&gpio0 19 1>;
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/PX4885-4M.dts b/target/linux/ramips/dts/PX4885-4M.dts
deleted file mode 100644
index 33f167d..0000000
--- a/target/linux/ramips/dts/PX4885-4M.dts
+++ /dev/null
@@ -1,43 +0,0 @@
-/dts-v1/;
-
-/include/ "PX4885.dtsi"
-
-/ {
-	palmbus at 10000000 {
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "mx25l3205d";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "mx25l3205d";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x20000>;
-					read-only;
-				};
-
-				partition at 20000 {
-					label = "devdata";
-					reg = <0x20000 0x20000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "devconf";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x3b0000>;
-				};
-			};
-		};
-	};
-};
diff --git a/target/linux/ramips/dts/PX4885-8M.dts b/target/linux/ramips/dts/PX4885-8M.dts
deleted file mode 100644
index b8015ab..0000000
--- a/target/linux/ramips/dts/PX4885-8M.dts
+++ /dev/null
@@ -1,43 +0,0 @@
-/dts-v1/;
-
-/include/ "PX4885.dtsi"
-
-/ {
-	palmbus at 10000000 {
-		spi at b00 {
-			status = "okay";
-
-			m25p80 at 0 {
-				#address-cells = <1>;
-				#size-cells = <1>;
-				compatible = "mx25l3205d";
-				reg = <0 0>;
-				linux,modalias = "m25p80", "mx25l3205d";
-				spi-max-frequency = <10000000>;
-
-				partition at 0 {
-					label = "u-boot";
-					reg = <0x0 0x20000>;
-					read-only;
-				};
-
-				partition at 20000 {
-					label = "devdata";
-					reg = <0x20000 0x20000>;
-					read-only;
-				};
-
-				factory: partition at 40000 {
-					label = "devconf";
-					reg = <0x40000 0x10000>;
-					read-only;
-				};
-
-				partition at 50000 {
-					label = "firmware";
-					reg = <0x50000 0x7b0000>;
-				};
-			};
-		};
-	};
-};
diff --git a/target/linux/ramips/dts/PX4885.dtsi b/target/linux/ramips/dts/PX4885.dtsi
deleted file mode 100644
index 50f4b9e..0000000
--- a/target/linux/ramips/dts/PX4885.dtsi
+++ /dev/null
@@ -1,54 +0,0 @@
-/include/ "rt5350.dtsi"
-
-/ {
-	compatible = "PX4885", "ralink,rt5350-soc";
-	model = "7Links PX-4885";
-
-	pinctrl {
-		state_default: pinctrl0 {
-			gpio {
-				ralink,group = "i2c", "jtag", "uartf";
-				ralink,function = "gpio";
-			};
-		};
-	};
-
-	ethernet at 10100000 {
-		mtd-mac-address = <&factory 0x28>;
-	};
-
-	esw at 10110000 {
-		ralink,portmap = <0x3f>;
-	};
-
-	wmac at 10180000 {
-		ralink,mtd-eeprom = <&factory 0>;
-	};
-
-	gpio-keys-polled {
-		compatible = "gpio-keys-polled";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		poll-interval = <20>;
-
-		reset {
-			label = "reset";
-			gpios = <&gpio0 10 1>;
-			linux,code = <0x198>;
-		};
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-
-		orange {
-			label = "7links:orange:wifi";
-			gpios = <&gpio0 18 1>;
-		};
-
-		blue {
-			label = "7links:blue:storage";
-			gpios = <&gpio0 19 1>;
-		};
-	};
-};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 2539b5a..2f4d4cb 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -582,7 +582,7 @@ Image/Build/Profile/PSR-680W=$(call BuildFirmware/Default4M/$(1),$(1),psr-680w,P
 
 Image/Build/Profile/PWH2004=$(call BuildFirmware/Default8M/$(1),$(1),pwh2004,PWH2004)
 
-Image/Build/Profile/PX4885=$(call BuildFirmware/DefaultDualSize/$(1),$(1),px4885,PX4885)
+Image/Build/Profile/PX-4885=$(call BuildFirmware/DefaultDualSize/$(1),$(1),px-4885,PX-4885)
 
 Image/Build/Profile/RT5350F-OLINUXINO=$(call BuildFirmware/Default8M/$(1),$(1),rt5350f-olinuxino,RT5350F-OLINUXINO)
 
@@ -746,7 +746,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/MINIEMBPLUG,$(1))
 	$(call Image/Build/Profile/PSR-680W,$(1))
 	$(call Image/Build/Profile/PWH2004,$(1))
-	$(call Image/Build/Profile/PX4885,$(1))
+	$(call Image/Build/Profile/PX-4885,$(1))
 	$(call Image/Build/Profile/RT5350F-OLINUXINO,$(1))
 	$(call Image/Build/Profile/RT5350F-OLINUXINO-EVB,$(1))
 	$(call Image/Build/Profile/RTG32B1,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/sevenlinks.mk b/target/linux/ramips/rt305x/profiles/sevenlinks.mk
index e1a8665..6ddc383 100644
--- a/target/linux/ramips/rt305x/profiles/sevenlinks.mk
+++ b/target/linux/ramips/rt305x/profiles/sevenlinks.mk
@@ -5,16 +5,14 @@
 # See /LICENSE for more information.
 #
 
-define Profile/PX4885
+define Profile/PX-4885
 	NAME:=7Links PX-4885
 	PACKAGES:=\
 		kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \
 		kmod-ledtrig-usbdev kmod-leds-gpio
 endef
 
-define Profile/PX4885/Description
+define Profile/PX-4885/Description
 	Package set for 7Links PX-4885 wireless router.
 endef
-
-$(eval $(call Profile,PX4885))
-
+$(eval $(call Profile,PX-4885))
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:19 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:19 +0200
Subject: [OpenWrt-Devel] [PATCH v2 18/25] ramips: remove old code for Edimax
	BR-6524N
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-19-git-send-email-pepe2k@gmail.com>

It seems that support for Edimax BR-6524N was dropped long time ago (dts file for this device is missing).
This patch removes remaining code.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds    |  3 ---
 target/linux/ramips/base-files/etc/board.d/02_network |  1 -
 target/linux/ramips/base-files/etc/diag.sh            |  3 ---
 target/linux/ramips/rt288x/profiles/edimax.mk         | 18 ------------------
 4 files changed, 25 deletions(-)
 delete mode 100644 target/linux/ramips/rt288x/profiles/edimax.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 1456be1..e872b39 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -70,9 +70,6 @@ case $board in
 		set_usb_led "red:diskmounted"
 		set_wifi_led "red:wps_active"
 		;;
-	br6524n)
-		set_wifi_led "edimax:blue:wlan"
-		;;
 	cf-wr800n)
 		ucidef_set_led_netdev "lan" "lan" "comfast:white:ethernet" eth0.1
 		set_wifi_led "comfast:white:wifi"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 334003d..8c19b40 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -182,7 +182,6 @@ ramips_setup_interfaces()
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		;;
 
-	br6524n | \
 	v11st-fe)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index f63cf31..1e0a15e 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -33,9 +33,6 @@ get_status_led() {
 	asl26555)
 		status_led="asl26555:green:power"
 		;;
-	br6524n)
-		status_led="edimax:blue:power"
-		;;
 	br-6425 | br-6475nd)
 		status_led="edimax:green:power"
 		;;
diff --git a/target/linux/ramips/rt288x/profiles/edimax.mk b/target/linux/ramips/rt288x/profiles/edimax.mk
deleted file mode 100644
index 43ac818..0000000
--- a/target/linux/ramips/rt288x/profiles/edimax.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/BR6524N
-       NAME:=Edimax BR6524N
-       PACKAGES:=kmod-switch-ip17xx kmod-swconfig swconfig
-endef
-
-define Profile/BR6524N/Description
-       Package set for Edimax BR6524N
-endef
-
-$(eval $(call Profile,BR6524N))
-
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:20 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:20 +0200
Subject: [OpenWrt-Devel] [PATCH v2 19/25] ramips: fix various mistakes in
	subtargets *.mk profiles
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-20-git-send-email-pepe2k@gmail.com>

This patch:
 * fixes wrong indentation
 * fixes wrong names and descriptions (ex. Dlink -> D-Link)
 * changes filenames to manufacturer names
 * moves oem/unknown manufacturers boards to misc.mk profiles
 * combines profiles for boards from the same manufacturers in one file (ex. Olimex)
 * fix profile files structure (keep the same convention as in other targets, ex. ar71xx)

in various .mk profiles, in ramips target.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/mt7620/profiles/mediatek.mk    |  2 +-
 target/linux/ramips/mt7620/profiles/microduino.mk  | 16 +++++
 target/linux/ramips/mt7620/profiles/microwrt.mk    |  9 ---
 target/linux/ramips/mt7620/profiles/xiaomi.mk      | 10 ++--
 target/linux/ramips/mt7621/profiles/firefly.mk     | 12 ++--
 target/linux/ramips/mt7621/profiles/misc.mk        | 20 +++++++
 target/linux/ramips/mt7621/profiles/pbr-m1.mk      | 22 -------
 target/linux/ramips/mt7621/profiles/sap-g3200u3.mk | 18 ------
 target/linux/ramips/mt7621/profiles/storylink.mk   | 18 ++++++
 target/linux/ramips/rt288x/profiles/asus.mk        |  8 +--
 target/linux/ramips/rt288x/profiles/belkin.mk      | 10 ++--
 target/linux/ramips/rt305x/profiles/allnet.mk      |  7 +--
 target/linux/ramips/rt305x/profiles/alpha.mk       |  1 -
 target/linux/ramips/rt305x/profiles/arcwireless.mk | 17 ++++++
 target/linux/ramips/rt305x/profiles/asiarf.mk      | 23 ++++----
 target/linux/ramips/rt305x/profiles/asus.mk        |  8 +--
 target/linux/ramips/rt305x/profiles/aximcom.mk     |  1 -
 target/linux/ramips/rt305x/profiles/aztech.mk      |  1 -
 target/linux/ramips/rt305x/profiles/belkin.mk      | 10 ++--
 target/linux/ramips/rt305x/profiles/broadway.mk    |  1 -
 target/linux/ramips/rt305x/profiles/d-link.mk      | 68 +++++++++++++++++++++
 target/linux/ramips/rt305x/profiles/dlink.mk       | 69 ----------------------
 target/linux/ramips/rt305x/profiles/easyacc.mk     |  1 -
 target/linux/ramips/rt305x/profiles/engenius.mk    | 10 ++--
 target/linux/ramips/rt305x/profiles/fon.mk         |  1 -
 .../linux/ramips/rt305x/profiles/freestation5.mk   | 18 ------
 target/linux/ramips/rt305x/profiles/hame.mk        |  4 +-
 target/linux/ramips/rt305x/profiles/hg255d.mk      | 17 ------
 target/linux/ramips/rt305x/profiles/hilink.mk      |  2 -
 target/linux/ramips/rt305x/profiles/hootoo.mk      |  2 -
 target/linux/ramips/rt305x/profiles/huawei.mk      | 16 +++++
 target/linux/ramips/rt305x/profiles/intenso.mk     | 19 ++++++
 target/linux/ramips/rt305x/profiles/m2m.mk         | 20 -------
 target/linux/ramips/rt305x/profiles/misc.mk        |  1 -
 target/linux/ramips/rt305x/profiles/nexx.mk        |  1 -
 target/linux/ramips/rt305x/profiles/olimex.mk      | 33 +++++++++++
 target/linux/ramips/rt305x/profiles/planex.mk      |  1 -
 target/linux/ramips/rt305x/profiles/poray.mk       | 12 ++--
 .../rt305x/profiles/rt5350f-olinuxino-evb.mk       | 21 -------
 .../ramips/rt305x/profiles/rt5350f-olinuxino.mk    | 20 -------
 target/linux/ramips/rt305x/profiles/tenda.mk       |  5 +-
 target/linux/ramips/rt305x/profiles/upvel.mk       | 17 +++---
 target/linux/ramips/rt305x/profiles/vocore.mk      |  1 -
 target/linux/ramips/rt305x/profiles/wansview.mk    |  3 +-
 target/linux/ramips/rt3883/profiles/trendnet.mk    |  1 +
 45 files changed, 276 insertions(+), 301 deletions(-)
 create mode 100644 target/linux/ramips/mt7620/profiles/microduino.mk
 delete mode 100644 target/linux/ramips/mt7620/profiles/microwrt.mk
 create mode 100644 target/linux/ramips/mt7621/profiles/misc.mk
 delete mode 100644 target/linux/ramips/mt7621/profiles/pbr-m1.mk
 delete mode 100644 target/linux/ramips/mt7621/profiles/sap-g3200u3.mk
 create mode 100644 target/linux/ramips/mt7621/profiles/storylink.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/arcwireless.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/d-link.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/dlink.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/freestation5.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/hg255d.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/huawei.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/intenso.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/m2m.mk
 create mode 100644 target/linux/ramips/rt305x/profiles/olimex.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/rt5350f-olinuxino-evb.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/rt5350f-olinuxino.mk

diff --git a/target/linux/ramips/mt7620/profiles/mediatek.mk b/target/linux/ramips/mt7620/profiles/mediatek.mk
index acb0c03..4f6703e 100644
--- a/target/linux/ramips/mt7620/profiles/mediatek.mk
+++ b/target/linux/ramips/mt7620/profiles/mediatek.mk
@@ -9,7 +9,7 @@ define Profile/MT7620a
 	NAME:=MT7620a EVB
 endef
 
-define Profile/Default/Description
+define Profile/MT7620a/Description
 	Default package set compatible with MT7620a eval board
 endef
 $(eval $(call Profile,MT7620a))
diff --git a/target/linux/ramips/mt7620/profiles/microduino.mk b/target/linux/ramips/mt7620/profiles/microduino.mk
new file mode 100644
index 0000000..b68a269
--- /dev/null
+++ b/target/linux/ramips/mt7620/profiles/microduino.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/MicroWRT
+	NAME:=Microduino MicroWRT
+	PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci
+endef
+
+define Profile/MicroWRT/Description
+	Package set compatible with MicroWRT
+endef
+$(eval $(call Profile,MicroWRT))
diff --git a/target/linux/ramips/mt7620/profiles/microwrt.mk b/target/linux/ramips/mt7620/profiles/microwrt.mk
deleted file mode 100644
index 2b0977d..0000000
--- a/target/linux/ramips/mt7620/profiles/microwrt.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-define Profile/MicroWRT
-	NAME:=Microduino MicroWRT
-	PACKAGES:= kmod-usb-core kmod-usb2 kmod-usb-ohci
-endef
-
-define Profile/MicroWRT/Description
-		Package set compatible with MicroWRT
-endef
-$(eval $(call Profile,MicroWRT))
diff --git a/target/linux/ramips/mt7620/profiles/xiaomi.mk b/target/linux/ramips/mt7620/profiles/xiaomi.mk
index 47f6d49..df5598c 100644
--- a/target/linux/ramips/mt7620/profiles/xiaomi.mk
+++ b/target/linux/ramips/mt7620/profiles/xiaomi.mk
@@ -6,13 +6,13 @@
 #
 
 define Profile/MIWIFI-MINI
- NAME:=Xiaomi MiWiFi Mini
- PACKAGES:=\
-	kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \
-	kmod-mt76
+	NAME:=Xiaomi MiWiFi Mini
+	PACKAGES:=\
+		kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \
+		kmod-mt76
 endef
 
 define Profile/MIWIFI-MINI/Description
- Support for Xiaomi MiWiFi Mini routers
+	Support for Xiaomi MiWiFi Mini routers
 endef
 $(eval $(call Profile,MIWIFI-MINI))
diff --git a/target/linux/ramips/mt7621/profiles/firefly.mk b/target/linux/ramips/mt7621/profiles/firefly.mk
index 501a32b..bc50ab4 100644
--- a/target/linux/ramips/mt7621/profiles/firefly.mk
+++ b/target/linux/ramips/mt7621/profiles/firefly.mk
@@ -1,18 +1,18 @@
 #
-# Copyright (C) 2011 OpenWrt.org
+# Copyright (C) 2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
 
-define Profile/Firefly
-	NAME:=Firefly Device
+define Profile/FIREWRT
+	NAME:=Firefly FireWRT
 	PACKAGES:=\
 		kmod-usb-core kmod-usb3 kmod-usb-hid kmod-sdhci-mt7620 \
 		kmod-ledtrig-usbdev
 endef
 
-define Profile/Firefly/Description
-	Default package set compatible with most boards.
+define Profile/FIREWRT/Description
+	Package set compatible with the Firefly FireWRT board.
 endef
-$(eval $(call Profile,Firefly))
+$(eval $(call Profile,FIREWRT))
diff --git a/target/linux/ramips/mt7621/profiles/misc.mk b/target/linux/ramips/mt7621/profiles/misc.mk
new file mode 100644
index 0000000..9db0cd5
--- /dev/null
+++ b/target/linux/ramips/mt7621/profiles/misc.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/PBR-M1
+	NAME:=PBR-M1 Device
+	FEATURES+=rtc
+	PACKAGES:=\
+		kmod-usb-core kmod-usb3 kmod-usb-hid kmod-sdhci-mt7620 \
+		kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
+		kmod-usb3-mt7621 kmod-rtc-pcf8563
+endef
+
+define Profile/PBR-M1/Description
+	Default package set compatible with most boards.
+endef
+$(eval $(call Profile,PBR-M1))
diff --git a/target/linux/ramips/mt7621/profiles/pbr-m1.mk b/target/linux/ramips/mt7621/profiles/pbr-m1.mk
deleted file mode 100644
index 9773b31..0000000
--- a/target/linux/ramips/mt7621/profiles/pbr-m1.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright (C) 2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/PBR-M1
-	NAME:=PBR-M1 Device
-	PACKAGES:=\
-		kmod-usb-core kmod-usb3 kmod-usb-hid kmod-sdhci-mt7620 \
-		kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
-		kmod-usb3-mt7621 kmod-rtc-pcf8563
-endef
-
-
-FEATURES+=rtc
-
-define Profile/PBR-M1/Description
-	Default package set compatible with most boards.
-endef
-$(eval $(call Profile,PBR-M1))
diff --git a/target/linux/ramips/mt7621/profiles/sap-g3200u3.mk b/target/linux/ramips/mt7621/profiles/sap-g3200u3.mk
deleted file mode 100644
index 9ca4a2f..0000000
--- a/target/linux/ramips/mt7621/profiles/sap-g3200u3.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/SAP-G3200U3
-	NAME:=STORYLiNK SAP-G3200U3
-	PACKAGES:=\
-		kmod-usb-core kmod-usb3 kmod-usb-hid \
-		kmod-ledtrig-usbdev
-endef
-
-define Profile/SAP-G3200U3/Description
-	Package set compatible with the STORYLiNK SAP-G3200U3 board.
-endef
-$(eval $(call Profile,SAP-G3200U3))
diff --git a/target/linux/ramips/mt7621/profiles/storylink.mk b/target/linux/ramips/mt7621/profiles/storylink.mk
new file mode 100644
index 0000000..9ca4a2f
--- /dev/null
+++ b/target/linux/ramips/mt7621/profiles/storylink.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/SAP-G3200U3
+	NAME:=STORYLiNK SAP-G3200U3
+	PACKAGES:=\
+		kmod-usb-core kmod-usb3 kmod-usb-hid \
+		kmod-ledtrig-usbdev
+endef
+
+define Profile/SAP-G3200U3/Description
+	Package set compatible with the STORYLiNK SAP-G3200U3 board.
+endef
+$(eval $(call Profile,SAP-G3200U3))
diff --git a/target/linux/ramips/rt288x/profiles/asus.mk b/target/linux/ramips/rt288x/profiles/asus.mk
index 1e8de5c..aa6fb4d 100644
--- a/target/linux/ramips/rt288x/profiles/asus.mk
+++ b/target/linux/ramips/rt288x/profiles/asus.mk
@@ -6,13 +6,11 @@
 #
 
 define Profile/RTN15
-       NAME:=Asus RT-N15
-       PACKAGES:=kmod-switch-rtl8366s kmod-swconfig swconfig
+	NAME:=Asus RT-N15
+	PACKAGES:=kmod-switch-rtl8366s kmod-swconfig swconfig
 endef
 
 define Profile/RTN15/Description
-       Package set for Asus RT-N15 board
+	Package set for Asus RT-N15 board
 endef
-
 $(eval $(call Profile,RTN15))
-
diff --git a/target/linux/ramips/rt288x/profiles/belkin.mk b/target/linux/ramips/rt288x/profiles/belkin.mk
index 608cee9..4a0c62d 100644
--- a/target/linux/ramips/rt288x/profiles/belkin.mk
+++ b/target/linux/ramips/rt288x/profiles/belkin.mk
@@ -6,13 +6,11 @@
 #
 
 define Profile/F5D8235V1
-       NAME:=Belkin F5D8235 V1
-       PACKAGES:=kmod-switch-rtl8366s kmod-swconfig swconfig
+	NAME:=Belkin F5D8235 V1
+	PACKAGES:=kmod-switch-rtl8366s kmod-swconfig swconfig
 endef
 
-define Profile/F5D8235_V1/Description
-       Package set for Belkin F5D8235 V1
+define Profile/F5D8235V1/Description
+	Package set for Belkin F5D8235 V1
 endef
-
 $(eval $(call Profile,F5D8235V1))
-
diff --git a/target/linux/ramips/rt305x/profiles/allnet.mk b/target/linux/ramips/rt305x/profiles/allnet.mk
index e625f47..eb175ec 100644
--- a/target/linux/ramips/rt305x/profiles/allnet.mk
+++ b/target/linux/ramips/rt305x/profiles/allnet.mk
@@ -15,9 +15,9 @@ endef
 define Profile/ALL02393G/Description
 	Package set for Allnet ALL0239-3G
 endef
-
 $(eval $(call Profile,ALL02393G))
 
+
 define Profile/ALL0256N
 	NAME:=Allnet ALL0256N
 	PACKAGES:=rssileds
@@ -26,9 +26,9 @@ endef
 define Profile/ALL0256N/Description
 	Package set for Allnet ALL0256N
 endef
-
 $(eval $(call Profile,ALL0256N))
 
+
 define Profile/ALL5002
 	NAME:=Allnet ALL5002
 	PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
@@ -38,9 +38,9 @@ endef
 define Profile/ALL5002/Description
 	Package set for Allnet ALL5002
 endef
-
 $(eval $(call Profile,ALL5002))
 
+
 define Profile/ALL5003
 	NAME:=Allnet ALL5003
 	PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
@@ -50,5 +50,4 @@ endef
 define Profile/ALL5003/Description
 	Package set for Allnet ALL5003
 endef
-
 $(eval $(call Profile,ALL5003))
diff --git a/target/linux/ramips/rt305x/profiles/alpha.mk b/target/linux/ramips/rt305x/profiles/alpha.mk
index 2b8e311..4ecbd6a 100644
--- a/target/linux/ramips/rt305x/profiles/alpha.mk
+++ b/target/linux/ramips/rt305x/profiles/alpha.mk
@@ -15,5 +15,4 @@ endef
 define Profile/ASL26555/Description
 	Package set for Alpha ASL26555
 endef
-
 $(eval $(call Profile,ASL26555))
diff --git a/target/linux/ramips/rt305x/profiles/arcwireless.mk b/target/linux/ramips/rt305x/profiles/arcwireless.mk
new file mode 100644
index 0000000..8405f2d
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/arcwireless.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/FREESTATION5
+	NAME:=ARC Wireless FreeStation
+	PACKAGES:=\
+		 kmod-usb-dwc2 kmod-rt2500-usb kmod-rt2800-usb kmod-rt2x00-usb
+endef
+
+define Profile/FREESTATION5/Description
+	Package set for ARC Wireless FreeStation, Flex mARC, iFlex, and SplitStation
+endef
+$(eval $(call Profile,FREESTATION5))
diff --git a/target/linux/ramips/rt305x/profiles/asiarf.mk b/target/linux/ramips/rt305x/profiles/asiarf.mk
index a0bd385..efa01ea 100644
--- a/target/linux/ramips/rt305x/profiles/asiarf.mk
+++ b/target/linux/ramips/rt305x/profiles/asiarf.mk
@@ -5,6 +5,16 @@
 # See /LICENSE for more information.
 #
 
+define Profile/AWAPN2403
+	NAME:=AsiaRF AWAPN2403
+endef
+
+define Profile/AWAPN2403/Description
+	Package set for AsiaRF AWAPN2403 Pocket Router
+endef
+$(eval $(call Profile,AWAPN2403))
+
+
 define Profile/AWM002EVB
 	NAME:=AsiaRF AWM002-EVB
 	PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
@@ -14,6 +24,8 @@ endef
 define Profile/AWM002EVB/Description
 	Package set for AsiaRF AWM002 Evaluation Board
 endef
+$(eval $(call Profile,AWM002EVB))
+
 
 define Profile/AWM003EVB
 	NAME:=AsiaRF AWM003-EVB
@@ -24,15 +36,4 @@ endef
 define Profile/AWM003EVB/Description
 	Package set for AsiaRF AWM003 Evaluation Board
 endef
-
-define Profile/AWAPN2403
-	NAME:=AsiaRF AWAPN2403
-endef
-
-define Profile/AWAPN2403/Description
-	Package set for AsiaRF AWAPN2403 Pocket Router
-endef
-
-$(eval $(call Profile,AWM002EVB))
 $(eval $(call Profile,AWM003EVB))
-$(eval $(call Profile,AWAPN2403))
diff --git a/target/linux/ramips/rt305x/profiles/asus.mk b/target/linux/ramips/rt305x/profiles/asus.mk
index d7fd8ca..ddfdc1a 100644
--- a/target/linux/ramips/rt305x/profiles/asus.mk
+++ b/target/linux/ramips/rt305x/profiles/asus.mk
@@ -5,14 +5,16 @@
 # See /LICENSE for more information.
 #
 
-define Profile/RT-N10-PLUS
+define Profile/RTN10PLUS
 	NAME:=Asus RT-N10+
 	PACKAGES:=kmod-leds-gpio wpad-mini
 endef
 
-define Profile/RT-N10-PLUS/Description
+define Profile/RTN10PLUS/Description
 	Package set for Asus RT-N10+.
 endef
+$(eval $(call Profile,RTN10PLUS))
+
 
 define Profile/RT-N13U
 	NAME:=Asus RT-N13U
@@ -22,6 +24,4 @@ endef
 define Profile/RT-N13U/Description
 	Package set for Asus RT-N13U.
 endef
-
-$(eval $(call Profile,RT-N10-PLUS))
 $(eval $(call Profile,RT-N13U))
diff --git a/target/linux/ramips/rt305x/profiles/aximcom.mk b/target/linux/ramips/rt305x/profiles/aximcom.mk
index eb305af..d00e7a9 100644
--- a/target/linux/ramips/rt305x/profiles/aximcom.mk
+++ b/target/linux/ramips/rt305x/profiles/aximcom.mk
@@ -13,5 +13,4 @@ endef
 define Profile/MR102N/Description
 	Package set for AXIMCom MR-102N
 endef
-
 $(eval $(call Profile,MR102N))
diff --git a/target/linux/ramips/rt305x/profiles/aztech.mk b/target/linux/ramips/rt305x/profiles/aztech.mk
index 4333f71..e869398 100644
--- a/target/linux/ramips/rt305x/profiles/aztech.mk
+++ b/target/linux/ramips/rt305x/profiles/aztech.mk
@@ -15,5 +15,4 @@ endef
 define Profile/HW550-3G/Description
 	Package set for Aztech HW550-3G
 endef
-
 $(eval $(call Profile,HW550-3G))
diff --git a/target/linux/ramips/rt305x/profiles/belkin.mk b/target/linux/ramips/rt305x/profiles/belkin.mk
index 88688d6..27c6bf4 100644
--- a/target/linux/ramips/rt305x/profiles/belkin.mk
+++ b/target/linux/ramips/rt305x/profiles/belkin.mk
@@ -16,17 +16,17 @@ endef
 define Profile/F5D8235V2/Description
 	Package set for Belkin F5D8235 v2
 endef
+$(eval $(call Profile,F5D8235V2))
+
 
 define Profile/F7C027
 	NAME:=Belkin F7C027
-        PACKAGES:=\
-                -kmod-usb-core -kmod-usb-dwc2 \
-                -kmod-ledtrig-usbdev
+	PACKAGES:=\
+		-kmod-usb-core -kmod-usb-dwc2 \
+		-kmod-ledtrig-usbdev
 endef
 
 define Profile/F7C027/Description
 	Package set for Belkin F7C027 - Plug with soc_ap and a relay
 endef
-
-$(eval $(call Profile,F5D8235V2))
 $(eval $(call Profile,F7C027))
diff --git a/target/linux/ramips/rt305x/profiles/broadway.mk b/target/linux/ramips/rt305x/profiles/broadway.mk
index e7833b1..b757387 100644
--- a/target/linux/ramips/rt305x/profiles/broadway.mk
+++ b/target/linux/ramips/rt305x/profiles/broadway.mk
@@ -15,5 +15,4 @@ endef
 define Profile/BROADWAY/Description
 	Package set for Hauppauge Broadway
 endef
-
 $(eval $(call Profile,BROADWAY))
diff --git a/target/linux/ramips/rt305x/profiles/d-link.mk b/target/linux/ramips/rt305x/profiles/d-link.mk
new file mode 100644
index 0000000..05d919b
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/d-link.mk
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/DCS930
+	NAME:=D-Link DCS-930
+	PACKAGES:=kmod-video-core kmod-video-uvc \
+		kmod-sound-core kmod-usb-audio \
+		kmod-usb-core kmod-usb-dwc2
+endef
+
+define Profile/DCS930/Description
+	Package set for D-Link DCS-930 board
+endef
+$(eval $(call Profile,DCS930))
+
+
+define Profile/DCS930LB1
+	NAME:=D-Link DCS-930L B1
+	PACKAGES:=kmod-video-core kmod-video-uvc \
+		kmod-sound-core kmod-usb-audio \
+		kmod-usb-core kmod-usb-ohci kmod-usb2
+endef
+
+define Profile/DCS930LB1/Description
+	Package set for D-Link DCS-930L B1 board
+endef
+$(eval $(call Profile,DCS930LB1))
+
+
+define Profile/DIR610A1
+	NAME:=D-Link DIR-610 A1
+	PACKAGES:=kmod-ledtrig-netdev kmod-ledtrig-timer
+endef
+
+define Profile/DIR610A1/Description
+	Package set for D-Link DIR610 A1 board
+endef
+$(eval $(call Profile,DIR610A1))
+
+
+define Profile/DIR-615-D
+	NAME:=D-Link DIR-615 D
+	PACKAGES:=\
+		-kmod-usb-core -kmod-usb-dwc2 \
+		-kmod-ledtrig-usbdev
+endef
+
+define Profile/DIR-615-D/Description
+	Package set for D-Link DIR-615 D board
+endef
+$(eval $(call Profile,DIR-615-D))
+
+
+define Profile/DIR615H1
+	NAME:=D-Link DIR-615 H1
+	PACKAGES:=\
+		-kmod-usb-core -kmod-usb-dwc2 \
+		-kmod-ledtrig-usbdev
+endef
+
+define Profile/DIR615H1/Description
+	Package set for D-Link DIR-615 H1 board
+endef
+$(eval $(call Profile,DIR615H1))
diff --git a/target/linux/ramips/rt305x/profiles/dlink.mk b/target/linux/ramips/rt305x/profiles/dlink.mk
deleted file mode 100644
index 5fc5709..0000000
--- a/target/linux/ramips/rt305x/profiles/dlink.mk
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/DIR615H1
-	NAME:=Dlink DIR-615 H1
-        PACKAGES:=\
-                -kmod-usb-core -kmod-usb-dwc2 \
-                -kmod-ledtrig-usbdev
-endef
-
-define Profile/DIR615H1/Description
-	Package set for Dlink DIR-615 H1 board
-endef
-
-$(eval $(call Profile,DIR615H1))
-
-define Profile/DIR-615-D
-	NAME:=Dlink DIR-615 D
-        PACKAGES:=\
-                -kmod-usb-core -kmod-usb-dwc2 \
-                -kmod-ledtrig-usbdev
-endef
-
-define Profile/DIR-615-D/Description
-	Package set for Dlink DIR-615 D board
-endef
-
-$(eval $(call Profile,DIR-615-D))
-
-define Profile/DCS930
-	NAME:=Dlink DCS-930
-        PACKAGES:=kmod-video-core kmod-video-uvc \
-		kmod-sound-core kmod-usb-audio \
-		kmod-usb-core kmod-usb-dwc2
-endef
-
-define Profile/DCS930/Description
-	Package set for Dlink DCS-930 board
-endef
-
-$(eval $(call Profile,DCS930))
-
-define Profile/DCS930LB1
-	NAME:=Dlink DCS-930L B1
-        PACKAGES:=kmod-video-core kmod-video-uvc \
-		kmod-sound-core kmod-usb-audio \
-		kmod-usb-core kmod-usb-ohci kmod-usb2
-endef
-
-define Profile/DCS930LB1/Description
-	Package set for Dlink DCS-930L B1 board
-endef
-
-$(eval $(call Profile,DCS930LB1))
-
-define Profile/DIR610A1
-	NAME:=Dlink DIR-610 A1
-	PACKAGES:=kmod-ledtrig-netdev kmod-ledtrig-timer
-endef
-
-define Profile/DIR610A1/Description
-	Package set for Dlink DIR610 A1 board
-endef
-
-$(eval $(call Profile,DIR610A1))
diff --git a/target/linux/ramips/rt305x/profiles/easyacc.mk b/target/linux/ramips/rt305x/profiles/easyacc.mk
index 012cfec..6b31673 100644
--- a/target/linux/ramips/rt305x/profiles/easyacc.mk
+++ b/target/linux/ramips/rt305x/profiles/easyacc.mk
@@ -17,5 +17,4 @@ endef
 define Profile/WIZARD8800/Description
 	Package set for EasyAcc Wi-Stor Wizard 4in1 wireless storage 8800
 endef
-
 $(eval $(call Profile,WIZARD8800))
diff --git a/target/linux/ramips/rt305x/profiles/engenius.mk b/target/linux/ramips/rt305x/profiles/engenius.mk
index 09c716e..cef275e 100644
--- a/target/linux/ramips/rt305x/profiles/engenius.mk
+++ b/target/linux/ramips/rt305x/profiles/engenius.mk
@@ -5,12 +5,12 @@
 # See /LICENSE for more information.
 #
 
-define Profile/ESR9753
-	NAME:=EnGenius Profile
+define Profile/ESR-9753
+	NAME:=EnGenius ESR-9753
 	PACKAGES:=
 endef
 
-define Profile/ESR9753/Description
-	EnGenius profile.
+define Profile/ESR-9753/Description
+	EnGenius ESR-9753 profile.
 endef
-$(eval $(call Profile,ESR9753))
+$(eval $(call Profile,ESR-9753))
diff --git a/target/linux/ramips/rt305x/profiles/fon.mk b/target/linux/ramips/rt305x/profiles/fon.mk
index 2c0d82a..cb95ad9 100644
--- a/target/linux/ramips/rt305x/profiles/fon.mk
+++ b/target/linux/ramips/rt305x/profiles/fon.mk
@@ -15,5 +15,4 @@ endef
 define Profile/FONERA20N/Description
 	Package set for Fonera 2.0N
 endef
-
 $(eval $(call Profile,FONERA20N))
diff --git a/target/linux/ramips/rt305x/profiles/freestation5.mk b/target/linux/ramips/rt305x/profiles/freestation5.mk
deleted file mode 100644
index ce9c304..0000000
--- a/target/linux/ramips/rt305x/profiles/freestation5.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/FREESTATION5
-	NAME:=FreeStation5
-	PACKAGES:=\
-		 kmod-usb-dwc2 kmod-rt2500-usb kmod-rt2800-usb kmod-rt2x00-usb
-endef
-
-define Profile/FREESTATION5/Description
-	Package set for ARC FreeStation, Flex mARC, iFlex, and SplitStation
-endef
-
-$(eval $(call Profile,FREESTATION5))
diff --git a/target/linux/ramips/rt305x/profiles/hame.mk b/target/linux/ramips/rt305x/profiles/hame.mk
index 06dfc12..2f483a0 100644
--- a/target/linux/ramips/rt305x/profiles/hame.mk
+++ b/target/linux/ramips/rt305x/profiles/hame.mk
@@ -14,9 +14,9 @@ endef
 define Profile/MPRA1/Description
 	Package set for HAME MPR-A1 board
 endef
-
 $(eval $(call Profile,MPRA1))
 
+
 define Profile/MPRA2
 	NAME:=HAME MPR-A2
 	PACKAGES:=\
@@ -26,6 +26,4 @@ endef
 define Profile/MPRA2/Description
 	Package set for HAME MPR-A2 board
 endef
-
 $(eval $(call Profile,MPRA2))
-
diff --git a/target/linux/ramips/rt305x/profiles/hg255d.mk b/target/linux/ramips/rt305x/profiles/hg255d.mk
deleted file mode 100644
index 3bb32dd..0000000
--- a/target/linux/ramips/rt305x/profiles/hg255d.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/HG255D
-	NAME:=HuaWei HG255D
-	PACKAGES:=kmod-leds-gpio wpad-mini kmod-usb-dwc2
-endef
-
-define Profile/HG255D/Description
-	Package set for HuaWei HG255D.
-endef
-
-$(eval $(call Profile,HG255D))
diff --git a/target/linux/ramips/rt305x/profiles/hilink.mk b/target/linux/ramips/rt305x/profiles/hilink.mk
index d978303..fa6833d 100644
--- a/target/linux/ramips/rt305x/profiles/hilink.mk
+++ b/target/linux/ramips/rt305x/profiles/hilink.mk
@@ -12,6 +12,4 @@ endef
 define Profile/HLKRM04/Description
 	Package set for HiLink RM04 Module
 endef
-
 $(eval $(call Profile,HLKRM04))
-
diff --git a/target/linux/ramips/rt305x/profiles/hootoo.mk b/target/linux/ramips/rt305x/profiles/hootoo.mk
index efd23ed..216ccff 100644
--- a/target/linux/ramips/rt305x/profiles/hootoo.mk
+++ b/target/linux/ramips/rt305x/profiles/hootoo.mk
@@ -13,6 +13,4 @@ endef
 define Profile/HT-TM02/Description
 	Package set optimized for the HooToo HT-TM02.
 endef
-
 $(eval $(call Profile,HT-TM02))
-
diff --git a/target/linux/ramips/rt305x/profiles/huawei.mk b/target/linux/ramips/rt305x/profiles/huawei.mk
new file mode 100644
index 0000000..3223e76
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/huawei.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/HG255D
+	NAME:=Huawei HG255D
+	PACKAGES:=kmod-leds-gpio wpad-mini kmod-usb-dwc2
+endef
+
+define Profile/HG255D/Description
+	Package set for Huawei HG255D.
+endef
+$(eval $(call Profile,HG255D))
diff --git a/target/linux/ramips/rt305x/profiles/intenso.mk b/target/linux/ramips/rt305x/profiles/intenso.mk
new file mode 100644
index 0000000..89f3094
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/intenso.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/M2M
+	NAME:=Intenso Memory 2 Move
+	PACKAGES:=\
+		kmod-ledtrig-netdev kmod-ledtrig-timer \
+		kmod-usb-core kmod-usb2 kmod-usb-storage kmod-scsi-core \
+		kmod-fs-ext4 kmod-fs-vfat block-mount
+endef
+
+define Profile/M2M/Description
+	Package set for Intenso Memory 2 Move USB 3.0
+endef
+$(eval $(call Profile,M2M))
diff --git a/target/linux/ramips/rt305x/profiles/m2m.mk b/target/linux/ramips/rt305x/profiles/m2m.mk
deleted file mode 100644
index 1b13cc5..0000000
--- a/target/linux/ramips/rt305x/profiles/m2m.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/M2M
-	NAME:=Intenso Memory 2 Move
-	PACKAGES:=\
-		kmod-ledtrig-netdev kmod-ledtrig-timer \
-		kmod-usb-core kmod-usb2 kmod-usb-storage kmod-scsi-core \
-		kmod-fs-ext4 kmod-fs-vfat block-mount
-endef
-
-define Profile/M2M/Description
-	Package set for Intenso Memory 2 Move USB 3.0
-endef
-
-$(eval $(call Profile,M2M))
diff --git a/target/linux/ramips/rt305x/profiles/misc.mk b/target/linux/ramips/rt305x/profiles/misc.mk
index cf7db6a..62a1d94 100644
--- a/target/linux/ramips/rt305x/profiles/misc.mk
+++ b/target/linux/ramips/rt305x/profiles/misc.mk
@@ -14,5 +14,4 @@ endef
 define Profile/A5-V11/Description
 	Package set for A5-V11
 endef
-
 $(eval $(call Profile,A5-V11))
diff --git a/target/linux/ramips/rt305x/profiles/nexx.mk b/target/linux/ramips/rt305x/profiles/nexx.mk
index eaef4c1..52f132e 100644
--- a/target/linux/ramips/rt305x/profiles/nexx.mk
+++ b/target/linux/ramips/rt305x/profiles/nexx.mk
@@ -13,5 +13,4 @@ endef
 define Profile/WT1520/Description
 	Package set for WT1520
 endef
-
 $(eval $(call Profile,WT1520))
diff --git a/target/linux/ramips/rt305x/profiles/olimex.mk b/target/linux/ramips/rt305x/profiles/olimex.mk
new file mode 100644
index 0000000..0c6276a
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/olimex.mk
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/RT5350F-OLINUXINO
+	NAME:=RT5350F-OLinuXino
+	PACKAGES:=\
+		kmod-usb-core kmod-usb-ohci kmod-usb2 \
+		kmod-i2c-core kmod-i2c-ralink \
+		kmod-spi-dev
+endef
+
+define Profile/RT5350F-OLINUXINO/Description
+	Package set for RT5350F-OLinuXino board
+endef
+$(eval $(call Profile,RT5350F-OLINUXINO))
+
+
+define Profile/RT5350F-OLINUXINO-EVB
+	NAME:=RT5350F-OLinuXino-EVB
+	PACKAGES:=\
+		kmod-usb-core kmod-usb-ohci kmod-usb2 \
+		kmod-i2c-core kmod-i2c-ralink \
+		kmod-spi-dev
+endef
+
+define Profile/RT5350F-OLINUXINO-EVB/Description
+	Package set for RT5350F-OLinuXino-EVB board
+endef
+$(eval $(call Profile,RT5350F-OLINUXINO-EVB))
diff --git a/target/linux/ramips/rt305x/profiles/planex.mk b/target/linux/ramips/rt305x/profiles/planex.mk
index d0d9ac9..50ce382 100644
--- a/target/linux/ramips/rt305x/profiles/planex.mk
+++ b/target/linux/ramips/rt305x/profiles/planex.mk
@@ -13,5 +13,4 @@ endef
 define Profile/MZK-DP150N/Description
 	Package set optimized for the Planex MZK-DP150N.
 endef
-
 $(eval $(call Profile,MZK-DP150N))
diff --git a/target/linux/ramips/rt305x/profiles/poray.mk b/target/linux/ramips/rt305x/profiles/poray.mk
index 572d0e3..7a68a5f 100644
--- a/target/linux/ramips/rt305x/profiles/poray.mk
+++ b/target/linux/ramips/rt305x/profiles/poray.mk
@@ -14,9 +14,9 @@ endef
 define Profile/IP2202/Description
 	Package set for Poray IP2202 board
 endef
-
 $(eval $(call Profile,IP2202))
 
+
 define Profile/M3
 	NAME:=Poray M3
 	PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
@@ -25,35 +25,37 @@ endef
 define Profile/M3/Description
 	Package set for Poray M3 board
 endef
-
 $(eval $(call Profile,M3))
 
+
 define Profile/M4
 	NAME:=Poray M4
 	PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
 endef
+
 define Profile/M4/Description
 	Package set for Poray M4 board
 endef
-
 $(eval $(call Profile,M4))
 
+
 define Profile/X5
 	NAME:=Poray X5/X6
 	PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
 endef
+
 define Profile/X5/Description
 	Package set for Poray X5/X6 board
 endef
-
 $(eval $(call Profile,X5))
 
+
 define Profile/X8
 	NAME:=Poray X8
 	PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer
 endef
+
 define Profile/X8/Description
 	Package set for Poray X8 board
 endef
-
 $(eval $(call Profile,X8))
diff --git a/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino-evb.mk b/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino-evb.mk
deleted file mode 100644
index 61f5ddb..0000000
--- a/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino-evb.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/RT5350F-OLINUXINO-EVB
-	NAME:=RT5350F-OLinuXino-EVB
-	PACKAGES:=\
-		kmod-usb-core kmod-usb-ohci kmod-usb2 \
-		kmod-i2c-core kmod-i2c-ralink \
-		kmod-spi-dev
-endef
-
-define Profile/RT5350F-OLINUXINO-EVB/Description
-	Package set for RT5350F-OLinuXino-EVB board
-endef
-
-$(eval $(call Profile,RT5350F-OLINUXINO-EVB))
-
diff --git a/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino.mk b/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino.mk
deleted file mode 100644
index 3b20190..0000000
--- a/target/linux/ramips/rt305x/profiles/rt5350f-olinuxino.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/RT5350F-OLINUXINO
-	NAME:=RT5350F-OLinuXino
-	PACKAGES:=\
-		kmod-usb-core kmod-usb-ohci kmod-usb2 \
-		kmod-i2c-core kmod-i2c-ralink \
-		kmod-spi-dev
-endef
-
-define Profile/RT5350F-OLINUXINO/Description
-	Package set for RT5350F-OLinuXino board
-endef
-
-$(eval $(call Profile,RT5350F-OLINUXINO))
diff --git a/target/linux/ramips/rt305x/profiles/tenda.mk b/target/linux/ramips/rt305x/profiles/tenda.mk
index 36ba822..a3c5d3b 100644
--- a/target/linux/ramips/rt305x/profiles/tenda.mk
+++ b/target/linux/ramips/rt305x/profiles/tenda.mk
@@ -15,9 +15,9 @@ endef
 define Profile/3G150B/Description
 	Package set for Tenda 3G150B board
 endef
-
 $(eval $(call Profile,3G150B))
 
+
 define Profile/3G300M
 	NAME:=Tenda 3G300M
 	PACKAGES:=\
@@ -28,9 +28,9 @@ endef
 define Profile/3G300M/Description
 	Package set for Tenda 3G300M board
 endef
-
 $(eval $(call Profile,3G300M))
 
+
 define Profile/W306R_V20
 	NAME:=Tenda W306R V2.0
 	PACKAGES:=
@@ -39,5 +39,4 @@ endef
 define Profile/W306R_V20/Description
 	Package set for Tenda W306R V2.0 board
 endef
-
 $(eval $(call Profile,W306R_V20))
diff --git a/target/linux/ramips/rt305x/profiles/upvel.mk b/target/linux/ramips/rt305x/profiles/upvel.mk
index 590abb0..c5d60f5 100644
--- a/target/linux/ramips/rt305x/profiles/upvel.mk
+++ b/target/linux/ramips/rt305x/profiles/upvel.mk
@@ -5,26 +5,27 @@
 # See /LICENSE for more information.
 #
 
-define Profile/UR-336UN
-	NAME:=UPVEL UR-336UN
+define Profile/UR-326N4G
+	NAME:=UPVEL UR-326N4G
 	PACKAGES:=\
 		kmod-usb-core kmod-usb-dwc2 \
 		kmod-ledtrig-usbdev
 endef
 
-define Profile/UR-336UN/Description
+define Profile/UR-326N4G/Description
 	Default package set compatible with URVEL router board.
 endef
-$(eval $(call Profile,UR-336UN))
+$(eval $(call Profile,UR-326N4G))
 
-define Profile/UR-326N4G
-	NAME:=UPVEL UR-326N4G
+
+define Profile/UR-336UN
+	NAME:=UPVEL UR-336UN
 	PACKAGES:=\
 		kmod-usb-core kmod-usb-dwc2 \
 		kmod-ledtrig-usbdev
 endef
 
-define Profile/UR-326N4G/Description
+define Profile/UR-336UN/Description
 	Default package set compatible with URVEL router board.
 endef
-$(eval $(call Profile,UR-326N4G))
+$(eval $(call Profile,UR-336UN))
diff --git a/target/linux/ramips/rt305x/profiles/vocore.mk b/target/linux/ramips/rt305x/profiles/vocore.mk
index 92f3ce5..2ba3499 100644
--- a/target/linux/ramips/rt305x/profiles/vocore.mk
+++ b/target/linux/ramips/rt305x/profiles/vocore.mk
@@ -16,5 +16,4 @@ endef
 define Profile/VOCORE/Description
 	Package set for VoCore board
 endef
-
 $(eval $(call Profile,VOCORE))
diff --git a/target/linux/ramips/rt305x/profiles/wansview.mk b/target/linux/ramips/rt305x/profiles/wansview.mk
index 064cc06..0908a9c 100644
--- a/target/linux/ramips/rt305x/profiles/wansview.mk
+++ b/target/linux/ramips/rt305x/profiles/wansview.mk
@@ -7,12 +7,11 @@
 
 define Profile/NCS601W
 	NAME:=Wansview NCS601W
-        PACKAGES:=kmod-video-core kmod-video-uvc \
+	PACKAGES:=kmod-video-core kmod-video-uvc \
 		kmod-usb-core kmod-usb-ohci
 endef
 
 define Profile/NCS601W/Description
 	Package set for Wansview NCS601W board
 endef
-
 $(eval $(call Profile,NCS601W))
diff --git a/target/linux/ramips/rt3883/profiles/trendnet.mk b/target/linux/ramips/rt3883/profiles/trendnet.mk
index 89867ac..5a055ae 100644
--- a/target/linux/ramips/rt3883/profiles/trendnet.mk
+++ b/target/linux/ramips/rt3883/profiles/trendnet.mk
@@ -15,6 +15,7 @@ define Profile/TEW691GR/Description
 endef
 $(eval $(call Profile,TEW691GR))
 
+
 define Profile/TEW692GR
 	NAME:=TRENDnet TEW-692GR
 	PACKAGES:=swconfig
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:21 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:21 +0200
Subject: [OpenWrt-Devel] [PATCH v2 20/25] ramips: remove leading spaces,
	sort boards and optimize base-files/lib/ramips.sh
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-21-git-send-email-pepe2k@gmail.com>

This patch:
 * fixes various mistakes (leading spaces, wrong or missing model names)
 * shortens model strings (we don't need to use whole model string from dts file, make it for consistency and as optimization)
 * sorts boards alphabetically

in base-files/lib/ramips.sh script.

Case statement was tested after above changes with simple script, which:
 * takes model string from dts{,i} file (model = "...")
 * provides this value as case input ($machine)
 * returns output ($name)

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/lib/ramips.sh | 434 +++++++++++++--------------
 1 file changed, 217 insertions(+), 217 deletions(-)

diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 9e7e73f..5cafd45 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -13,96 +13,90 @@ ramips_board_detect() {
 	machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
 
 	case "$machine" in
-	*"7Links PX-4885")
-		name="px-4885"
+	*"3G150B")
+		name="3g150b"
 		;;
-	*"8devices Carambola")
-		name="carambola"
+	*"3G300M")
+		name="3g300m"
 		;;
-	*"Edimax 3g-6200n")
+	*"3g-6200n")
 		name="3g-6200n"
 		;;
-	*"Edimax 3g-6200nl")
+	*"3g-6200nl")
 		name="3g-6200nl"
 		;;
 	*"A5-V11")
 		name="a5-v11"
 		;;
-	*"Aigale Ai-BR100")
+	*"Ai-BR100")
 		name="ai-br100"
 		;;
-	*"Airlink101 AR670W")
-		name="ar670w"
-		;;
-	*"Airlink101 AR725W")
-		name="ar725w"
-		;;
-	*"AirLive Air3GII")
+	*"Air3GII")
 		name="air3gii"
 		;;
-	*"Edimax BR-6425")
-		name="br-6425"
-		;;
-	*"Allnet ALL0239-3G")
+	*"ALL0239-3G")
 		name="all0239-3g"
 		;;
-	*"Allnet ALL0256N")
+	*"ALL0256N")
 		name="all0256n"
 		;;
-	*"Allnet ALL5002")
+	*"ALL5002")
 		name="all5002"
 		;;
-	*"Allnet ALL5003")
+	*"ALL5003")
 		name="all5003"
 		;;
-	*"ARC FreeStation5")
-		name="freestation5"
+	*"AR670W")
+		name="ar670w"
 		;;
-	*"Archer C20i")
-		name="c20i"
+	*"AR725W")
+		name="ar725w"
+		;;
+	*"ASL26555")
+		name="asl26555"
 		;;
-	*"Argus ATP-52B")
+	*"ATP-52B")
 		name="atp-52b"
 		;;
-	*"AsiaRF AWM002 EVB")
+	*"AWAPN2403")
+		name="awapn2403"
+		;;
+	*"AWM002 EVB")
 		name="awm002-evb"
 		;;
-	*"AsiaRF AWM003 EVB")
+	*"AWM003 EVB")
 		name="awm003-evb"
 		;;
-	*"AsiaRF AWAPN2403")
-		name="awapn2403"
-		;;
-	*"Asus WL-330N")
-		name="wl-330n"
-		;;
-	*"Asus WL-330N3G")
-		name="wl-330n3g"
+	*"BC2")
+		name="bc2"
 		;;
-	*"Alpha ASL26555")
-		name="asl26555"
+	*"BR-6425")
+		name="br-6425"
 		;;
-	*"Aztech HW550-3G")
-		name="hw550-3g"
+	*"BR-6475nD")
+		name="br-6475nd"
 		;;
-	*"AXIMCom MR-102N")
-		name="mr-102n"
+	*"Broadway")
+		name="broadway"
 		;;
-	*"Buffalo WSR-600DHP")
-		name="wsr-600"
+	*"C20i")
+		name="c20i"
 		;;
-	*"Buffalo WSR-1166DHP")
-		name="wsr-1166"
+	*"Carambola")
+		name="carambola"
 		;;
-	*"Comfast CF-WR800N")
+	*"CF-WR800N")
 		name="cf-wr800n"
 		;;
-	*"Firefly FireWRT")
-		name="firewrt"
-		;;
 	*"CY-SWR1100")
 		name="cy-swr1100"
 		;;
+	*"D105")
+		name="d105"
+		;;
+	*"DAP-1350")
+		name="dap-1350"
+		;;
 	*"DCS-930")
 		name="dcs-930"
 		;;
@@ -127,18 +121,18 @@ ramips_board_detect() {
 	*"DIR-610 A1")
 		name="dir-610-a1"
 		;;
+	*"DIR-615 D")
+		name="dir-615-d"
+		;;
+	*"DIR-615 H1")
+		name="dir-615-h1"
+		;;
 	*"DIR-620 A1")
 		name="dir-620-a1"
 		;;
 	*"DIR-620 D1")
 		name="dir-620-d1"
 		;;
-	*"DIR-615 H1")
-		name="dir-615-h1"
-		;;
-	*"DIR-615 D")
-		name="dir-615-d"
-		;;
 	*"DIR-645")
 		name="dir-645"
 		;;
@@ -148,143 +142,155 @@ ramips_board_detect() {
 	*"DIR-860L B1")
 		name="dir-860l-b1"
 		;;
-	*"DAP-1350")
-		name="dap-1350"
+	*"E1700")
+		name="e1700"
 		;;
 	*"ESR-9753")
 		name="esr-9753"
 		;;
-	*"EASYACC WI-STOR WIZARD 8800")
-		name="wizard8800"
-		;;
-	*"Edimax BR-6475nD")
-		name="br-6475nd"
-		;;
-	*"F7C027")
-		name="f7c027"
-		;;
 	*"F5D8235 v1")
 		name="f5d8235-v1"
 		;;
 	*"F5D8235 v2")
 		name="f5d8235-v2"
 		;;
-	*"Hauppauge Broadway")
-		name="broadway"
+	*"F7C027")
+		name="f7c027"
 		;;
-	*"Huawei D105")
-		name="d105"
+	*"FireWRT")
+		name="firewrt"
 		;;
-	*"La Fonera 2.0N")
+	*"Fonera 2.0N")
 		name="fonera20n"
 		;;
-	*"Asus RT-N14U")
-		name="rt-n14u"
-		;;
-	*"Asus RT-N13U")
-		name="rt-n13u"
+	*"FreeStation5")
+		name="freestation5"
 		;;
-	*"MoFi Network MOFI3500-3GN")
-		name="mofi3500-3gn"
+	*"HG255D")
+		name="hg255d"
 		;;
-	*"HILINK HLK-RM04")
+	*"HLK-RM04")
 		name="hlk-rm04"
 		;;
-	*"HooToo HT-TM02")
+	*"HPM")
+		name="hpm"
+		;;
+	*"HT-TM02")
 		name="ht-tm02"
 		;;
-	*"HAME MPR-A1")
- 		name="mpr-a1"
- 		;;
-	*"HAME MPR-A2")
- 		name="mpr-a2"
- 		;;
-	*"Kingston MLW221")
-		name="mlw221"
+	*"HW550-3G")
+		name="hw550-3g"
 		;;
-	*"Kingston MLWG2")
-		name="mlwg2"
+	*"IP2202")
+		name="ip2202"
 		;;
-	*"Linksys E1700")
-		name="e1700"
+	*"M3")
+		name="m3"
 		;;
-	*"Linksys RE6500")
-		name="re6500"
+	*"M4")
+		name="m4"
 		;;
-	*"Planex MZK-750DHP")
-		name="mzk-750dhp"
+	*"Memory 2 Move")
+		name="m2m"
 		;;
-	*"Microduino MicroWRT")
+	*"MicroWRT")
 		name="microwrt"
 		;;
-	*"NBG-419N")
-		name="nbg-419n"
+	*"MiniEMBPlug")
+		name="miniembplug"
 		;;
-	*"Netgear WNCE2001")
-		name="wnce2001"
+	*"MiniEMBWiFi")
+		name="miniembwifi"
 		;;
-	*"NexAira BC2")
-		name="bc2"
+	*"MiWiFi Mini")
+		name="miwifi-mini"
 		;;
-	*"Nexx WT1520")
-		name="wt1520"
+	*"MLW221")
+		name="mlw221"
 		;;
-	*"Nexx WT3020")
-		name="wt3020"
+	*"MLWG2")
+		name="mlwg2"
 		;;
-	*"NW718")
-		name="nw718"
+	*"MOFI3500-3GN")
+		name="mofi3500-3gn"
 		;;
-	*"Intenso Memory 2 Move")
-		name="m2m"
+	*"MPR-A1")
+		name="mpr-a1"
 		;;
-	*"Omnima HPM")
-		name="hpm"
+	*"MPR-A2")
+		name="mpr-a2"
 		;;
-	*"Omnima MiniEMBWiFi")
-		name="miniembwifi"
+	*"MR-102N")
+		name="mr-102n"
 		;;
-	*"Omnima MiniEMBPlug")
-		name="miniembplug"
+	*"MT7620a + MT7530 evaluation"*)
+		name="mt7620a_mt7530"
 		;;
-	*"Olimex RT5350F-OLinuXino")
-		name="rt5350f-olinuxino"
+	*"MT7620a V22SG"*)
+		name="mt7620a_v22sg"
 		;;
-	*"Olimex RT5350F-OLinuXino-EVB")
-		name="rt5350f-olinuxino-evb"
+	*"MT7621 evaluation"*)
+		name="mt7621"
 		;;
-	*"PBR-M1")
-		name="pbr-m1"
+	*"MT7628AN evaluation"*)
+		name="mt7628"
 		;;
-	*"Petatel PSR-680W"*)
-		name="psr-680w"
+	*"MT7688 evaluation"*)
+		name="mt7688"
+		;;
+	*"MZK-750DHP")
+		name="mzk-750dhp"
 		;;
-	*"Planex MZK-W300NH2"*)
+	*"MZK-DP150N")
+		name="mzk-dp150n"
+		;;
+	*"MZK-W300NH2"*)
 		name="mzk-w300nh2"
 		;;
-	*"Poray IP2202")
-		name="ip2202"
+	*"NA930")
+		name="na930"
 		;;
-	*"Poray M3")
-		name="m3"
+	*"NBG-419N")
+		name="nbg-419n"
 		;;
-	*"Poray M4")
-		name="m4"
+	*"NCS601W")
+		name="ncs601w"
 		;;
-	*"Poray X5")
-		name="x5"
+	*"NW718")
+		name="nw718"
 		;;
-	*"Poray X8")
-		name="x8"
+	*"OY-0001")
+		name="oy-0001"
+		;;
+	*"PBR-M1")
+		name="pbr-m1"
+		;;
+	*"PSR-680W"*)
+		name="psr-680w"
 		;;
 	*"PWH2004")
 		name="pwh2004"
 		;;
-	*"Asus RP-N53")
+	*"PX-4885")
+		name="px-4885"
+		;;
+	*"Q7")
+		name="zte-q7"
+		;;
+	*"RE6500")
+		name="re6500"
+		;;
+	*"RN502J")
+		name="xdxrn502j"
+		;;
+	*"RP-N53")
 		name="rp-n53"
 		;;
-	*"Ralink MT7620a + MT7530 evaluation board")
-		name="mt7620a_mt7530"
+	*"RT5350F-OLinuXino")
+		name="rt5350f-olinuxino"
+		;;
+	*"RT5350F-OLinuXino-EVB")
+		name="rt5350f-olinuxino-evb"
 		;;
 	*"RT-G32 B1")
 		name="rt-g32-b1"
@@ -292,6 +298,12 @@ ramips_board_detect() {
 	*"RT-N10+")
 		name="rt-n10-plus"
 		;;
+	*"RT-N13U")
+		name="rt-n13u"
+		;;
+	*"RT-N14U")
+		name="rt-n14u"
+		;;
 	*"RT-N15")
 		name="rt-n15"
 		;;
@@ -301,14 +313,26 @@ ramips_board_detect() {
 	*"RUT5XX")
 		name="rut5xx"
 		;;
-	*"Skyline SL-R7205"*)
+	*"SAP-G3200U3")
+		name="sap-g3200u3"
+		;;
+	*"SL-R7205"*)
 		name="sl-r7205"
 		;;
-	*"Sparklan WCR-150GN")
-		name="wcr-150gn"
+	*"TEW-691GR")
+		name="tew-691gr"
 		;;
-	*"STORYLiNK SAP-G3200U3")
-		name="sap-g3200u3"
+	*"TEW-692GR")
+		name="tew-692gr"
+		;;
+	*"UR-326N4G")
+		name="ur-326n4g"
+		;;
+	*"UR-336UN")
+		name="ur-336un"
+		;;
+	*"V11ST-FE")
+		name="v11st-fe"
 		;;
 	*"V22RW-2X2")
 		name="v22rw-2x2"
@@ -316,11 +340,20 @@ ramips_board_detect() {
 	*"VoCore")
 		name="vocore"
 		;;
+	*"W150M")
+		name="w150m"
+		;;
+	*"W306R V2.0")
+		name="w306r-v20"
+		;;
 	*"W502U")
 		name="w502u"
 		;;
-	*"WMR-300")
-		name="wmr-300"
+	*"WCR-150GN")
+		name="wcr-150gn"
+		;;
+	*"WHR-1166D")
+		name="whr-1166d"
 		;;
 	*"WHR-300HP2")
 		name="whr-300hp2"
@@ -328,107 +361,74 @@ ramips_board_detect() {
 	*"WHR-600D")
 		name="whr-600d"
 		;;
-	*"WHR-1166D")
-		name="whr-1166d"
-		;;
 	*"WHR-G300N")
 		name="whr-g300n"
 		;;
-	*"Sitecom WL-341 v3")
-		name="wl-341v3"
-		;;
-	*"Sitecom WL-351 v1 002")
-		name="wl-351"
-		;;
-	*"Tenda 3G300M")
-		name="3g300m"
-		;;
-	*"Tenda 3G150B")
-		name="3g150b"
-		;;
-	*"Tenda W306R V2.0")
-		name="w306r-v20"
+	*"WIZARD 8800")
+		name="wizard8800"
 		;;
-	*"Tenda W150M")
-		name="w150m"
+	*"WL-330N")
+		name="wl-330n"
 		;;
-	*"TEW-691GR")
-		name="tew-691gr"
+	*"WL-330N3G")
+		name="wl-330n3g"
 		;;
-	*"TEW-692GR")
-		name="tew-692gr"
+	*"WL-341 v3")
+		name="wl-341v3"
 		;;
-	*"Ralink V11ST-FE")
-		name="v11st-fe"
+	*"WL-351 v1 002")
+		name="wl-351"
 		;;
 	*"WLI-TX4-AG300N")
 		name="wli-tx4-ag300n"
 		;;
-	*"WZR-AGL300NH")
-		name="wzr-agl300nh"
-		;;
-	*"WR512-3GN-like router")
-		name="wr512-3gn"
+	*"WMR-300")
+		name="wmr-300"
 		;;
-	*"UPVEL UR-326N4G")
-		name="ur-326n4g"
+	*"WNCE2001")
+		name="wnce2001"
 		;;
-	*"UPVEL UR-336UN")
-		name="ur-336un"
+	*"WR512-3GN-like"*)
+		name="wr512-3gn"
 		;;
-	*"AWB WR6202")
+	*"WR6202")
 		name="wr6202"
 		;;
-	*"XDX RN502J")
-		name="xdxrn502j"
-		;;
-	*"HG255D")
-		name="hg255d"
-		;;
-	*"V22SG")
-		name="v22sg"
-		;;
 	*"WRTNODE")
 		name="wrtnode"
 		;;
-	*"Wansview NCS601W")
-		name="ncs601w"
+	*"WSR-1166DHP")
+		name="wsr-1166"
 		;;
-	*"Xiaomi MiWiFi Mini")
-		name="miwifi-mini"
+	*"WSR-600DHP")
+		name="wsr-600"
 		;;
-	*"Sercomm NA930")
-		name="na930"
+	*"WT1520")
+		name="wt1520"
 		;;
-	*"Zbtlink ZBT-WA05")
-		name="zbt-wa05"
+	*"WT3020")
+		name="wt3020"
 		;;
-	*"OY-0001")
-		name="oy-0001"
+	*"WZR-AGL300NH")
+		name="wzr-agl300nh"
 		;;
-	*"Zbtlink ZBT-WR8305RT")
-		name="zbt-wr8305rt"
+	*"X5")
+		name="x5"
 		;;
-	*"ZTE Q7")
-		name="zte-q7"
+	*"X8")
+		name="x8"
 		;;
-	*"Lenovo Y1")
+	*"Y1")
 		name="y1"
 		;;
-	*"Lenovo Y1S")
+	*"Y1S")
 		name="y1s"
 		;;
-	*"Mediatek MT7621 evaluation board")
-		name="mt7621"
-		;;
-	*"Mediatek MT7628AN evaluation board")
-		name="mt7628"
-		;;
-	*"Mediatek MT7688 evaluation board")
-		name="mt7688"
+	*"ZBT-WA05")
+		name="zbt-wa05"
 		;;
-	*"Planex MZK-DP150N")
-		name="mzk-dp150n"
+	*"ZBT-WR8305RT")
+		name="zbt-wr8305rt"
 		;;
 	*)
 		name="generic"
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:22 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:22 +0200
Subject: [OpenWrt-Devel] [PATCH v2 21/25] ramips: be consistent with case
	statement in base-files/lib/upgrade/platform.sh
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-22-git-send-email-pepe2k@gmail.com>

Always use "|\" (without spaces) and keep boards in alphabetical order.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 .../ramips/base-files/lib/upgrade/platform.sh      | 234 ++++++++++-----------
 1 file changed, 117 insertions(+), 117 deletions(-)

diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index b5e0f5f..4d261a5 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -14,120 +14,120 @@ platform_check_image() {
 	[ "$#" -gt 1 ] && return 1
 
 	case "$board" in
-	3g-6200n | \
-	3g-6200nl | \
-	3g150b | \
-	3g300m | \
-	a5-v11 | \
-	air3gii | \
-	ai-br100 |\
-	all0239-3g | \
-	all0256n | \
-	all5002 | \
-	all5003 | \
-	ar725w | \
-	asl26555 | \
-	awapn2403 | \
-	awm002-evb | \
-	awm003-evb | \
-	bc2 | \
-	broadway | \
-	carambola | \
-	cf-wr800n | \
-	d105 | \
-	dap-1350 | \
-	dcs-930 | \
-	dcs-930l-b1 | \
-	dir-300-b1 | \
-	dir-300-b7 | \
-	dir-320-b1 | \
-	dir-600-b1 | \
-	dir-600-b2 | \
-	dir-615-d | \
-	dir-615-h1 | \
-	dir-620-a1 | \
-	dir-620-d1 | \
-	dir-810l | \
-	e1700 | \
-	esr-9753 | \
-	f7c027 | \
-	fonera20n | \
-	freestation5 | \
-	firewrt |\
-	pbr-m1 |\
-	hg255d | \
-	hlk-rm04 | \
-	ht-tm02 | \
-	hw550-3g | \
-	ip2202 | \
-	m2m | \
-	m3 | \
-	m4 | \
-	microwrt | \
-	mlw221 | \
-	mlwg2 | \
-	mofi3500-3gn | \
-	mpr-a1 | \
-	mpr-a2 | \
-	mr-102n | \
-	mzk-w300nh2 | \
-	mzk-dp150n | \
-	nbg-419n | \
-	nw718 | \
-	miniembwifi | \
-	hpm | \
-	miniembplug | \
-	rt5350f-olinuxino | \
-	rt5350f-olinuxino-evb | \
-	psr-680w | \
-	px-4885 | \
-	re6500 | \
-	rp-n53 | \
-	rt-g32-b1 | \
-	rt-n10-plus | \
-	rt-n13u | \
-	rt-n14u | \
-	rt-n15 | \
-	rt-n56u | \
-	rut5xx | \
-	sap-g3200u3 | \
-	sl-r7205 | \
-	tew-691gr | \
-	tew-692gr | \
-	ur-326n4g |\
-	ur-336un |\
-	v22rw-2x2 | \
-	vocore | \
-	w150m | \
-	w306r-v20 |\
-	w502u |\
-	whr-g300n |\
-	whr-300hp2 |\
-	whr-600d |\
-	whr-1166d |\
-	wsr-600 |\
-	wl-330n | \
-	wl-330n3g | \
-	wl-351 | \
-	wl-341v3 | \
-	wli-tx4-ag300n | \
-	wzr-agl300nh | \
-	wmr-300 |\
-	wnce2001 | \
-	wr512-3gn |\
-	wr6202 |\
-	zbt-wr8305rt |\
-	wrtnode |\
-	oy-0001 |\
-	wt1520 |\
-	wt3020 |\
-	x5 |\
-	x8 |\
-	miwifi-mini |\
-	y1 |\
-	y1s |\
-	zte-q7 |\
-	zbt-wa05)
+	3g150b|\
+	3g300m|\
+	3g-6200n|\
+	3g-6200nl|\
+	a5-v11|\
+	ai-br100|\
+	air3gii|\
+	all0239-3g|\
+	all0256n|\
+	all5002|\
+	all5003|\
+	ar725w|\
+	asl26555|\
+	awapn2403|\
+	awm002-evb|\
+	awm003-evb|\
+	bc2|\
+	broadway|\
+	carambola|\
+	cf-wr800n|\
+	d105|\
+	dap-1350|\
+	dcs-930|\
+	dcs-930l-b1|\
+	dir-300-b1|\
+	dir-300-b7|\
+	dir-320-b1|\
+	dir-600-b1|\
+	dir-600-b2|\
+	dir-615-d|\
+	dir-615-h1|\
+	dir-620-a1|\
+	dir-620-d1|\
+	dir-810l|\
+	e1700|\
+	esr-9753|\
+	f7c027|\
+	firewrt|\
+	fonera20n|\
+	freestation5|\
+	hg255d|\
+	hlk-rm04|\
+	hpm|\
+	ht-tm02|\
+	hw550-3g|\
+	ip2202|\
+	m2m|\
+	m3|\
+	m4|\
+	microwrt|\
+	miniembplug|\
+	miniembwifi|\
+	miwifi-mini|\
+	mlw221|\
+	mlwg2|\
+	mofi3500-3gn|\
+	mpr-a1|\
+	mpr-a2|\
+	mr-102n|\
+	mzk-dp150n|\
+	mzk-w300nh2|\
+	nbg-419n|\
+	nw718|\
+	oy-0001|\
+	pbr-m1|\
+	psr-680w|\
+	px-4885|\
+	re6500|\
+	rp-n53|\
+	rt5350f-olinuxino|\
+	rt5350f-olinuxino-evb|\
+	rt-g32-b1|\
+	rt-n10-plus|\
+	rt-n13u|\
+	rt-n14u|\
+	rt-n15|\
+	rt-n56u|\
+	rut5xx|\
+	sap-g3200u3|\
+	sl-r7205|\
+	tew-691gr|\
+	tew-692gr|\
+	ur-326n4g|\
+	ur-336un|\
+	v22rw-2x2|\
+	vocore|\
+	w150m|\
+	w306r-v20|\
+	w502u|\
+	whr-1166d|\
+	whr-300hp2|\
+	whr-600d|\
+	whr-g300n|\
+	wl-330n|\
+	wl-330n3g|\
+	wl-341v3|\
+	wl-351|\
+	wli-tx4-ag300n|\
+	wmr-300|\
+	wnce2001|\
+	wr512-3gn|\
+	wr6202|\
+	wrtnode|\
+	wsr-600|\
+	wt1520|\
+	wt3020|\
+	wzr-agl300nh|\
+	x5|\
+	x8|\
+	y1|\
+	y1s|\
+	zbt-wa05|\
+	zbt-wr8305rt|\
+	zte-q7)
 		[ "$magic" != "27051956" ] && {
 			echo "Invalid image type."
 			return 1
@@ -148,9 +148,9 @@ platform_check_image() {
 		}
 		return 0
 		;;
-	cy-swr1100 |\
-	dir-610-a1 |\
-	dir-645 |\
+	cy-swr1100|\
+	dir-610-a1|\
+	dir-645|\
 	dir-860l-b1)
 		[ "$magic" != "5ea3a417" ] && {
 			echo "Invalid image type."
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:23 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:23 +0200
Subject: [OpenWrt-Devel] [PATCH v2 22/25] ramips: fix indentation,
	case statements structure and optimize
	base-files/etc/board.d/02_network
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-23-git-send-email-pepe2k@gmail.com>

The following patch:
 * fixes wrong indentation
 * combines together boards with same configuration
 * removes unnecessary spaces
 * removes empty lines after ";;" and uses only "|\" (for consistency)
 * orders boards alphabetically

in base-files/etc/board.d/02_network script.

One bug was left untouched: freestation5 board is listed twice in case statement, in ramips_setup_macs().

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 .../linux/ramips/base-files/etc/board.d/02_network | 390 +++++++++------------
 1 file changed, 170 insertions(+), 220 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 8c19b40..6a2f042 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -37,175 +37,160 @@ ramips_setup_interfaces()
 	ucidef_set_interface_loopback
 
 	case $board in
-	a5-v11)
-		ucidef_set_interface_lan "eth0.1"
-		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "0 6t"
-		;;
-
-	3g150b | \
-	3g300m | \
-	microwrt | \
-	w150m | \
-	zte-q7 | \
-	all0256n | \
-	all5002 | \
-	all5003 | \
-	broadway | \
-	dcs-930| \
-	dcs-930l-b1| \
-	ht-tm02| \
-	ncs601w | \
-	wnce2001)
+	3g150b|\
+	3g300m|\
+	all0256n|\
+	all5002|\
+	all5003|\
+	broadway|\
+	dcs-930|\
+	dcs-930l-b1|\
+	ht-tm02|\
+	microwrt|\
+	ncs601w|\
+	w150m|\
+	wnce2001|\
+	zte-q7)
 		ucidef_add_switch "switch0" "1" "0"
 		ucidef_set_interface_lan "eth0"
 		;;
-
-	3g-6200nl | \
-	mlw221 | \
+	3g-6200nl|\
+	mlw221|\
 	mr-102n)
 		ucidef_set_interface_lan "eth0.2"
 		;;
-	mlwg2)
+	3g-6200n|\
+	ai-br100|\
+	dir-300-b7|\
+	dir-320-b1|\
+	dir-610-a1|\
+	dir-615-h1|\
+	firewrt|\
+	hlk-rm04|\
+	miwifi-mini|\
+	mt7621|\
+	mt7628|\
+	mzk-750dhp|\
+	mzk-w300nh2|\
+	oy-0001|\
+	pbr-m1|\
+	sap-g3200u3|\
+	whr-300hp2|\
+	whr-600d|\
+	wsr-1166|\
+	wsr-600|\
+	wt1520|\
+	y1)
+		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+		ucidef_add_switch "switch0" "1" "1"
+		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
+		ucidef_add_switch_vlan "switch0" "2" "4 6t"
+		;;
+	a5-v11)
 		ucidef_set_interface_lan "eth0.1"
+		ucidef_add_switch "switch0" "1" "1"
+		ucidef_add_switch_vlan "switch0" "1" "0 6t"
 		;;
-
-	m2m)
-		ucidef_add_switch "switch0" "4"
-		ucidef_set_interface_lan "eth0"
+	ar670w|\
+	ar725w|\
+	rt-n15|\
+	wl-351)
+		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+		ucidef_add_switch "switch0" "1" "1"
+		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
+		ucidef_add_switch_vlan "switch0" "2" "4 5t"
 		;;
-
-	wizard8800 | \
-	wl-330n | \
-	wmr-300)
+	asl26555|\
+	re6500)
 		ucidef_set_interface_lan "eth0.1"
+		ucidef_add_switch "switch0" "1" "1"
+		ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
 		;;
-
-	b2c | \
-	nw718 | \
-	psr-680w | \
-	sl-r7205 | \
-	w502u | \
-	wr6202)
+	atp-52b|\
+	awm002-evb|\
+	awm003-evb|\
+	dir-645|\
+	dir-860l-b1|\
+	f5d8235-v1|\
+	f5d8235-v2|\
+	hg255d|\
+	rt-n14u|\
+	ur-326n4g|\
+	wrtnode|\
+	wt3020|\
+	zbt-wa05)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+		ucidef_add_switch "switch0" "1" "1"
+		ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
+		ucidef_add_switch_vlan "switch0" "2" "0 6t"
 		;;
-
 	awapn2403)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
 		ucidef_add_switch_vlan "switch0" "1" "0 6t"
 		ucidef_add_switch_vlan "switch0" "2" "1 6t"
 		;;
-
+	b2c|\
+	nw718|\
+	psr-680w|\
+	sl-r7205|\
+	ur-336un|\
+	w502u|\
+	wr6202)
+		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+		;;
 	br-6475nd)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
 		ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
 		ucidef_add_switch_vlan "switch0" "2" "0 9t"
 		;;
-
-        re6500 | \
-	asl26555)
-		ucidef_set_interface_lan "eth0.1"
-		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
-		;;
-
 	cf-wr800n)
 		ucidef_set_interface_lan "eth0.1"
 		ucidef_add_switch "switch0" "1" "1"
 		ucidef_add_switch_vlan "switch0" "1" "4 6t"
 		;;
-
 	cy-swr1100)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
 		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 9t"
 		ucidef_add_switch_vlan "switch0" "2" "4 9t"
 		;;
-
-	3g-6200n | \
-	ai-br100 | \
-	dir-610-a1 | \
-	dir-300-b7 | \
-	dir-320-b1 | \
-	dir-615-h1 | \
-	firewrt | \
-	pbr-m1 | \
-	hlk-rm04 | \
-	mt7621 | \
-	mt7628 | \
-	mzk-w300nh2 | \
-	mzk-750dhp | \
-	whr-300hp2 | \
-	whr-600d | \
-	oy-0001 | \
-	sap-g3200u3 | \
-	wsr-600 | \
-	wsr-1166 | \
-	wt1520 | \
-	miwifi-mini |\
-	y1)
-		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
-		ucidef_add_switch_vlan "switch0" "2" "4 6t"
-		;;
-
-	whr-1166d)
-		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
-		ucidef_add_switch_vlan "switch0" "2" "5 6t"
+	d105|\
+	hpm|\
+	na930|\
+	wli-tx4-ag300n)
+		ucidef_set_interface_lan "eth0"
 		;;
-
-	awm002-evb | \
-	awm003-evb | \
-	atp-52b | \
-	dir-645 | \
-	dir-860l-b1 | \
-	f5d8235-v1 | \
-	f5d8235-v2 | \
-	hg255d | \
-	rt-n14u | \
-	wrtnode | \
-	wt3020 | \
-	ur-326n4g | \
-	zbt-wa05)
+	e1700|\
+	mt7620a_mt7530)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
-		ucidef_add_switch_vlan "switch0" "2" "0 6t"
+		ucidef_add_switch "switch1" "1" "1"
+		ucidef_add_switch_vlan "switch1" "1" "0 1 2 3 6t"
+		ucidef_add_switch_vlan "switch1" "2" "4 6t"
 		;;
-
-	ur-336un)
-		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+	m2m)
+		ucidef_add_switch "switch0" "4"
+		ucidef_set_interface_lan "eth0"
 		;;
-
-	v11st-fe)
-		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
-		ucidef_add_switch_vlan "switch0" "2" "0 5t"
+	mlwg2|\
+	wizard8800|\
+	wl-330n|\
+	wmr-300)
+		ucidef_set_interface_lan "eth0.1"
 		;;
-
-	ar670w | \
-	ar725w | \
-	rt-n15 | \
-	wl-351)
-		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+	mzk-dp150n|\
+	vocore)
+		ucidef_set_interface_lan "eth0.1"
 		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
-		ucidef_add_switch_vlan "switch0" "2" "4 5t"
+		ucidef_add_switch_vlan "switch0" "1" "0 4 6t"
 		;;
-
 	rt-n56u)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
 		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 8t"
 		ucidef_add_switch_vlan "switch0" "2" "4 8t"
 		;;
-
 	tew-691gr|\
 	tew-692gr)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
@@ -213,61 +198,37 @@ ramips_setup_interfaces()
 		ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
 		ucidef_add_switch_vlan "switch0" "2" "0t 5"
 		;;
-
-	vocore)
-		ucidef_set_interface_lan "eth0.1"
+	v11st-fe|\
+	wzr-agl300nh)
+		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "0 4 6t"
+		ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
+		ucidef_add_switch_vlan "switch0" "2" "0 5t"
 		;;
-
 	wcr-150gn)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
 		ucidef_add_switch_vlan "switch0" "1" "0 6t"
 		ucidef_add_switch_vlan "switch0" "2" "6t"
 		;;
-
-	zbt-wr8305rt)
+	whr-1166d)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
-		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 6t"
-		ucidef_add_switch_vlan "switch0" "2" "4 6t"
+		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
+		ucidef_add_switch_vlan "switch0" "2" "5 6t"
 		;;
-
 	y1s)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
 		ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5 6t"
 		ucidef_add_switch_vlan "switch0" "2" "0 6t"
 		;;
-	d105 | \
-	na930 | \
-	hpm|\
-	wli-tx4-ag300n)
-		ucidef_set_interface_lan "eth0"
-		;;
-
-	e1700 | \
-	mt7620a_mt7530)
-		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-		ucidef_add_switch "switch1" "1" "1"
-		ucidef_add_switch_vlan "switch1" "1" "0 1 2 3 6t"
-		ucidef_add_switch_vlan "switch1" "2" "4 6t"
-		;;
-
-	wzr-agl300nh)
+	zbt-wr8305rt)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
-		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"
+		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 6t"
+		ucidef_add_switch_vlan "switch0" "2" "4 6t"
 		;;
-
 	*)
 		RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
 		if [ -n "${RT3X5X}" ]; then
@@ -286,93 +247,83 @@ ramips_setup_macs()
 	local wan_mac=""
 
 	case $board in
-	br-6475nd)
+	a5-v11|\
+	bc2|\
+	broadway|\
+	d105|\
+	dir-300-b7|\
+	dir-320-b1|\
+	dir-620-a1|\
+	esr-9753|\
+	freestation5|\
+	hlk-rm04|\
+	mpr-a1|\
+	mpr-a2|\
+	psr-680w|\
+	sl-r7205|\
+	y1|\
+	y1s)
 		lan_mac=$(cat /sys/class/net/eth0/address)
-		wan_mac=$(mtd_get_mac_binary devdata 7)
+		lan_mac=$(macaddr_setbit_la "$lan_mac")
+		wan_mac=$(macaddr_add "$lan_mac" 1)
 		;;
-
-	oy-0001)
-		lan_mac=$(mtd_get_mac_binary factory 40)
+	all0239-3g|\
+	carambola|\
+	freestation5|\
+	w502u|\
+	wnce2001)
 		wan_mac=$(mtd_get_mac_binary factory 46)
 		;;
-
-	w306r-v20)
+	br-6475nd)
 		lan_mac=$(cat /sys/class/net/eth0/address)
-		wan_mac=$(macaddr_add "$lan_mac" 5)
+		wan_mac=$(mtd_get_mac_binary devdata 7)
 		;;
-
-	tew-691gr)
-		lan_mac=$(cat /sys/class/net/eth0/address)
-		wan_mac=$(macaddr_add "$lan_mac" 3)
+	cy-swr1100|\
+	dir-645)
+		lan_mac=$(mtd_get_mac_ascii nvram lanmac)
+		wan_mac=$(mtd_get_mac_ascii nvram wanmac)
 		;;
-
-	tew-692gr)
+	e1700)
+		wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
+		;;
+	ht-tm02)
 		lan_mac=$(cat /sys/class/net/eth0/address)
-		wan_mac=$(macaddr_add "$lan_mac" 4)
 		;;
-
-	m3 |\
-	m4 |\
-	x5 |\
+	m3|\
+	m4|\
+	x5|\
 	x8)
 		lan_mac=$(cat /sys/class/net/eth0/address)
 		lan_mac=$(macaddr_add "$lan_mac" -2)
 		;;
-
-	a5-v11 |\
-	bc2 |\
-	broadway |\
-	d105 |\
-	dir-620-a1 |\
-	esr-9753 |\
-	freestation5 |\
-	hlk-rm04 | \
-	mpr-a1 | \
-	mpr-a2 | \
-	dir-300-b7 | \
-	dir-320-b1 | \
-	psr-680w |\
-	sl-r7205 |\
-	y1 |\
-	y1s)
+	oy-0001)
+		lan_mac=$(mtd_get_mac_binary factory 40)
+		wan_mac=$(mtd_get_mac_binary factory 46)
+		;;
+	rt-n56u)
 		lan_mac=$(cat /sys/class/net/eth0/address)
 		lan_mac=$(macaddr_setbit_la "$lan_mac")
-		wan_mac=$(macaddr_add "$lan_mac" 1)
+		wan_mac=$(mtd_get_mac_binary factory 32772)
 		;;
-
-	ht-tm02)
+	tew-691gr)
 		lan_mac=$(cat /sys/class/net/eth0/address)
+		wan_mac=$(macaddr_add "$lan_mac" 3)
 		;;
-
-	cy-swr1100 | \
-	dir-645)
-		lan_mac=$(mtd_get_mac_ascii nvram lanmac)
-		wan_mac=$(mtd_get_mac_ascii nvram wanmac)
+	tew-692gr)
+		lan_mac=$(cat /sys/class/net/eth0/address)
+		wan_mac=$(macaddr_add "$lan_mac" 4)
 		;;
-
-	e1700)
-		wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
+	w306r-v20)
+		lan_mac=$(cat /sys/class/net/eth0/address)
+		wan_mac=$(macaddr_add "$lan_mac" 5)
 		;;
-
 	wcr-150gn)
 		wan_mac=$(mtd_get_mac_binary factory 40)
 		;;
-
-	rt-n56u)
-		lan_mac=$(cat /sys/class/net/eth0/address)
-		lan_mac=$(macaddr_setbit_la "$lan_mac")
-		wan_mac=$(mtd_get_mac_binary factory 32772)
-		;;
-
-	all0239-3g | \
-	carambola | \
-	freestation5 | \
-	w502u | \
-	wnce2001)
-		wan_mac=$(mtd_get_mac_binary factory 46)
-		;;
-
-	wsr-600|whr-300hp2|whr-600d|whr-1166d)
+	whr-1166d|\
+	whr-300hp2|\
+	whr-600d|\
+	wsr-600)
 		wan_mac=$(mtd_get_mac_binary factory 4)
 		lan_mac=$wan_mac
 		;;
@@ -385,7 +336,6 @@ ramips_setup_macs()
 		lan_mac=$(cat /sys/class/net/eth0/address)
 		wan_mac=$(macaddr_add "$lan_mac" 1)
 		;;
-
 	esac
 
 	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:24 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:24 +0200
Subject: [OpenWrt-Devel] [PATCH v2 23/25] ramips: remove unnecessary LED
	declaration for WT1520 in diag.sh
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-24-git-send-email-pepe2k@gmail.com>

This device doesn't have defined LEDs in its dts file.

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/diag.sh | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 1e0a15e..b776070 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -208,9 +208,6 @@ get_status_led() {
 	wnce2001)
 		status_led="netgear:green:power"
 		;;
-	nexx-wt1520)
-		status_led="nexx-wt1520:white:power"
-		;;
 	wt3020)
 		status_led="nexx:blue:power"
 		;;
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:25 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:25 +0200
Subject: [OpenWrt-Devel] [PATCH v2 24/25] ramips: use consistent naming
	scheme for LEDs
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-25-git-send-email-pepe2k@gmail.com>

The upstream LED naming convention is "device:color:led-name", but it seems that many of supported boards in OpenWrt don't follow this approach.
The following patch fixes this inconsistency in dts{,i} files and updates base-files scripts for ramips target:
 * fixes wrong indentation
 * keeps case statements structure in same convention as in other scripts (no empty line after ";;", no indentation for case...esac body)
 * fixes wrong LED names for some of boards (makes them the same as in dts{,i} files)
 * combines boards with same configuration (ex. set_wifi_led "rt2800pci-phy0::radio" in 01_leds)

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds | 520 +++++++++++----------
 target/linux/ramips/base-files/etc/diag.sh         | 252 ++++++----
 target/linux/ramips/dts/3G-6200N.dts               |   6 +-
 target/linux/ramips/dts/3G-6200NL.dts              |   2 +-
 target/linux/ramips/dts/3G150B.dts                 |   4 +-
 target/linux/ramips/dts/3G300M.dts                 |  12 +-
 target/linux/ramips/dts/AI-BR100.dts               |   4 +-
 target/linux/ramips/dts/AIR3GII.dts                |   4 +-
 target/linux/ramips/dts/ALL0239-3G.dts             |   8 +-
 target/linux/ramips/dts/ALL5002.dts                |   4 +-
 target/linux/ramips/dts/ALL5003.dts                |   4 +-
 target/linux/ramips/dts/AWAPN2403.dts              |   2 +-
 target/linux/ramips/dts/AWM002.dtsi                |   4 +-
 target/linux/ramips/dts/AWM003-EVB.dts             |   6 +-
 target/linux/ramips/dts/BR-6425.dts                |   4 +-
 target/linux/ramips/dts/BR-6475ND.dts              |   6 +-
 target/linux/ramips/dts/BROADWAY.dts               |   4 +-
 target/linux/ramips/dts/CF-WR800N.dts              |   6 +-
 target/linux/ramips/dts/CY-SWR1100.dts             |   4 +-
 target/linux/ramips/dts/DAP-1350.dts               |   6 +-
 target/linux/ramips/dts/DCS-930.dts                |   6 +-
 target/linux/ramips/dts/DCS-930L-B1.dts            |   4 +-
 target/linux/ramips/dts/DIR-300-B1.dts             |  10 +-
 target/linux/ramips/dts/DIR-300-B7.dts             |   4 +-
 target/linux/ramips/dts/DIR-320-B1.dts             |   6 +-
 target/linux/ramips/dts/DIR-600-B1.dts             |  10 +-
 target/linux/ramips/dts/DIR-600-B2.dts             |  10 +-
 target/linux/ramips/dts/DIR-610-A1.dts             |   4 +-
 target/linux/ramips/dts/DIR-615-D.dts              |  10 +-
 target/linux/ramips/dts/DIR-615-H1.dts             |  10 +-
 target/linux/ramips/dts/DIR-620-A1.dts             |  12 +-
 target/linux/ramips/dts/DIR-620-D1.dts             |   4 +-
 target/linux/ramips/dts/DIR-645.dts                |   4 +-
 target/linux/ramips/dts/DIR-810L.dts               |   6 +-
 target/linux/ramips/dts/E1700.dts                  |   4 +-
 target/linux/ramips/dts/F5D8235_V2.dts             |  18 +-
 target/linux/ramips/dts/F7C027.dts                 |   8 +-
 target/linux/ramips/dts/FREESTATION5.dts           |   6 +-
 target/linux/ramips/dts/HG255D.dts                 |  12 +-
 target/linux/ramips/dts/MLW221.dts                 |   4 +-
 target/linux/ramips/dts/MLWG2.dts                  |   4 +-
 target/linux/ramips/dts/MPRA1.dts                  |   4 +-
 target/linux/ramips/dts/MPRA2.dts                  |   4 +-
 target/linux/ramips/dts/MZK-750DHP.dts             |   4 +-
 target/linux/ramips/dts/MZK-DP150N.dts             |   2 +-
 target/linux/ramips/dts/MZK-W300NH2.dts            |   6 +-
 target/linux/ramips/dts/OY-0001.dts                |   4 +-
 target/linux/ramips/dts/RE6500.dts                 |   4 +-
 target/linux/ramips/dts/RP-N53.dts                 |  16 +-
 target/linux/ramips/dts/RT-N10-PLUS.dts            |   2 +-
 target/linux/ramips/dts/RT-N13U.dts                |   4 +-
 target/linux/ramips/dts/RT-N14U.dts                |  10 +-
 target/linux/ramips/dts/RT-N56U.dts                |   8 +-
 target/linux/ramips/dts/SAP-G3200U3.dts            |   2 +-
 target/linux/ramips/dts/TEW-691GR.dts              |   2 +-
 target/linux/ramips/dts/TEW-692GR.dts              |   4 +-
 target/linux/ramips/dts/UR-326N4G.dts              |  10 +-
 target/linux/ramips/dts/UR-336UN.dts               |  10 +-
 target/linux/ramips/dts/W150M.dts                  |  12 +-
 target/linux/ramips/dts/W502U.dts                  |   4 +-
 target/linux/ramips/dts/WCR150GN.dts               |   4 +-
 target/linux/ramips/dts/WHR-1166D.dts              |  14 +-
 target/linux/ramips/dts/WHR-300HP2.dts             |  14 +-
 target/linux/ramips/dts/WHR-600D.dts               |  14 +-
 target/linux/ramips/dts/WL-330N.dts                |   4 +-
 target/linux/ramips/dts/WL-330N3G.dts              |   6 +-
 target/linux/ramips/dts/WLI-TX4-AG300N.dts         |   6 +-
 target/linux/ramips/dts/WNCE2001.dts               |   8 +-
 target/linux/ramips/dts/WR512-3GN-4M.dts           |  10 +-
 target/linux/ramips/dts/WR512-3GN-8M.dts           |  10 +-
 target/linux/ramips/dts/WSR-1166.dts               |  16 +-
 target/linux/ramips/dts/WSR-600.dts                |  16 +-
 target/linux/ramips/dts/WT3020-4M.dts              |   2 +-
 target/linux/ramips/dts/WT3020-8M.dts              |   2 +-
 target/linux/ramips/dts/WZR-AGL300NH.dts           |   8 +-
 target/linux/ramips/dts/Y1.dts                     |  12 +-
 target/linux/ramips/dts/Y1S.dts                    |  14 +-
 target/linux/ramips/dts/ZBT-WA05.dts               |   6 +-
 target/linux/ramips/dts/ZBT-WR8305RT.dts           |   6 +-
 target/linux/ramips/dts/ZTE-Q7.dts                 |   4 +-
 80 files changed, 694 insertions(+), 612 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index e872b39..c8256db 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -17,257 +17,275 @@ board=$(ramips_board_name)
 board_config_update
 
 case $board in
-	3g-6200n)
-		set_wifi_led "edimax:amber:wlan"
-		set_usb_led "edimax:blue:3g"
-		;;
-	3g-6200nl)
-		set_wifi_led "edimax:green:wlan"
-		;;
-	3g150b |\
-	3g300m)
-		set_usb_led "tenda:blue:3g"
-		;;
-	ai-br100)
-		ucidef_set_led_netdev "wan" "wan" "aigale:blue:wan" "eth0.2"
-		set_wifi_led "aigale:blue:wlan"
-		;;
-	a5-v11)
-		ucidef_set_led_default "power" "POWER" "a5-v11:red:power" "1"
-		;;
-	air3gii)
-		set_wifi_led "airlive:green:wlan"
-		set_usb_led "airlive:green:mobile"
-		;;
-	all0256n)
-		ucidef_set_rssimon "wlan0" "40000" "1"
-		ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
-		ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
-		ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	ar670w|\
-	ar725w|\
-	awapn2403)
-		set_wifi_led "rt2800soc-phy0::radio"
-		;;
-	asl26555)
-		ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1"
-		ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
-		set_wifi_led "asl26555:green:wlan"
-		set_usb_led "asl26555:green:3g"
-		;;
-	bc2)
-		set_usb_led "bc2:blue:usb"
-		;;
-	br-6425)
-		set_wifi_led "edimax:orange:wlan"
-		;;
-	br-6475nd)
-		set_wifi_led "edimax:amber:wlan"
-		;;
-	broadway)
-		set_usb_led "red:diskmounted"
-		set_wifi_led "red:wps_active"
-		;;
-	cf-wr800n)
-		ucidef_set_led_netdev "lan" "lan" "comfast:white:ethernet" eth0.1
-		set_wifi_led "comfast:white:wifi"
-		;;
-	cy-swr1100)
-		ucidef_set_led_default "wps" "WPS" "samsung:blue:wps" "0"
-		set_usb_led "samsung:blue:usb"
-		;;
-	d105)
-		ucidef_set_led_default "power" "POWER" "d105:red:power" "1"
-		set_usb_led "d105:green:usb"
-		;;
-	dcs-930l-b1)
-		ucidef_set_led_default "power" "POWER" "d-link:red:power" "1"
-		ucidef_set_led_netdev "wifi" "WiFi" "d-link:blue:wps"
-		;;
-	dir-300-b1|\
-	dir-600-b1|\
-	dir-600-b2|\
-	dir-620-a1)
-		# ANDed with vlan switch port 4 led state
-		ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1"
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	dir-615-d|\
-	dir-615-h1)
-		ucidef_set_led_default "status" "Status LED (amber)" "d-link:amber:status" "0"
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	dir-620-d1)
-		set_wifi_led "d-link:green:wifi"
-		;;
-	dir-810l)
-		ucidef_set_led_default "power" "POWER" "d-link:green:power" "1"
-		;;
-	dir-610-a1 |\
-	dir-300-b7 |\
-	dir-320-b1 |\
-	esr-9753)
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	f5d8235-v1)
-		set_usb_led "f5d8235-v1:blue:storage"
-		;;
-	f5d8235-v2)
-		set_usb_led "f5d8235v2:blue:storage"
-		;;
-	fonera20n)
-		set_usb_led "fonera20n:orange:usb"
-		set_wifi_led "fonera20n:orange:wifi"
-		;;
-	hlk-rm04)
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	ht-tm02)
-		ucidef_set_led_netdev "eth" "Ethernet" "ht-tm02:green:lan" "eth0"
-		set_wifi_led "ht-tm02:blue:wlan"
-		;;
-	all0239-3g|\
-	hw550-3g)
-		set_usb_led "hw550-3g:green:usb"
-		;;
-	mlw221|\
-	mlwg2)
-		set_wifi_led "kingston:blue:wifi"
-		ucidef_set_led_default "system" "system" "kingston:blue:system" "1"
-		;;
-	mofi3500-3gn)
-		set_usb_led "mofi3500-3gn:green:usb"
-		;;
-	mpr-a1)
-		set_wifi_led "hame:blue:system"
-		;;
-	mpr-a2)
-		set_wifi_led "hame:blue:system"
-		;;
-	mr-102n)
-		set_wifi_led "mr-102n:green:wlan"
-		set_usb_led "mr-102n:green:usb"
-		;;
-	mzk-w300nh2)
-		set_wifi_led "mzkw300nh2:amber:wlan"
-		;;
-	na930)
-		set_usb_led "na930:blue:status"
-		;;
-	nw718)
-		set_usb_led "nw718:amber:usb"
-		;;
-	m2m)
-		set_wifi_led "m2m:blue:wifi"
-		ucidef_set_led_netdev "eth" "Ethernet" "m2m:green:wan" "eth0"
-		;;
-	hpm)
-		ucidef_set_led_default "power" "POWER" "hpm:orange:power" "1"
-		ucidef_set_led_netdev "eth" "ETH" "hpm:green:eth" "eth0"
-		set_wifi_led "hpm:green:wifi"
-		;;
-	miniembplug)
-		set_wifi_led "miniembplug:green:wlan"
-		set_usb_led "miniembplug:green:mobile"
-		;;
-	px-4885)
-		set_wifi_led "px-4885:orange:wifi"
-		set_usb_led "px-4885:blue:storage"
-		;;
-    pbr-m1)
-        ucidef_set_led_netdev "internet" "internet" "pbr-m1:green:internet" "eth0.2"
-        ucidef_set_led_default "power" "power" "pbr-m1:green:power" "1"
-        ucidef_set_led_default "sys" "sys" "pbr-m1:green:sys" "1"
-        ;;
-	sap-g3200u3)
-		set_usb_led "storylink:green:usb"
-		;;
-	sl-r7205)
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	v11st-fe)
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	vocore)
-		ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
-		set_wifi_led "vocore:green:status"
-		;;
-	w306r-v20)
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	w502u)
-		set_usb_led "alfa:blue:usb"
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	wcr-150gn)
-		set_usb_led "wcr150gn:amber:user"
-		;;
-	hg255d)
-		set_wifi_led "hg255d:wlan"
-		set_usb_led "hg255d:usb"
-		ucidef_set_led_interface "lan" "hg255d:internet"
-		;;
-	wnce2001)
-		set_wifi_led "netgear:green:wlan"
-		;;
-	re6500)
-		ucidef_set_led_default "power" "power" "linksys:white:power" "1"
-		ucidef_set_led_default "wifi" "wifi" "linksys:orange:wifi" "1"
-		;;
-	rt-n14u)
-		ucidef_set_led_default "power" "power" "asus:blue:power" "1"
-		ucidef_set_led_netdev "lan" "lan" "asus:blue:lan" eth0.1
-		ucidef_set_led_netdev "wan" "wan" "asus:blue:wan" eth0.2
-		set_wifi_led "asus:blue:air"
-		set_usb_led "asus:blue:usb"
-		;;
-	rp-n53)
-		ucidef_set_led_netdev "eth" "Network" "asus:white:back" "eth0"
-		set_wifi_led "asus:blue:wifi"
-		;;
-	whr-300hp2 |\
-	whr-600d |\
-	whr-1166d)
-		ucidef_set_led_default "power" "power" "buffalo:green:power" "1"
-		ucidef_set_led_default "router" "router" "buffalo:green:router" "1"
-		;;
-	zbt-wa05)
-		ucidef_set_led_default "power" "power" "zbtlink:blue:power" "1"
-		set_wifi_led "zbtlink:blue:air"
-		set_usb_led "zbtlink:blue:usb"
-		;;
-	oy-0001)
-		ucidef_set_led_default "power" "power" "oy:green:power" "1"
-		set_wifi_led "oy:green:wifi"
-		;;
-	zbt-wr8305rt)
-		ucidef_set_led_default "power" "power" "zbt-wr8305rt:sys" "1"
-		set_usb_led "zbt-wr8305rt:usb"
-		set_wifi_led "zbt-wr8305rt:wifi"
-		;;
-	wt1520)
-		set_wifi_led "rt2800pci-phy0::radio"
-		;;
-	wt3020)
-		ucidef_set_led_default "power" "power" "nexx:blue:power" "0"
-		;;
-	miwifi-mini)
-		ucidef_set_led_default "power" "power" "miwifi-mini:red:status" "1"
-		;;
-	y1 |\
-	y1s)
-		ucidef_set_led_default "power" "power" "lenovo:blue:power" "1"
-		set_usb_led "lenovo:blue:usb"
-		set_wifi_led "lenovo:blue:wifi"
-		;;
-	zte-q7)
-		set_wifi_led "zte:blue:status"
-		;;
-	mzk-dp150n)
-		ucidef_set_led_default "power" "power" "mzkdp150n:green:power" "1"
-		;;
+3g150b)
+	set_usb_led "3g150b:blue:3g"
+	;;
+3g300m)
+	set_usb_led "3g300m:blue:3g"
+	;;
+3g-6200n)
+	set_wifi_led "3g-6200n:amber:wlan"
+	set_usb_led "3g-6200n:blue:3g"
+	;;
+3g-6200nl)
+	set_wifi_led "3g-6200nl:amber:wlan"
+	;;
+a5-v11)
+	ucidef_set_led_default "power" "POWER" "a5-v11:red:power" "1"
+	;;
+ai-br100)
+	ucidef_set_led_netdev "wan" "wan" "ai-br100:blue:wan" "eth0.2"
+	set_wifi_led "ai-br100:blue:wlan"
+	;;
+air3gii)
+	set_wifi_led "air3gii:green:wlan"
+	set_usb_led "air3gii:green:mobile"
+	;;
+all0239-3g)
+	set_usb_led "all0239-3g:green:usb"
+	;;
+all0256n)
+	ucidef_set_rssimon "wlan0" "40000" "1"
+	ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
+	ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
+	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+ar670w|\
+ar725w|\
+awapn2403)
+	set_wifi_led "rt2800soc-phy0::radio"
+	;;
+asl26555)
+	ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1"
+	ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
+	set_wifi_led "asl26555:green:wlan"
+	set_usb_led "asl26555:green:3g"
+	;;
+bc2)
+	set_usb_led "bc2:blue:usb"
+	;;
+br-6425)
+	set_wifi_led "br-6425:orange:wlan"
+	;;
+br-6475nd)
+	set_wifi_led "br-6475nd:amber:wlan"
+	;;
+broadway)
+	set_usb_led "broadway:red:diskmounted"
+	set_wifi_led "broadway:red:wps_active"
+	;;
+cf-wr800n)
+	ucidef_set_led_netdev "lan" "lan" "cf-wr800n:white:ethernet" eth0.1
+	set_wifi_led "cf-wr800n:white:wifi"
+	;;
+cy-swr1100)
+	ucidef_set_led_default "wps" "WPS" "cy-swr1100:blue:wps" "0"
+	set_usb_led "cy-swr1100:blue:usb"
+	;;
+d105)
+	ucidef_set_led_default "power" "POWER" "d105:red:power" "1"
+	set_usb_led "d105:green:usb"
+	;;
+dcs-930l-b1)
+	ucidef_set_led_default "power" "POWER" "dcs-930l-b1:red:power" "1"
+	ucidef_set_led_netdev "wifi" "WiFi" "dcs-930l-b1:blue:wps"
+	;;
+dir-300-b1)
+	ucidef_set_led_default "wan" "WAN LED (amber)" "dir-300-b1:amber:wan" "1"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+dir-300-b7|\
+dir-320-b1|\
+dir-610-a1|\
+esr-9753|\
+hlk-rm04|\
+sl-r7205|\
+v11st-fe|\
+w306r-v20|\
+wt1520)
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+dir-600-b1)
+	ucidef_set_led_default "wan" "WAN LED (amber)" "dir-600-b1:amber:wan" "1"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+dir-600-b2)
+	ucidef_set_led_default "wan" "WAN LED (amber)" "dir-600-b2:amber:wan" "1"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+dir-615-d)
+	ucidef_set_led_default "status" "Status LED (amber)" "dir-615-d:amber:status" "0"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+dir-615-h1)
+	ucidef_set_led_default "status" "Status LED (amber)" "dir-615-h1:amber:status" "0"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+dir-620-a1)
+	ucidef_set_led_default "wan" "WAN LED (amber)" "dir-620-a1:amber:wan" "1"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+dir-620-d1)
+	set_wifi_led "dir-620-d1:green:wifi"
+	;;
+dir-810l)
+	ucidef_set_led_default "power" "POWER" "dir-810l:green:power" "1"
+	;;
+f5d8235-v1)
+	set_usb_led "f5d8235-v1:blue:storage"
+	;;
+f5d8235-v2)
+	set_usb_led "f5d8235-v2:blue:storage"
+	;;
+fonera20n)
+	set_usb_led "fonera20n:orange:usb"
+	set_wifi_led "fonera20n:orange:wifi"
+	;;
+hg255d)
+	set_wifi_led "hg255d:green:wlan"
+	set_usb_led "hg255d:green:usb"
+	ucidef_set_led_interface "lan" "hg255d:green:internet"
+	;;
+hpm)
+	ucidef_set_led_default "power" "POWER" "hpm:orange:power" "1"
+	ucidef_set_led_netdev "eth" "ETH" "hpm:green:eth" "eth0"
+	set_wifi_led "hpm:green:wifi"
+	;;
+ht-tm02)
+	ucidef_set_led_netdev "eth" "Ethernet" "ht-tm02:green:lan" "eth0"
+	set_wifi_led "ht-tm02:blue:wlan"
+	;;
+hw550-3g)
+	set_usb_led "hw550-3g:green:usb"
+	;;
+m2m)
+	set_wifi_led "m2m:blue:wifi"
+	ucidef_set_led_netdev "eth" "Ethernet" "m2m:green:wan" "eth0"
+	;;
+miniembplug)
+	set_wifi_led "miniembplug:red:wlan"
+	set_usb_led "miniembplug:green:mobile"
+	;;
+miwifi-mini)
+	ucidef_set_led_default "power" "power" "miwifi-mini:red:status" "1"
+	;;
+mlw221)
+	set_wifi_led "mlw221:blue:wifi"
+	ucidef_set_led_default "system" "system" "mlw221:blue:system" "1"
+	;;
+mlwg2)
+	set_wifi_led "mlwg2:blue:wifi"
+	ucidef_set_led_default "system" "system" "mlwg2:blue:system" "1"
+	;;
+mofi3500-3gn)
+	set_usb_led "mofi3500-3gn:green:usb"
+	;;
+mpr-a1)
+	set_wifi_led "mpr-a1:blue:system"
+	;;
+mpr-a2)
+	set_wifi_led "mpr-a2:blue:system"
+	;;
+mr-102n)
+	set_wifi_led "mr-102n:green:wlan"
+	set_usb_led "mr-102n:green:usb"
+	;;
+mzk-dp150n)
+	ucidef_set_led_default "power" "power" "mzk-dp150n:green:power" "1"
+	;;
+mzk-w300nh2)
+	set_wifi_led "mzk-w300nh2:amber:wlan"
+	;;
+na930)
+	set_usb_led "na930:blue:status"
+	;;
+nw718)
+	set_usb_led "nw718:amber:usb"
+	;;
+oy-0001)
+	ucidef_set_led_default "power" "power" "oy-0001:green:power" "1"
+	set_wifi_led "oy-0001:green:wifi"
+	;;
+pbr-m1)
+	ucidef_set_led_netdev "internet" "internet" "pbr-m1:green:internet" "eth0.2"
+	ucidef_set_led_default "power" "power" "pbr-m1:green:power" "1"
+	ucidef_set_led_default "sys" "sys" "pbr-m1:green:sys" "1"
+	;;
+px-4885)
+	set_wifi_led "px-4885:orange:wifi"
+	set_usb_led "px-4885:blue:storage"
+	;;
+re6500)
+	ucidef_set_led_default "power" "power" "re6500:white:power" "1"
+	ucidef_set_led_default "wifi" "wifi" "re6500:orange:wifi" "1"
+	;;
+rp-n53)
+	ucidef_set_led_netdev "eth" "Network" "rp-n53:white:back" "eth0"
+	set_wifi_led "rp-n53:blue:wifi"
+	;;
+rt-n14u)
+	ucidef_set_led_default "power" "power" "rt-n14u:blue:power" "1"
+	ucidef_set_led_netdev "lan" "lan" "rt-n14u:blue:lan" eth0.1
+	ucidef_set_led_netdev "wan" "wan" "rt-n14u:blue:wan" eth0.2
+	set_wifi_led "rt-n14u:blue:air"
+	set_usb_led "rt-n14u:blue:usb"
+	;;
+sap-g3200u3)
+	set_usb_led "sap-g3200u3:green:usb"
+	;;
+vocore)
+	ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
+	set_wifi_led "vocore:green:status"
+	;;
+w502u)
+	set_usb_led "w502u:blue:usb"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
+wcr-150gn)
+	set_usb_led "wcr-150gn:amber:user"
+	;;
+whr-1166d)
+	ucidef_set_led_default "power" "power" "whr-1166d:green:power" "1"
+	ucidef_set_led_default "router" "router" "whr-1166d:green:router" "1"
+	;;
+whr-300hp2)
+	ucidef_set_led_default "power" "power" "whr-300hp2:green:power" "1"
+	ucidef_set_led_default "router" "router" "whr-300hp2:green:router" "1"
+	;;
+whr-600d)
+	ucidef_set_led_default "power" "power" "whr-600d:green:power" "1"
+	ucidef_set_led_default "router" "router" "whr-600d:green:router" "1"
+	;;
+wnce2001)
+	set_wifi_led "wnce2001:green:wlan"
+	;;
+wt3020)
+	ucidef_set_led_default "power" "power" "wt3020:blue:power" "0"
+	;;
+y1)
+	ucidef_set_led_default "power" "power" "y1:blue:power" "1"
+	set_usb_led "y1:blue:usb"
+	set_wifi_led "y1:blue:wifi"
+	;;
+y1s)
+	ucidef_set_led_default "power" "power" "y1s:blue:power" "1"
+	set_usb_led "y1s:blue:usb"
+	set_wifi_led "y1s:blue:wifi"
+	;;
+zbt-wa05)
+	ucidef_set_led_default "power" "power" "zbt-wa05:blue:power" "1"
+	set_wifi_led "zbt-wa05:blue:air"
+	set_usb_led "zbt-wa05:blue:usb"
+	;;
+zbt-wr8305rt)
+	ucidef_set_led_default "power" "power" "zbt-wr8305rt:green:sys" "1"
+	set_usb_led "zbt-wr8305rt:green:usb"
+	set_wifi_led "zbt-wr8305rt:green:wifi"
+	;;
+zte-q7)
+	set_wifi_led "zte-q7:blue:status"
+	;;
 esac
 
 board_config_flush
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index b776070..e9b8744 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -6,17 +6,23 @@
 
 get_status_led() {
 	case $(ramips_board_name) in
-	3g-6200n)
-		status_led="edimax:green:power"
+	3g150b)
+		status_led="3g150b:blue:ap"
+		;;
+	3g300m)
+		status_led="3g300m:blue:ap"
 		;;
-	3g150b | 3g300m | w150m)
-		status_led="tenda:blue:ap"
+	3g-6200n)
+		status_led="3g-6200n:green:power"
 		;;
 	a5-v11)
 		status_led="a5-v11:red:power"
 		;;
 	ai-br100)
-		status_led="aigale:blue:wlan"
+		status_led="ai-br100:blue:wlan"
+		;;
+	all0239-3g)
+		status_led="all0239-3g:green:status"
 		;;
 	ar670w)
 		status_led="ar670w:green:power"
@@ -24,67 +30,102 @@ get_status_led() {
 	ar725w)
 		status_led="ar725w:green:power"
 		;;
-	awapn2403)
-		status_led="asiarf:green:wps"
+	asl26555)
+		status_led="asl26555:green:power"
 		;;
 	atp-52b)
 		status_led="atp-52b:green:run"
 		;;
-	asl26555)
-		status_led="asl26555:green:power"
+	awapn2403)
+		status_led="awapn2403:green:wps"
+		;;
+	br-6425)
+		status_led="br-6425:green:power"
 		;;
-	br-6425 | br-6475nd)
-		status_led="edimax:green:power"
+	br-6475nd)
+		status_led="br-6475nd:green:power"
 		;;
 	cf-wr800n)
-		status_led="comfast:white:wps"
+		status_led="cf-wr800n:white:wps"
 		;;
 	cy-swr1100)
-		status_led="samsung:blue:wps"
+		status_led="cy-swr1100:blue:wps"
 		;;
 	d105)
 		status_led="d105:red:power"
 		;;
-	dcs-930 | dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1| dir-300-b7| dir-320-b1)
-		status_led="d-link:green:status"
+	dap-1350)
+		status_led="dap-1350:blue:power"
+		;;
+	dcs-930)
+		status_led="dcs-930:green:status"
 		;;
 	dcs-930l-b1)
-		status_led="d-link:red:power"
+		status_led="dcs-930l-b1:red:power"
 		;;
-	dir-645)
-		status_led="d-link:green:wps"
+	dir-300-b1)
+		status_led="dir-300-b1:green:status"
 		;;
-	dap-1350)
-		status_led="d-link:blue:power"
+	dir-300-b7)
+		status_led="dir-300-b7:green:status"
+		;;
+	dir-320-b1)
+		status_led="dir-320-b1:green:status"
+		;;
+	dir-600-b1)
+		status_led="dir-600-b1:green:status"
+		;;
+	dir-600-b2)
+		status_led="dir-600-b2:green:status"
+		;;
+	dir-610-a1)
+		status_led="dir-610-a1:green:status"
+		;;
+	dir-615-d)
+		status_led="dir-615-d:green:status"
+		;;
+	dir-615-h1)
+		status_led="dir-615-h1:green:status"
+		;;
+	dir-620-a1)
+		status_led="dir-620-a1:green:status"
+		;;
+	dir-620-d1)
+		status_led="dir-620-d1:green:status"
+		;;
+	dir-645)
+		status_led="dir-645:green:wps"
 		;;
 	e1700)
-		status_led="linksys:green:power"
+		status_led="e1700:green:power"
 		;;
 	esr-9753)
 		status_led="esr-9753:orange:power"
 		;;
 	f5d8235-v2)
-		status_led="f5d8235v2:blue:router"
+		status_led="f5d8235-v2:blue:router"
+		;;
+	f7c027)
+		status_led="f7c027:orange:status"
 		;;
 	fonera20n)
 		status_led="fonera20n:green:power"
 		;;
-	ip2202)
-		status_led="ip2202:green:run"
-		;;
-	rt-n13u)
-		status_led="rt-n13u:power"
-		;;
 	hlk-rm04)
 		status_led="hlk-rm04:red:power"
 		;;
+	hpm)
+		status_led="hpm:green:status"
+		;;
 	ht-tm02)
 		status_led="ht-tm02:blue:wlan"
 		;;
-	all0239-3g|\
 	hw550-3g)
 		status_led="hw550-3g:green:status"
 		;;
+	ip2202)
+		status_led="ip2202:green:run"
+		;;
 	m2m)
 		status_led="m2m:blue:wifi"
 		;;
@@ -94,33 +135,47 @@ get_status_led() {
 	m4)
 		status_led="m4:blue:status"
 		;;
-	mlw221|\
+	miniembwifi)
+		status_led="miniembwifi:green:status"
+		;;
+	miwifi-mini)
+		status_led="miwifi-mini:red:status"
+		;;
+	mlw221)
+		status_led="mlw221:blue:system"
+		;;
 	mlwg2)
-		status_led="kingston:blue:system"
+		status_led="mlwg2:blue:system"
 		;;
 	mofi3500-3gn)
 		status_led="mofi3500-3gn:green:status"
 		;;
 	mpr-a1)
-		status_led="hame:red:power"
+		status_led="mpr-a1:red:power"
 		;;
 	mpr-a2)
-		status_led="hame:red:power"
+		status_led="mpr-a2:red:power"
 		;;
 	mr-102n)
 		status_led="mr-102n:amber:status"
 		;;
+	mzk-dp150n)
+		status_led="mzk-dp150n:green:power"
+		;;
+	mzk-w300nh2)
+		status_led="mzk-w300nh2:green:power"
+		;;
+	na930)
+		status_led="na930:blue:power"
+		;;
 	nbg-419n)
 		status_led="nbg-419n:green:power"
 		;;
 	nw718)
 		status_led="nw718:amber:cpu"
 		;;
-	miniembwifi)
-		status_led="miniembwifi:green:status"
-		;;
-	hpm)
-		status_led="hpm:green:status"
+	oy-0001)
+		status_led="oy-0001:green:wifi"
 		;;
 	pbr-m1)
 		status_led="pbr-m1:green:sys"
@@ -135,29 +190,43 @@ get_status_led() {
 		status_led="px-4885:orange:wifi"
 		;;
 	re6500)
-		status_led="linksys:orange:wifi"
+		status_led="re6500:orange:wifi"
+		;;
+	rt-n10-plus)
+		status_led="rt-n10-plus:green:wps"
+		;;
+	rt-n13u)
+		status_led="rt-n13u:blue:power"
+		;;
+	rt-n14u)
+		status_led="rt-n14u:blue:power"
 		;;
 	rt-n15)
 		status_led="rt-n15:blue:power"
 		;;
-	rt-n10-plus)
-		status_led="asus:green:wps"
-		;;
-	rt-n14u | rt-n56u | wl-330n | wl-330n3g)
-		status_led="asus:blue:power"
+	rt-n56u)
+		status_led="rt-n56u:blue:power"
 		;;
 	rut5xx)
 		status_led="rut5xx:green:status"
 		;;
 	sap-g3200u3)
-		status_led="storylink:green:usb"
+		status_led="sap-g3200u3:green:usb"
 		;;
 	sl-r7205)
-		status_led="sl-r7205:green:status"
+		status_led="sl-r7205:green:wifi"
+		;;
+	tew-691gr)
+		status_led="tew-691gr:green:wps"
 		;;
-	tew-691gr|\
 	tew-692gr)
-		status_led="trendnet:green:wps"
+		status_led="tew-692gr:green:wps"
+		;;
+	ur-326n4g)
+		status_led="ur-326n4g:green:wps"
+		;;
+	ur-336un)
+		status_led="ur-336un:green:wps"
 		;;
 	v11st-fe)
 		status_led="v11st-fe:green:status"
@@ -168,57 +237,62 @@ get_status_led() {
 	vocore)
 		status_led="vocore:green:status"
 		;;
+	w150m)
+		status_led="w150m:blue:ap"
+		;;
 	w306r-v20)
 		status_led="w306r-v20:green:sys"
 		;;
 	w502u)
-		status_led="alfa:blue:wps"
+		status_led="w502u:blue:wps"
 		;;
 	wcr-150gn)
-		status_led="wcr150gn:amber:power"
+		status_led="wcr-150gn:amber:power"
+		;;
+	whr-1166d)
+		status_led="whr-1166d:orange:wifi"
+		;;
+	whr-300hp2)
+		status_led="whr-300hp2:orange:wifi"
+		;;
+	whr-600d)
+		status_led="whr-600d:orange:wifi"
 		;;
 	whr-g300n)
 		status_led="whr-g300n:green:router"
 		;;
-	wmr-300)
-		status_led="wmr-300:green:status"
-		;;
-	wli-tx4-ag300n)
-		status_led="buffalo:blue:power"
+	wl-330n)
+		status_led="wl-330n:blue:power"
 		;;
-	wzr-agl300nh)
-		status_led="buffalo:green:router"
+	wl-330n3g)
+		status_led="wl-330n3g:blue:power"
 		;;
 	wl-351)
 		status_led="wl-351:amber:power"
 		;;
-	wr512-3gn)
-		status_led="wr512:green:wps"
-		;;
-	zbt-wr8305rt)
-		status_led="zbt-wr8305rt:sys"
+	wli-tx4-ag300n)
+		status_led="wli-tx4-ag300n:blue:power"
 		;;
-	whr-300hp2 | \
-	whr-600d | \
-	whr-1166d | \
-	wsr-600 | \
-	wsr-1166)
-		status_led="buffalo:orange:diag"
+	wmr-300)
+		status_led="wmr-300:green:status"
 		;;
 	wnce2001)
-		status_led="netgear:green:power"
+		status_led="wnce2001:green:power"
 		;;
-	wt3020)
-		status_led="nexx:blue:power"
+	wr512-3gn)
+		status_led="wr512-3gn:green:wps"
 		;;
-	mzk-w300nh2)
-		status_led="mzkw300nh2:green:power"
+	wsr-1166)
+		status_led="wsr-1166:orange:diag"
 		;;
-	ur-326n4g)
-		status_led="ur326:green:wps"
+	wsr-600)
+		status_led="wsr-600:orange:diag"
 		;;
-	ur-336un)
-		status_led="ur336:green:wps"
+	wt3020)
+		status_led="wt3020:blue:power"
+		;;
+	wzr-agl300nh)
+		status_led="wzr-agl300nh:green:router"
 		;;
 	x5)
 		status_led="x5:green:power"
@@ -229,27 +303,17 @@ get_status_led() {
 	xdxrn502j)
 		status_led="xdxrn502j:green:power"
 		;;
-	miwifi-mini)
-		status_led="miwifi-mini:red:status"
-		;;
-	f7c027)
-		status_led="belkin:orange:status"
+	y1)
+		status_led="y1:blue:power"
 		;;
-	oy-0001)
-		status_led="oy:green:wifi"
-		;;
-	na930)
-		status_led="na930:blue:power"
-		;;
-	y1 | \
 	y1s)
-		status_led="lenovo:blue:power"
+		status_led="y1s:blue:power"
 		;;
-	zte-q7)
-		status_led="zte:red:status"
+	zbt-wr8305rt)
+		status_led="zbt-wr8305rt:green:sys"
 		;;
-	mzk-dp150n)
-		status_led="mzkdp150n:green:power"
+	zte-q7)
+		status_led="zte-q7:red:status"
 		;;
 	esac
 }
diff --git a/target/linux/ramips/dts/3G-6200N.dts b/target/linux/ramips/dts/3G-6200N.dts
index 3a79d46..5c1e588 100644
--- a/target/linux/ramips/dts/3G-6200N.dts
+++ b/target/linux/ramips/dts/3G-6200N.dts
@@ -69,17 +69,17 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "edimax:green:power";
+			label = "3g-6200n:green:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wlan {
-			label = "edimax:amber:wlan";
+			label = "3g-6200n:amber:wlan";
 			gpios = <&gpio0 14 1>;
 		};
 
 		3g {
-			label = "edimax:blue:3g";
+			label = "3g-6200n:blue:3g";
 			gpios = <&gpio0 7 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/3G-6200NL.dts b/target/linux/ramips/dts/3G-6200NL.dts
index eb6e7d4..8f7d383 100644
--- a/target/linux/ramips/dts/3G-6200NL.dts
+++ b/target/linux/ramips/dts/3G-6200NL.dts
@@ -69,7 +69,7 @@
 		compatible = "gpio-leds";
 
 		wlan {
-			label = "edimax:amber:wlan";
+			label = "3g-6200nl:amber:wlan";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/3G150B.dts b/target/linux/ramips/dts/3G150B.dts
index 26f4ce6..a8387a4 100644
--- a/target/linux/ramips/dts/3G150B.dts
+++ b/target/linux/ramips/dts/3G150B.dts
@@ -82,12 +82,12 @@
 		compatible = "gpio-leds";
 
 		ap {
-			label = "tenda:blue:ap";
+			label = "3g150b:blue:ap";
 			gpios = <&gpio0 7 1>;
 		};
 
 		3g {
-			label = "tenda:blue:3g";
+			label = "3g150b:blue:3g";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/3G300M.dts b/target/linux/ramips/dts/3G300M.dts
index 1f9d6f9..997c081 100644
--- a/target/linux/ramips/dts/3G300M.dts
+++ b/target/linux/ramips/dts/3G300M.dts
@@ -57,32 +57,32 @@
 		compatible = "gpio-leds";
 
 		3grouter {
-			label = "tenda:blue:3grouter";
+			label = "3g300m:blue:3grouter";
 			gpios = <&gpio0 11 1>;
 		};
 
 		ap {
-			label = "tenda:blue:ap";
+			label = "3g300m:blue:ap";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wisprouter {
-			label = "tenda:blue:wisprouter";
+			label = "3g300m:blue:wisprouter";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wirelessrouter {
-			label = "tenda:blue:wirelessrouter";
+			label = "3g300m:blue:wirelessrouter";
 			gpios = <&gpio0 13 1>;
 		};
 
 		3g {
-			label = "tenda:blue:3g";
+			label = "3g300m:blue:3g";
 			gpios = <&gpio0 7 1>;
 		};
 
 		wpsreset {
-			label = "tenda:blue:wpsreset";
+			label = "3g300m:blue:wpsreset";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/AI-BR100.dts b/target/linux/ramips/dts/AI-BR100.dts
index 90195b6..f3932ae 100644
--- a/target/linux/ramips/dts/AI-BR100.dts
+++ b/target/linux/ramips/dts/AI-BR100.dts
@@ -84,12 +84,12 @@
 		compatible = "gpio-leds";
 
 		wan {
-			label = "aigale:blue:wan";
+			label = "ai-br100:blue:wan";
 			gpios = <&gpio2 4 1>;
 		};
 
 		wlan {
-			label = "aigale:blue:wlan";
+			label = "ai-br100:blue:wlan";
 			gpios = <&gpio3 0 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/AIR3GII.dts b/target/linux/ramips/dts/AIR3GII.dts
index 434b10b..40d3228 100644
--- a/target/linux/ramips/dts/AIR3GII.dts
+++ b/target/linux/ramips/dts/AIR3GII.dts
@@ -73,12 +73,12 @@
 		compatible = "gpio-leds";
 
 		wlan {
-			label = "airlive:green:wlan";
+			label = "air3gii:green:wlan";
 			gpios = <&gpio0 8 0>;
 		};
 
 		mobile {
-			label = "airlive:green:mobile";
+			label = "air3gii:green:mobile";
 			gpios = <&gpio0 9 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/ALL0239-3G.dts b/target/linux/ramips/dts/ALL0239-3G.dts
index ac8a4e9..d75bb2c 100644
--- a/target/linux/ramips/dts/ALL0239-3G.dts
+++ b/target/linux/ramips/dts/ALL0239-3G.dts
@@ -64,22 +64,22 @@
 		compatible = "gpio-leds";
 
 		usb {
-			label = "hw550-3g:green:usb";
+			label = "all0239-3g:green:usb";
 			gpios = <&gpio0 8 1>;
 		};
 
 		3g {
-			label = "hw550-3g:green:3g";
+			label = "all0239-3g:green:3g";
 			gpios = <&gpio0 11 1>;
 		};
 
 		status {
-			label = "hw550-3g:green:status";
+			label = "all0239-3g:green:status";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "hw550-3g:green:wps";
+			label = "all0239-3g:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/ALL5002.dts b/target/linux/ramips/dts/ALL5002.dts
index 06f892b..7717f02 100644
--- a/target/linux/ramips/dts/ALL5002.dts
+++ b/target/linux/ramips/dts/ALL5002.dts
@@ -99,12 +99,12 @@
 		compatible = "gpio-leds";
 
 		ld1 {
-			label = "allnet:green:ld1";
+			label = "all5002:green:ld1";
 			gpios = <&pcf0 0 1>;
 		};
 
 		ld2 {
-			label = "allnet:green:ld2";
+			label = "all5002:green:ld2";
 			gpios = <&pcf0 1 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/ALL5003.dts b/target/linux/ramips/dts/ALL5003.dts
index d14b1f9..c256145 100644
--- a/target/linux/ramips/dts/ALL5003.dts
+++ b/target/linux/ramips/dts/ALL5003.dts
@@ -99,12 +99,12 @@
 		compatible = "gpio-leds";
 
 		ld1 {
-			label = "allnet:green:ld1";
+			label = "all5003:green:ld1";
 			gpios = <&pcf0 0 1>;
 		};
 
 		ld2 {
-			label = "allnet:green:ld2";
+			label = "all5003:green:ld2";
 			gpios = <&pcf0 1 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/AWAPN2403.dts b/target/linux/ramips/dts/AWAPN2403.dts
index 754f9f7..b0f81b0 100644
--- a/target/linux/ramips/dts/AWAPN2403.dts
+++ b/target/linux/ramips/dts/AWAPN2403.dts
@@ -65,7 +65,7 @@
 		compatible = "gpio-leds";
 
 		link {
-			label = "asiarf:green:wps";
+			label = "awapn2403:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/AWM002.dtsi b/target/linux/ramips/dts/AWM002.dtsi
index ce45bd3..1906e6e 100644
--- a/target/linux/ramips/dts/AWM002.dtsi
+++ b/target/linux/ramips/dts/AWM002.dtsi
@@ -65,12 +65,12 @@
 		compatible = "gpio-leds";
 
 		ld1 {
-			label = "asiarf:green:ld1";
+			label = "awm002:green:ld1";
 			gpios = <&gpio0 0 1>;
 		};
 
 		ld2 {
-			label = "asiarf:green:ld2";
+			label = "awm002:green:ld2";
 			gpios = <&gpio0 1 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/AWM003-EVB.dts b/target/linux/ramips/dts/AWM003-EVB.dts
index 02de20d..4f3ff1b 100644
--- a/target/linux/ramips/dts/AWM003-EVB.dts
+++ b/target/linux/ramips/dts/AWM003-EVB.dts
@@ -32,17 +32,17 @@
 		compatible = "gpio-leds";
 
 		tx {
-			label = "awm002-evb:green:tx";
+			label = "awm003-evb:green:tx";
 			gpios = <&gpio0 15 1>;
 		};
 
 		rx {
-			label = "awm002-evb:green:rx";
+			label = "awm003-evb:green:rx";
 			gpios = <&gpio0 16 1>;
 		};
 
 		wps {
-			label = "awm002-evb:green:wps";
+			label = "awm003-evb:green:wps";
 			gpios = <&gpio0 21 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/BR-6425.dts b/target/linux/ramips/dts/BR-6425.dts
index 2d62615..cb2c89b 100644
--- a/target/linux/ramips/dts/BR-6425.dts
+++ b/target/linux/ramips/dts/BR-6425.dts
@@ -40,12 +40,12 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "edimax:green:power";
+			label = "br-6425:green:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wlan {
-			label = "edimax:orange:wlan";
+			label = "br-6425:orange:wlan";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/BR-6475ND.dts b/target/linux/ramips/dts/BR-6475ND.dts
index ce8bd61..8c8a980 100644
--- a/target/linux/ramips/dts/BR-6475ND.dts
+++ b/target/linux/ramips/dts/BR-6475ND.dts
@@ -150,17 +150,17 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "edimax:green:power";
+			label = "br-6475nd:green:power";
 			gpios = <&gpio0 10 1>;
 		};
 
 		wlan {
-			label = "edimax:amber:wlan";
+			label = "br-6475nd:amber:wlan";
 			gpios = <&gpio0 11 1>;
 		};
 
 		wlan_5ghz {
-			label = "edimax:amber:wlan_5ghz";
+			label = "br-6475nd:amber:wlan_5ghz";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/BROADWAY.dts b/target/linux/ramips/dts/BROADWAY.dts
index 34696ad..95c245d 100644
--- a/target/linux/ramips/dts/BROADWAY.dts
+++ b/target/linux/ramips/dts/BROADWAY.dts
@@ -63,12 +63,12 @@
 		compatible = "gpio-leds";
 
 		diskmounted {
-			label = "red:diskmounted";
+			label = "broadway:red:diskmounted";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wps_active {
-			label = "red:wps_active";
+			label = "broadway:red:wps_active";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/CF-WR800N.dts b/target/linux/ramips/dts/CF-WR800N.dts
index beb2805..2ee16df 100644
--- a/target/linux/ramips/dts/CF-WR800N.dts
+++ b/target/linux/ramips/dts/CF-WR800N.dts
@@ -85,17 +85,17 @@
 		compatible = "gpio-leds";
 
 		ethernet {
-			label = "comfast:white:ethernet";
+			label = "cf-wr800n:white:ethernet";
 			gpios = <&gpio2 4 1>;
 		};
 
 		wifi {
-			label = "comfast:white:wifi";
+			label = "cf-wr800n:white:wifi";
 			gpios = <&gpio3 0 1>;
 		};
 
 		wps {
-			label = "comfast:white:wps";
+			label = "cf-wr800n:white:wps";
 			gpios = <&gpio1 15 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/CY-SWR1100.dts b/target/linux/ramips/dts/CY-SWR1100.dts
index acccfdb..cec84ac 100644
--- a/target/linux/ramips/dts/CY-SWR1100.dts
+++ b/target/linux/ramips/dts/CY-SWR1100.dts
@@ -140,12 +140,12 @@
 		compatible = "gpio-leds";
 
 		wps {
-			label = "samsung:blue:wps";
+			label = "cy-swr1100:blue:wps";
 			gpios = <&gpio0 0 1>;
 		};
 
 		usb {
-			label = "samsung:blue:usb";
+			label = "cy-swr1100:blue:usb";
 			gpios = <&gpio1 1 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DAP-1350.dts b/target/linux/ramips/dts/DAP-1350.dts
index ae36baf..ce52945 100644
--- a/target/linux/ramips/dts/DAP-1350.dts
+++ b/target/linux/ramips/dts/DAP-1350.dts
@@ -73,17 +73,17 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "d-link:blue:power";
+			label = "dap-1350:blue:power";
 			gpios = <&gpio0 8 1>;
 		};
 
 		power2 {
-			label = "d-link:red:power";
+			label = "dap-1350:red:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dap-1350:blue:wps";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DCS-930.dts b/target/linux/ramips/dts/DCS-930.dts
index d544d21..3c89f84 100644
--- a/target/linux/ramips/dts/DCS-930.dts
+++ b/target/linux/ramips/dts/DCS-930.dts
@@ -61,17 +61,17 @@
 		compatible = "gpio-leds";
 
 		wifi {
-			label = "d-link:red:alert";
+			label = "dcs-930:red:alert";
 			gpios = <&gpio0 8 1>;
 		};
 
 		power {
-			label = "d-link:green:status";
+			label = "dcs-930:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dcs-930:blue:wps";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DCS-930L-B1.dts b/target/linux/ramips/dts/DCS-930L-B1.dts
index 7b54d8c..525707c 100644
--- a/target/linux/ramips/dts/DCS-930L-B1.dts
+++ b/target/linux/ramips/dts/DCS-930L-B1.dts
@@ -77,12 +77,12 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "d-link:red:power";
+			label = "dcs-930l-b1:red:power";
 			gpios = <&gpio0 17 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dcs-930l-b1:blue:wps";
 			gpios = <&gpio0 19 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-300-B1.dts b/target/linux/ramips/dts/DIR-300-B1.dts
index e1962d5..6d19f65 100644
--- a/target/linux/ramips/dts/DIR-300-B1.dts
+++ b/target/linux/ramips/dts/DIR-300-B1.dts
@@ -82,27 +82,27 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:amber:status";
+			label = "dir-300-b1:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
 
 		status2 {
-			label = "d-link:green:status";
+			label = "dir-300-b1:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wan {
-			label = "d-link:amber:wan";
+			label = "dir-300-b1:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
 
 		wan2 {
-			label = "d-link:green:wan";
+			label = "dir-300-b1:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dir-300-b1:blue:wps";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-300-B7.dts b/target/linux/ramips/dts/DIR-300-B7.dts
index c143d6e..30c2596 100644
--- a/target/linux/ramips/dts/DIR-300-B7.dts
+++ b/target/linux/ramips/dts/DIR-300-B7.dts
@@ -66,12 +66,12 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:green:status";
+			label = "dir-300-b7:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dir-300-b7:blue:wps";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-320-B1.dts b/target/linux/ramips/dts/DIR-320-B1.dts
index 958fdee..c1e5832 100644
--- a/target/linux/ramips/dts/DIR-320-B1.dts
+++ b/target/linux/ramips/dts/DIR-320-B1.dts
@@ -70,17 +70,17 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:green:status";
+			label = "dir-320-b1:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		usb {
-			label = "d-link:green:usb";
+			label = "dir-320-b1:green:usb";
 			gpios = <&gpio0 14 1>;
 		};
 
 		wps {
-			label = "d-link:green:wps";
+			label = "dir-320-b1:green:wps";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-600-B1.dts b/target/linux/ramips/dts/DIR-600-B1.dts
index 7201532..5020b78 100644
--- a/target/linux/ramips/dts/DIR-600-B1.dts
+++ b/target/linux/ramips/dts/DIR-600-B1.dts
@@ -82,27 +82,27 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:amber:status";
+			label = "dir-600-b1:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
 
 		status2 {
-			label = "d-link:green:status";
+			label = "dir-600-b1:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wan {
-			label = "d-link:amber:wan";
+			label = "dir-600-b1:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
 
 		wan2 {
-			label = "d-link:green:wan";
+			label = "dir-600-b1:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dir-600-b1:blue:wps";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-600-B2.dts b/target/linux/ramips/dts/DIR-600-B2.dts
index 0f05ad7..d06b853 100644
--- a/target/linux/ramips/dts/DIR-600-B2.dts
+++ b/target/linux/ramips/dts/DIR-600-B2.dts
@@ -78,27 +78,27 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:amber:status";
+			label = "dir-600-b2:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
 
 		status2 {
-			label = "d-link:green:status";
+			label = "dir-600-b2:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wan {
-			label = "d-link:amber:wan";
+			label = "dir-600-b2:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
 
 		wan2 {
-			label = "d-link:green:wan";
+			label = "dir-600-b2:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dir-600-b2:blue:wps";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-610-A1.dts b/target/linux/ramips/dts/DIR-610-A1.dts
index cd7b19d..9ec9870 100644
--- a/target/linux/ramips/dts/DIR-610-A1.dts
+++ b/target/linux/ramips/dts/DIR-610-A1.dts
@@ -73,12 +73,12 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:green:status";
+			label = "dir-610-a1:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wps {
-			label = "d-link:green:wps";
+			label = "dir-610-a1:green:wps";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-615-D.dts b/target/linux/ramips/dts/DIR-615-D.dts
index d95c077..a57ea6d 100644
--- a/target/linux/ramips/dts/DIR-615-D.dts
+++ b/target/linux/ramips/dts/DIR-615-D.dts
@@ -78,27 +78,27 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:amber:status";
+			label = "dir-615-d:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
 
 		status2 {
-			label = "d-link:green:status";
+			label = "dir-615-d:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wan {
-			label = "d-link:amber:wan";
+			label = "dir-615-d:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
 
 		wan2 {
-			label = "d-link:green:wan";
+			label = "dir-615-d:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dir-615-d:blue:wps";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-615-H1.dts b/target/linux/ramips/dts/DIR-615-H1.dts
index e76d6ee..f9bdc92 100644
--- a/target/linux/ramips/dts/DIR-615-H1.dts
+++ b/target/linux/ramips/dts/DIR-615-H1.dts
@@ -79,27 +79,27 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:amber:status";
+			label = "dir-615-h1:amber:status";
 			gpios = <&gpio0 7 0>;
 		};
 
 		status2 {
-			label = "d-link:green:status";
+			label = "dir-615-h1:green:status";
 			gpios = <&gpio0 9 0>;
 		};
 
 		wan {
-			label = "d-link:amber:wan";
+			label = "dir-615-h1:amber:wan";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wan2 {
-			label = "d-link:green:wan";
+			label = "dir-615-h1:green:wan";
 			gpios = <&gpio0 13 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dir-615-h1:blue:wps";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-620-A1.dts b/target/linux/ramips/dts/DIR-620-A1.dts
index 1655982..212cf88 100644
--- a/target/linux/ramips/dts/DIR-620-A1.dts
+++ b/target/linux/ramips/dts/DIR-620-A1.dts
@@ -82,32 +82,32 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:amber:status";
+			label = "dir-620-a1:amber:status";
 			gpios = <&gpio0 8 1>;
 		};
 
 		status2 {
-			label = "d-link:green:status";
+			label = "dir-620-a1:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wan {
-			label = "d-link:amber:wan";
+			label = "dir-620-a1:amber:wan";
 			gpios = <&gpio0 14 1>;
 		};
 
 		wan2 {
-			label = "d-link:green:wan";
+			label = "dir-620-a1:green:wan";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "d-link:blue:wps";
+			label = "dir-620-a1:blue:wps";
 			gpios = <&gpio0 13 0>;
 		};
 
 		wps2 {
-			label = "d-link:amber:wps";
+			label = "dir-620-a1:amber:wps";
 			gpios = <&gpio0 11 0>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-620-D1.dts b/target/linux/ramips/dts/DIR-620-D1.dts
index 8a5b057..166d61e 100644
--- a/target/linux/ramips/dts/DIR-620-D1.dts
+++ b/target/linux/ramips/dts/DIR-620-D1.dts
@@ -79,12 +79,12 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "d-link:green:status";
+			label = "dir-620-d1:green:status";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wifi {
-			label = "d-link:green:wifi";
+			label = "dir-620-d1:green:wifi";
 			gpios = <&gpio0 17 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-645.dts b/target/linux/ramips/dts/DIR-645.dts
index ab83901..58a0788 100644
--- a/target/linux/ramips/dts/DIR-645.dts
+++ b/target/linux/ramips/dts/DIR-645.dts
@@ -119,12 +119,12 @@
 		compatible = "gpio-leds";
 
 		inet {
-			label = "d-link:green:inet";
+			label = "dir-645:green:inet";
 			gpios = <&gpio0 0 1>;
 		};
 
 		wps {
-			label = "d-link:green:wps";
+			label = "dir-645:green:wps";
 			gpios = <&gpio1 2 0>;
 		};
 	};
diff --git a/target/linux/ramips/dts/DIR-810L.dts b/target/linux/ramips/dts/DIR-810L.dts
index ae74500..4f00787 100644
--- a/target/linux/ramips/dts/DIR-810L.dts
+++ b/target/linux/ramips/dts/DIR-810L.dts
@@ -119,17 +119,17 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "d-link:green:power";
+			label = "dir-810l:green:power";
 			gpios = <&gpio0 9 0>;
 		};
 
 		wan {
-			label = "d-link:orange:wan";
+			label = "dir-810l:orange:wan";
 			gpios = <&gpio0 12 0>;
 		};
 
 		status {
-			label = "d-link:orange:power";
+			label = "dir-810l:orange:power";
 			gpios = <&gpio0 13 0>;
 		};
 	};
diff --git a/target/linux/ramips/dts/E1700.dts b/target/linux/ramips/dts/E1700.dts
index 7689b17..832b715 100644
--- a/target/linux/ramips/dts/E1700.dts
+++ b/target/linux/ramips/dts/E1700.dts
@@ -142,12 +142,12 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "linksys:green:power";
+			label = "e1700:green:power";
 			gpios = <&gpio0 10 1>;
 		};
 
 		wan {
-			label = "linksys:green:wps";
+			label = "e1700:green:wps";
 			gpios = <&gpio0 12 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/F5D8235_V2.dts b/target/linux/ramips/dts/F5D8235_V2.dts
index 45f7d69..d0a49f6 100644
--- a/target/linux/ramips/dts/F5D8235_V2.dts
+++ b/target/linux/ramips/dts/F5D8235_V2.dts
@@ -71,47 +71,47 @@
 		compatible = "gpio-leds";
 
 		internet {
-			label = "f5d8235v2:blue:internet";
+			label = "f5d8235-v2:blue:internet";
 			gpios = <&gpio0 5 1>;
 		};
 
 		internet2 {
-			label = "f5d8235v2:amber:internet";
+			label = "f5d8235-v2:amber:internet";
 			gpios = <&gpio0 6 1>;
 		};
 
 		modem {
-			label = "f5d8235v2:blue:modem";
+			label = "f5d8235-v2:blue:modem";
 			gpios = <&gpio0 11 1>;
 		};
 
 		modem2 {
-			label = "f5d8235v2:amber:modem";
+			label = "f5d8235-v2:amber:modem";
 			gpios = <&gpio0 8 1>;
 		};
 
 		router {
-			label = "f5d8235v2:blue:router";
+			label = "f5d8235-v2:blue:router";
 			gpios = <&gpio0 9 1>;
 		};
 
 		storage {
-			label = "f5d8235v2:blue:storage";
+			label = "f5d8235-v2:blue:storage";
 			gpios = <&gpio0 23 1>;
 		};
 
 		storage2 {
-			label = "f5d8235v2:amber:storage";
+			label = "f5d8235-v2:amber:storage";
 			gpios = <&gpio0 22 1>;
 		};
 
 		security {
-			label = "f5d8235v2:blue:security";
+			label = "f5d8235-v2:blue:security";
 			gpios = <&gpio0 13 1>;
 		};
 
 		security2 {
-			label = "f5d8235v2:amber:security";
+			label = "f5d8235-v2:amber:security";
 			gpios = <&gpio0 12 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/F7C027.dts b/target/linux/ramips/dts/F7C027.dts
index 874d606..89e9356 100644
--- a/target/linux/ramips/dts/F7C027.dts
+++ b/target/linux/ramips/dts/F7C027.dts
@@ -86,22 +86,22 @@
 		compatible = "gpio-leds";
 
 		status {
-			label = "belkin:blue:status";
+			label = "f7c027:blue:status";
 			gpios = <&gpio0 7 1>;
 		};
 
 		power {
-			label = "belkin:blue:power";
+			label = "f7c027:blue:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		orange {
-			label = "belkin:orange:status";
+			label = "f7c027:orange:status";
 			gpios = <&gpio0 11 1>;
 		};
 
 		relay {
-			label = "belkin:device:relay";
+			label = "f7c027:device:relay";
 			gpios = <&gpio0 13 0>;
 		};
 	};
diff --git a/target/linux/ramips/dts/FREESTATION5.dts b/target/linux/ramips/dts/FREESTATION5.dts
index 1febfb5..a6a7402 100644
--- a/target/linux/ramips/dts/FREESTATION5.dts
+++ b/target/linux/ramips/dts/FREESTATION5.dts
@@ -85,17 +85,17 @@
 		// The following leds are defined in the ArcOS firmware, but reportedly
 		// not present in the Freestation5 device.
 		wifi {
-			label = "freestation:unknown:wifi";
+			label = "freestation5:unknown:wifi";
 			gpios = <&gpio0 7 1>;
 		};
 
 		powerg {
-			label = "freestation:unknown:powerg";
+			label = "freestation5:unknown:powerg";
 			gpios = <&gpio0 9 1>;
 		};
 
 		usb {
-			label = "freestation:unknown:usb";
+			label = "freestation5:unknown:usb";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/HG255D.dts b/target/linux/ramips/dts/HG255D.dts
index 2aa3cc9..4fbe3e6 100644
--- a/target/linux/ramips/dts/HG255D.dts
+++ b/target/linux/ramips/dts/HG255D.dts
@@ -57,32 +57,32 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "hg255d:power";
+			label = "hg255d:green:power";
 			gpios = <&gpio0 8 1>;
 		};
 
 		internet {
-			label = "hg255d:internet";
+			label = "hg255d:green:internet";
 			gpios = <&gpio0 13 1>;
 		};
 
 		wifi {
-			label = "hg255d:wlan";
+			label = "hg255d:green:wlan";
 			gpios = <&gpio0 14 1>;
 		};
 
 		usb {
-			label = "hg255d:usb";
+			label = "hg255d:green:usb";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wps {
-			label = "hg255d:wps";
+			label = "hg255d:green:wps";
 			gpios = <&gpio0 12 1>;
 		};
 
 		voice {
-			label = "hg255d:voice";
+			label = "hg255d:green:voice";
 			gpios = <&gpio0 5 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/MLW221.dts b/target/linux/ramips/dts/MLW221.dts
index 1c41f6c..12bc8c0 100644
--- a/target/linux/ramips/dts/MLW221.dts
+++ b/target/linux/ramips/dts/MLW221.dts
@@ -91,12 +91,12 @@
 		compatible = "gpio-leds";
 
 		system {
-			label = "kingston:blue:system";
+			label = "mlw221:blue:system";
 			gpios = <&gpio2 3 1>;
 		};
 
 		wifi {
-			label = "kingston:blue:wifi";
+			label = "mlw221:blue:wifi";
 			gpios = <&gpio3 0 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/MLWG2.dts b/target/linux/ramips/dts/MLWG2.dts
index c1b5276..c417bff 100644
--- a/target/linux/ramips/dts/MLWG2.dts
+++ b/target/linux/ramips/dts/MLWG2.dts
@@ -91,12 +91,12 @@
 		compatible = "gpio-leds";
 
 		system {
-			label = "kingston:blue:system";
+			label = "mlwg2:blue:system";
 			gpios = <&gpio2 3 1>;
 		};
 
 		wifi {
-			label = "kingston:blue:wifi";
+			label = "mlwg2:blue:wifi";
 			gpios = <&gpio3 0 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/MPRA1.dts b/target/linux/ramips/dts/MPRA1.dts
index 1389b807..8a7d684 100644
--- a/target/linux/ramips/dts/MPRA1.dts
+++ b/target/linux/ramips/dts/MPRA1.dts
@@ -81,12 +81,12 @@
 		compatible = "gpio-leds";
 
 		system {
-			label = "hame:blue:system";
+			label = "mpr-a1:blue:system";
 			gpios = <&gpio0 20 1>;
 		};
 
 		power {
-			label = "hame:red:power";
+			label = "mpr-a1:red:power";
 			gpios = <&gpio0 17 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/MPRA2.dts b/target/linux/ramips/dts/MPRA2.dts
index 849e911..4b8fd29 100644
--- a/target/linux/ramips/dts/MPRA2.dts
+++ b/target/linux/ramips/dts/MPRA2.dts
@@ -77,12 +77,12 @@
 		compatible = "gpio-leds";
 
 		system {
-			label = "hame:blue:system";
+			label = "mpr-a2:blue:system";
 			gpios = <&gpio0 20 1>;
 		};
 
 		power {
-			label = "hame:red:power";
+			label = "mpr-a2:red:power";
 			gpios = <&gpio0 17 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/MZK-750DHP.dts b/target/linux/ramips/dts/MZK-750DHP.dts
index 2502874..bdf3f8f 100644
--- a/target/linux/ramips/dts/MZK-750DHP.dts
+++ b/target/linux/ramips/dts/MZK-750DHP.dts
@@ -80,12 +80,12 @@
 		compatible = "gpio-leds";
 
 		wps {
-			label = "mzk750:green:wps";
+			label = "mzk-750dhp:green:wps";
 			gpios = <&gpio1 11 1>;
 		};
 
 		power {
-			label = "mzk750:green:power";
+			label = "mzk-750dhp:green:power";
 			gpios = <&gpio1 15 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/MZK-DP150N.dts b/target/linux/ramips/dts/MZK-DP150N.dts
index 4b7b925..893807c 100644
--- a/target/linux/ramips/dts/MZK-DP150N.dts
+++ b/target/linux/ramips/dts/MZK-DP150N.dts
@@ -80,7 +80,7 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "mzkdp150n:green:power";
+			label = "mzk-dp150n:green:power";
 			gpios = <&gpio0 9 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/MZK-W300NH2.dts b/target/linux/ramips/dts/MZK-W300NH2.dts
index 7195253..06cc292 100644
--- a/target/linux/ramips/dts/MZK-W300NH2.dts
+++ b/target/linux/ramips/dts/MZK-W300NH2.dts
@@ -69,17 +69,17 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "mzkw300nh2:green:power";
+			label = "mzk-w300nh2:green:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wlan {
-			label = "mzkw300nh2:amber:wlan";
+			label = "mzk-w300nh2:amber:wlan";
 			gpios = <&gpio0 14 1>;
 		};
 
 		wps {
-			label = "mzkw300nh2:amber:wps";
+			label = "mzk-w300nh2:amber:wps";
 			gpios = <&gpio0 11 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/OY-0001.dts b/target/linux/ramips/dts/OY-0001.dts
index b008afd..36c783b 100644
--- a/target/linux/ramips/dts/OY-0001.dts
+++ b/target/linux/ramips/dts/OY-0001.dts
@@ -84,12 +84,12 @@
 		compatible = "gpio-leds";
 
 		powerled {
-			label = "oy:green:power";
+			label = "oy-0001:green:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wifiled {
-			label = "oy:green:wifi";
+			label = "oy-0001:green:wifi";
 			gpios = <&gpio3 0 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/RE6500.dts b/target/linux/ramips/dts/RE6500.dts
index 89029bf..b65ade4 100644
--- a/target/linux/ramips/dts/RE6500.dts
+++ b/target/linux/ramips/dts/RE6500.dts
@@ -88,12 +88,12 @@
 		compatible = "gpio-leds";
 
 		wifi {
-			label = "linksys:orange:wifi";
+			label = "re6500:orange:wifi";
 			gpios = <&gpio0 0 1>;
 		};
 
 		power {
-			label = "linksys:white:power";
+			label = "re6500:white:power";
 			gpios = <&gpio0 9 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/RP-N53.dts b/target/linux/ramips/dts/RP-N53.dts
index 80ece00..2287a8c 100644
--- a/target/linux/ramips/dts/RP-N53.dts
+++ b/target/linux/ramips/dts/RP-N53.dts
@@ -120,42 +120,42 @@
 		compatible = "gpio-leds";
 
 		backlight {
-			label = "asus:white:back";
+			label = "rp-n53:white:back";
 			gpios = <&gpio1 4 1>;
 		};
 
 		wifi0 {
-			label = "asus:blue:5g3";
+			label = "rp-n53:blue:5g3";
 			gpios = <&gpio1 5 1>;
 		};
 
 		wifi1 {
-			label = "asus:blue:5g2";
+			label = "rp-n53:blue:5g2";
 			gpios = <&gpio1 6 1>;
 		};
 
 		wifi2 {
-			label = "asus:blue:5g1";
+			label = "rp-n53:blue:5g1";
 			gpios = <&gpio1 7 1>;
 		};
 
 		wifi3 {
-			label = "asus:blue:wifi";
+			label = "rp-n53:blue:wifi";
 			gpios = <&gpio1 8 1>;
 		};
 
 		wifi4 {
-			label = "asus:blue:2g1";
+			label = "rp-n53:blue:2g1";
 			gpios = <&gpio1 9 1>;
 		};
 
 		wifi5 {
-			label = "asus:blue:2g2";
+			label = "rp-n53:blue:2g2";
 			gpios = <&gpio1 10 1>;
 		};
 
 		wifi6 {
-			label = "asus:blue:2g3";
+			label = "rp-n53:blue:2g3";
 			gpios = <&gpio1 11 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/RT-N10-PLUS.dts b/target/linux/ramips/dts/RT-N10-PLUS.dts
index 7bbd221..edbd92b 100644
--- a/target/linux/ramips/dts/RT-N10-PLUS.dts
+++ b/target/linux/ramips/dts/RT-N10-PLUS.dts
@@ -54,7 +54,7 @@
 		compatible = "gpio-leds";
 
 		wps {
-			label = "asus:green:wps";
+			label = "rt-n10-plus:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/RT-N13U.dts b/target/linux/ramips/dts/RT-N13U.dts
index 4e1737e..7e0fbd2 100644
--- a/target/linux/ramips/dts/RT-N13U.dts
+++ b/target/linux/ramips/dts/RT-N13U.dts
@@ -51,12 +51,12 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "rt-n13u:power";
+			label = "rt-n13u:blue:power";
 			gpios = <&gpio0 7 1>;
 		};
 
 		wifi {
-			label = "rt-n13u:wifi";
+			label = "rt-n13u:blue:wifi";
 			gpios = <&gpio0 8 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/RT-N14U.dts b/target/linux/ramips/dts/RT-N14U.dts
index cd46bdf..6d1080b 100644
--- a/target/linux/ramips/dts/RT-N14U.dts
+++ b/target/linux/ramips/dts/RT-N14U.dts
@@ -83,27 +83,27 @@
 		compatible = "gpio-leds";
 
 		wan {
-			label = "asus:blue:wan";
+			label = "rt-n14u:blue:wan";
 			gpios = <&gpio2 0 1>;
 		};
 
 		lan {
-			label = "asus:blue:lan";
+			label = "rt-n14u:blue:lan";
 			gpios = <&gpio2 1 1>;
 		};
 
 		usb {
-			label = "asus:blue:usb";
+			label = "rt-n14u:blue:usb";
 			gpios = <&gpio2 2 1>;
 		};
 
 		power {
-			label = "asus:blue:power";
+			label = "rt-n14u:blue:power";
 			gpios = <&gpio2 3 1>;
 		};
 
 		air {
-			label = "asus:blue:air";
+			label = "rt-n14u:blue:air";
 			gpios = <&gpio3 0 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/RT-N56U.dts b/target/linux/ramips/dts/RT-N56U.dts
index 3ecd1b7..8ea4970 100644
--- a/target/linux/ramips/dts/RT-N56U.dts
+++ b/target/linux/ramips/dts/RT-N56U.dts
@@ -129,22 +129,22 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "asus:blue:power";
+			label = "rt-n56u:blue:power";
 			gpios = <&gpio0 0 1>;
 		};
 
 		lan {
-			label = "asus:blue:lan";
+			label = "rt-n56u:blue:lan";
 			gpios = <&gpio0 19 1>;
 		};
 
 		wan {
-			label = "asus:blue:wan";
+			label = "rt-n56u:blue:wan";
 			gpios = <&gpio1 3 1>;
 		};
 
 		usb {
-			label = "asus:blue:usb";
+			label = "rt-n56u:blue:usb";
 			gpios = <&gpio1 0 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/SAP-G3200U3.dts b/target/linux/ramips/dts/SAP-G3200U3.dts
index d273559..e2798fb 100644
--- a/target/linux/ramips/dts/SAP-G3200U3.dts
+++ b/target/linux/ramips/dts/SAP-G3200U3.dts
@@ -89,7 +89,7 @@
 		compatible = "gpio-leds";
 
 		usb {
-			label = "storylink:green:usb";
+			label = "sap-g3200u3:green:usb";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/TEW-691GR.dts b/target/linux/ramips/dts/TEW-691GR.dts
index b56ff9f..5bd6444 100644
--- a/target/linux/ramips/dts/TEW-691GR.dts
+++ b/target/linux/ramips/dts/TEW-691GR.dts
@@ -102,7 +102,7 @@
 		compatible = "gpio-leds";
 
 		wps {
-			label = "trendnet:green:wps";
+			label = "tew-691gr:green:wps";
 			gpios = <&gpio0 9 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/TEW-692GR.dts b/target/linux/ramips/dts/TEW-692GR.dts
index d537e29..17835f6 100644
--- a/target/linux/ramips/dts/TEW-692GR.dts
+++ b/target/linux/ramips/dts/TEW-692GR.dts
@@ -116,12 +116,12 @@
 		compatible = "gpio-leds";
 
 		wps {
-			label = "trendnet:orange:wps";
+			label = "tew-692gr:orange:wps";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wps2 {
-			label = "trendnet:green:wps";
+			label = "tew-692gr:green:wps";
 			gpios = <&gpio1 4 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/UR-326N4G.dts b/target/linux/ramips/dts/UR-326N4G.dts
index 92a7a57..3eb2526 100644
--- a/target/linux/ramips/dts/UR-326N4G.dts
+++ b/target/linux/ramips/dts/UR-326N4G.dts
@@ -63,27 +63,27 @@
 		compatible = "gpio-leds";
 
 		3g {
-			label = "ur326:green:3g";
+			label = "ur-326n4g:green:3g";
 			gpios = <&gpio0 9 1>;
 		};
 
 		gateway {
-			label = "ur326:green:gateway";
+			label = "ur-326n4g:green:gateway";
 			gpios = <&gpio0 11 1>;
 		};
 
 		ap {
-			label = "ur326:green:ap";
+			label = "ur-326n4g:green:ap";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "ur326:green:wps";
+			label = "ur-326n4g:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
 
 		station {
-			label = "ur326:green:station";
+			label = "ur-326n4g:green:station";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/UR-336UN.dts b/target/linux/ramips/dts/UR-336UN.dts
index a6ef6cd..76f669a 100644
--- a/target/linux/ramips/dts/UR-336UN.dts
+++ b/target/linux/ramips/dts/UR-336UN.dts
@@ -42,27 +42,27 @@
 		compatible = "gpio-leds";
 
 		3g {
-			label = "ur336:green:3g";
+			label = "ur-336un:green:3g";
 			gpios = <&gpio0 9 1>;
 		};
 
 		gateway {
-			label = "ur336:green:gateway";
+			label = "ur-336un:green:gateway";
 			gpios = <&gpio0 11 1>;
 		};
 
 		ap {
-			label = "ur336:green:ap";
+			label = "ur-336un:green:ap";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "ur336:green:wps";
+			label = "ur-336un:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
 
 		station {
-			label = "ur336:green:station";
+			label = "ur-336un:green:station";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/W150M.dts b/target/linux/ramips/dts/W150M.dts
index 2309df6..875c468 100644
--- a/target/linux/ramips/dts/W150M.dts
+++ b/target/linux/ramips/dts/W150M.dts
@@ -51,32 +51,32 @@
 		compatible = "gpio-leds";
 
 		3grouter {
-			label = "tenda:blue:3grouter";
+			label = "w150m:blue:3grouter";
 			gpios = <&gpio0 11 1>;
 		};
 
 		ap {
-			label = "tenda:blue:ap";
+			label = "w150m:blue:ap";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wisprouter {
-			label = "tenda:blue:wisprouter";
+			label = "w150m:blue:wisprouter";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wirelessrouter {
-			label = "tenda:blue:wirelessrouter";
+			label = "w150m:blue:wirelessrouter";
 			gpios = <&gpio0 13 1>;
 		};
 
 		3g {
-			label = "tenda:blue:3g";
+			label = "w150m:blue:3g";
 			gpios = <&gpio0 7 1>;
 		};
 
 		wpsreset {
-			label = "tenda:blue:wpsreset";
+			label = "w150m:blue:wpsreset";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/W502U.dts b/target/linux/ramips/dts/W502U.dts
index 8afe741..0f423ba 100644
--- a/target/linux/ramips/dts/W502U.dts
+++ b/target/linux/ramips/dts/W502U.dts
@@ -67,12 +67,12 @@
 		compatible = "gpio-leds";
 
 		usb {
-			label = "alfa:blue:usb";
+			label = "w502u:blue:usb";
 			gpios = <&gpio0 13 1>;
 		};
 
 		wps {
-			label = "alfa:blue:wps";
+			label = "w502u:blue:wps";
 			gpios = <&gpio0 14 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WCR150GN.dts b/target/linux/ramips/dts/WCR150GN.dts
index 66bf901..e197bb9 100644
--- a/target/linux/ramips/dts/WCR150GN.dts
+++ b/target/linux/ramips/dts/WCR150GN.dts
@@ -51,12 +51,12 @@
 		compatible = "gpio-leds";
 
 		user {
-			label = "wcr150gn:amber:user";
+			label = "wcr-150gn:amber:user";
 			gpios = <&gpio0 12 1>;
 		};
 
 		power {
-			label = "wcr150gn:amber:power";
+			label = "wcr-150gn:amber:power";
 			gpios = <&gpio0 8 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WHR-1166D.dts b/target/linux/ramips/dts/WHR-1166D.dts
index 756d180..69b8641 100644
--- a/target/linux/ramips/dts/WHR-1166D.dts
+++ b/target/linux/ramips/dts/WHR-1166D.dts
@@ -102,37 +102,37 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "buffalo:red:power";
+			label = "whr-1166d:red:power";
 			gpios = <&gpio0 7 1>;
 		};
 
 		wifi {
-			label = "buffalo:green:wifi";
+			label = "whr-1166d:green:wifi";
 			gpios = <&gpio0 8 1>;
 		};
 
 		power2 {
-			label = "buffalo:green:power";
+			label = "whr-1166d:green:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wifi2 {
-			label = "buffalo:orange:wifi";
+			label = "whr-1166d:orange:wifi";
 			gpios = <&gpio0 10 1>;
 		};
 
 		internet {
-			label = "buffalo:green:internet";
+			label = "whr-1166d:green:internet";
 			gpios = <&gpio2 17 1>;
 		};
 
 		router {
-			label = "buffalo:orange:router";
+			label = "whr-1166d:orange:router";
 			gpios = <&gpio2 18 1>;
 		};
 
 		router2 {
-			label = "buffalo:green:router";
+			label = "whr-1166d:green:router";
 			gpios = <&gpio2 19 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WHR-300HP2.dts b/target/linux/ramips/dts/WHR-300HP2.dts
index 83bc407..5916715 100644
--- a/target/linux/ramips/dts/WHR-300HP2.dts
+++ b/target/linux/ramips/dts/WHR-300HP2.dts
@@ -80,37 +80,37 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "buffalo:red:power";
+			label = "whr-300hp2:red:power";
 			gpios = <&gpio0 7 1>;
 		};
 
 		wifi {
-			label = "buffalo:green:wifi";
+			label = "whr-300hp2:green:wifi";
 			gpios = <&gpio0 8 1>;
 		};
 
 		power2 {
-			label = "buffalo:green:power";
+			label = "whr-300hp2:green:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wifi2 {
-			label = "buffalo:orange:wifi";
+			label = "whr-300hp2:orange:wifi";
 			gpios = <&gpio0 10 1>;
 		};
 
 		internet {
-			label = "buffalo:green:internet";
+			label = "whr-300hp2:green:internet";
 			gpios = <&gpio2 17 1>;
 		};
 
 		router {
-			label = "buffalo:green:router";
+			label = "whr-300hp2:green:router";
 			gpios = <&gpio2 18 1>;
 		};
 
 		router2 {
-			label = "buffalo:orange:router";
+			label = "whr-300hp2:orange:router";
 			gpios = <&gpio2 19 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WHR-600D.dts b/target/linux/ramips/dts/WHR-600D.dts
index 5e06060..8e20859 100644
--- a/target/linux/ramips/dts/WHR-600D.dts
+++ b/target/linux/ramips/dts/WHR-600D.dts
@@ -80,37 +80,37 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "buffalo:red:power";
+			label = "whr-600d:red:power";
 			gpios = <&gpio0 7 1>;
 		};
 
 		wifi {
-			label = "buffalo:green:wifi";
+			label = "whr-600d:green:wifi";
 			gpios = <&gpio0 8 1>;
 		};
 
 		power2 {
-			label = "buffalo:green:power";
+			label = "whr-600d:green:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wifi2 {
-			label = "buffalo:orange:wifi";
+			label = "whr-600d:orange:wifi";
 			gpios = <&gpio0 10 1>;
 		};
 
 		internet {
-			label = "buffalo:green:internet";
+			label = "whr-600d:green:internet";
 			gpios = <&gpio2 17 1>;
 		};
 
 		router {
-			label = "buffalo:green:router";
+			label = "whr-600d:green:router";
 			gpios = <&gpio2 18 1>;
 		};
 
 		router2 {
-			label = "buffalo:orange:router";
+			label = "whr-600d:orange:router";
 			gpios = <&gpio2 19 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WL-330N.dts b/target/linux/ramips/dts/WL-330N.dts
index 0e7c027..a7238dc 100644
--- a/target/linux/ramips/dts/WL-330N.dts
+++ b/target/linux/ramips/dts/WL-330N.dts
@@ -69,12 +69,12 @@
 		compatible = "gpio-leds";
 
 		link {
-			label = "asus:blue:link";
+			label = "wl-330n:blue:link";
 			gpios = <&gpio0 9 1>;
 		};
 
 		power {
-			label = "asus:blue:power";
+			label = "wl-330n:blue:power";
 			gpios = <&gpio0 11 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WL-330N3G.dts b/target/linux/ramips/dts/WL-330N3G.dts
index 12a24b5..c02f6a9 100644
--- a/target/linux/ramips/dts/WL-330N3G.dts
+++ b/target/linux/ramips/dts/WL-330N3G.dts
@@ -69,17 +69,17 @@
 		compatible = "gpio-leds";
 
 		3g {
-			label = "asus:blue:3g";
+			label = "wl-330n3g:blue:3g";
 			gpios = <&gpio0 9 1>;
 		};
 
 		3g2 {
-			label = "asus:red:3g";
+			label = "wl-330n3g:red:3g";
 			gpios = <&gpio0 13 1>;
 		};
 
 		power {
-			label = "asus:blue:power";
+			label = "wl-330n3g:blue:power";
 			gpios = <&gpio0 11 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WLI-TX4-AG300N.dts b/target/linux/ramips/dts/WLI-TX4-AG300N.dts
index e7e8e4a..3a456b8 100644
--- a/target/linux/ramips/dts/WLI-TX4-AG300N.dts
+++ b/target/linux/ramips/dts/WLI-TX4-AG300N.dts
@@ -88,17 +88,17 @@
 		compatible = "gpio-leds";
 
 		diag {
-			label = "buffalo:red:diag";
+			label = "wli-tx4-ag300n:red:diag";
 			gpios = <&gpio0 10 1>;
 		};
 
 		power {
-			label = "buffalo:blue:power";
+			label = "wli-tx4-ag300n:blue:power";
 			gpios = <&gpio0 12 1>;
 		};
 
 		security {
-			label = "buffalo:blue:security";
+			label = "wli-tx4-ag300n:blue:security";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WNCE2001.dts b/target/linux/ramips/dts/WNCE2001.dts
index bd0d596..36eb473 100644
--- a/target/linux/ramips/dts/WNCE2001.dts
+++ b/target/linux/ramips/dts/WNCE2001.dts
@@ -86,22 +86,22 @@
 		compatible = "gpio-leds";
 
 		power-green {
-			label = "netgear:green:power";
+			label = "wnce2001:green:power";
 			gpios = <&gpio0 8 1>;
 		};
 
 		power-red {
-			label = "netgear:red:power";
+			label = "wnce2001:red:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wlan-green {
-			label = "netgear:green:wlan";
+			label = "wnce2001:green:wlan";
 			gpios = <&gpio0 12 0>;
 		};
 
 		wlan-red {
-			label = "netgear:red:wlan";
+			label = "wnce2001:red:wlan";
 			gpios = <&gpio0 13 0>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WR512-3GN-4M.dts b/target/linux/ramips/dts/WR512-3GN-4M.dts
index f5c1319..def7751 100644
--- a/target/linux/ramips/dts/WR512-3GN-4M.dts
+++ b/target/linux/ramips/dts/WR512-3GN-4M.dts
@@ -59,27 +59,27 @@
 		compatible = "gpio-leds";
 
 		3g {
-			label = "wr512:green:3g";
+			label = "wr512-3gn:green:3g";
 			gpios = <&gpio0 9 1>;
 		};
 
 		gateway {
-			label = "wr512:green:gateway";
+			label = "wr512-3gn:green:gateway";
 			gpios = <&gpio0 11 1>;
 		};
 
 		ap {
-			label = "wr512:green:ap";
+			label = "wr512-3gn:green:ap";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "wr512:green:wps";
+			label = "wr512-3gn:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
 
 		station {
-			label = "wr512:green:station";
+			label = "wr512-3gn:green:station";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WR512-3GN-8M.dts b/target/linux/ramips/dts/WR512-3GN-8M.dts
index d0cc0ef..b439f0a 100644
--- a/target/linux/ramips/dts/WR512-3GN-8M.dts
+++ b/target/linux/ramips/dts/WR512-3GN-8M.dts
@@ -59,27 +59,27 @@
 		compatible = "gpio-leds";
 
 		3g {
-			label = "wr512:green:3g";
+			label = "wr512-3gn:green:3g";
 			gpios = <&gpio0 9 1>;
 		};
 
 		gateway {
-			label = "wr512:green:gateway";
+			label = "wr512-3gn:green:gateway";
 			gpios = <&gpio0 11 1>;
 		};
 
 		ap {
-			label = "wr512:green:ap";
+			label = "wr512-3gn:green:ap";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wps {
-			label = "wr512:green:wps";
+			label = "wr512-3gn:green:wps";
 			gpios = <&gpio0 14 1>;
 		};
 
 		station {
-			label = "wr512:green:station";
+			label = "wr512-3gn:green:station";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WSR-1166.dts b/target/linux/ramips/dts/WSR-1166.dts
index dd075db..2dc59cc 100644
--- a/target/linux/ramips/dts/WSR-1166.dts
+++ b/target/linux/ramips/dts/WSR-1166.dts
@@ -71,42 +71,42 @@
 		compatible = "gpio-leds";
 
 		internet_g {
-			label = "buffalo:green:internet";
+			label = "wsr-1166:green:internet";
 			gpios = <&gpio1 9 1>;
 		};
 
 		router_g {
-			label = "buffalo:green:router";
+			label = "wsr-1166:green:router";
 			gpios = <&gpio1 10 1>;
 		};
 
 		router_o {
-			label = "buffalo:orange:router";
+			label = "wsr-1166:orange:router";
 			gpios = <&gpio1 11 1>;
 		};
 
 		internet_o {
-			label = "buffalo:orange:internet";
+			label = "wsr-1166:orange:internet";
 			gpios = <&gpio1 12 1>;
 		};
 
 		wifi_o {
-			label = "buffalo:orange:wifi";
+			label = "wsr-1166:orange:wifi";
 			gpios = <&gpio1 13 1>;
 		};
 
 		power {
-			label = "buffalo:green:power";
+			label = "wsr-1166:green:power";
 			gpios = <&gpio1 14 1>;
 		};
 
 		diag {
-			label = "buffalo:orange:diag";
+			label = "wsr-1166:orange:diag";
 			gpios = <&gpio1 15 1>;
 		};
 
 		wifi_g {
-			label = "buffalo:green:wifi";
+			label = "wsr-1166:green:wifi";
 			gpios = <&gpio1 16 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WSR-600.dts b/target/linux/ramips/dts/WSR-600.dts
index 7b4fd74..5eb813f 100644
--- a/target/linux/ramips/dts/WSR-600.dts
+++ b/target/linux/ramips/dts/WSR-600.dts
@@ -66,42 +66,42 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "buffalo:green:power";
+			label = "wsr-600:green:power";
 			gpios = <&gpio0 12 1>;
 		};
 
 		wifi_o {
-			label = "buffalo:orange:wifi";
+			label = "wsr-600:orange:wifi";
 			gpios = <&gpio1 9 1>;
 		};
 
 		diag {
-			label = "buffalo:orange:diag";
+			label = "wsr-600:orange:diag";
 			gpios = <&gpio1 10 1>;
 		};
 
 		wifi_g {
-			label = "buffalo:green:wifi";
+			label = "wsr-600:green:wifi";
 			gpios = <&gpio1 12 1>;
 		};
 
 		router_o {
-			label = "buffalo:orange:router";
+			label = "wsr-600:orange:router";
 			gpios = <&gpio1 13 1>;
 		};
 
 		router_g {
-			label = "buffalo:green:router";
+			label = "wsr-600:green:router";
 			gpios = <&gpio1 14 1>;
 		};
 
 		internet_o {
-			label = "buffalo:orange:internet";
+			label = "wsr-600:orange:internet";
 			gpios = <&gpio1 15 1>;
 		};
 
 		internet_g {
-			label = "buffalo:green:internet";
+			label = "wsr-600:green:internet";
 			gpios = <&gpio1 16 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WT3020-4M.dts b/target/linux/ramips/dts/WT3020-4M.dts
index 4295939..6670a1c 100644
--- a/target/linux/ramips/dts/WT3020-4M.dts
+++ b/target/linux/ramips/dts/WT3020-4M.dts
@@ -95,7 +95,7 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "nexx:blue:power";
+			label = "wt3020:blue:power";
 			gpios = <&gpio3 0 0>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WT3020-8M.dts b/target/linux/ramips/dts/WT3020-8M.dts
index 122499d..3abd8fe 100644
--- a/target/linux/ramips/dts/WT3020-8M.dts
+++ b/target/linux/ramips/dts/WT3020-8M.dts
@@ -95,7 +95,7 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "nexx:blue:power";
+			label = "wt3020:blue:power";
 			gpios = <&gpio3 0 0>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WZR-AGL300NH.dts b/target/linux/ramips/dts/WZR-AGL300NH.dts
index 5d6c25d..98b50ba 100644
--- a/target/linux/ramips/dts/WZR-AGL300NH.dts
+++ b/target/linux/ramips/dts/WZR-AGL300NH.dts
@@ -112,22 +112,22 @@
 		compatible = "gpio-leds";
 
 		router {
-			label = "buffalo:green:router";
+			label = "wzr-agl300nh:green:router";
 			gpios = <&gpio0 8 1>;
 		};
 
 		diag {
-			label = "buffalo:red:diag";
+			label = "wzr-agl300nh:red:diag";
 			gpios = <&gpio0 12 1>;
 		};
 
 		security_g {
-			label = "buffalo:orange:security_g";
+			label = "wzr-agl300nh:orange:security_g";
 			gpios = <&gpio0 11 1>;
 		};
 
 		security_n {
-			label = "buffalo:orange:security_n";
+			label = "wzr-agl300nh:orange:security_n";
 			gpios = <&gpio0 13 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/Y1.dts b/target/linux/ramips/dts/Y1.dts
index 783cdaa..4a64115 100644
--- a/target/linux/ramips/dts/Y1.dts
+++ b/target/linux/ramips/dts/Y1.dts
@@ -17,32 +17,32 @@
 		compatible = "gpio-leds";
 
 		power1 {
-			label = "lenovo:blue:power";
+			label = "y1:blue:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wlan1 {
-			label = "lenovo:blue:wifi";
+			label = "y1:blue:wifi";
 			gpios = <&gpio3 0 1>;
 		};
 
 		wlan2 {
-			label = "lenovo:blue:wifi5g";
+			label = "y1:blue:wifi5g";
 			gpios = <&gpio2 10 1>;
 		};
 
 		usb {
-			label = "lenovo:blue:usb";
+			label = "y1:blue:usb";
 			gpios = <&gpio2 12 1>;
 		};
 
 		lan {
-			label = "lenovo:blue:lan";
+			label = "y1:blue:lan";
 			gpios = <&gpio2 15 1>;
 		};
 
 		internet {
-			label = "lenovo:blue:internet";
+			label = "y1:blue:internet";
 			gpios = <&gpio2 11 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/Y1S.dts b/target/linux/ramips/dts/Y1S.dts
index b8c6ad0..f61280b 100644
--- a/target/linux/ramips/dts/Y1S.dts
+++ b/target/linux/ramips/dts/Y1S.dts
@@ -48,37 +48,37 @@
 		compatible = "gpio-leds";
 
 		power1 {
-			label = "lenovo:yellow:power";
+			label = "y1s:yellow:power";
 			gpios = <&gpio0 14 1>;
 		};
 
 		power2 {
-			label = "lenovo:blue:power";
+			label = "y1s:blue:power";
 			gpios = <&gpio0 9 1>;
 		};
 
 		wlan1 {
-			label = "lenovo:yellow:wifi";
+			label = "y1s:yellow:wifi";
 			gpios = <&gpio3 0 1>;
 		};
 
 		wlan2 {
-			label = "lenovo:blue:wifi";
+			label = "y1s:blue:wifi";
 			gpios = <&gpio2 10 1>;
 		};
 
 		usb1 {
-			label = "lenovo:yellow:usb";
+			label = "y1s:yellow:usb";
 			gpios = <&gpio2 13 1>;
 		};
 
 		usb2 {
-			label = "lenovo:blue:usb";
+			label = "y1s:blue:usb";
 			gpios = <&gpio2 12 1>;
 		};
 
 		internet {
-			label = "lenovo:blue:internet";
+			label = "y1s:blue:internet";
 			gpios = <&gpio2 11 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/ZBT-WA05.dts b/target/linux/ramips/dts/ZBT-WA05.dts
index 69060a3..84974cf 100644
--- a/target/linux/ramips/dts/ZBT-WA05.dts
+++ b/target/linux/ramips/dts/ZBT-WA05.dts
@@ -90,17 +90,17 @@
 		compatible = "gpio-leds";
 
 		power {
-			label = "zbtlink:blue:power";
+			label = "zbt-wa05:blue:power";
 			gpios = <&gpio1 14 1>;
 		};
 
 		usb {
-			label = "zbtlink:blue:usb";
+			label = "zbt-wa05:blue:usb";
 			gpios = <&gpio1 15 0>;
 		};
 
 		air {
-			label = "zbtlink:blue:air";
+			label = "zbt-wa05:blue:air";
 			gpios = <&gpio3 0 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/ZBT-WR8305RT.dts b/target/linux/ramips/dts/ZBT-WR8305RT.dts
index 8c56c15..8d21a2d 100644
--- a/target/linux/ramips/dts/ZBT-WR8305RT.dts
+++ b/target/linux/ramips/dts/ZBT-WR8305RT.dts
@@ -87,17 +87,17 @@
 		compatible = "gpio-leds";
 
 		sys {
-			label = "zbt-wr8305rt:sys";
+			label = "zbt-wr8305rt:green:sys";
 			gpios = <&gpio1 14 1>;
 		};
 
 		lan {
-			label = "zbt-wr8305rt:usb";
+			label = "zbt-wr8305rt:green:usb";
 			gpios = <&gpio1 15 1>;
 		};
 
 		wifi {
-			label = "zbt-wr8305rt:wifi";
+			label = "zbt-wr8305rt:green:wifi";
 			gpios = <&gpio3 0 1>;
 		};
 	};
diff --git a/target/linux/ramips/dts/ZTE-Q7.dts b/target/linux/ramips/dts/ZTE-Q7.dts
index 62af06a..997349b 100644
--- a/target/linux/ramips/dts/ZTE-Q7.dts
+++ b/target/linux/ramips/dts/ZTE-Q7.dts
@@ -88,12 +88,12 @@
 		compatible = "gpio-leds";
 
 		statred {
-			label = "zte:red:status";
+			label = "zte-q7:red:status";
 			gpios = <&gpio0 13 1>;
 		};
 
 		statblue {
-			label = "zte:blue:status";
+			label = "zte-q7:blue:status";
 			gpios = <&gpio0 9 1>;
 		};
 	};
-- 
2.4.6

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Wed Aug  5 14:30:26 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Wed,  5 Aug 2015 20:30:26 +0200
Subject: [OpenWrt-Devel] [PATCH v2 25/25] ramips: base-files: optimize
	etc/diag.sh and etc/board.d/01_leds scripts
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <1438799426-24409-26-git-send-email-pepe2k@gmail.com>

Instead of using board name provided explicitly as text in LED name, ex.:

[...]
mlwg2)
	status_led="mlwg2:blue:system"
[...]

use $board variable, which allows to combine together multiple boards with same color and LED names, ex:

[...]
mlw221|\
mlwg2)
	status_led="$board:blue:system"
[...]

The above approach allows to shrink size of code in base-files/etc/board.d/01_leds and base-files/etc/diag.sh scripts dramatically.
One thing to keep in mind here is that we assume to use proper and consistent LED naming scheme ("device:color:led-name").

Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds | 265 ++++++--------
 target/linux/ramips/base-files/etc/diag.sh         | 394 +++++++--------------
 2 files changed, 235 insertions(+), 424 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index c8256db..71cf3ac 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -17,38 +17,41 @@ board=$(ramips_board_name)
 board_config_update
 
 case $board in
-3g150b)
-	set_usb_led "3g150b:blue:3g"
-	;;
+3g150b|\
 3g300m)
-	set_usb_led "3g300m:blue:3g"
+	set_usb_led "$board:blue:3g"
 	;;
 3g-6200n)
-	set_wifi_led "3g-6200n:amber:wlan"
-	set_usb_led "3g-6200n:blue:3g"
+	set_wifi_led "$board:amber:wlan"
+	set_usb_led "$board:blue:3g"
 	;;
-3g-6200nl)
-	set_wifi_led "3g-6200nl:amber:wlan"
+3g-6200nl|\
+br-6475nd|\
+mzk-w300nh2)
+	set_wifi_led "$board:amber:wlan"
 	;;
 a5-v11)
-	ucidef_set_led_default "power" "POWER" "a5-v11:red:power" "1"
+	ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
 	;;
 ai-br100)
-	ucidef_set_led_netdev "wan" "wan" "ai-br100:blue:wan" "eth0.2"
-	set_wifi_led "ai-br100:blue:wlan"
+	ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" "eth0.2"
+	set_wifi_led "$board:blue:wlan"
 	;;
 air3gii)
-	set_wifi_led "air3gii:green:wlan"
-	set_usb_led "air3gii:green:mobile"
+	set_wifi_led "$board:green:wlan"
+	set_usb_led "$board:green:mobile"
 	;;
-all0239-3g)
-	set_usb_led "all0239-3g:green:usb"
+all0239-3g|\
+hw550-3g|\
+mofi3500-3gn|\
+sap-g3200u3)
+	set_usb_led "$board:green:usb"
 	;;
 all0256n)
 	ucidef_set_rssimon "wlan0" "40000" "1"
-	ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
-	ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
-	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
+	ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:green:rssilow" "wlan0" "1" "40" "0" "6"
+	ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$board:green:rssimed" "wlan0" "30" "80" "-29" "5"
+	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:rssihigh" "wlan0" "70" "100" "-69" "8"
 	set_wifi_led "rt2800pci-phy0::radio"
 	;;
 ar670w|\
@@ -57,42 +60,42 @@ awapn2403)
 	set_wifi_led "rt2800soc-phy0::radio"
 	;;
 asl26555)
-	ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1"
-	ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
-	set_wifi_led "asl26555:green:wlan"
-	set_usb_led "asl26555:green:3g"
+	ucidef_set_led_default "power" "POWER" "$board:green:power" "1"
+	ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
+	set_wifi_led "$board:green:wlan"
+	set_usb_led "$board:green:3g"
 	;;
 bc2)
-	set_usb_led "bc2:blue:usb"
+	set_usb_led "$board:blue:usb"
 	;;
 br-6425)
-	set_wifi_led "br-6425:orange:wlan"
-	;;
-br-6475nd)
-	set_wifi_led "br-6475nd:amber:wlan"
+	set_wifi_led "$board:orange:wlan"
 	;;
 broadway)
-	set_usb_led "broadway:red:diskmounted"
-	set_wifi_led "broadway:red:wps_active"
+	set_usb_led "$board:red:diskmounted"
+	set_wifi_led "$board:red:wps_active"
 	;;
 cf-wr800n)
-	ucidef_set_led_netdev "lan" "lan" "cf-wr800n:white:ethernet" eth0.1
-	set_wifi_led "cf-wr800n:white:wifi"
+	ucidef_set_led_netdev "lan" "lan" "$board:white:ethernet" eth0.1
+	set_wifi_led "$board:white:wifi"
 	;;
 cy-swr1100)
-	ucidef_set_led_default "wps" "WPS" "cy-swr1100:blue:wps" "0"
-	set_usb_led "cy-swr1100:blue:usb"
+	ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0"
+	set_usb_led "$board:blue:usb"
 	;;
 d105)
-	ucidef_set_led_default "power" "POWER" "d105:red:power" "1"
-	set_usb_led "d105:green:usb"
+	ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
+	set_usb_led "$board:green:usb"
 	;;
 dcs-930l-b1)
-	ucidef_set_led_default "power" "POWER" "dcs-930l-b1:red:power" "1"
-	ucidef_set_led_netdev "wifi" "WiFi" "dcs-930l-b1:blue:wps"
+	ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
+	ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps"
 	;;
-dir-300-b1)
-	ucidef_set_led_default "wan" "WAN LED (amber)" "dir-300-b1:amber:wan" "1"
+dir-300-b1|\
+dir-600-b1|\
+dir-600-b2|\
+dir-620-a1)
+	ucidef_set_led_default "wan" "WAN LED (amber)" "$board:amber:wan" "1"
 	set_wifi_led "rt2800pci-phy0::radio"
 	;;
 dir-300-b7|\
@@ -106,185 +109,139 @@ w306r-v20|\
 wt1520)
 	set_wifi_led "rt2800pci-phy0::radio"
 	;;
-dir-600-b1)
-	ucidef_set_led_default "wan" "WAN LED (amber)" "dir-600-b1:amber:wan" "1"
-	set_wifi_led "rt2800pci-phy0::radio"
-	;;
-dir-600-b2)
-	ucidef_set_led_default "wan" "WAN LED (amber)" "dir-600-b2:amber:wan" "1"
-	set_wifi_led "rt2800pci-phy0::radio"
-	;;
-dir-615-d)
-	ucidef_set_led_default "status" "Status LED (amber)" "dir-615-d:amber:status" "0"
-	set_wifi_led "rt2800pci-phy0::radio"
-	;;
+dir-615-d|\
 dir-615-h1)
-	ucidef_set_led_default "status" "Status LED (amber)" "dir-615-h1:amber:status" "0"
-	set_wifi_led "rt2800pci-phy0::radio"
-	;;
-dir-620-a1)
-	ucidef_set_led_default "wan" "WAN LED (amber)" "dir-620-a1:amber:wan" "1"
+	ucidef_set_led_default "status" "Status LED (amber)" "$board:amber:status" "0"
 	set_wifi_led "rt2800pci-phy0::radio"
 	;;
 dir-620-d1)
-	set_wifi_led "dir-620-d1:green:wifi"
-	;;
-dir-810l)
-	ucidef_set_led_default "power" "POWER" "dir-810l:green:power" "1"
+	set_wifi_led "$board:green:wifi"
 	;;
-f5d8235-v1)
-	set_usb_led "f5d8235-v1:blue:storage"
+dir-810l|\
+mzk-dp150n)
+	ucidef_set_led_default "power" "power" "$board:green:power" "1"
 	;;
+f5d8235-v1|\
 f5d8235-v2)
-	set_usb_led "f5d8235-v2:blue:storage"
+	set_usb_led "$board:blue:storage"
 	;;
 fonera20n)
-	set_usb_led "fonera20n:orange:usb"
-	set_wifi_led "fonera20n:orange:wifi"
+	set_usb_led "$board:orange:usb"
+	set_wifi_led "$board:orange:wifi"
 	;;
 hg255d)
-	set_wifi_led "hg255d:green:wlan"
-	set_usb_led "hg255d:green:usb"
-	ucidef_set_led_interface "lan" "hg255d:green:internet"
+	set_wifi_led "$board:green:wlan"
+	set_usb_led "$board:green:usb"
+	ucidef_set_led_interface "lan" "$board:green:internet"
 	;;
 hpm)
-	ucidef_set_led_default "power" "POWER" "hpm:orange:power" "1"
-	ucidef_set_led_netdev "eth" "ETH" "hpm:green:eth" "eth0"
-	set_wifi_led "hpm:green:wifi"
+	ucidef_set_led_default "power" "POWER" "$board:orange:power" "1"
+	ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
+	set_wifi_led "$board:green:wifi"
 	;;
 ht-tm02)
-	ucidef_set_led_netdev "eth" "Ethernet" "ht-tm02:green:lan" "eth0"
-	set_wifi_led "ht-tm02:blue:wlan"
-	;;
-hw550-3g)
-	set_usb_led "hw550-3g:green:usb"
+	ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0"
+	set_wifi_led "$board:blue:wlan"
 	;;
 m2m)
-	set_wifi_led "m2m:blue:wifi"
-	ucidef_set_led_netdev "eth" "Ethernet" "m2m:green:wan" "eth0"
+	set_wifi_led "$board:blue:wifi"
+	ucidef_set_led_netdev "eth" "Ethernet" "$board:green:wan" "eth0"
 	;;
 miniembplug)
-	set_wifi_led "miniembplug:red:wlan"
-	set_usb_led "miniembplug:green:mobile"
+	set_wifi_led "$board:red:wlan"
+	set_usb_led "$board:green:mobile"
 	;;
 miwifi-mini)
-	ucidef_set_led_default "power" "power" "miwifi-mini:red:status" "1"
-	;;
-mlw221)
-	set_wifi_led "mlw221:blue:wifi"
-	ucidef_set_led_default "system" "system" "mlw221:blue:system" "1"
+	ucidef_set_led_default "power" "power" "$board:red:status" "1"
 	;;
+mlw221|\
 mlwg2)
-	set_wifi_led "mlwg2:blue:wifi"
-	ucidef_set_led_default "system" "system" "mlwg2:blue:system" "1"
-	;;
-mofi3500-3gn)
-	set_usb_led "mofi3500-3gn:green:usb"
-	;;
-mpr-a1)
-	set_wifi_led "mpr-a1:blue:system"
+	set_wifi_led "$board:blue:wifi"
+	ucidef_set_led_default "system" "system" "$board:blue:system" "1"
 	;;
+mpr-a1|\
 mpr-a2)
-	set_wifi_led "mpr-a2:blue:system"
+	set_wifi_led "$board:blue:system"
 	;;
 mr-102n)
-	set_wifi_led "mr-102n:green:wlan"
-	set_usb_led "mr-102n:green:usb"
-	;;
-mzk-dp150n)
-	ucidef_set_led_default "power" "power" "mzk-dp150n:green:power" "1"
-	;;
-mzk-w300nh2)
-	set_wifi_led "mzk-w300nh2:amber:wlan"
+	set_wifi_led "$board:green:wlan"
+	set_usb_led "$board:green:usb"
 	;;
 na930)
-	set_usb_led "na930:blue:status"
+	set_usb_led "$board:blue:status"
 	;;
 nw718)
-	set_usb_led "nw718:amber:usb"
+	set_usb_led "$board:amber:usb"
 	;;
 oy-0001)
-	ucidef_set_led_default "power" "power" "oy-0001:green:power" "1"
-	set_wifi_led "oy-0001:green:wifi"
+	ucidef_set_led_default "power" "power" "$board:green:power" "1"
+	set_wifi_led "$board:green:wifi"
 	;;
 pbr-m1)
-	ucidef_set_led_netdev "internet" "internet" "pbr-m1:green:internet" "eth0.2"
-	ucidef_set_led_default "power" "power" "pbr-m1:green:power" "1"
-	ucidef_set_led_default "sys" "sys" "pbr-m1:green:sys" "1"
+	ucidef_set_led_netdev "internet" "internet" "$board:green:internet" "eth0.2"
+	ucidef_set_led_default "power" "power" "$board:green:power" "1"
+	ucidef_set_led_default "sys" "sys" "$board:green:sys" "1"
 	;;
 px-4885)
-	set_wifi_led "px-4885:orange:wifi"
-	set_usb_led "px-4885:blue:storage"
+	set_wifi_led "$board:orange:wifi"
+	set_usb_led "$board:blue:storage"
 	;;
 re6500)
-	ucidef_set_led_default "power" "power" "re6500:white:power" "1"
-	ucidef_set_led_default "wifi" "wifi" "re6500:orange:wifi" "1"
+	ucidef_set_led_default "power" "power" "$board:white:power" "1"
+	ucidef_set_led_default "wifi" "wifi" "$board:orange:wifi" "1"
 	;;
 rp-n53)
-	ucidef_set_led_netdev "eth" "Network" "rp-n53:white:back" "eth0"
-	set_wifi_led "rp-n53:blue:wifi"
+	ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0"
+	set_wifi_led "$board:blue:wifi"
 	;;
 rt-n14u)
-	ucidef_set_led_default "power" "power" "rt-n14u:blue:power" "1"
-	ucidef_set_led_netdev "lan" "lan" "rt-n14u:blue:lan" eth0.1
-	ucidef_set_led_netdev "wan" "wan" "rt-n14u:blue:wan" eth0.2
-	set_wifi_led "rt-n14u:blue:air"
-	set_usb_led "rt-n14u:blue:usb"
-	;;
-sap-g3200u3)
-	set_usb_led "sap-g3200u3:green:usb"
+	ucidef_set_led_default "power" "power" "$board:blue:power" "1"
+	ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" eth0.1
+	ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" eth0.2
+	set_wifi_led "$board:blue:air"
+	set_usb_led "$board:blue:usb"
 	;;
 vocore)
-	ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
-	set_wifi_led "vocore:green:status"
+	ucidef_set_led_netdev "eth" "ETH" "$board:orange:eth" "eth0"
+	set_wifi_led "$board:green:status"
 	;;
 w502u)
-	set_usb_led "w502u:blue:usb"
+	set_usb_led "$board:blue:usb"
 	set_wifi_led "rt2800pci-phy0::radio"
 	;;
 wcr-150gn)
-	set_usb_led "wcr-150gn:amber:user"
-	;;
-whr-1166d)
-	ucidef_set_led_default "power" "power" "whr-1166d:green:power" "1"
-	ucidef_set_led_default "router" "router" "whr-1166d:green:router" "1"
-	;;
-whr-300hp2)
-	ucidef_set_led_default "power" "power" "whr-300hp2:green:power" "1"
-	ucidef_set_led_default "router" "router" "whr-300hp2:green:router" "1"
+	set_usb_led "$board:amber:user"
 	;;
+whr-1166d|\
+whr-300hp2|\
 whr-600d)
-	ucidef_set_led_default "power" "power" "whr-600d:green:power" "1"
-	ucidef_set_led_default "router" "router" "whr-600d:green:router" "1"
+	ucidef_set_led_default "power" "power" "$board:green:power" "1"
+	ucidef_set_led_default "router" "router" "$board:green:router" "1"
 	;;
 wnce2001)
-	set_wifi_led "wnce2001:green:wlan"
+	set_wifi_led "$board:green:wlan"
 	;;
 wt3020)
-	ucidef_set_led_default "power" "power" "wt3020:blue:power" "0"
-	;;
-y1)
-	ucidef_set_led_default "power" "power" "y1:blue:power" "1"
-	set_usb_led "y1:blue:usb"
-	set_wifi_led "y1:blue:wifi"
+	ucidef_set_led_default "power" "power" "$board:blue:power" "0"
 	;;
+y1|\
 y1s)
-	ucidef_set_led_default "power" "power" "y1s:blue:power" "1"
-	set_usb_led "y1s:blue:usb"
-	set_wifi_led "y1s:blue:wifi"
+	ucidef_set_led_default "power" "power" "$board:blue:power" "1"
+	set_usb_led "$board:blue:usb"
+	set_wifi_led "$board:blue:wifi"
 	;;
 zbt-wa05)
-	ucidef_set_led_default "power" "power" "zbt-wa05:blue:power" "1"
-	set_wifi_led "zbt-wa05:blue:air"
-	set_usb_led "zbt-wa05:blue:usb"
+	ucidef_set_led_default "power" "power" "$board:blue:power" "1"
+	set_wifi_led "$board:blue:air"
+	set_usb_led "$board:blue:usb"
 	;;
 zbt-wr8305rt)
-	ucidef_set_led_default "power" "power" "zbt-wr8305rt:green:sys" "1"
-	set_usb_led "zbt-wr8305rt:green:usb"
-	set_wifi_led "zbt-wr8305rt:green:wifi"
+	ucidef_set_led_default "power" "power" "$board:green:sys" "1"
+	set_usb_led "$board:green:usb"
+	set_wifi_led "$board:green:wifi"
 	;;
 zte-q7)
-	set_wifi_led "zte-q7:blue:status"
+	set_wifi_led "$board:blue:status"
 	;;
 esac
 
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index e9b8744..a4911b0 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -5,315 +5,169 @@
 . /lib/ramips.sh
 
 get_status_led() {
-	case $(ramips_board_name) in
-	3g150b)
-		status_led="3g150b:blue:ap"
-		;;
-	3g300m)
-		status_led="3g300m:blue:ap"
-		;;
-	3g-6200n)
-		status_led="3g-6200n:green:power"
-		;;
-	a5-v11)
-		status_led="a5-v11:red:power"
-		;;
-	ai-br100)
-		status_led="ai-br100:blue:wlan"
-		;;
-	all0239-3g)
-		status_led="all0239-3g:green:status"
-		;;
-	ar670w)
-		status_led="ar670w:green:power"
-		;;
-	ar725w)
-		status_led="ar725w:green:power"
-		;;
-	asl26555)
-		status_led="asl26555:green:power"
+	board=$(ramips_board_name)
+
+	case $board in
+	3g150b|\
+	3g300m|\
+	w150m)
+		status_led="$board:blue:ap"
+		;;
+	3g-6200n|\
+	ar670w|\
+	ar725w|\
+	asl26555|\
+	br-6425|\
+	br-6475nd|\
+	e1700|\
+	fonera20n|\
+	mzk-dp150n|\
+	mzk-w300nh2|\
+	nbg-419n|\
+	pwh2004|\
+	wnce2001|\
+	x5|\
+	x8|\
+	xdxrn502j)
+		status_led="$board:green:power"
 		;;
-	atp-52b)
-		status_led="atp-52b:green:run"
+	a5-v11|\
+	d105|\
+	dcs-930l-b1|\
+	hlk-rm04|\
+	mpr-a1|\
+	mpr-a2)
+		status_led="$board:red:power"
 		;;
-	awapn2403)
-		status_led="awapn2403:green:wps"
+	ai-br100|\
+	ht-tm02)
+		status_led="$board:blue:wlan"
+		;;
+	all0239-3g|\
+	dcs-930|\
+	dir-300-b1|\
+	dir-300-b7|\
+	dir-320-b1|\
+	dir-600-b1|\
+	dir-600-b2|\
+	dir-610-a1|\
+	dir-615-d|\
+	dir-615-h1|\
+	dir-620-a1|\
+	dir-620-d1|\
+	hpm|\
+	hw550-3g|\
+	miniembwifi|\
+	mofi3500-3gn|\
+	rut5xx|\
+	v11st-fe|\
+	vocore|\
+	wmr-300)
+		status_led="$board:green:status"
 		;;
-	br-6425)
-		status_led="br-6425:green:power"
+	atp-52b|\
+	ip2202)
+		status_led="$board:green:run"
 		;;
-	br-6475nd)
-		status_led="br-6475nd:green:power"
+	awapn2403|\
+	dir-645)
+		status_led="$board:green:wps"
 		;;
 	cf-wr800n)
-		status_led="cf-wr800n:white:wps"
-		;;
-	cy-swr1100)
-		status_led="cy-swr1100:blue:wps"
-		;;
-	d105)
-		status_led="d105:red:power"
-		;;
-	dap-1350)
-		status_led="dap-1350:blue:power"
-		;;
-	dcs-930)
-		status_led="dcs-930:green:status"
-		;;
-	dcs-930l-b1)
-		status_led="dcs-930l-b1:red:power"
-		;;
-	dir-300-b1)
-		status_led="dir-300-b1:green:status"
-		;;
-	dir-300-b7)
-		status_led="dir-300-b7:green:status"
-		;;
-	dir-320-b1)
-		status_led="dir-320-b1:green:status"
-		;;
-	dir-600-b1)
-		status_led="dir-600-b1:green:status"
-		;;
-	dir-600-b2)
-		status_led="dir-600-b2:green:status"
-		;;
-	dir-610-a1)
-		status_led="dir-610-a1:green:status"
+		status_led="$board:white:wps"
 		;;
-	dir-615-d)
-		status_led="dir-615-d:green:status"
-		;;
-	dir-615-h1)
-		status_led="dir-615-h1:green:status"
-		;;
-	dir-620-a1)
-		status_led="dir-620-a1:green:status"
-		;;
-	dir-620-d1)
-		status_led="dir-620-d1:green:status"
-		;;
-	dir-645)
-		status_led="dir-645:green:wps"
-		;;
-	e1700)
-		status_led="e1700:green:power"
+	cy-swr1100|\
+	w502u)
+		status_led="$board:blue:wps"
+		;;
+	dap-1350|\
+	na930|\
+	rt-n13u|\
+	rt-n14u|\
+	rt-n15|\
+	rt-n56u|\
+	wl-330n|\
+	wl-330n3g|\
+	wli-tx4-ag300n|\
+	wt3020|\
+	y1|\
+	y1s)
+		status_led="$board:blue:power"
 		;;
 	esr-9753)
-		status_led="esr-9753:orange:power"
+		status_led="$board:orange:power"
 		;;
 	f5d8235-v2)
-		status_led="f5d8235-v2:blue:router"
+		status_led="$board:blue:router"
 		;;
 	f7c027)
-		status_led="f7c027:orange:status"
-		;;
-	fonera20n)
-		status_led="fonera20n:green:power"
-		;;
-	hlk-rm04)
-		status_led="hlk-rm04:red:power"
-		;;
-	hpm)
-		status_led="hpm:green:status"
-		;;
-	ht-tm02)
-		status_led="ht-tm02:blue:wlan"
-		;;
-	hw550-3g)
-		status_led="hw550-3g:green:status"
-		;;
-	ip2202)
-		status_led="ip2202:green:run"
+		status_led="$board:orange:status"
 		;;
 	m2m)
-		status_led="m2m:blue:wifi"
-		;;
-	m3)
-		status_led="m3:blue:status"
+		status_led="$board:blue:wifi"
 		;;
+	m3|\
 	m4)
-		status_led="m4:blue:status"
-		;;
-	miniembwifi)
-		status_led="miniembwifi:green:status"
+		status_led="$board:blue:status"
 		;;
-	miwifi-mini)
-		status_led="miwifi-mini:red:status"
-		;;
-	mlw221)
-		status_led="mlw221:blue:system"
+	miwifi-mini|\
+	zte-q7)
+		status_led="$board:red:status"
 		;;
+	mlw221|\
 	mlwg2)
-		status_led="mlwg2:blue:system"
-		;;
-	mofi3500-3gn)
-		status_led="mofi3500-3gn:green:status"
-		;;
-	mpr-a1)
-		status_led="mpr-a1:red:power"
-		;;
-	mpr-a2)
-		status_led="mpr-a2:red:power"
+		status_led="$board:blue:system"
 		;;
 	mr-102n)
-		status_led="mr-102n:amber:status"
-		;;
-	mzk-dp150n)
-		status_led="mzk-dp150n:green:power"
-		;;
-	mzk-w300nh2)
-		status_led="mzk-w300nh2:green:power"
-		;;
-	na930)
-		status_led="na930:blue:power"
-		;;
-	nbg-419n)
-		status_led="nbg-419n:green:power"
+		status_led="$board:amber:status"
 		;;
 	nw718)
-		status_led="nw718:amber:cpu"
+		status_led="$board:amber:cpu"
 		;;
-	oy-0001)
-		status_led="oy-0001:green:wifi"
+	oy-0001|\
+	sl-r7205)
+		status_led="$board:green:wifi"
 		;;
-	pbr-m1)
-		status_led="pbr-m1:green:sys"
+	pbr-m1|\
+	w306r-v20|\
+	zbt-wr8305rt)
+		status_led="$board:green:sys"
 		;;
 	psr-680w)
-		status_led="psr-680w:red:wan"
-		;;
-	pwh2004)
-		status_led="pwh2004:green:power"
-		;;
-	px-4885)
-		status_led="px-4885:orange:wifi"
-		;;
-	re6500)
-		status_led="re6500:orange:wifi"
-		;;
-	rt-n10-plus)
-		status_led="rt-n10-plus:green:wps"
+		status_led="$board:red:wan"
 		;;
-	rt-n13u)
-		status_led="rt-n13u:blue:power"
-		;;
-	rt-n14u)
-		status_led="rt-n14u:blue:power"
-		;;
-	rt-n15)
-		status_led="rt-n15:blue:power"
-		;;
-	rt-n56u)
-		status_led="rt-n56u:blue:power"
+	px-4885|\
+	re6500|\
+	whr-1166d|\
+	whr-300hp2|\
+	whr-600d)
+		status_led="$board:orange:wifi"
 		;;
-	rut5xx)
-		status_led="rut5xx:green:status"
+	rt-n10-plus|\
+	tew-691gr|\
+	tew-692gr|\
+	ur-326n4g|\
+	ur-336un|\
+	wr512-3gn)
+		status_led="$board:green:wps"
 		;;
 	sap-g3200u3)
-		status_led="sap-g3200u3:green:usb"
-		;;
-	sl-r7205)
-		status_led="sl-r7205:green:wifi"
-		;;
-	tew-691gr)
-		status_led="tew-691gr:green:wps"
-		;;
-	tew-692gr)
-		status_led="tew-692gr:green:wps"
-		;;
-	ur-326n4g)
-		status_led="ur-326n4g:green:wps"
-		;;
-	ur-336un)
-		status_led="ur-336un:green:wps"
-		;;
-	v11st-fe)
-		status_led="v11st-fe:green:status"
+		status_led="$board:green:usb"
 		;;
 	v22rw-2x2)
-		status_led="v22rw-2x2:green:security"
-		;;
-	vocore)
-		status_led="vocore:green:status"
-		;;
-	w150m)
-		status_led="w150m:blue:ap"
-		;;
-	w306r-v20)
-		status_led="w306r-v20:green:sys"
-		;;
-	w502u)
-		status_led="w502u:blue:wps"
-		;;
-	wcr-150gn)
-		status_led="wcr-150gn:amber:power"
-		;;
-	whr-1166d)
-		status_led="whr-1166d:orange:wifi"
-		;;
-	whr-300hp2)
-		status_led="whr-300hp2:orange:wifi"
-		;;
-	whr-600d)
-		status_led="whr-600d:orange:wifi"
-		;;
-	whr-g300n)
-		status_led="whr-g300n:green:router"
-		;;
-	wl-330n)
-		status_led="wl-330n:blue:power"
-		;;
-	wl-330n3g)
-		status_led="wl-330n3g:blue:power"
+		status_led="$board:green:security"
 		;;
+	wcr-150gn|\
 	wl-351)
-		status_led="wl-351:amber:power"
-		;;
-	wli-tx4-ag300n)
-		status_led="wli-tx4-ag300n:blue:power"
-		;;
-	wmr-300)
-		status_led="wmr-300:green:status"
-		;;
-	wnce2001)
-		status_led="wnce2001:green:power"
-		;;
-	wr512-3gn)
-		status_led="wr512-3gn:green:wps"
-		;;
-	wsr-1166)
-		status_led="wsr-1166:orange:diag"
-		;;
-	wsr-600)
-		status_led="wsr-600:orange:diag"
-		;;
-	wt3020)
-		status_led="wt3020:blue:power"
+		status_led="$board:amber:power"
 		;;
+	whr-g300n|\
 	wzr-agl300nh)
-		status_led="wzr-agl300nh:green:router"
-		;;
-	x5)
-		status_led="x5:green:power"
-		;;
-	x8)
-		status_led="x8:green:power"
-		;;
-	xdxrn502j)
-		status_led="xdxrn502j:green:power"
-		;;
-	y1)
-		status_led="y1:blue:power"
+		status_led="$board:green:router"
 		;;
-	y1s)
-		status_led="y1s:blue:power"
-		;;
-	zbt-wr8305rt)
-		status_led="zbt-wr8305rt:green:sys"
-		;;
-	zte-q7)
-		status_led="zte-q7:red:status"
+	wsr-1166|\
+	wsr-600)
+		status_led="$board:orange:diag"
 		;;
 	esac
 }
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mhei at heimpold.de  Wed Aug  5 16:44:12 2015
From: mhei at heimpold.de (Michael Heimpold)
Date: Wed, 05 Aug 2015 22:44:12 +0200
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <5714095.G0nz8SHoBc@kerker>

Hi Piotr,

great work!

While looking at your DT cleanups, I wonder whether it would be possible to
go one step further and adopt the BuildDTB stuff which Jonas did for brcm63xx target:
then it would be possible to use preprocessor includes in the DTS files and use 
defines like KEY_* and so on.

And it would be great, if you could provide a git url to pull your series from :-)

Regards, mhei

Am Mittwoch, 5. August 2015, 20:30:01 schrieb Piotr Dymacz:
> The following changes fix different mistakes in ramips target and try to make the code more clean and consistent.
> 
> The patches affect:
>  * dts{,i} files
>  * base-files/* scripts
>  * image Makefile
>  * subtargets *.mk profile files
> 
> Changes in v2 of the series:
>  * rebased to r46566
>  * use the upstream convention for LED naming
>  * more fixes in dts{,i} files
>  * patches are now ordered more logically
>  * patches are now better described
>  * additional fixes related with devices names
>  * big patches related with particular devices are not combined together, for easy review
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From eschultz at prplfoundation.org  Wed Aug  5 16:45:35 2015
From: eschultz at prplfoundation.org (Eric Schultz)
Date: Wed, 5 Aug 2015 15:45:35 -0500
Subject: [OpenWrt-Devel] OpenWrt Summit Submission Deadline change
Message-ID: <CAMkzgA4iUd7WrVVAA-8Sz7UX=T0N-kP45z5b166_V2s8P9mZwg@mail.gmail.com>

I?ve decided to move the OpenWrt Summit session submission deadline to
Friday August 28 (one week later than before). There were a number of folks
from Battlemesh who asked for an additional week for their proposals and
we?re happy to accommodate them

You certainly don?t have to wait until then to submit and I encourage
everyone to start submitting as soon as possible. If there are multiple
proposals on the same topic or a particular important topic that hasn?t
been addressed, addressing them sooner is much easier than later for
everyone.

Also, don?t be afraid to submit a session even if you don?t have what you
view as a cool use-case or created a new feature of OpenWrt. We?re also
looking for topics like:

* Building and customizing OpenWrt
* Adding hardware support to OpenWrt
* Package creation and submission on OpenWrt
* Integrating with LuCI
* Discussing important OpenWrt software like procd, ubus, buildroot, etc.

The OpenWrt community is filled with awesome people and I?m looking forward
to seeing what everyone comes up with.

If you?d like more information about the summit or submitting, please visit
http://summit.prplfoundation.org or contact me.

Thanks,

Eric

--
Eric Schultz, Community Manager, prpl Foundation
http://www.prplfoundation.org
eschultz at prplfoundation.org
cell: 920-539-0404
skype: ericschultzwi
@EricPrpl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150805/ccf383cb/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From mathieu at codeaurora.org  Wed Aug  5 19:54:11 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed,  5 Aug 2015 16:54:11 -0700
Subject: [OpenWrt-Devel] [PATCH 0/2] Fix quilt error when $STAGING_DIR
	doesn't exist yet
Message-ID: <1438818853-5481-1-git-send-email-mathieu@codeaurora.org>

This patch has been posted a few weeks ago. Just posting again as a
gentle reminder. Concerns were raised regarding whether the SDK worked
after the modification, which has been confirmed.

Mathieu Olivari (2):
  rules.mk: export STAGING_DIR_HOST to sub-makefiles and shells
  tools/quilt: fix build error during kernel_menuconfig on a cleaned env

 rules.mk                                  |  2 +-
 tools/quilt/patches/000-relocatable.patch | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Wed Aug  5 19:54:12 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed,  5 Aug 2015 16:54:12 -0700
Subject: [OpenWrt-Devel] [PATCH 1/2] rules.mk: export STAGING_DIR_HOST to
	sub-makefiles and shells
In-Reply-To: <1438818853-5481-1-git-send-email-mathieu@codeaurora.org>
References: <1438818853-5481-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438818853-5481-2-git-send-email-mathieu@codeaurora.org>

Certains host packages (like quilt) need to know the previously used
install location at run-time. They currently use $STAGING_DIR, which
causes issues on cleaned environment, where $STAGING_DIR doesn't exist
yet.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules.mk b/rules.mk
index 58b9f3e..e67ffd5 100644
--- a/rules.mk
+++ b/rules.mk
@@ -188,7 +188,7 @@ else
 endif
 
 export PATH:=$(TARGET_PATH)
-export STAGING_DIR
+export STAGING_DIR STAGING_DIR_HOST
 export SH_FUNC:=. $(INCLUDE_DIR)/shell.sh;
 
 PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Wed Aug  5 19:54:13 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed,  5 Aug 2015 16:54:13 -0700
Subject: [OpenWrt-Devel] [PATCH 2/2] tools/quilt: fix build error during
	kernel_menuconfig on a cleaned env
In-Reply-To: <1438818853-5481-1-git-send-email-mathieu@codeaurora.org>
References: <1438818853-5481-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438818853-5481-3-git-send-email-mathieu@codeaurora.org>

When running "make kernel_menuconfig" right after "make clean", we error
out with the following message:

Makefile:22: recipe for target '.../build_dir/target-arm_cortex-a7_musl-1.1.10_eabi/linux-.../linux-3.18.18/.quilt_checked' failed
make[2]: [.../build_dir/target-arm_cortex-a7_musl-1.1.10_eabi/linux-.../linux-3.18.18/.quilt_checked]
Error 127 (ignored)

The root cause of the problem is located in the OpenWrt specific quilt
patch, which sets the quilt install directory to $STAGING_DIR/../host.
However, on a clean environment (right after running "make clean"),
$STAGING_DIR doesn't exist. The "quilt" executable doesn't find its
different commands, errors out, and creates this message.

We're fixing it by using $STAGING_DIR_HOST rather than $STAGING_DIR,
which is absolute. It will work even if there is no target directory
yet.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 tools/quilt/patches/000-relocatable.patch | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/quilt/patches/000-relocatable.patch b/tools/quilt/patches/000-relocatable.patch
index 99d7af5..c498627 100644
--- a/tools/quilt/patches/000-relocatable.patch
+++ b/tools/quilt/patches/000-relocatable.patch
@@ -7,9 +7,9 @@
 -export TEXTDOMAINDIR=@LOCALEDIR@
  
 -: ${QUILT_DIR=@QUILT_DIR@}
-+if test -n "$STAGING_DIR"; then
-+	export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
-+	: ${QUILT_DIR=$STAGING_DIR/../host/share/quilt} ${QUILT_LIB=$STAGING_DIR/../host/lib/quilt}
++if test -n "$STAGING_DIR_HOST"; then
++	export TEXTDOMAINDIR="$STAGING_DIR_HOST/share/locale"
++	: ${QUILT_DIR=$STAGING_DIR_HOST/share/quilt} ${QUILT_LIB=$STAGING_DIR_HOST/lib/quilt}
 +else
 +	export TEXTDOMAINDIR=@LOCALEDIR@
 +	: ${QUILT_DIR=@QUILT_DIR@}
@@ -25,7 +25,7 @@
  
  setlocale(LC_MESSAGES, "");
 -bindtextdomain("quilt", "@LOCALEDIR@");
-+bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/locale' : "@LOCALEDIR@");
++bindtextdomain("quilt", $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/locale' : "@LOCALEDIR@");
  textdomain("quilt");
  
  sub _($) {
@@ -36,8 +36,8 @@
  #  See the COPYING and AUTHORS files for more details.
  
 -: ${QUILT_DIR=@QUILT_DIR@}
-+if test -n "$STAGING_DIR"; then
-+	: ${QUILT_DIR="$STAGING_DIR/../host/share/quilt"}
++if test -n "$STAGING_DIR_HOST"; then
++	: ${QUILT_DIR="$STAGING_DIR_HOST/share/quilt"}
 +else
 +	: ${QUILT_DIR=@QUILT_DIR@}
 +fi
@@ -51,8 +51,8 @@
  
  export TEXTDOMAIN=quilt
 -export TEXTDOMAINDIR=@LOCALEDIR@
-+if [ -n "$STAGING_DIR" ]; then
-+	export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
++if [ -n "$STAGING_DIR_HOST" ]; then
++	export TEXTDOMAINDIR="$STAGING_DIR_HOST/share/locale"
 +else
 +	export TEXTDOMAINDIR=@LOCALEDIR@
 +fi
@@ -66,7 +66,7 @@
  
  setlocale(LC_MESSAGES, "");
 -bindtextdomain("quilt", "@LOCALEDIR@");
-+bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/locale' : "@LOCALEDIR@");
++bindtextdomain("quilt", $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/locale' : "@LOCALEDIR@");
  textdomain("quilt");
  
  sub _($) {
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Wed Aug  5 20:10:56 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed,  5 Aug 2015 17:10:56 -0700
Subject: [OpenWrt-Devel] [PATCH] scripts: add a new patch-rename.sh script
Message-ID: <1438819856-5788-1-git-send-email-mathieu@codeaurora.org>

During quilt based development, it is sometimes necessary to reorder
patch files, which can become a tedious process as the patch list gets
bigger. This script can help when doing such operations, by allowing to
increment or decrement the number of multiple patch files at once:

$ ./scripts/patch-rename.sh -i 5 target/linux/generic/1*
Add 5 to all the prefix numbers of all the patch files specified as an
argument.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 scripts/patch-rename.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100755 scripts/patch-rename.sh

diff --git a/scripts/patch-rename.sh b/scripts/patch-rename.sh
new file mode 100755
index 0000000..011d179
--- /dev/null
+++ b/scripts/patch-rename.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+usage() {
+	echo "Usage: `basename $0` [ -i addval ] [ -d decval ] xxx.patch yyy.patch ..."
+	echo -e "\t -i ==> increment patch files by \"addval\""
+	echo -e "\t -d ==> decrement patch files by \"decval\""
+	exit 1
+}
+
+_do_rename() {
+	local mod=$1
+	local op=$2
+	local file=$3
+	local oldval newval
+
+	[ -f $file ] || { echo "Can't find file: $file"; exit 1; }
+
+	oldval=$(echo $file | sed 's/.*\/\([0-9]*\)-[^\/]*/\1/')
+	digits=${#oldval}
+	newval=$((${oldval##0*0} $op $mod))
+	# Pad newval to the previous number of characters
+	newval=$(printf "%0${#oldval}d" $newval)
+	rename "s/$oldval/$newval/" $file || { \
+		echo "Can't rename file: $file\n"; \
+		exit 1; \
+	}
+}
+
+dec_patches() {
+	local decval=$1; shift
+	# process the lowest patch first to avoid having conflicting numbers
+	local patchlist=$(echo $@ | sort -n)
+	local oldval newval
+
+	for p in ${patchlist}; do
+		_do_rename $decval - $p
+	done
+}
+
+inc_patches() {
+	local incval=$1; shift
+	# process the highest patch first to avoid having conflicting numbers
+	local patchlist=$(echo $@ | sort -nr)
+	local oldval newval
+
+	for p in ${patchlist}; do
+		_do_rename $incval + $p
+	done
+}
+
+while getopts "i:d:" OPTION; do
+	case $OPTION in
+		i ) INCVAL=$OPTARG;;
+		d ) DECVAL=$OPTARG;;
+		* ) usage;;
+	esac
+done
+
+shift $((OPTIND-1))
+PATCH_LIST=$@
+
+# If the user didn't provide any file, show the usage information
+[ ${#PATCH_LIST} == 0 ] && usage
+
+[ -n "$INCVAL" ] && inc_patches $INCVAL $PATCH_LIST
+[ -n "$DECVAL" ] && dec_patches $DECVAL $PATCH_LIST
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Wed Aug  5 20:40:55 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu,  6 Aug 2015 02:40:55 +0200
Subject: [OpenWrt-Devel] [PATCH] ar71xx: fix TP-LINK TL-WR941ND v6 support
Message-ID: <e87ef2eb25c510165aaa0f7be290d78d2d0c4b99.1438821655.git.mschiffer@universe-factory.net>

The images currently generated for the TL-WR941ND v6 try to treat it like
a TL-WDR3500, which doesn't make any sense and causes the kernel to panic
in early boot. I don't think this has ever worked (the TL-WR941ND v6 has
a different SoC, uses another MDIO bus, has only one WMAC and no USB...).

Fix this by adding proper support for the device.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 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  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ar71xx/config-4.1                     |   1 +
 .../files/arch/mips/ath79/mach-tl-wr941nd-v6.c     | 151 +++++++++++++++++++++
 target/linux/ar71xx/image/Makefile                 |   2 +-
 .../700-MIPS-ath79-openwrt-machines.patch          |  23 +++-
 9 files changed, 186 insertions(+), 8 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..46b83fc 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -277,7 +277,8 @@ get_status_led() {
 	tl-wdr4300 | \
 	tl-wr703n | \
 	tl-wr710n | \
-	tl-wr720n-v3)
+	tl-wr720n-v3 | \
+	tl-wr941nd-v6)
 		status_led="tp-link:blue:system"
 		;;
 	tl-wr841n-v9)
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 2aced37..3344d97 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -474,6 +474,15 @@ tl-wr941nd-v5)
 	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
 	;;
 
+tl-wr941nd-v6)
+	ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
+	ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10"
+	ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04"
+	ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
+	;;
+
 tl-wa830re-v2)
 	ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
 	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green: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 2893e62..a6507db 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -227,6 +227,7 @@ tl-mr3420-v2 |\
 tl-wr841n-v8 |\
 tl-wr842n-v2 |\
 tl-wr941nd-v5 |\
+tl-wr941nd-v6 |\
 wnr2000-v3 |\
 wnr2000-v4 |\
 wnr2200 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..5d27538 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -793,6 +793,9 @@ ar71xx_board_detect() {
 	*"TL-WR941N/ND v5")
 		name="tl-wr941nd-v5"
 		;;
+	*"TL-WR941N/ND v6")
+		name="tl-wr941nd-v6"
+		;;
 	*"TL-WR703N v1")
 		name="tl-wr703n"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..55ff568 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -353,6 +353,7 @@ platform_check_image() {
 	tl-wr842n-v2 | \
 	tl-wr941nd | \
 	tl-wr941nd-v5 | \
+	tl-wr941nd-v6 | \
 	tl-wr1041n-v2 | \
 	tl-wr1043nd | \
 	tl-wr1043nd-v2 | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 1e31a01..ecaf454 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -134,6 +134,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y
 CONFIG_ATH79_MACH_TL_WR841N_V8=y
 CONFIG_ATH79_MACH_TL_WR841N_V9=y
 CONFIG_ATH79_MACH_TL_WR941ND=y
+CONFIG_ATH79_MACH_TL_WR941ND_V6=y
 CONFIG_ATH79_MACH_TUBE2H=y
 CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_XM=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
new file mode 100644
index 0000000..c5fc9fc
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
@@ -0,0 +1,151 @@
+/*
+ *  TP-LINK TL-WR941N/ND v6 board support
+ *
+ *  Copyright (C) 2015 Matthias Schiffer <mschiffer at universe-factory.net>
+ *
+ *  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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+
+#define TL_WR941ND_V6_GPIO_LED_QSS		3
+#define TL_WR941ND_V6_GPIO_LED_WAN		14
+#define TL_WR941ND_V6_GPIO_LED_WAN_RED		15
+#define TL_WR941ND_V6_GPIO_LED_LAN1		7
+#define TL_WR941ND_V6_GPIO_LED_LAN2		6
+#define TL_WR941ND_V6_GPIO_LED_LAN3		5
+#define TL_WR941ND_V6_GPIO_LED_LAN4		4
+#define TL_WR941ND_V6_GPIO_LED_WLAN		8
+#define TL_WR941ND_V6_GPIO_LED_SYSTEM		18
+
+#define TL_WR941ND_V6_GPIO_BTN_RESET		1
+#define TL_WR941ND_V6_GPIO_BTN_RFKILL		2
+
+#define TL_WR941ND_V6_KEYS_POLL_INTERVAL	20
+#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL	(3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL)
+
+
+static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = {
+	{
+		.name		= "tp-link:blue:qss",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_QSS,
+		.active_low	= 1,
+	},
+	{
+		.name		= "tp-link:blue:wan",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_WAN,
+		.active_low	= 1,
+	},
+	{
+		.name		= "tp-link:red:wan",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_WAN_RED,
+		.active_low	= 0,
+	},
+	{
+		.name		= "tp-link:blue:lan1",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_LAN1,
+		.active_low	= 1,
+	},
+	{
+		.name		= "tp-link:blue:lan2",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_LAN2,
+		.active_low	= 1,
+	},
+	{
+		.name		= "tp-link:blue:lan3",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_LAN3,
+		.active_low	= 1,
+	},
+	{
+		.name		= "tp-link:blue:lan4",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_LAN4,
+		.active_low	= 1,
+	},
+	{
+		.name		= "tp-link:blue:wlan",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_WLAN,
+		.active_low	= 1,
+	},
+	{
+		.name		= "tp-link:blue:system",
+		.gpio		= TL_WR941ND_V6_GPIO_LED_SYSTEM,
+		.active_low	= 1,
+	},
+};
+
+static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = {
+	{
+		.desc		= "Reset button",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= TL_WR941ND_V6_GPIO_BTN_RESET,
+		.active_low	= 1,
+	}, {
+		.desc		= "RFKILL button",
+		.type		= EV_KEY,
+		.code		= KEY_RFKILL,
+		.debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= TL_WR941ND_V6_GPIO_BTN_RFKILL,
+		.active_low	= 1,
+	}
+};
+
+
+static const char *tl_wr941n_v6_part_probes[] = {
+	"tp-link",
+	NULL,
+};
+
+static struct flash_platform_data tl_wr941n_v6_flash_data = {
+	.part_probes	= tl_wr941n_v6_part_probes,
+};
+
+
+static void __init tl_wr941nd_v6_setup(void)
+{
+	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+	ath79_register_m25p80(&tl_wr941n_v6_flash_data);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio),
+				 tl_wr941nd_v6_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(tl_wr941nd_v6_gpio_keys),
+					tl_wr941nd_v6_gpio_keys);
+
+	ath79_register_mdio(0, 0x0);
+
+	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
+
+	ath79_switch_data.phy4_mii_en = 1;
+	ath79_switch_data.phy_poll_mask = BIT(0);
+	ath79_eth0_data.phy_mask = BIT(0);
+
+	ath79_register_eth(0);
+	ath79_register_eth(1);
+
+	ath79_register_wmac(ee, mac);
+
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V6, "TL-WR941ND-v6", "TP-LINK TL-WR941N/ND v6",
+	     tl_wr941nd_v6_setup);
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e894d78..f9e0087 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -620,7 +620,7 @@ endef
 
 define Device/tl-wr941nd-v6
     $(Device/tplink-4mlzma)
-    BOARDNAME := TL-WDR3500
+    BOARDNAME := TL-WR941ND-v6
     DEVICE_PROFILE := TLWR941
     TPLINK_HWID := 0x09410006
 endef
diff --git a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
index 02ebd1b..558d43c 100644
--- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
+++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,24 +16,207 @@
+@@ -16,24 +16,208 @@
  
  enum ath79_mach_type {
  	ATH79_MACH_GENERIC = 0,
@@ -157,6 +157,7 @@
 +	ATH79_MACH_TL_WR842N_V2,	/* TP-LINK TL-WR842N/ND v2 */
 +	ATH79_MACH_TL_WR941ND,		/* TP-LINK TL-WR941ND */
 +	ATH79_MACH_TL_WR941ND_V5,	/* TP-LINK TL-WR941ND v5 */
++	ATH79_MACH_TL_WR941ND_V6,	/* TP-LINK TL-WR941ND v6 */
 +	ATH79_MACH_TUBE2H,		/* Alfa Network Tube2H */
 +	ATH79_MACH_UBNT_AIRGW,		/* Ubiquiti AirGateway */
  	ATH79_MACH_UBNT_AIRROUTER,	/* Ubiquiti AirRouter */
@@ -301,7 +302,7 @@
  config ATH79_MACH_AP121
  	bool "Atheros AP121 reference board"
  	select SOC_AR933X
-@@ -11,62 +95,1107 @@ config ATH79_MACH_AP121
+@@ -11,62 +95,1116 @@ config ATH79_MACH_AP121
  	select ATH79_DEV_M25P80
  	select ATH79_DEV_USB
  	select ATH79_DEV_WMAC
@@ -1342,6 +1343,15 @@
 +	select ATH79_DEV_M25P80
 +	select ATH79_DEV_WMAC
 +
++config ATH79_MACH_TL_WR941ND_V6
++       bool "TP-LINK TL-WR941ND v6 support"
++       select SOC_QCA956X
++       select ATH79_DEV_ETH
++       select ATH79_DEV_GPIO_BUTTONS
++       select ATH79_DEV_LEDS_GPIO
++       select ATH79_DEV_M25P80
++       select ATH79_DEV_WMAC
++
 +config ATH79_MACH_TL_WR1041N_V2
 +	bool "TP-LINK TL-WR1041N v2 support"
 +	select SOC_AR934X
@@ -1437,7 +1447,7 @@
  
  config ATH79_MACH_UBNT_XM
  	bool "Ubiquiti Networks XM/UniFi boards"
-@@ -83,6 +1212,97 @@ config ATH79_MACH_UBNT_XM
+@@ -83,6 +1221,97 @@ config ATH79_MACH_UBNT_XM
  	  Say 'Y' here if you want your kernel to support the
  	  Ubiquiti Networks XM (rev 1.0) board.
  
@@ -1535,7 +1545,7 @@
  endmenu
  
  config SOC_AR71XX
-@@ -134,7 +1354,10 @@ config ATH79_DEV_DSA
+@@ -134,7 +1363,10 @@ config ATH79_DEV_DSA
  config ATH79_DEV_ETH
  	def_bool n
  
@@ -1547,7 +1557,7 @@
  	def_bool n
  
  config ATH79_DEV_GPIO_BUTTONS
-@@ -164,6 +1387,11 @@ config ATH79_PCI_ATH9K_FIXUP
+@@ -164,6 +1396,11 @@ config ATH79_PCI_ATH9K_FIXUP
  	def_bool n
  
  config ATH79_ROUTERBOOT
@@ -1561,7 +1571,7 @@
  endif
 --- a/arch/mips/ath79/Makefile
 +++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,133 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
+@@ -38,9 +38,134 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
  #
  # Machines
  #
@@ -1661,6 +1671,7 @@
 +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8)	+= mach-tl-wr841n-v8.o
 +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9)	+= mach-tl-wr841n-v9.o
 +obj-$(CONFIG_ATH79_MACH_TL_WR941ND)	+= mach-tl-wr941nd.o
++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6)	+= mach-tl-wr941nd-v6.o
 +obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2)	+= mach-tl-wr1041n-v2.o
 +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND)	+= mach-tl-wr1043nd.o
 +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2)	+= mach-tl-wr1043nd-v2.o
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From gch981213 at gmail.com  Wed Aug  5 22:32:55 2015
From: gch981213 at gmail.com (=?UTF-8?B?6YOt5Lyg6Yic?=)
Date: Thu, 6 Aug 2015 10:32:55 +0800
Subject: [OpenWrt-Devel] [PATCH] ar71xx: fix TP-LINK TL-WR941ND v6
	support
In-Reply-To: <e87ef2eb25c510165aaa0f7be290d78d2d0c4b99.1438821655.git.mschiffer@universe-factory.net>
References: <e87ef2eb25c510165aaa0f7be290d78d2d0c4b99.1438821655.git.mschiffer@universe-factory.net>
Message-ID: <CAJsYDVJ_OncaBXE1WVgeq0MQXekFKDCxdegEcAft4W0FJRG9Lw@mail.gmail.com>

In fact there is a model called TL-WR941N v6 which sells in China.It
uses AR9344 SoC and AR9381 for 450M wireless.It's just a mistake made
by the patch submitter to call it wr941nd-v6.I think you should rename
the old profile and create a new one:D

2015-08-06 8:40 GMT+08:00 Matthias Schiffer <mschiffer at universe-factory.net>:
> The images currently generated for the TL-WR941ND v6 try to treat it like
> a TL-WDR3500, which doesn't make any sense and causes the kernel to panic
> in early boot. I don't think this has ever worked (the TL-WR941ND v6 has
> a different SoC, uses another MDIO bus, has only one WMAC and no USB...).
>
> Fix this by adding proper support for the device.
>
> Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
> ---
>  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  |   1 +
>  target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
>  .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
>  target/linux/ar71xx/config-4.1                     |   1 +
>  .../files/arch/mips/ath79/mach-tl-wr941nd-v6.c     | 151 +++++++++++++++++++++
>  target/linux/ar71xx/image/Makefile                 |   2 +-
>  .../700-MIPS-ath79-openwrt-machines.patch          |  23 +++-
>  9 files changed, 186 insertions(+), 8 deletions(-)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
>
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
> index 561c5da..46b83fc 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -277,7 +277,8 @@ get_status_led() {
>         tl-wdr4300 | \
>         tl-wr703n | \
>         tl-wr710n | \
> -       tl-wr720n-v3)
> +       tl-wr720n-v3 | \
> +       tl-wr941nd-v6)
>                 status_led="tp-link:blue:system"
>                 ;;
>         tl-wr841n-v9)
> 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 2aced37..3344d97 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> @@ -474,6 +474,15 @@ tl-wr941nd-v5)
>         ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
>         ;;
>
> +tl-wr941nd-v6)
> +       ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
> +       ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10"
> +       ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08"
> +       ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04"
> +       ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02"
> +       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
> +       ;;
> +
>  tl-wa830re-v2)
>         ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
>         ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green: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 2893e62..a6507db 100755
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -227,6 +227,7 @@ tl-mr3420-v2 |\
>  tl-wr841n-v8 |\
>  tl-wr842n-v2 |\
>  tl-wr941nd-v5 |\
> +tl-wr941nd-v6 |\
>  wnr2000-v3 |\
>  wnr2000-v4 |\
>  wnr2200 |\
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 256bd10..5d27538 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -793,6 +793,9 @@ ar71xx_board_detect() {
>         *"TL-WR941N/ND v5")
>                 name="tl-wr941nd-v5"
>                 ;;
> +       *"TL-WR941N/ND v6")
> +               name="tl-wr941nd-v6"
> +               ;;
>         *"TL-WR703N v1")
>                 name="tl-wr703n"
>                 ;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index 76d8c5b..55ff568 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -353,6 +353,7 @@ platform_check_image() {
>         tl-wr842n-v2 | \
>         tl-wr941nd | \
>         tl-wr941nd-v5 | \
> +       tl-wr941nd-v6 | \
>         tl-wr1041n-v2 | \
>         tl-wr1043nd | \
>         tl-wr1043nd-v2 | \
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index 1e31a01..ecaf454 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -134,6 +134,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y
>  CONFIG_ATH79_MACH_TL_WR841N_V8=y
>  CONFIG_ATH79_MACH_TL_WR841N_V9=y
>  CONFIG_ATH79_MACH_TL_WR941ND=y
> +CONFIG_ATH79_MACH_TL_WR941ND_V6=y
>  CONFIG_ATH79_MACH_TUBE2H=y
>  CONFIG_ATH79_MACH_UBNT=y
>  CONFIG_ATH79_MACH_UBNT_XM=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
> new file mode 100644
> index 0000000..c5fc9fc
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
> @@ -0,0 +1,151 @@
> +/*
> + *  TP-LINK TL-WR941N/ND v6 board support
> + *
> + *  Copyright (C) 2015 Matthias Schiffer <mschiffer at universe-factory.net>
> + *
> + *  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.
> + */
> +
> +#include <linux/gpio.h>
> +#include <linux/platform_device.h>
> +
> +#include <asm/mach-ath79/ath79.h>
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +
> +
> +#define TL_WR941ND_V6_GPIO_LED_QSS             3
> +#define TL_WR941ND_V6_GPIO_LED_WAN             14
> +#define TL_WR941ND_V6_GPIO_LED_WAN_RED         15
> +#define TL_WR941ND_V6_GPIO_LED_LAN1            7
> +#define TL_WR941ND_V6_GPIO_LED_LAN2            6
> +#define TL_WR941ND_V6_GPIO_LED_LAN3            5
> +#define TL_WR941ND_V6_GPIO_LED_LAN4            4
> +#define TL_WR941ND_V6_GPIO_LED_WLAN            8
> +#define TL_WR941ND_V6_GPIO_LED_SYSTEM          18
> +
> +#define TL_WR941ND_V6_GPIO_BTN_RESET           1
> +#define TL_WR941ND_V6_GPIO_BTN_RFKILL          2
> +
> +#define TL_WR941ND_V6_KEYS_POLL_INTERVAL       20
> +#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL   (3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL)
> +
> +
> +static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = {
> +       {
> +               .name           = "tp-link:blue:qss",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_QSS,
> +               .active_low     = 1,
> +       },
> +       {
> +               .name           = "tp-link:blue:wan",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_WAN,
> +               .active_low     = 1,
> +       },
> +       {
> +               .name           = "tp-link:red:wan",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_WAN_RED,
> +               .active_low     = 0,
> +       },
> +       {
> +               .name           = "tp-link:blue:lan1",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_LAN1,
> +               .active_low     = 1,
> +       },
> +       {
> +               .name           = "tp-link:blue:lan2",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_LAN2,
> +               .active_low     = 1,
> +       },
> +       {
> +               .name           = "tp-link:blue:lan3",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_LAN3,
> +               .active_low     = 1,
> +       },
> +       {
> +               .name           = "tp-link:blue:lan4",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_LAN4,
> +               .active_low     = 1,
> +       },
> +       {
> +               .name           = "tp-link:blue:wlan",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_WLAN,
> +               .active_low     = 1,
> +       },
> +       {
> +               .name           = "tp-link:blue:system",
> +               .gpio           = TL_WR941ND_V6_GPIO_LED_SYSTEM,
> +               .active_low     = 1,
> +       },
> +};
> +
> +static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = {
> +       {
> +               .desc           = "Reset button",
> +               .type           = EV_KEY,
> +               .code           = KEY_RESTART,
> +               .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
> +               .gpio           = TL_WR941ND_V6_GPIO_BTN_RESET,
> +               .active_low     = 1,
> +       }, {
> +               .desc           = "RFKILL button",
> +               .type           = EV_KEY,
> +               .code           = KEY_RFKILL,
> +               .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
> +               .gpio           = TL_WR941ND_V6_GPIO_BTN_RFKILL,
> +               .active_low     = 1,
> +       }
> +};
> +
> +
> +static const char *tl_wr941n_v6_part_probes[] = {
> +       "tp-link",
> +       NULL,
> +};
> +
> +static struct flash_platform_data tl_wr941n_v6_flash_data = {
> +       .part_probes    = tl_wr941n_v6_part_probes,
> +};
> +
> +
> +static void __init tl_wr941nd_v6_setup(void)
> +{
> +       u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
> +       u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> +
> +       ath79_register_m25p80(&tl_wr941n_v6_flash_data);
> +
> +       ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio),
> +                                tl_wr941nd_v6_leds_gpio);
> +
> +       ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL,
> +                                       ARRAY_SIZE(tl_wr941nd_v6_gpio_keys),
> +                                       tl_wr941nd_v6_gpio_keys);
> +
> +       ath79_register_mdio(0, 0x0);
> +
> +       ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
> +       ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
> +
> +       ath79_switch_data.phy4_mii_en = 1;
> +       ath79_switch_data.phy_poll_mask = BIT(0);
> +       ath79_eth0_data.phy_mask = BIT(0);
> +
> +       ath79_register_eth(0);
> +       ath79_register_eth(1);
> +
> +       ath79_register_wmac(ee, mac);
> +
> +}
> +
> +MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V6, "TL-WR941ND-v6", "TP-LINK TL-WR941N/ND v6",
> +            tl_wr941nd_v6_setup);
> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
> index e894d78..f9e0087 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -620,7 +620,7 @@ endef
>
>  define Device/tl-wr941nd-v6
>      $(Device/tplink-4mlzma)
> -    BOARDNAME := TL-WDR3500
> +    BOARDNAME := TL-WR941ND-v6
>      DEVICE_PROFILE := TLWR941
>      TPLINK_HWID := 0x09410006
>  endef
> diff --git a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> index 02ebd1b..558d43c 100644
> --- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> +++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> @@ -1,6 +1,6 @@
>  --- a/arch/mips/ath79/machtypes.h
>  +++ b/arch/mips/ath79/machtypes.h
> -@@ -16,24 +16,207 @@
> +@@ -16,24 +16,208 @@
>
>   enum ath79_mach_type {
>         ATH79_MACH_GENERIC = 0,
> @@ -157,6 +157,7 @@
>  +      ATH79_MACH_TL_WR842N_V2,        /* TP-LINK TL-WR842N/ND v2 */
>  +      ATH79_MACH_TL_WR941ND,          /* TP-LINK TL-WR941ND */
>  +      ATH79_MACH_TL_WR941ND_V5,       /* TP-LINK TL-WR941ND v5 */
> ++      ATH79_MACH_TL_WR941ND_V6,       /* TP-LINK TL-WR941ND v6 */
>  +      ATH79_MACH_TUBE2H,              /* Alfa Network Tube2H */
>  +      ATH79_MACH_UBNT_AIRGW,          /* Ubiquiti AirGateway */
>         ATH79_MACH_UBNT_AIRROUTER,      /* Ubiquiti AirRouter */
> @@ -301,7 +302,7 @@
>   config ATH79_MACH_AP121
>         bool "Atheros AP121 reference board"
>         select SOC_AR933X
> -@@ -11,62 +95,1107 @@ config ATH79_MACH_AP121
> +@@ -11,62 +95,1116 @@ config ATH79_MACH_AP121
>         select ATH79_DEV_M25P80
>         select ATH79_DEV_USB
>         select ATH79_DEV_WMAC
> @@ -1342,6 +1343,15 @@
>  +      select ATH79_DEV_M25P80
>  +      select ATH79_DEV_WMAC
>  +
> ++config ATH79_MACH_TL_WR941ND_V6
> ++       bool "TP-LINK TL-WR941ND v6 support"
> ++       select SOC_QCA956X
> ++       select ATH79_DEV_ETH
> ++       select ATH79_DEV_GPIO_BUTTONS
> ++       select ATH79_DEV_LEDS_GPIO
> ++       select ATH79_DEV_M25P80
> ++       select ATH79_DEV_WMAC
> ++
>  +config ATH79_MACH_TL_WR1041N_V2
>  +      bool "TP-LINK TL-WR1041N v2 support"
>  +      select SOC_AR934X
> @@ -1437,7 +1447,7 @@
>
>   config ATH79_MACH_UBNT_XM
>         bool "Ubiquiti Networks XM/UniFi boards"
> -@@ -83,6 +1212,97 @@ config ATH79_MACH_UBNT_XM
> +@@ -83,6 +1221,97 @@ config ATH79_MACH_UBNT_XM
>           Say 'Y' here if you want your kernel to support the
>           Ubiquiti Networks XM (rev 1.0) board.
>
> @@ -1535,7 +1545,7 @@
>   endmenu
>
>   config SOC_AR71XX
> -@@ -134,7 +1354,10 @@ config ATH79_DEV_DSA
> +@@ -134,7 +1363,10 @@ config ATH79_DEV_DSA
>   config ATH79_DEV_ETH
>         def_bool n
>
> @@ -1547,7 +1557,7 @@
>         def_bool n
>
>   config ATH79_DEV_GPIO_BUTTONS
> -@@ -164,6 +1387,11 @@ config ATH79_PCI_ATH9K_FIXUP
> +@@ -164,6 +1396,11 @@ config ATH79_PCI_ATH9K_FIXUP
>         def_bool n
>
>   config ATH79_ROUTERBOOT
> @@ -1561,7 +1571,7 @@
>   endif
>  --- a/arch/mips/ath79/Makefile
>  +++ b/arch/mips/ath79/Makefile
> -@@ -38,9 +38,133 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)             += route
> +@@ -38,9 +38,134 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)             += route
>   #
>   # Machines
>   #
> @@ -1661,6 +1671,7 @@
>  +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR941ND)   += mach-tl-wr941nd.o
> ++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6)        += mach-tl-wr941nd-v6.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2)        += mach-tl-wr1041n-v2.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND)  += mach-tl-wr1043nd.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2)       += mach-tl-wr1043nd-v2.o
> --
> 2.5.0
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Wed Aug  5 22:55:45 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu, 6 Aug 2015 04:55:45 +0200
Subject: [OpenWrt-Devel] [PATCH] ar71xx: fix TP-LINK TL-WR941ND v6
	support
In-Reply-To: <e87ef2eb25c510165aaa0f7be290d78d2d0c4b99.1438821655.git.mschiffer@universe-factory.net>
References: <e87ef2eb25c510165aaa0f7be290d78d2d0c4b99.1438821655.git.mschiffer@universe-factory.net>
Message-ID: <55C2CCB1.3050409@universe-factory.net>

Please ignore this patch for now, the WLAN isn't working correctly, I'll
have a look at that first.

Matthias


On 08/06/2015 02:40 AM, Matthias Schiffer wrote:
> The images currently generated for the TL-WR941ND v6 try to treat it like
> a TL-WDR3500, which doesn't make any sense and causes the kernel to panic
> in early boot. I don't think this has ever worked (the TL-WR941ND v6 has
> a different SoC, uses another MDIO bus, has only one WMAC and no USB...).
> 
> Fix this by adding proper support for the device.
> 
> Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
> ---
>  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  |   1 +
>  target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
>  .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
>  target/linux/ar71xx/config-4.1                     |   1 +
>  .../files/arch/mips/ath79/mach-tl-wr941nd-v6.c     | 151 +++++++++++++++++++++
>  target/linux/ar71xx/image/Makefile                 |   2 +-
>  .../700-MIPS-ath79-openwrt-machines.patch          |  23 +++-
>  9 files changed, 186 insertions(+), 8 deletions(-)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
> 
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
> index 561c5da..46b83fc 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -277,7 +277,8 @@ get_status_led() {
>  	tl-wdr4300 | \
>  	tl-wr703n | \
>  	tl-wr710n | \
> -	tl-wr720n-v3)
> +	tl-wr720n-v3 | \
> +	tl-wr941nd-v6)
>  		status_led="tp-link:blue:system"
>  		;;
>  	tl-wr841n-v9)
> 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 2aced37..3344d97 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> @@ -474,6 +474,15 @@ tl-wr941nd-v5)
>  	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
>  	;;
>  
> +tl-wr941nd-v6)
> +	ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
> +	ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10"
> +	ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08"
> +	ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04"
> +	ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02"
> +	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
> +	;;
> +
>  tl-wa830re-v2)
>  	ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
>  	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green: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 2893e62..a6507db 100755
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -227,6 +227,7 @@ tl-mr3420-v2 |\
>  tl-wr841n-v8 |\
>  tl-wr842n-v2 |\
>  tl-wr941nd-v5 |\
> +tl-wr941nd-v6 |\
>  wnr2000-v3 |\
>  wnr2000-v4 |\
>  wnr2200 |\
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 256bd10..5d27538 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -793,6 +793,9 @@ ar71xx_board_detect() {
>  	*"TL-WR941N/ND v5")
>  		name="tl-wr941nd-v5"
>  		;;
> +	*"TL-WR941N/ND v6")
> +		name="tl-wr941nd-v6"
> +		;;
>  	*"TL-WR703N v1")
>  		name="tl-wr703n"
>  		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index 76d8c5b..55ff568 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -353,6 +353,7 @@ platform_check_image() {
>  	tl-wr842n-v2 | \
>  	tl-wr941nd | \
>  	tl-wr941nd-v5 | \
> +	tl-wr941nd-v6 | \
>  	tl-wr1041n-v2 | \
>  	tl-wr1043nd | \
>  	tl-wr1043nd-v2 | \
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index 1e31a01..ecaf454 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -134,6 +134,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y
>  CONFIG_ATH79_MACH_TL_WR841N_V8=y
>  CONFIG_ATH79_MACH_TL_WR841N_V9=y
>  CONFIG_ATH79_MACH_TL_WR941ND=y
> +CONFIG_ATH79_MACH_TL_WR941ND_V6=y
>  CONFIG_ATH79_MACH_TUBE2H=y
>  CONFIG_ATH79_MACH_UBNT=y
>  CONFIG_ATH79_MACH_UBNT_XM=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
> new file mode 100644
> index 0000000..c5fc9fc
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
> @@ -0,0 +1,151 @@
> +/*
> + *  TP-LINK TL-WR941N/ND v6 board support
> + *
> + *  Copyright (C) 2015 Matthias Schiffer <mschiffer at universe-factory.net>
> + *
> + *  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.
> + */
> +
> +#include <linux/gpio.h>
> +#include <linux/platform_device.h>
> +
> +#include <asm/mach-ath79/ath79.h>
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +
> +
> +#define TL_WR941ND_V6_GPIO_LED_QSS		3
> +#define TL_WR941ND_V6_GPIO_LED_WAN		14
> +#define TL_WR941ND_V6_GPIO_LED_WAN_RED		15
> +#define TL_WR941ND_V6_GPIO_LED_LAN1		7
> +#define TL_WR941ND_V6_GPIO_LED_LAN2		6
> +#define TL_WR941ND_V6_GPIO_LED_LAN3		5
> +#define TL_WR941ND_V6_GPIO_LED_LAN4		4
> +#define TL_WR941ND_V6_GPIO_LED_WLAN		8
> +#define TL_WR941ND_V6_GPIO_LED_SYSTEM		18
> +
> +#define TL_WR941ND_V6_GPIO_BTN_RESET		1
> +#define TL_WR941ND_V6_GPIO_BTN_RFKILL		2
> +
> +#define TL_WR941ND_V6_KEYS_POLL_INTERVAL	20
> +#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL	(3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL)
> +
> +
> +static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = {
> +	{
> +		.name		= "tp-link:blue:qss",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_QSS,
> +		.active_low	= 1,
> +	},
> +	{
> +		.name		= "tp-link:blue:wan",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_WAN,
> +		.active_low	= 1,
> +	},
> +	{
> +		.name		= "tp-link:red:wan",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_WAN_RED,
> +		.active_low	= 0,
> +	},
> +	{
> +		.name		= "tp-link:blue:lan1",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_LAN1,
> +		.active_low	= 1,
> +	},
> +	{
> +		.name		= "tp-link:blue:lan2",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_LAN2,
> +		.active_low	= 1,
> +	},
> +	{
> +		.name		= "tp-link:blue:lan3",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_LAN3,
> +		.active_low	= 1,
> +	},
> +	{
> +		.name		= "tp-link:blue:lan4",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_LAN4,
> +		.active_low	= 1,
> +	},
> +	{
> +		.name		= "tp-link:blue:wlan",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_WLAN,
> +		.active_low	= 1,
> +	},
> +	{
> +		.name		= "tp-link:blue:system",
> +		.gpio		= TL_WR941ND_V6_GPIO_LED_SYSTEM,
> +		.active_low	= 1,
> +	},
> +};
> +
> +static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "Reset button",
> +		.type		= EV_KEY,
> +		.code		= KEY_RESTART,
> +		.debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= TL_WR941ND_V6_GPIO_BTN_RESET,
> +		.active_low	= 1,
> +	}, {
> +		.desc		= "RFKILL button",
> +		.type		= EV_KEY,
> +		.code		= KEY_RFKILL,
> +		.debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= TL_WR941ND_V6_GPIO_BTN_RFKILL,
> +		.active_low	= 1,
> +	}
> +};
> +
> +
> +static const char *tl_wr941n_v6_part_probes[] = {
> +	"tp-link",
> +	NULL,
> +};
> +
> +static struct flash_platform_data tl_wr941n_v6_flash_data = {
> +	.part_probes	= tl_wr941n_v6_part_probes,
> +};
> +
> +
> +static void __init tl_wr941nd_v6_setup(void)
> +{
> +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
> +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> +
> +	ath79_register_m25p80(&tl_wr941n_v6_flash_data);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio),
> +				 tl_wr941nd_v6_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(tl_wr941nd_v6_gpio_keys),
> +					tl_wr941nd_v6_gpio_keys);
> +
> +	ath79_register_mdio(0, 0x0);
> +
> +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
> +
> +	ath79_switch_data.phy4_mii_en = 1;
> +	ath79_switch_data.phy_poll_mask = BIT(0);
> +	ath79_eth0_data.phy_mask = BIT(0);
> +
> +	ath79_register_eth(0);
> +	ath79_register_eth(1);
> +
> +	ath79_register_wmac(ee, mac);
> +
> +}
> +
> +MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V6, "TL-WR941ND-v6", "TP-LINK TL-WR941N/ND v6",
> +	     tl_wr941nd_v6_setup);
> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
> index e894d78..f9e0087 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -620,7 +620,7 @@ endef
>  
>  define Device/tl-wr941nd-v6
>      $(Device/tplink-4mlzma)
> -    BOARDNAME := TL-WDR3500
> +    BOARDNAME := TL-WR941ND-v6
>      DEVICE_PROFILE := TLWR941
>      TPLINK_HWID := 0x09410006
>  endef
> diff --git a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> index 02ebd1b..558d43c 100644
> --- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> +++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> @@ -1,6 +1,6 @@
>  --- a/arch/mips/ath79/machtypes.h
>  +++ b/arch/mips/ath79/machtypes.h
> -@@ -16,24 +16,207 @@
> +@@ -16,24 +16,208 @@
>   
>   enum ath79_mach_type {
>   	ATH79_MACH_GENERIC = 0,
> @@ -157,6 +157,7 @@
>  +	ATH79_MACH_TL_WR842N_V2,	/* TP-LINK TL-WR842N/ND v2 */
>  +	ATH79_MACH_TL_WR941ND,		/* TP-LINK TL-WR941ND */
>  +	ATH79_MACH_TL_WR941ND_V5,	/* TP-LINK TL-WR941ND v5 */
> ++	ATH79_MACH_TL_WR941ND_V6,	/* TP-LINK TL-WR941ND v6 */
>  +	ATH79_MACH_TUBE2H,		/* Alfa Network Tube2H */
>  +	ATH79_MACH_UBNT_AIRGW,		/* Ubiquiti AirGateway */
>   	ATH79_MACH_UBNT_AIRROUTER,	/* Ubiquiti AirRouter */
> @@ -301,7 +302,7 @@
>   config ATH79_MACH_AP121
>   	bool "Atheros AP121 reference board"
>   	select SOC_AR933X
> -@@ -11,62 +95,1107 @@ config ATH79_MACH_AP121
> +@@ -11,62 +95,1116 @@ config ATH79_MACH_AP121
>   	select ATH79_DEV_M25P80
>   	select ATH79_DEV_USB
>   	select ATH79_DEV_WMAC
> @@ -1342,6 +1343,15 @@
>  +	select ATH79_DEV_M25P80
>  +	select ATH79_DEV_WMAC
>  +
> ++config ATH79_MACH_TL_WR941ND_V6
> ++       bool "TP-LINK TL-WR941ND v6 support"
> ++       select SOC_QCA956X
> ++       select ATH79_DEV_ETH
> ++       select ATH79_DEV_GPIO_BUTTONS
> ++       select ATH79_DEV_LEDS_GPIO
> ++       select ATH79_DEV_M25P80
> ++       select ATH79_DEV_WMAC
> ++
>  +config ATH79_MACH_TL_WR1041N_V2
>  +	bool "TP-LINK TL-WR1041N v2 support"
>  +	select SOC_AR934X
> @@ -1437,7 +1447,7 @@
>   
>   config ATH79_MACH_UBNT_XM
>   	bool "Ubiquiti Networks XM/UniFi boards"
> -@@ -83,6 +1212,97 @@ config ATH79_MACH_UBNT_XM
> +@@ -83,6 +1221,97 @@ config ATH79_MACH_UBNT_XM
>   	  Say 'Y' here if you want your kernel to support the
>   	  Ubiquiti Networks XM (rev 1.0) board.
>   
> @@ -1535,7 +1545,7 @@
>   endmenu
>   
>   config SOC_AR71XX
> -@@ -134,7 +1354,10 @@ config ATH79_DEV_DSA
> +@@ -134,7 +1363,10 @@ config ATH79_DEV_DSA
>   config ATH79_DEV_ETH
>   	def_bool n
>   
> @@ -1547,7 +1557,7 @@
>   	def_bool n
>   
>   config ATH79_DEV_GPIO_BUTTONS
> -@@ -164,6 +1387,11 @@ config ATH79_PCI_ATH9K_FIXUP
> +@@ -164,6 +1396,11 @@ config ATH79_PCI_ATH9K_FIXUP
>   	def_bool n
>   
>   config ATH79_ROUTERBOOT
> @@ -1561,7 +1571,7 @@
>   endif
>  --- a/arch/mips/ath79/Makefile
>  +++ b/arch/mips/ath79/Makefile
> -@@ -38,9 +38,133 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
> +@@ -38,9 +38,134 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
>   #
>   # Machines
>   #
> @@ -1661,6 +1671,7 @@
>  +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8)	+= mach-tl-wr841n-v8.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9)	+= mach-tl-wr841n-v9.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR941ND)	+= mach-tl-wr941nd.o
> ++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6)	+= mach-tl-wr941nd-v6.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2)	+= mach-tl-wr1041n-v2.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND)	+= mach-tl-wr1043nd.o
>  +obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2)	+= mach-tl-wr1043nd-v2.o
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/31a98168/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From eckert.florian at googlemail.com  Thu Aug  6 01:41:44 2015
From: eckert.florian at googlemail.com (feckert)
Date: Thu,  6 Aug 2015 07:41:44 +0200
Subject: [OpenWrt-Devel] [PATCH v3] lantiq: get more status information from
	xDSL
Message-ID: <1438839704-7187-1-git-send-email-Eckert.Florian@googlemail.com>

Signed-off-by: Florian Eckert <Eckert.Florian at googlemail.com>
Signed-off-by: Helge Mader <hmader at tdt.de>
Tested-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
Tested-by: Andre Heider <a.heider at gmail.com>
---

v2 fix annex and line mode comma
v2 fix latency to ms
v3 fix latency syntax quotation error "x ms"
v3 fix echo "----" separation removed from status function

 .../lantiq/base-files/lib/functions/lantiq_dsl.sh  |  412 +++++++++++++++++++-
 1 file changed, 400 insertions(+), 12 deletions(-)
 mode change 100644 => 100755 target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh

diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
old mode 100644
new mode 100755
index 56b8652..7809d01
--- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
@@ -19,6 +19,9 @@ dsl_cmd() {
 dsl_val() {
 	echo $(expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*')
 }
+dsl_string() {
+	echo $(expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))')
+}
 
 #
 # Simple divide by 10 routine to cope with one decimal place
@@ -49,6 +52,16 @@ scale() {
 	fi
 }
 
+scale_latency() {
+	local val=$1
+	local a
+	local b
+
+	a=$(expr $val / 100)
+	b=$(expr $val % 100)
+	printf "%d.%d ms" ${a} ${b}
+}
+
 #
 # Read the data rates for both directions
 #
@@ -77,7 +90,7 @@ data_rates() {
 		echo "dsl.data_rate_down_s=\"$sdrd\""
 		echo "dsl.data_rate_up_s=\"$sdru\""
 	else
-		echo "Data Rate:		${sdrd}/s / ${sdru}/s"
+		echo "Data Rate:                                Down: ${sdrd}/s / Up: ${sdru}/s"
 	fi
 }
 
@@ -92,11 +105,340 @@ chipset() {
 	vig=$(dsl_cmd vig)
 	cs=$(dsl_val "$vig" DSL_ChipSetType)
 	csv=$(dsl_val "$vig" DSL_ChipSetHWVersion)
+	csfw=$(dsl_val "$vig" DSL_ChipSetFWVersion)
+	csapi=$(dsl_val "$vig" DSL_DriverVersionApi)
 
 	if [ "$action" = "lucistat" ]; then
 		echo "dsl.chipset=\"${cs} ${csv}\""
+		echo "dsl.firmware_version=\"${csfw}\""
+		echo "dsl.api_version=\"${csapi}\""
 	else
-		echo "Chipset:		${cs} ${csv}"
+		echo "Chipset:                                  ${cs} ${csv}"
+		echo "Firmware Version:                         ${csfw}"
+		echo "API Version:                              ${csapi}"
+	fi
+}
+
+#
+# Vendor information
+#
+vendor() {
+	local lig
+	local vid
+	local svid
+
+	lig=$(dsl_cmd g997lig 1)
+	vid=$(dsl_string "$lig" G994VendorID)
+	svid=$(dsl_string "$lig" SystemVendorID)
+
+	if [ "$action" = "lucistat" ]; then
+		echo "dsl.atuc_vendor_id=\"${vid}\""
+		echo "dsl.atuc_system_vendor_id=\"${svid}\""
+	else
+		echo "ATU-C Vendor ID:                          ${vid}"
+		echo "ATU-C System Vendor ID:                   ${svid}"
+	fi
+}
+
+#
+# XTSE capabilities
+#
+xtse() {
+	local xtusesg
+	local xtse1
+	local xtse2
+	local xtse3
+	local xtse4
+	local xtse5
+	local xtse6
+	local xtse7
+	local xtse8
+
+	local xtse_s=""
+
+	local annex_s=""
+	local line_mode_s=""
+	local cmd=""
+
+	xtusesg=$(dsl_cmd g997xtusesg)
+	xtse1=$(dsl_val "$xtusesg" XTSE1)
+	xtse2=$(dsl_val "$xtusesg" XTSE2)
+	xtse3=$(dsl_val "$xtusesg" XTSE3)
+	xtse4=$(dsl_val "$xtusesg" XTSE4)
+	xtse5=$(dsl_val "$xtusesg" XTSE5)
+	xtse6=$(dsl_val "$xtusesg" XTSE6)
+	xtse7=$(dsl_val "$xtusesg" XTSE7)
+	xtse8=$(dsl_val "$xtusesg" XTSE8)
+
+	# Evaluate Annex (according to G.997.1, 7.3.1.1.1)
+	if [ $((xtse1 & 13)) != 0 \
+	-o $((xtse2 & 1)) != 0 \
+	-o $((xtse3 & 12)) != 0 \
+	-o $((xtse4 & 3)) != 0 \
+	-o $((xtse6 & 3)) != 0 \
+	-o $((xtse8 & 1)) != 0 ]; then
+		annex_s=" A,"
+	fi
+
+	if [ $((xtse1 & 48)) != 0 \
+	-o $((xtse2 & 2)) != 0 \
+	-o $((xtse3 & 48)) != 0 \
+	-o $((xtse6 & 12)) != 0 \
+	-o $((xtse8 & 2)) != 0 ]; then
+		annex_s="$annex_s B,"
+	fi
+
+	if [ $((xtse1 & 194)) != 0 \
+	-o $((xtse2 & 12)) != 0 \
+	-o $((xtse8 & 4)) != 0 ]; then
+		annex_s="$annex_s C,"
+	fi
+
+	if [ $((xtse4 & 48)) != 0 \
+	-o $((xtse5 & 3)) != 0 \
+	-o $((xtse6 & 192)) != 0 ]; then
+		annex_s="$annex_s I,"
+	fi
+
+	if [ $((xtse4 & 192)) != 0 \
+	-o $((xtse7 & 3)) != 0 ]; then
+		annex_s="$annex_s J,"
+	fi
+
+	if [ $((xtse5 & 60)) != 0 ]; then
+		annex_s="$annex_s L,"
+	fi
+
+	if [ $((xtse5 & 192)) != 0 \
+	-o $((xtse7 & 12)) != 0 ]; then
+		annex_s="$annex_s M,"
+	fi
+
+	annex_s=`echo ${annex_s:1}`
+	annex_s=`echo ${annex_s%?}`
+
+	# Evaluate Line Mode (according to G.997.1, 7.3.1.1.1)
+
+	# Regional standard: ANSI T1.413
+	if [ $((xtse1 & 1)) != 0  ]; then
+		line_mode_s=" T1.413,"
+	fi
+
+	# Regional standard: TS 101 388
+	if [ $((xtse1 & 1)) != 0  ]; then
+		line_mode_s="$line_mode_s TS 101 388,"
+	fi
+
+	if [ $((xtse1 & 252)) != 0  ]; then
+		line_mode_s="$line_mode_s G.992.1 (ADSL),"
+	fi
+
+	if [ $((xtse2 & 15)) != 0  ]; then
+		line_mode_s="$line_mode_s G.992.2 (ADSL lite),"
+	fi
+
+	if [ $((xtse3 & 60)) != 0 \
+	-o $((xtse4 & 240)) != 0 \
+	-o $((xtse5 & 252)) != 0  ]; then
+		line_mode_s="$line_mode_s G.992.3 (ADSL2),"
+	fi
+
+	if [ $((xtse4 & 3)) != 0 \
+	-o $((xtse5 & 3)) != 0  ]; then
+		line_mode_s="$line_mode_s G.992.4 (ADSL2 lite),"
+	fi
+
+	if [ $((xtse6 & 199)) != 0 \
+	-o $((xtse7 & 15)) != 0  ]; then
+		line_mode_s="$line_mode_s G.992.5 (ADSL2+),"
+	fi
+
+	if [ $((xtse8 & 7)) != 0  ]; then
+		line_mode_s="$line_mode_s G.993.2 (VDSL2),"
+	fi
+
+	#!!! PROPRIETARY & INTERMEDIATE USE !!!
+	if [ $((xtse8 & 128)) != 0  ]; then
+		line_mode_s="$line_mode_s G.993.1 (VDSL),"
+	fi
+
+	line_mode_s=`echo ${line_mode_s:1}`
+	line_mode_s=`echo ${line_mode_s%?}`
+
+	xtse_s="${xtse1}, ${xtse2}, ${xtse3}, ${xtse4}, ${xtse5}, ${xtse6}, ${xtse7}, ${xtse8}"
+
+	if [ "$action" = "lucistat" ]; then
+		echo "dsl.xtse1=$xtse1"
+		echo "dsl.xtse2=$xtse2"
+		echo "dsl.xtse3=$xtse3"
+		echo "dsl.xtse4=$xtse4"
+		echo "dsl.xtse5=$xtse5"
+		echo "dsl.xtse6=$xtse6"
+		echo "dsl.xtse7=$xtse7"
+		echo "dsl.xtse8=$xtse8"
+		echo "dsl.xtse_s=\"$xtse_s\""
+		echo "dsl.annex_s=\"${annex_s}\""
+		echo "dsl.line_mode_s=\"${line_mode_s}\""
+	else
+		echo "XTSE Capabilities:                        ${xtse_s}"
+		echo "Annex:                                    ${annex_s}"
+		echo "Line Mode:                                ${line_mode_s}"
+	fi
+}
+
+#
+# Power Management Mode
+#
+power_mode() {
+	local pmsg=$(dsl_cmd g997pmsg)
+	local pm=$(dsl_val "$pmsg" nPowerManagementStatus);
+	local s;
+
+	case "$pm" in
+		"-1")		s="Power management state is not available" ;;
+		"0")		s="L0 - Synchronized" ;;
+		"1")		s="L1 - Power Down Data transmission (G.992.2)" ;;
+		"2")		s="L2 - Power Down Data transmission (G.992.3 and G.992.4)" ;;
+		"3")		s="L3 - No power" ;;
+		*)		s="unknown" ;;
+	esac
+
+	if [ "$action" = "lucistat" ]; then
+		echo "dsl.power_mode_num=$pm"
+		echo "dsl.power_mode_s=\"$s\""
+	else
+		echo "Power Management Mode:                    $s"
+	fi
+}
+
+#
+# Latency type (interleave delay)
+#
+latency_delay() {
+	local csg
+
+	local idu
+	local idu_s;
+	local sidu
+
+	local idd
+	local idd_s;
+	local sidd
+
+	csg=$(dsl_cmd g997csg 0 1)
+	idd=$(dsl_val "$csg" ActualInterleaveDelay)
+
+	csg=$(dsl_cmd g997csg 0 0)
+	idu=$(dsl_val "$csg" ActualInterleaveDelay)
+
+	[ -z "$idd" ] && idd=0
+	[ -z "$idu" ] && idu=0
+
+	if [ "$idd" > 100 ]; then
+		idd_s="Interleave"
+	else
+		idd_s="Fast"
+	fi
+
+	if [ "$idu" > 100 ]; then
+		idu_s="Interleave"
+	else
+		idu_s="Fast"
+	fi
+
+	sidu=$(scale_latency $idu)
+	sidd=$(scale_latency $idd)
+
+	if [ "$action" = "lucistat" ]; then
+		echo "dsl.latency_num_down=\"$sidu\""
+		echo "dsl.latency_num_up=\"$sidd\""
+		echo "dsl.latency_s_down=\"$idd_s\""
+		echo "dsl.latency_s_up=\"$idu_s\""
+	else
+		echo "Latency / Interleave Delay:               Down: ${idd_s} (${sidd}) / Up: ${idu_s} (${sidu})"
+	fi
+}
+
+#
+# Errors
+#
+errors() {
+	local lsctg
+	local dpctg
+	local ccsg
+	local esf
+	local esn
+	local sesf
+	local sesn
+	local lossf
+	local lossn
+	local uasf
+	local uasn
+
+	local crc_pf
+	local crc_pn
+	local crcp_pf
+	local crcp_pn
+	local hecf
+	local hecn
+
+	local fecn
+	local fecf
+
+	lsctg=$(dsl_cmd pmlsctg 1)
+	esf=$(dsl_val "$lsctg" nES)
+	sesf=$(dsl_val "$lsctg" nSES)
+	lossf=$(dsl_val "$lsctg" nLOSS)
+	uasf=$(dsl_val "$lsctg" nUAS)
+
+	lsctg=$(dsl_cmd pmlsctg 0)
+	esn=$(dsl_val "$lsctg" nES)
+	sesn=$(dsl_val "$lsctg" nSES)
+	lossn=$(dsl_val "$lsctg" nLOSS)
+	uasn=$(dsl_val "$lsctg" nUAS)
+
+	dpctg=$(dsl_cmd pmdpctg 0 1)
+	hecf=$(dsl_val "$dpctg" nHEC)
+	crc_pf=$(dsl_val "$dpctg" nCRC_P)
+	crcp_pf=$(dsl_val "$dpctg" nCRCP_P)
+
+	dpctg=$(dsl_cmd pmdpctg 0 0)
+	hecn=$(dsl_val "$dpctg" nHEC)
+	crc_pn=$(dsl_val "$dpctg" nCRC_P)
+	crcp_pn=$(dsl_val "$dpctg" nCRCP_P)
+
+	ccsg=$(dsl_cmd pmccsg 0 1 0)
+	fecf=$(dsl_val "$ccsg" nFEC)
+
+	ccsg=$(dsl_cmd pmccsg 0 0 0)
+	fecn=$(dsl_val "$ccsg" nFEC)
+
+	if [ "$action" = "lucistat" ]; then
+		echo "dsl.errors_fec_near=$fecn"
+		echo "dsl.errors_fec_far=$fecf"
+		echo "dsl.errors_es_near=$esn"
+		echo "dsl.errors_es_far=$esf"
+		echo "dsl.errors_ses_near=$sesn"
+		echo "dsl.errors_ses_far=$sesf"
+		echo "dsl.errors_loss_near=$lossn"
+		echo "dsl.errors_loss_far=$lossf"
+		echo "dsl.errors_uas_near=$uasn"
+		echo "dsl.errors_uas_far=$uasf"
+		echo "dsl.errors_hec_near=$hecn"
+		echo "dsl.errors_hec_far=$hecf"
+		echo "dsl.errors_crc_p_near=$crc_pn"
+		echo "dsl.errors_crc_p_far=$crc_pf"
+		echo "dsl.errors_crcp_p_near=$crcp_pn"
+		echo "dsl.errors_crcp_p_far=$crcp_pf"
+	else
+		echo "Forward Error Correction Seconds (FECS):  Near: ${fecn} / Far: ${fecf}"
+		echo "Errored seconds (ES):                     Near: ${esn} / Far: ${esf}"
+		echo "Severely Errored Seconds (SES):           Near: ${sesn} / Far: ${sesf}"
+		echo "Loss of Signal Seconds (LOSS):            Near: ${lossn} / Far: ${lossf}"
+		echo "Unavailable Seconds (UAS):                Near: ${uasn} / Far: ${uasf}"
+		echo "Header Error Code Errors (HEC):           Near: ${hecn} / Far: ${hecf}"
+		echo "Non Pre-emtive CRC errors (CRC_P):        Near: ${crcp_pn} / Far: ${crcp_pf}"
+		echo "Pre-emtive CRC errors (CRCP_P):           Near: ${crcp_pn} / Far: ${crcp_pf}"
 	fi
 }
 
@@ -118,11 +460,6 @@ line_uptime() {
 
 	[ -z "$et" ] && et=0
 
-	if [ "$action" = "lucistat" ]; then
-		echo "dsl.line_uptime=${et}"
-		return
-	fi
-
 	d=$(expr $et / 86400)
 	etr=$(expr $et % 86400)
 	h=$(expr $etr / 3600)
@@ -137,7 +474,16 @@ line_uptime() {
 	[ "${d}" -ne 0 ] && rc="${d}d ${rc}"
 
 	[ -z "$rc" ] && rc="down"
-	echo "Line Uptime:		${rc}"
+
+
+	if [ "$action" = "lucistat" ]; then
+		echo "dsl.line_uptime=${et}"
+		echo "dsl.line_uptime_s=\"${rc}\""
+	else
+
+		echo "Line Uptime Seconds:                      ${et}"
+		echo "Line Uptime:                              ${rc}"
+	fi
 }
 
 #
@@ -147,35 +493,72 @@ line_data() {
 	local lsg
 	local latnu
 	local latnd
+	local satnu
+	local satnd
 	local snru
 	local snrd
+	local attndru
+	local attndrd
+	local sattndru
+	local sattndrd
+	local actatpu
+	local actatpd
 
 	lsg=$(dsl_cmd g997lsg 1 1)
 	latnd=$(dsl_val "$lsg" LATN)
+	satnd=$(dsl_val "$lsg" SATN)
 	snrd=$(dsl_val "$lsg" SNR)
+	attndrd=$(dsl_val "$lsg" ATTNDR)
+	actatpd=$(dsl_val "$lsg" ACTATP)
 
 	lsg=$(dsl_cmd g997lsg 0 1)
 	latnu=$(dsl_val "$lsg" LATN)
+	satnu=$(dsl_val "$lsg" SATN)
 	snru=$(dsl_val "$lsg" SNR)
+	attndru=$(dsl_val "$lsg" ATTNDR)
+	actatpu=$(dsl_val "$lsg" ACTATP)
 
 	[ -z "$latnd" ] && latnd=0
 	[ -z "$latnu" ] && latnu=0
+	[ -z "$satnd" ] && satnd=0
+	[ -z "$satnu" ] && satnu=0
 	[ -z "$snrd" ] && snrd=0
 	[ -z "$snru" ] && snru=0
 
 	latnd=$(dbt $latnd)
 	latnu=$(dbt $latnu)
+	satnd=$(dbt $satnd)
+	satnu=$(dbt $satnu)
 	snrd=$(dbt $snrd)
 	snru=$(dbt $snru)
+	actatpd=$(dbt $actatpd)
+	actatpu=$(dbt $actatpu)
+
+	[ -z "$attndrd" ] && attndrd=0
+	[ -z "$attndru" ] && attndru=0
+
+	sattndrd=$(scale $attndrd)
+	sattndru=$(scale $attndru)
 	
 	if [ "$action" = "lucistat" ]; then
 		echo "dsl.line_attenuation_down=$latnd"
 		echo "dsl.line_attenuation_up=$latnu"
 		echo "dsl.noise_margin_down=$snrd"
 		echo "dsl.noise_margin_up=$snru"
+		echo "dsl.signal_attenuation_down=$satnd"
+		echo "dsl.signal_attenuation_up=$satnu"
+		echo "dsl.actatp_down=$actatpd"
+		echo "dsl.actatp_up=$actatpu"
+		echo "dsl.max_data_rate_down=$attndrd"
+		echo "dsl.max_data_rate_up=$attndru"
+		echo "dsl.max_data_rate_down_s=\"$sattndrd\""
+		echo "dsl.max_data_rate_up_s=\"$sattndru\""
 	else
-		echo "Line Attenuation:	${latnd}dB / ${latnu}dB"
-		echo "Noise Margin:		${snrd}dB / ${snru}dB"
+		echo "Line Attenuation (LATN):                  Down: ${latnd}dB / Up: ${latnu}dB"
+		echo "Signal Attenuation (SATN):                Down: ${satnd}dB / Up: ${satnu}dB"
+		echo "Noise Margin (SNR):                       Down: ${snrd}dB / Up: ${snru}dB"
+		echo "Aggregate Transmit Power(ACTATP):         Down: ${actatpd}dB / Up: ${actatpu}dB"
+		echo "Max. Attainable Data Rate (ATTNDR):       Down: ${sattndrd}/s / Up: ${sattndru}/s"
 	fi
 }
 
@@ -226,16 +609,21 @@ line_state() {
 		fi
 	else
 		if [ "$ls" = "0x801" ]; then
-			echo "Line State:		UP [$ls: $s]"
+			echo "Line State:                               UP [$ls: $s]"
 		else
-			echo "Line State:		DOWN [$ls: $s]"
+			echo "Line State:                               DOWN [$ls: $s]"
 		fi
 	fi
 }
 
 status() {
+	vendor
 	chipset
+	xtse
 	line_state
+	errors
+	power_mode
+	latency_delay
 	data_rates
 	line_data
 	line_uptime
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sscapi at gmail.com  Thu Aug  6 03:15:39 2015
From: sscapi at gmail.com (Sylwester Petela)
Date: Thu, 6 Aug 2015 09:15:39 +0200
Subject: [OpenWrt-Devel] [PATCH v3] lantiq: get more status information
 from xDSL
In-Reply-To: <1438839704-7187-1-git-send-email-Eckert.Florian@googlemail.com>
References: <1438839704-7187-1-git-send-email-Eckert.Florian@googlemail.com>
Message-ID: <55C3099B.20807@gmail.com>

W dniu 2015-08-06 o 07:41, feckert pisze:
> Signed-off-by: Florian Eckert <Eckert.Florian at googlemail.com>
> Signed-off-by: Helge Mader <hmader at tdt.de>
> Tested-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
> Tested-by: Andre Heider <a.heider at gmail.com>
> ---
>
> v2 fix annex and line mode comma
> v2 fix latency to ms
> v3 fix latency syntax quotation error "x ms"
> v3 fix echo "----" separation removed from status function
>
>   .../lantiq/base-files/lib/functions/lantiq_dsl.sh  |  412 +++++++++++++++++++-
>   1 file changed, 400 insertions(+), 12 deletions(-)
>   mode change 100644 => 100755 target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>
> diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
> old mode 100644
> new mode 100755
> index 56b8652..7809d01
> --- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
> +++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
> @@ -19,6 +19,9 @@ dsl_cmd() {
>   dsl_val() {
>   	echo $(expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*')
>   }
> +dsl_string() {
> +	echo $(expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))')
> +}
>   
>   #
>   # Simple divide by 10 routine to cope with one decimal place
> @@ -49,6 +52,16 @@ scale() {
>   	fi
>   }
>   
> +scale_latency() {
> +	local val=$1
> +	local a
> +	local b
> +
> +	a=$(expr $val / 100)
> +	b=$(expr $val % 100)
> +	printf "%d.%d ms" ${a} ${b}
> +}
> +
>   #
>   # Read the data rates for both directions
>   #
> @@ -77,7 +90,7 @@ data_rates() {
>   		echo "dsl.data_rate_down_s=\"$sdrd\""
>   		echo "dsl.data_rate_up_s=\"$sdru\""
>   	else
> -		echo "Data Rate:		${sdrd}/s / ${sdru}/s"
> +		echo "Data Rate:                                Down: ${sdrd}/s / Up: ${sdru}/s"
>   	fi
>   }
>   
> @@ -92,11 +105,340 @@ chipset() {
>   	vig=$(dsl_cmd vig)
>   	cs=$(dsl_val "$vig" DSL_ChipSetType)
>   	csv=$(dsl_val "$vig" DSL_ChipSetHWVersion)
> +	csfw=$(dsl_val "$vig" DSL_ChipSetFWVersion)
> +	csapi=$(dsl_val "$vig" DSL_DriverVersionApi)
>   
>   	if [ "$action" = "lucistat" ]; then
>   		echo "dsl.chipset=\"${cs} ${csv}\""
> +		echo "dsl.firmware_version=\"${csfw}\""
> +		echo "dsl.api_version=\"${csapi}\""
>   	else
> -		echo "Chipset:		${cs} ${csv}"
> +		echo "Chipset:                                  ${cs} ${csv}"
> +		echo "Firmware Version:                         ${csfw}"
> +		echo "API Version:                              ${csapi}"
> +	fi
> +}
> +
> +#
> +# Vendor information
> +#
> +vendor() {
> +	local lig
> +	local vid
> +	local svid
> +
> +	lig=$(dsl_cmd g997lig 1)
> +	vid=$(dsl_string "$lig" G994VendorID)
> +	svid=$(dsl_string "$lig" SystemVendorID)
> +
> +	if [ "$action" = "lucistat" ]; then
> +		echo "dsl.atuc_vendor_id=\"${vid}\""
> +		echo "dsl.atuc_system_vendor_id=\"${svid}\""
> +	else
> +		echo "ATU-C Vendor ID:                          ${vid}"
> +		echo "ATU-C System Vendor ID:                   ${svid}"
> +	fi
> +}
> +
> +#
> +# XTSE capabilities
> +#
> +xtse() {
> +	local xtusesg
> +	local xtse1
> +	local xtse2
> +	local xtse3
> +	local xtse4
> +	local xtse5
> +	local xtse6
> +	local xtse7
> +	local xtse8
> +
> +	local xtse_s=""
> +
> +	local annex_s=""
> +	local line_mode_s=""
> +	local cmd=""
> +
> +	xtusesg=$(dsl_cmd g997xtusesg)
> +	xtse1=$(dsl_val "$xtusesg" XTSE1)
> +	xtse2=$(dsl_val "$xtusesg" XTSE2)
> +	xtse3=$(dsl_val "$xtusesg" XTSE3)
> +	xtse4=$(dsl_val "$xtusesg" XTSE4)
> +	xtse5=$(dsl_val "$xtusesg" XTSE5)
> +	xtse6=$(dsl_val "$xtusesg" XTSE6)
> +	xtse7=$(dsl_val "$xtusesg" XTSE7)
> +	xtse8=$(dsl_val "$xtusesg" XTSE8)
> +
> +	# Evaluate Annex (according to G.997.1, 7.3.1.1.1)
> +	if [ $((xtse1 & 13)) != 0 \
> +	-o $((xtse2 & 1)) != 0 \
> +	-o $((xtse3 & 12)) != 0 \
> +	-o $((xtse4 & 3)) != 0 \
> +	-o $((xtse6 & 3)) != 0 \
> +	-o $((xtse8 & 1)) != 0 ]; then
> +		annex_s=" A,"
> +	fi
> +
> +	if [ $((xtse1 & 48)) != 0 \
> +	-o $((xtse2 & 2)) != 0 \
> +	-o $((xtse3 & 48)) != 0 \
> +	-o $((xtse6 & 12)) != 0 \
> +	-o $((xtse8 & 2)) != 0 ]; then
> +		annex_s="$annex_s B,"
> +	fi
> +
> +	if [ $((xtse1 & 194)) != 0 \
> +	-o $((xtse2 & 12)) != 0 \
> +	-o $((xtse8 & 4)) != 0 ]; then
> +		annex_s="$annex_s C,"
> +	fi
> +
> +	if [ $((xtse4 & 48)) != 0 \
> +	-o $((xtse5 & 3)) != 0 \
> +	-o $((xtse6 & 192)) != 0 ]; then
> +		annex_s="$annex_s I,"
> +	fi
> +
> +	if [ $((xtse4 & 192)) != 0 \
> +	-o $((xtse7 & 3)) != 0 ]; then
> +		annex_s="$annex_s J,"
> +	fi
> +
> +	if [ $((xtse5 & 60)) != 0 ]; then
> +		annex_s="$annex_s L,"
> +	fi
> +
> +	if [ $((xtse5 & 192)) != 0 \
> +	-o $((xtse7 & 12)) != 0 ]; then
> +		annex_s="$annex_s M,"
> +	fi
> +
> +	annex_s=`echo ${annex_s:1}`
> +	annex_s=`echo ${annex_s%?}`
> +
> +	# Evaluate Line Mode (according to G.997.1, 7.3.1.1.1)
> +
> +	# Regional standard: ANSI T1.413
> +	if [ $((xtse1 & 1)) != 0  ]; then
> +		line_mode_s=" T1.413,"
> +	fi
> +
> +	# Regional standard: TS 101 388
> +	if [ $((xtse1 & 1)) != 0  ]; then
> +		line_mode_s="$line_mode_s TS 101 388,"
> +	fi
> +
> +	if [ $((xtse1 & 252)) != 0  ]; then
> +		line_mode_s="$line_mode_s G.992.1 (ADSL),"
> +	fi
> +
> +	if [ $((xtse2 & 15)) != 0  ]; then
> +		line_mode_s="$line_mode_s G.992.2 (ADSL lite),"
> +	fi
> +
> +	if [ $((xtse3 & 60)) != 0 \
> +	-o $((xtse4 & 240)) != 0 \
> +	-o $((xtse5 & 252)) != 0  ]; then
> +		line_mode_s="$line_mode_s G.992.3 (ADSL2),"
> +	fi
> +
> +	if [ $((xtse4 & 3)) != 0 \
> +	-o $((xtse5 & 3)) != 0  ]; then
> +		line_mode_s="$line_mode_s G.992.4 (ADSL2 lite),"
> +	fi
> +
> +	if [ $((xtse6 & 199)) != 0 \
> +	-o $((xtse7 & 15)) != 0  ]; then
> +		line_mode_s="$line_mode_s G.992.5 (ADSL2+),"
> +	fi
> +
> +	if [ $((xtse8 & 7)) != 0  ]; then
> +		line_mode_s="$line_mode_s G.993.2 (VDSL2),"
> +	fi
> +
> +	#!!! PROPRIETARY & INTERMEDIATE USE !!!
> +	if [ $((xtse8 & 128)) != 0  ]; then
> +		line_mode_s="$line_mode_s G.993.1 (VDSL),"
> +	fi
> +
> +	line_mode_s=`echo ${line_mode_s:1}`
> +	line_mode_s=`echo ${line_mode_s%?}`
> +
> +	xtse_s="${xtse1}, ${xtse2}, ${xtse3}, ${xtse4}, ${xtse5}, ${xtse6}, ${xtse7}, ${xtse8}"
> +
> +	if [ "$action" = "lucistat" ]; then
> +		echo "dsl.xtse1=$xtse1"
> +		echo "dsl.xtse2=$xtse2"
> +		echo "dsl.xtse3=$xtse3"
> +		echo "dsl.xtse4=$xtse4"
> +		echo "dsl.xtse5=$xtse5"
> +		echo "dsl.xtse6=$xtse6"
> +		echo "dsl.xtse7=$xtse7"
> +		echo "dsl.xtse8=$xtse8"
> +		echo "dsl.xtse_s=\"$xtse_s\""
> +		echo "dsl.annex_s=\"${annex_s}\""
> +		echo "dsl.line_mode_s=\"${line_mode_s}\""
> +	else
> +		echo "XTSE Capabilities:                        ${xtse_s}"
> +		echo "Annex:                                    ${annex_s}"
> +		echo "Line Mode:                                ${line_mode_s}"
> +	fi
> +}
> +
> +#
> +# Power Management Mode
> +#
> +power_mode() {
> +	local pmsg=$(dsl_cmd g997pmsg)
> +	local pm=$(dsl_val "$pmsg" nPowerManagementStatus);
> +	local s;
> +
> +	case "$pm" in
> +		"-1")		s="Power management state is not available" ;;
> +		"0")		s="L0 - Synchronized" ;;
> +		"1")		s="L1 - Power Down Data transmission (G.992.2)" ;;
> +		"2")		s="L2 - Power Down Data transmission (G.992.3 and G.992.4)" ;;
> +		"3")		s="L3 - No power" ;;
> +		*)		s="unknown" ;;
> +	esac
> +
> +	if [ "$action" = "lucistat" ]; then
> +		echo "dsl.power_mode_num=$pm"
> +		echo "dsl.power_mode_s=\"$s\""
> +	else
> +		echo "Power Management Mode:                    $s"
> +	fi
> +}
> +
> +#
> +# Latency type (interleave delay)
> +#
> +latency_delay() {
> +	local csg
> +
> +	local idu
> +	local idu_s;
> +	local sidu
> +
> +	local idd
> +	local idd_s;
> +	local sidd
> +
> +	csg=$(dsl_cmd g997csg 0 1)
> +	idd=$(dsl_val "$csg" ActualInterleaveDelay)
> +
> +	csg=$(dsl_cmd g997csg 0 0)
> +	idu=$(dsl_val "$csg" ActualInterleaveDelay)
> +
> +	[ -z "$idd" ] && idd=0
> +	[ -z "$idu" ] && idu=0
> +
> +	if [ "$idd" > 100 ]; then
> +		idd_s="Interleave"
> +	else
> +		idd_s="Fast"
> +	fi
> +
> +	if [ "$idu" > 100 ]; then
> +		idu_s="Interleave"
> +	else
> +		idu_s="Fast"
> +	fi
> +
> +	sidu=$(scale_latency $idu)
> +	sidd=$(scale_latency $idd)
> +
> +	if [ "$action" = "lucistat" ]; then
> +		echo "dsl.latency_num_down=\"$sidu\""
> +		echo "dsl.latency_num_up=\"$sidd\""
> +		echo "dsl.latency_s_down=\"$idd_s\""
> +		echo "dsl.latency_s_up=\"$idu_s\""
> +	else
> +		echo "Latency / Interleave Delay:               Down: ${idd_s} (${sidd}) / Up: ${idu_s} (${sidu})"
> +	fi
> +}
> +
> +#
> +# Errors
> +#
> +errors() {
> +	local lsctg
> +	local dpctg
> +	local ccsg
> +	local esf
> +	local esn
> +	local sesf
> +	local sesn
> +	local lossf
> +	local lossn
> +	local uasf
> +	local uasn
> +
> +	local crc_pf
> +	local crc_pn
> +	local crcp_pf
> +	local crcp_pn
> +	local hecf
> +	local hecn
> +
> +	local fecn
> +	local fecf
> +
> +	lsctg=$(dsl_cmd pmlsctg 1)
> +	esf=$(dsl_val "$lsctg" nES)
> +	sesf=$(dsl_val "$lsctg" nSES)
> +	lossf=$(dsl_val "$lsctg" nLOSS)
> +	uasf=$(dsl_val "$lsctg" nUAS)
> +
> +	lsctg=$(dsl_cmd pmlsctg 0)
> +	esn=$(dsl_val "$lsctg" nES)
> +	sesn=$(dsl_val "$lsctg" nSES)
> +	lossn=$(dsl_val "$lsctg" nLOSS)
> +	uasn=$(dsl_val "$lsctg" nUAS)
> +
> +	dpctg=$(dsl_cmd pmdpctg 0 1)
> +	hecf=$(dsl_val "$dpctg" nHEC)
> +	crc_pf=$(dsl_val "$dpctg" nCRC_P)
> +	crcp_pf=$(dsl_val "$dpctg" nCRCP_P)
> +
> +	dpctg=$(dsl_cmd pmdpctg 0 0)
> +	hecn=$(dsl_val "$dpctg" nHEC)
> +	crc_pn=$(dsl_val "$dpctg" nCRC_P)
> +	crcp_pn=$(dsl_val "$dpctg" nCRCP_P)
> +
> +	ccsg=$(dsl_cmd pmccsg 0 1 0)
> +	fecf=$(dsl_val "$ccsg" nFEC)
> +
> +	ccsg=$(dsl_cmd pmccsg 0 0 0)
> +	fecn=$(dsl_val "$ccsg" nFEC)
> +
> +	if [ "$action" = "lucistat" ]; then
> +		echo "dsl.errors_fec_near=$fecn"
> +		echo "dsl.errors_fec_far=$fecf"
> +		echo "dsl.errors_es_near=$esn"
> +		echo "dsl.errors_es_far=$esf"
> +		echo "dsl.errors_ses_near=$sesn"
> +		echo "dsl.errors_ses_far=$sesf"
> +		echo "dsl.errors_loss_near=$lossn"
> +		echo "dsl.errors_loss_far=$lossf"
> +		echo "dsl.errors_uas_near=$uasn"
> +		echo "dsl.errors_uas_far=$uasf"
> +		echo "dsl.errors_hec_near=$hecn"
> +		echo "dsl.errors_hec_far=$hecf"
> +		echo "dsl.errors_crc_p_near=$crc_pn"
> +		echo "dsl.errors_crc_p_far=$crc_pf"
> +		echo "dsl.errors_crcp_p_near=$crcp_pn"
> +		echo "dsl.errors_crcp_p_far=$crcp_pf"
> +	else
> +		echo "Forward Error Correction Seconds (FECS):  Near: ${fecn} / Far: ${fecf}"
> +		echo "Errored seconds (ES):                     Near: ${esn} / Far: ${esf}"
> +		echo "Severely Errored Seconds (SES):           Near: ${sesn} / Far: ${sesf}"
> +		echo "Loss of Signal Seconds (LOSS):            Near: ${lossn} / Far: ${lossf}"
> +		echo "Unavailable Seconds (UAS):                Near: ${uasn} / Far: ${uasf}"
> +		echo "Header Error Code Errors (HEC):           Near: ${hecn} / Far: ${hecf}"
> +		echo "Non Pre-emtive CRC errors (CRC_P):        Near: ${crcp_pn} / Far: ${crcp_pf}"
> +		echo "Pre-emtive CRC errors (CRCP_P):           Near: ${crcp_pn} / Far: ${crcp_pf}"
>   	fi
>   }
>   
> @@ -118,11 +460,6 @@ line_uptime() {
>   
>   	[ -z "$et" ] && et=0
>   
> -	if [ "$action" = "lucistat" ]; then
> -		echo "dsl.line_uptime=${et}"
> -		return
> -	fi
> -
>   	d=$(expr $et / 86400)
>   	etr=$(expr $et % 86400)
>   	h=$(expr $etr / 3600)
> @@ -137,7 +474,16 @@ line_uptime() {
>   	[ "${d}" -ne 0 ] && rc="${d}d ${rc}"
>   
>   	[ -z "$rc" ] && rc="down"
> -	echo "Line Uptime:		${rc}"
> +
> +
> +	if [ "$action" = "lucistat" ]; then
> +		echo "dsl.line_uptime=${et}"
> +		echo "dsl.line_uptime_s=\"${rc}\""
> +	else
> +
> +		echo "Line Uptime Seconds:                      ${et}"
> +		echo "Line Uptime:                              ${rc}"
> +	fi
>   }
>   
>   #
> @@ -147,35 +493,72 @@ line_data() {
>   	local lsg
>   	local latnu
>   	local latnd
> +	local satnu
> +	local satnd
>   	local snru
>   	local snrd
> +	local attndru
> +	local attndrd
> +	local sattndru
> +	local sattndrd
> +	local actatpu
> +	local actatpd
>   
>   	lsg=$(dsl_cmd g997lsg 1 1)
>   	latnd=$(dsl_val "$lsg" LATN)
> +	satnd=$(dsl_val "$lsg" SATN)
>   	snrd=$(dsl_val "$lsg" SNR)
> +	attndrd=$(dsl_val "$lsg" ATTNDR)
> +	actatpd=$(dsl_val "$lsg" ACTATP)
>   
>   	lsg=$(dsl_cmd g997lsg 0 1)
>   	latnu=$(dsl_val "$lsg" LATN)
> +	satnu=$(dsl_val "$lsg" SATN)
>   	snru=$(dsl_val "$lsg" SNR)
> +	attndru=$(dsl_val "$lsg" ATTNDR)
> +	actatpu=$(dsl_val "$lsg" ACTATP)
>   
>   	[ -z "$latnd" ] && latnd=0
>   	[ -z "$latnu" ] && latnu=0
> +	[ -z "$satnd" ] && satnd=0
> +	[ -z "$satnu" ] && satnu=0
>   	[ -z "$snrd" ] && snrd=0
>   	[ -z "$snru" ] && snru=0
>   
>   	latnd=$(dbt $latnd)
>   	latnu=$(dbt $latnu)
> +	satnd=$(dbt $satnd)
> +	satnu=$(dbt $satnu)
>   	snrd=$(dbt $snrd)
>   	snru=$(dbt $snru)
> +	actatpd=$(dbt $actatpd)
> +	actatpu=$(dbt $actatpu)
> +
> +	[ -z "$attndrd" ] && attndrd=0
> +	[ -z "$attndru" ] && attndru=0
> +
> +	sattndrd=$(scale $attndrd)
> +	sattndru=$(scale $attndru)
>   	
>   	if [ "$action" = "lucistat" ]; then
>   		echo "dsl.line_attenuation_down=$latnd"
>   		echo "dsl.line_attenuation_up=$latnu"
>   		echo "dsl.noise_margin_down=$snrd"
>   		echo "dsl.noise_margin_up=$snru"
> +		echo "dsl.signal_attenuation_down=$satnd"
> +		echo "dsl.signal_attenuation_up=$satnu"
> +		echo "dsl.actatp_down=$actatpd"
> +		echo "dsl.actatp_up=$actatpu"
> +		echo "dsl.max_data_rate_down=$attndrd"
> +		echo "dsl.max_data_rate_up=$attndru"
> +		echo "dsl.max_data_rate_down_s=\"$sattndrd\""
> +		echo "dsl.max_data_rate_up_s=\"$sattndru\""
>   	else
> -		echo "Line Attenuation:	${latnd}dB / ${latnu}dB"
> -		echo "Noise Margin:		${snrd}dB / ${snru}dB"
> +		echo "Line Attenuation (LATN):                  Down: ${latnd}dB / Up: ${latnu}dB"
> +		echo "Signal Attenuation (SATN):                Down: ${satnd}dB / Up: ${satnu}dB"
> +		echo "Noise Margin (SNR):                       Down: ${snrd}dB / Up: ${snru}dB"
> +		echo "Aggregate Transmit Power(ACTATP):         Down: ${actatpd}dB / Up: ${actatpu}dB"
> +		echo "Max. Attainable Data Rate (ATTNDR):       Down: ${sattndrd}/s / Up: ${sattndru}/s"
>   	fi
>   }
>   
> @@ -226,16 +609,21 @@ line_state() {
>   		fi
>   	else
>   		if [ "$ls" = "0x801" ]; then
> -			echo "Line State:		UP [$ls: $s]"
> +			echo "Line State:                               UP [$ls: $s]"
>   		else
> -			echo "Line State:		DOWN [$ls: $s]"
> +			echo "Line State:                               DOWN [$ls: $s]"
>   		fi
>   	fi
>   }

Above change intrigues me a lot.
Is this patch intended whitespace broken or by mistake every "tab is 
converted into "space"?

>   
>   status() {
> +	vendor
>   	chipset
> +	xtse
>   	line_state
> +	errors
> +	power_mode
> +	latency_delay
>   	data_rates
>   	line_data
>   	line_uptime
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From eckert.florian at googlemail.com  Thu Aug  6 03:55:23 2015
From: eckert.florian at googlemail.com (Florian Eckert)
Date: Thu, 6 Aug 2015 09:55:23 +0200
Subject: [OpenWrt-Devel] Fwd: [PATCH v3] lantiq: get more status information
 from xDSL
Message-ID: <CALPCC5zKxYodF6rQw1QD8kW8pcH+vGmVV-u9ZOuq8i-Z_1PkYw@mail.gmail.com>

Sorry i dont understand your question.

This is the third version of the patch.

I edit this in v2 and v3

In v2 i have added the conversation of latency to ms (mentioned by
Martin Blumenstingl). I have forgotten the quotation around the ms
output. The lucistat output was broken so i fixed this in v3
(mentioned by Andre Heider)
In v2 i also fixed the line mode comma separation (mentioned by Martin
Blumenstingl)
In v3 i deleted the echo "----" output because this will also be
printed during lucistat output (mentioned by Andre Heider)

2015-08-06 9:15 GMT+02:00 Sylwester Petela <sscapi at gmail.com>:
> W dniu 2015-08-06 o 07:41, feckert pisze:
>
>> Signed-off-by: Florian Eckert <Eckert.Florian at googlemail.com>
>> Signed-off-by: Helge Mader <hmader at tdt.de>
>> Tested-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
>> Tested-by: Andre Heider <a.heider at gmail.com>
>> ---
>>
>> v2 fix annex and line mode comma
>> v2 fix latency to ms
>> v3 fix latency syntax quotation error "x ms"
>> v3 fix echo "----" separation removed from status function
>>
>>   .../lantiq/base-files/lib/functions/lantiq_dsl.sh  |  412
>> +++++++++++++++++++-
>>   1 file changed, 400 insertions(+), 12 deletions(-)
>>   mode change 100644 => 100755
>> target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>>
>> diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> old mode 100644
>> new mode 100755
>> index 56b8652..7809d01
>> --- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> +++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> @@ -19,6 +19,9 @@ dsl_cmd() {
>>   dsl_val() {
>>         echo $(expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*')
>>   }
>> +dsl_string() {
>> +       echo $(expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))')
>> +}
>>     #
>>   # Simple divide by 10 routine to cope with one decimal place
>> @@ -49,6 +52,16 @@ scale() {
>>         fi
>>   }
>>   +scale_latency() {
>> +       local val=$1
>> +       local a
>> +       local b
>> +
>> +       a=$(expr $val / 100)
>> +       b=$(expr $val % 100)
>> +       printf "%d.%d ms" ${a} ${b}
>> +}
>> +
>>   #
>>   # Read the data rates for both directions
>>   #
>> @@ -77,7 +90,7 @@ data_rates() {
>>                 echo "dsl.data_rate_down_s=\"$sdrd\""
>>                 echo "dsl.data_rate_up_s=\"$sdru\""
>>         else
>> -               echo "Data Rate:                ${sdrd}/s / ${sdru}/s"
>> +               echo "Data Rate:                                Down:
>> ${sdrd}/s / Up: ${sdru}/s"
>>         fi
>>   }
>>   @@ -92,11 +105,340 @@ chipset() {
>>         vig=$(dsl_cmd vig)
>>         cs=$(dsl_val "$vig" DSL_ChipSetType)
>>         csv=$(dsl_val "$vig" DSL_ChipSetHWVersion)
>> +       csfw=$(dsl_val "$vig" DSL_ChipSetFWVersion)
>> +       csapi=$(dsl_val "$vig" DSL_DriverVersionApi)
>>         if [ "$action" = "lucistat" ]; then
>>                 echo "dsl.chipset=\"${cs} ${csv}\""
>> +               echo "dsl.firmware_version=\"${csfw}\""
>> +               echo "dsl.api_version=\"${csapi}\""
>>         else
>> -               echo "Chipset:          ${cs} ${csv}"
>> +               echo "Chipset:                                  ${cs}
>> ${csv}"
>> +               echo "Firmware Version:                         ${csfw}"
>> +               echo "API Version:                              ${csapi}"
>> +       fi
>> +}
>> +
>> +#
>> +# Vendor information
>> +#
>> +vendor() {
>> +       local lig
>> +       local vid
>> +       local svid
>> +
>> +       lig=$(dsl_cmd g997lig 1)
>> +       vid=$(dsl_string "$lig" G994VendorID)
>> +       svid=$(dsl_string "$lig" SystemVendorID)
>> +
>> +       if [ "$action" = "lucistat" ]; then
>> +               echo "dsl.atuc_vendor_id=\"${vid}\""
>> +               echo "dsl.atuc_system_vendor_id=\"${svid}\""
>> +       else
>> +               echo "ATU-C Vendor ID:                          ${vid}"
>> +               echo "ATU-C System Vendor ID:                   ${svid}"
>> +       fi
>> +}
>> +
>> +#
>> +# XTSE capabilities
>> +#
>> +xtse() {
>> +       local xtusesg
>> +       local xtse1
>> +       local xtse2
>> +       local xtse3
>> +       local xtse4
>> +       local xtse5
>> +       local xtse6
>> +       local xtse7
>> +       local xtse8
>> +
>> +       local xtse_s=""
>> +
>> +       local annex_s=""
>> +       local line_mode_s=""
>> +       local cmd=""
>> +
>> +       xtusesg=$(dsl_cmd g997xtusesg)
>> +       xtse1=$(dsl_val "$xtusesg" XTSE1)
>> +       xtse2=$(dsl_val "$xtusesg" XTSE2)
>> +       xtse3=$(dsl_val "$xtusesg" XTSE3)
>> +       xtse4=$(dsl_val "$xtusesg" XTSE4)
>> +       xtse5=$(dsl_val "$xtusesg" XTSE5)
>> +       xtse6=$(dsl_val "$xtusesg" XTSE6)
>> +       xtse7=$(dsl_val "$xtusesg" XTSE7)
>> +       xtse8=$(dsl_val "$xtusesg" XTSE8)
>> +
>> +       # Evaluate Annex (according to G.997.1, 7.3.1.1.1)
>> +       if [ $((xtse1 & 13)) != 0 \
>> +       -o $((xtse2 & 1)) != 0 \
>> +       -o $((xtse3 & 12)) != 0 \
>> +       -o $((xtse4 & 3)) != 0 \
>> +       -o $((xtse6 & 3)) != 0 \
>> +       -o $((xtse8 & 1)) != 0 ]; then
>> +               annex_s=" A,"
>> +       fi
>> +
>> +       if [ $((xtse1 & 48)) != 0 \
>> +       -o $((xtse2 & 2)) != 0 \
>> +       -o $((xtse3 & 48)) != 0 \
>> +       -o $((xtse6 & 12)) != 0 \
>> +       -o $((xtse8 & 2)) != 0 ]; then
>> +               annex_s="$annex_s B,"
>> +       fi
>> +
>> +       if [ $((xtse1 & 194)) != 0 \
>> +       -o $((xtse2 & 12)) != 0 \
>> +       -o $((xtse8 & 4)) != 0 ]; then
>> +               annex_s="$annex_s C,"
>> +       fi
>> +
>> +       if [ $((xtse4 & 48)) != 0 \
>> +       -o $((xtse5 & 3)) != 0 \
>> +       -o $((xtse6 & 192)) != 0 ]; then
>> +               annex_s="$annex_s I,"
>> +       fi
>> +
>> +       if [ $((xtse4 & 192)) != 0 \
>> +       -o $((xtse7 & 3)) != 0 ]; then
>> +               annex_s="$annex_s J,"
>> +       fi
>> +
>> +       if [ $((xtse5 & 60)) != 0 ]; then
>> +               annex_s="$annex_s L,"
>> +       fi
>> +
>> +       if [ $((xtse5 & 192)) != 0 \
>> +       -o $((xtse7 & 12)) != 0 ]; then
>> +               annex_s="$annex_s M,"
>> +       fi
>> +
>> +       annex_s=`echo ${annex_s:1}`
>> +       annex_s=`echo ${annex_s%?}`
>> +
>> +       # Evaluate Line Mode (according to G.997.1, 7.3.1.1.1)
>> +
>> +       # Regional standard: ANSI T1.413
>> +       if [ $((xtse1 & 1)) != 0  ]; then
>> +               line_mode_s=" T1.413,"
>> +       fi
>> +
>> +       # Regional standard: TS 101 388
>> +       if [ $((xtse1 & 1)) != 0  ]; then
>> +               line_mode_s="$line_mode_s TS 101 388,"
>> +       fi
>> +
>> +       if [ $((xtse1 & 252)) != 0  ]; then
>> +               line_mode_s="$line_mode_s G.992.1 (ADSL),"
>> +       fi
>> +
>> +       if [ $((xtse2 & 15)) != 0  ]; then
>> +               line_mode_s="$line_mode_s G.992.2 (ADSL lite),"
>> +       fi
>> +
>> +       if [ $((xtse3 & 60)) != 0 \
>> +       -o $((xtse4 & 240)) != 0 \
>> +       -o $((xtse5 & 252)) != 0  ]; then
>> +               line_mode_s="$line_mode_s G.992.3 (ADSL2),"
>> +       fi
>> +
>> +       if [ $((xtse4 & 3)) != 0 \
>> +       -o $((xtse5 & 3)) != 0  ]; then
>> +               line_mode_s="$line_mode_s G.992.4 (ADSL2 lite),"
>> +       fi
>> +
>> +       if [ $((xtse6 & 199)) != 0 \
>> +       -o $((xtse7 & 15)) != 0  ]; then
>> +               line_mode_s="$line_mode_s G.992.5 (ADSL2+),"
>> +       fi
>> +
>> +       if [ $((xtse8 & 7)) != 0  ]; then
>> +               line_mode_s="$line_mode_s G.993.2 (VDSL2),"
>> +       fi
>> +
>> +       #!!! PROPRIETARY & INTERMEDIATE USE !!!
>> +       if [ $((xtse8 & 128)) != 0  ]; then
>> +               line_mode_s="$line_mode_s G.993.1 (VDSL),"
>> +       fi
>> +
>> +       line_mode_s=`echo ${line_mode_s:1}`
>> +       line_mode_s=`echo ${line_mode_s%?}`
>> +
>> +       xtse_s="${xtse1}, ${xtse2}, ${xtse3}, ${xtse4}, ${xtse5},
>> ${xtse6}, ${xtse7}, ${xtse8}"
>> +
>> +       if [ "$action" = "lucistat" ]; then
>> +               echo "dsl.xtse1=$xtse1"
>> +               echo "dsl.xtse2=$xtse2"
>> +               echo "dsl.xtse3=$xtse3"
>> +               echo "dsl.xtse4=$xtse4"
>> +               echo "dsl.xtse5=$xtse5"
>> +               echo "dsl.xtse6=$xtse6"
>> +               echo "dsl.xtse7=$xtse7"
>> +               echo "dsl.xtse8=$xtse8"
>> +               echo "dsl.xtse_s=\"$xtse_s\""
>> +               echo "dsl.annex_s=\"${annex_s}\""
>> +               echo "dsl.line_mode_s=\"${line_mode_s}\""
>> +       else
>> +               echo "XTSE Capabilities:                        ${xtse_s}"
>> +               echo "Annex:
>> ${annex_s}"
>> +               echo "Line Mode:
>> ${line_mode_s}"
>> +       fi
>> +}
>> +
>> +#
>> +# Power Management Mode
>> +#
>> +power_mode() {
>> +       local pmsg=$(dsl_cmd g997pmsg)
>> +       local pm=$(dsl_val "$pmsg" nPowerManagementStatus);
>> +       local s;
>> +
>> +       case "$pm" in
>> +               "-1")           s="Power management state is not
>> available" ;;
>> +               "0")            s="L0 - Synchronized" ;;
>> +               "1")            s="L1 - Power Down Data transmission
>> (G.992.2)" ;;
>> +               "2")            s="L2 - Power Down Data transmission
>> (G.992.3 and G.992.4)" ;;
>> +               "3")            s="L3 - No power" ;;
>> +               *)              s="unknown" ;;
>> +       esac
>> +
>> +       if [ "$action" = "lucistat" ]; then
>> +               echo "dsl.power_mode_num=$pm"
>> +               echo "dsl.power_mode_s=\"$s\""
>> +       else
>> +               echo "Power Management Mode:                    $s"
>> +       fi
>> +}
>> +
>> +#
>> +# Latency type (interleave delay)
>> +#
>> +latency_delay() {
>> +       local csg
>> +
>> +       local idu
>> +       local idu_s;
>> +       local sidu
>> +
>> +       local idd
>> +       local idd_s;
>> +       local sidd
>> +
>> +       csg=$(dsl_cmd g997csg 0 1)
>> +       idd=$(dsl_val "$csg" ActualInterleaveDelay)
>> +
>> +       csg=$(dsl_cmd g997csg 0 0)
>> +       idu=$(dsl_val "$csg" ActualInterleaveDelay)
>> +
>> +       [ -z "$idd" ] && idd=0
>> +       [ -z "$idu" ] && idu=0
>> +
>> +       if [ "$idd" > 100 ]; then
>> +               idd_s="Interleave"
>> +       else
>> +               idd_s="Fast"
>> +       fi
>> +
>> +       if [ "$idu" > 100 ]; then
>> +               idu_s="Interleave"
>> +       else
>> +               idu_s="Fast"
>> +       fi
>> +
>> +       sidu=$(scale_latency $idu)
>> +       sidd=$(scale_latency $idd)
>> +
>> +       if [ "$action" = "lucistat" ]; then
>> +               echo "dsl.latency_num_down=\"$sidu\""
>> +               echo "dsl.latency_num_up=\"$sidd\""
>> +               echo "dsl.latency_s_down=\"$idd_s\""
>> +               echo "dsl.latency_s_up=\"$idu_s\""
>> +       else
>> +               echo "Latency / Interleave Delay:               Down:
>> ${idd_s} (${sidd}) / Up: ${idu_s} (${sidu})"
>> +       fi
>> +}
>> +
>> +#
>> +# Errors
>> +#
>> +errors() {
>> +       local lsctg
>> +       local dpctg
>> +       local ccsg
>> +       local esf
>> +       local esn
>> +       local sesf
>> +       local sesn
>> +       local lossf
>> +       local lossn
>> +       local uasf
>> +       local uasn
>> +
>> +       local crc_pf
>> +       local crc_pn
>> +       local crcp_pf
>> +       local crcp_pn
>> +       local hecf
>> +       local hecn
>> +
>> +       local fecn
>> +       local fecf
>> +
>> +       lsctg=$(dsl_cmd pmlsctg 1)
>> +       esf=$(dsl_val "$lsctg" nES)
>> +       sesf=$(dsl_val "$lsctg" nSES)
>> +       lossf=$(dsl_val "$lsctg" nLOSS)
>> +       uasf=$(dsl_val "$lsctg" nUAS)
>> +
>> +       lsctg=$(dsl_cmd pmlsctg 0)
>> +       esn=$(dsl_val "$lsctg" nES)
>> +       sesn=$(dsl_val "$lsctg" nSES)
>> +       lossn=$(dsl_val "$lsctg" nLOSS)
>> +       uasn=$(dsl_val "$lsctg" nUAS)
>> +
>> +       dpctg=$(dsl_cmd pmdpctg 0 1)
>> +       hecf=$(dsl_val "$dpctg" nHEC)
>> +       crc_pf=$(dsl_val "$dpctg" nCRC_P)
>> +       crcp_pf=$(dsl_val "$dpctg" nCRCP_P)
>> +
>> +       dpctg=$(dsl_cmd pmdpctg 0 0)
>> +       hecn=$(dsl_val "$dpctg" nHEC)
>> +       crc_pn=$(dsl_val "$dpctg" nCRC_P)
>> +       crcp_pn=$(dsl_val "$dpctg" nCRCP_P)
>> +
>> +       ccsg=$(dsl_cmd pmccsg 0 1 0)
>> +       fecf=$(dsl_val "$ccsg" nFEC)
>> +
>> +       ccsg=$(dsl_cmd pmccsg 0 0 0)
>> +       fecn=$(dsl_val "$ccsg" nFEC)
>> +
>> +       if [ "$action" = "lucistat" ]; then
>> +               echo "dsl.errors_fec_near=$fecn"
>> +               echo "dsl.errors_fec_far=$fecf"
>> +               echo "dsl.errors_es_near=$esn"
>> +               echo "dsl.errors_es_far=$esf"
>> +               echo "dsl.errors_ses_near=$sesn"
>> +               echo "dsl.errors_ses_far=$sesf"
>> +               echo "dsl.errors_loss_near=$lossn"
>> +               echo "dsl.errors_loss_far=$lossf"
>> +               echo "dsl.errors_uas_near=$uasn"
>> +               echo "dsl.errors_uas_far=$uasf"
>> +               echo "dsl.errors_hec_near=$hecn"
>> +               echo "dsl.errors_hec_far=$hecf"
>> +               echo "dsl.errors_crc_p_near=$crc_pn"
>> +               echo "dsl.errors_crc_p_far=$crc_pf"
>> +               echo "dsl.errors_crcp_p_near=$crcp_pn"
>> +               echo "dsl.errors_crcp_p_far=$crcp_pf"
>> +       else
>> +               echo "Forward Error Correction Seconds (FECS):  Near:
>> ${fecn} / Far: ${fecf}"
>> +               echo "Errored seconds (ES):                     Near:
>> ${esn} / Far: ${esf}"
>> +               echo "Severely Errored Seconds (SES):           Near:
>> ${sesn} / Far: ${sesf}"
>> +               echo "Loss of Signal Seconds (LOSS):            Near:
>> ${lossn} / Far: ${lossf}"
>> +               echo "Unavailable Seconds (UAS):                Near:
>> ${uasn} / Far: ${uasf}"
>> +               echo "Header Error Code Errors (HEC):           Near:
>> ${hecn} / Far: ${hecf}"
>> +               echo "Non Pre-emtive CRC errors (CRC_P):        Near:
>> ${crcp_pn} / Far: ${crcp_pf}"
>> +               echo "Pre-emtive CRC errors (CRCP_P):           Near:
>> ${crcp_pn} / Far: ${crcp_pf}"
>>         fi
>>   }
>>   @@ -118,11 +460,6 @@ line_uptime() {
>>         [ -z "$et" ] && et=0
>>   -     if [ "$action" = "lucistat" ]; then
>> -               echo "dsl.line_uptime=${et}"
>> -               return
>> -       fi
>> -
>>         d=$(expr $et / 86400)
>>         etr=$(expr $et % 86400)
>>         h=$(expr $etr / 3600)
>> @@ -137,7 +474,16 @@ line_uptime() {
>>         [ "${d}" -ne 0 ] && rc="${d}d ${rc}"
>>         [ -z "$rc" ] && rc="down"
>> -       echo "Line Uptime:              ${rc}"
>> +
>> +
>> +       if [ "$action" = "lucistat" ]; then
>> +               echo "dsl.line_uptime=${et}"
>> +               echo "dsl.line_uptime_s=\"${rc}\""
>> +       else
>> +
>> +               echo "Line Uptime Seconds:                      ${et}"
>> +               echo "Line Uptime:                              ${rc}"
>> +       fi
>>   }
>>     #
>> @@ -147,35 +493,72 @@ line_data() {
>>         local lsg
>>         local latnu
>>         local latnd
>> +       local satnu
>> +       local satnd
>>         local snru
>>         local snrd
>> +       local attndru
>> +       local attndrd
>> +       local sattndru
>> +       local sattndrd
>> +       local actatpu
>> +       local actatpd
>>         lsg=$(dsl_cmd g997lsg 1 1)
>>         latnd=$(dsl_val "$lsg" LATN)
>> +       satnd=$(dsl_val "$lsg" SATN)
>>         snrd=$(dsl_val "$lsg" SNR)
>> +       attndrd=$(dsl_val "$lsg" ATTNDR)
>> +       actatpd=$(dsl_val "$lsg" ACTATP)
>>         lsg=$(dsl_cmd g997lsg 0 1)
>>         latnu=$(dsl_val "$lsg" LATN)
>> +       satnu=$(dsl_val "$lsg" SATN)
>>         snru=$(dsl_val "$lsg" SNR)
>> +       attndru=$(dsl_val "$lsg" ATTNDR)
>> +       actatpu=$(dsl_val "$lsg" ACTATP)
>>         [ -z "$latnd" ] && latnd=0
>>         [ -z "$latnu" ] && latnu=0
>> +       [ -z "$satnd" ] && satnd=0
>> +       [ -z "$satnu" ] && satnu=0
>>         [ -z "$snrd" ] && snrd=0
>>         [ -z "$snru" ] && snru=0
>>         latnd=$(dbt $latnd)
>>         latnu=$(dbt $latnu)
>> +       satnd=$(dbt $satnd)
>> +       satnu=$(dbt $satnu)
>>         snrd=$(dbt $snrd)
>>         snru=$(dbt $snru)
>> +       actatpd=$(dbt $actatpd)
>> +       actatpu=$(dbt $actatpu)
>> +
>> +       [ -z "$attndrd" ] && attndrd=0
>> +       [ -z "$attndru" ] && attndru=0
>> +
>> +       sattndrd=$(scale $attndrd)
>> +       sattndru=$(scale $attndru)
>>
>>         if [ "$action" = "lucistat" ]; then
>>                 echo "dsl.line_attenuation_down=$latnd"
>>                 echo "dsl.line_attenuation_up=$latnu"
>>                 echo "dsl.noise_margin_down=$snrd"
>>                 echo "dsl.noise_margin_up=$snru"
>> +               echo "dsl.signal_attenuation_down=$satnd"
>> +               echo "dsl.signal_attenuation_up=$satnu"
>> +               echo "dsl.actatp_down=$actatpd"
>> +               echo "dsl.actatp_up=$actatpu"
>> +               echo "dsl.max_data_rate_down=$attndrd"
>> +               echo "dsl.max_data_rate_up=$attndru"
>> +               echo "dsl.max_data_rate_down_s=\"$sattndrd\""
>> +               echo "dsl.max_data_rate_up_s=\"$sattndru\""
>>         else
>> -               echo "Line Attenuation: ${latnd}dB / ${latnu}dB"
>> -               echo "Noise Margin:             ${snrd}dB / ${snru}dB"
>> +               echo "Line Attenuation (LATN):                  Down:
>> ${latnd}dB / Up: ${latnu}dB"
>> +               echo "Signal Attenuation (SATN):                Down:
>> ${satnd}dB / Up: ${satnu}dB"
>> +               echo "Noise Margin (SNR):                       Down:
>> ${snrd}dB / Up: ${snru}dB"
>> +               echo "Aggregate Transmit Power(ACTATP):         Down:
>> ${actatpd}dB / Up: ${actatpu}dB"
>> +               echo "Max. Attainable Data Rate (ATTNDR):       Down:
>> ${sattndrd}/s / Up: ${sattndru}/s"
>>         fi
>>   }
>>   @@ -226,16 +609,21 @@ line_state() {
>>                 fi
>>         else
>>                 if [ "$ls" = "0x801" ]; then
>> -                       echo "Line State:               UP [$ls: $s]"
>> +                       echo "Line State:                               UP
>> [$ls: $s]"
>>                 else
>> -                       echo "Line State:               DOWN [$ls: $s]"
>> +                       echo "Line State:
>> DOWN [$ls: $s]"
>>                 fi
>>         fi
>>   }
>
>
> Above change intrigues me a lot.
> Is this patch intended whitespace broken or by mistake every "tab is
> converted into "space"?
>
>
>>     status() {
>> +       vendor
>>         chipset
>> +       xtse
>>         line_state
>> +       errors
>> +       power_mode
>> +       latency_delay
>>         data_rates
>>         line_data
>>         line_uptime
>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bapclenet at gmail.com  Thu Aug  6 05:52:27 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Thu, 6 Aug 2015 11:52:27 +0200
Subject: [OpenWrt-Devel] getaddrinfo breaks with IPV6 and IPV4
Message-ID: <CAPpUg6PA7GLGEZg2v86udegkFRx_3VLMAUBFadE-vbEsX+h8gg@mail.gmail.com>

Hi,

I try to use getaddrinfo() function and I send as parameters:

  static char addrstr[256] = "::1";
  struct addrinfo *res, *ainfo;
  struct addrinfo hints;
  memset ((char *)&hints, 0, sizeof(hints));
  hints.ai_socktype = SOCK_DGRAM;
  hints.ai_family = AF_UNSPEC;

  int error = getaddrinfo(addrstr, "", &hints, &res);

  if (error != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(error));
    return error;
  }


And it gives me:
getaddrinfo: Unrecognized service

I tried with an IPV4 address, same problem. Do you know which
implementation of getaddrinfo OpenWRT use?

Regards,

-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From cristian at samknows.com  Thu Aug  6 06:02:31 2015
From: cristian at samknows.com (Cristian Morales Vega)
Date: Thu, 6 Aug 2015 11:02:31 +0100
Subject: [OpenWrt-Devel] getaddrinfo breaks with IPV6 and IPV4
In-Reply-To: <CAPpUg6PA7GLGEZg2v86udegkFRx_3VLMAUBFadE-vbEsX+h8gg@mail.gmail.com>
References: <CAPpUg6PA7GLGEZg2v86udegkFRx_3VLMAUBFadE-vbEsX+h8gg@mail.gmail.com>
Message-ID: <CAGUfO+wzVWTKnqVriAbN1i15QE1cDteTHoFNWhfFw5zB7yLbUA@mail.gmail.com>

On 6 August 2015 at 10:52, Baptiste Clenet <bapclenet at gmail.com> wrote:
> Hi,
>
> I try to use getaddrinfo() function and I send as parameters:
>
>   static char addrstr[256] = "::1";
>   struct addrinfo *res, *ainfo;
>   struct addrinfo hints;
>   memset ((char *)&hints, 0, sizeof(hints));
>   hints.ai_socktype = SOCK_DGRAM;
>   hints.ai_family = AF_UNSPEC;
>
>   int error = getaddrinfo(addrstr, "", &hints, &res);
>
>   if (error != 0) {
>     fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(error));
>     return error;
>   }
>
>
> And it gives me:
> getaddrinfo: Unrecognized service
>
> I tried with an IPV4 address, same problem. Do you know which
> implementation of getaddrinfo OpenWRT use?

Why should it recognize the "" service? Give it the service you want
to use, or NULL.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bapclenet at gmail.com  Thu Aug  6 06:08:48 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Thu, 6 Aug 2015 12:08:48 +0200
Subject: [OpenWrt-Devel] getaddrinfo breaks with IPV6 and IPV4
In-Reply-To: <CAPpUg6PA7GLGEZg2v86udegkFRx_3VLMAUBFadE-vbEsX+h8gg@mail.gmail.com>
References: <CAPpUg6PA7GLGEZg2v86udegkFRx_3VLMAUBFadE-vbEsX+h8gg@mail.gmail.com>
Message-ID: <CAPpUg6OiD3iNZG87Pny-A694Hk34-LmhDuq_Kv6KEYkzve7ZUQ@mail.gmail.com>

2015-08-06 11:52 GMT+02:00 Baptiste Clenet <bapclenet at gmail.com>:
> Hi,
>
> I try to use getaddrinfo() function and I send as parameters:
>
>   static char addrstr[256] = "::1";
>   struct addrinfo *res, *ainfo;
>   struct addrinfo hints;
>   memset ((char *)&hints, 0, sizeof(hints));
>   hints.ai_socktype = SOCK_DGRAM;
>   hints.ai_family = AF_UNSPEC;
>
>   int error = getaddrinfo(addrstr, "", &hints, &res);
Found my error, change "" to NULL make the deal! getaadrinfo can't
read "" service.

>
>   if (error != 0) {
>     fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(error));
>     return error;
>   }
>
>
> And it gives me:
> getaddrinfo: Unrecognized service
>
> I tried with an IPV4 address, same problem. Do you know which
> implementation of getaddrinfo OpenWRT use?
>
> Regards,
>
> --
> Baptiste



-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bapclenet at gmail.com  Thu Aug  6 06:09:40 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Thu, 6 Aug 2015 12:09:40 +0200
Subject: [OpenWrt-Devel] getaddrinfo breaks with IPV6 and IPV4
In-Reply-To: <CAGUfO+wzVWTKnqVriAbN1i15QE1cDteTHoFNWhfFw5zB7yLbUA@mail.gmail.com>
References: <CAPpUg6PA7GLGEZg2v86udegkFRx_3VLMAUBFadE-vbEsX+h8gg@mail.gmail.com>
 <CAGUfO+wzVWTKnqVriAbN1i15QE1cDteTHoFNWhfFw5zB7yLbUA@mail.gmail.com>
Message-ID: <CAPpUg6PiEuGT+6bGsiBqEFGsGWTVu5yjfQn8cGccssePP0dDAQ@mail.gmail.com>

2015-08-06 12:02 GMT+02:00 Cristian Morales Vega <cristian at samknows.com>:
> On 6 August 2015 at 10:52, Baptiste Clenet <bapclenet at gmail.com> wrote:
>> Hi,
>>
>> I try to use getaddrinfo() function and I send as parameters:
>>
>>   static char addrstr[256] = "::1";
>>   struct addrinfo *res, *ainfo;
>>   struct addrinfo hints;
>>   memset ((char *)&hints, 0, sizeof(hints));
>>   hints.ai_socktype = SOCK_DGRAM;
>>   hints.ai_family = AF_UNSPEC;
>>
>>   int error = getaddrinfo(addrstr, "", &hints, &res);
>>
>>   if (error != 0) {
>>     fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(error));
>>     return error;
>>   }
>>
>>
>> And it gives me:
>> getaddrinfo: Unrecognized service
>>
>> I tried with an IPV4 address, same problem. Do you know which
>> implementation of getaddrinfo OpenWRT use?
>
> Why should it recognize the "" service? Give it the service you want
> to use, or NULL.
Yes, I've just found it as well, it was the reason, thanks anyway.


-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From lynxis at fe80.eu  Thu Aug  6 07:01:34 2015
From: lynxis at fe80.eu (Alexander Couzens)
Date: Thu,  6 Aug 2015 13:01:34 +0200
Subject: [OpenWrt-Devel] [PATCH] ustream-ssl: make ustream_ssl.server_name
	const
Message-ID: <1438858894-5072-1-git-send-email-lynxis@fe80.eu>

Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 ustream-ssl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi Felix,

can you please update CC too? BB would be also nice, if 
it still maintained.
Follow-up patch for uclient-fetch will fix SNI.

Best,
lynxis

diff --git a/ustream-ssl.h b/ustream-ssl.h
index 0c55344..7787788 100644
--- a/ustream-ssl.h
+++ b/ustream-ssl.h
@@ -34,7 +34,7 @@ struct ustream_ssl {
 	void *ssl;
 
 	char *peer_cn;
-	char *server_name;
+	const char *server_name;
 
 	int error;
 	bool connected;
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From lynxis at fe80.eu  Thu Aug  6 07:02:47 2015
From: lynxis at fe80.eu (Alexander Couzens)
Date: Thu,  6 Aug 2015 13:02:47 +0200
Subject: [OpenWrt-Devel] [PATCH] uclient-fetch: set server_name of the ssl
	context to support SNI
Message-ID: <1438858967-5421-1-git-send-email-lynxis@fe80.eu>

Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 uclient-http.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/uclient-http.c b/uclient-http.c
index d96094d..4300d05 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -826,6 +826,7 @@ static int uclient_setup_https(struct uclient_http *uh)
 	uh->ussl.notify_error = uclient_ssl_notify_error;
 	uh->ussl.notify_verify_error = uclient_ssl_notify_verify_error;
 	uh->ussl.notify_connected = uclient_ssl_notify_connected;
+	uh->ussl.server_name = uh->uc.url->host;
 	uh->ssl_ops->init(&uh->ussl, &uh->ufd.stream, uh->ssl_ctx, false);
 	uh->ssl_ops->set_peer_cn(&uh->ussl, uh->uc.url->host);
 
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Thu Aug  6 09:24:18 2015
From: kerry9842 at gmail.com (John kerry)
Date: Thu, 6 Aug 2015 21:24:18 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
Message-ID: <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>

Hi,

I have configured wireless as below:















*config wifi-device 'wifi0'        option type 'qcawifi'        option
channel 'auto'        option macaddr '00:03:7f:42:06:61'        option
hwmode '11ng'        option txpower '19'        option htmode 'HT20'config
wifi-iface        option device 'wifi0'        option network 'lan'
option mode 'ap'        option encryption 'psk2'        option ssid
'Test_ap_1'        option key **'Test_ap_1'*



*It works fine with WPA2 key but when i try to connect another router this
will become as client and SSID will change to that router SSID as i
mentioned before also.*


*As i understand we can create one more to avoid this problem as explained
in previous mail.*

*Basically i need that when i connect to wireless WAN, the LAN SSID should
not change. I am using AR9344. Can i use below script for my requirement.*

config wifi-device 'radio0'
>>                 option type 'mac80211'
>>                 option channel '11'
>>                 option hwmode '11g'
>>                 option path 'platform/ar933x_wmac'
>>                 option htmode 'HT20'
>>                 option country 'US'
>>                 option txpower '20'
>>
>>         config wifi-iface 'ap1'
>>                 option device 'radio0'
>>                 option mode 'ap'
>>                 option wds '1'
>>                 option ssid 'my AP'
>>                 option network 'lan'
>>
>>         config wifi-iface 'mesh1'
>>                 option device 'radio0'
>>                 option mode 'mesh'
>>                 option mesh_id 'my mesh'
>>                 option network 'lan'


Thanks & Regards,

On Wed, Aug 5, 2015 at 7:00 AM, Roman Yeryomin <leroi.lists at gmail.com>
wrote:

> On 4 August 2015 at 23:24, Joshua Judson Rosen <jrosen at harvestai.com>
> wrote:
> > On 2015-08-04 14:14, Roman Yeryomin wrote:
> >> On 4 August 2015 at 17:58, Joshua Judson Rosen <jrosen at harvestai.com>
> wrote:
> >>> On 2015-08-04 02:26, David Lang wrote:
> >>>> A given radio can be either an AP or a client, but not both at once.
> >>>>
> >>>> so if you use a radio to connect to another AP, you are making it a
> client, and
> >>>> in client mode all it can do is connect to that other AP as shows up
> as the SSID
> >>>> of that other AP.
> >>>>
> >>>> you can do this with one radio, while using the other radio (assuming
> you have
> >>>> two) to act as an AP for local clients.
> >>>
> >>>
> >>> This is not necessarily true: with at least some hardware/drivers, it's
> >>> possible to create multiple virtual interfaces on top of a single
> radio--
> >>> and separate virtual interfaces can in fact operate in different modes
> >>> (e.g.: one in STA mode, two in AP mode, one in mesh mode...).
> >>>
> >>> Assuming that your hardware/driver is capable of supporting multiple
> >>> virtual interfaces on top of the single physical radio,
> >>> you can create these interfaces by adding "wifi-iface" stanzas
> >>> in /etc/config/wireless, e.g:
> >>>
> >>>         config wifi-device 'radio0'
> >>>                 option type 'mac80211'
> >>>                 option channel '11'
> >>>                 option hwmode '11g'
> >>>                 option path 'platform/ar933x_wmac'
> >>>                 option htmode 'HT20'
> >>>                 option country 'US'
> >>>                 option txpower '20'
> >>>
> >>>         config wifi-iface 'ap1'
> >>>                 option device 'radio0'
> >>>                 option mode 'ap'
> >>>                 option wds '1'
> >>>                 option ssid 'my AP'
> >>>                 option network 'lan'
> >>>
> >>>         config wifi-iface 'mesh1'
> >>>                 option device 'radio0'
> >>>                 option mode 'mesh'
> >>>                 option mesh_id 'my mesh'
> >>>                 option network 'lan'
> >>>
> >>>
> >>> That creates two virtual interfaces using the same physical radio,
> >>> and bridges them together onto the OpenWrt "lan network"
> >>> (which is itself defined in /etc/config/network).
> >>>
> >>>
> >>> I believe you could also have an interface with "mode 'sta'", but note
> >>> that it would also need to use the same channel as the other
> interfaces--
> >>> which means that the external AP to which you connect it would also
> >>> need to use that same channel (11, in the example above).
> >>> That's where having multiple *radios* helps: you can run them on
> >>> different frequencies (either completely different bands [2.4 GHz vs.
> 5 GHz],
> >>> or on different channels within the same band [e.g. 2.427 GHz =
> channel 4
> >>> vs. 2.472 GHz = channel 13]) to increase efficiency by multiplexing
> >>> less data over a single radio, or to increase compatibility with other
> >>> APs outside of your control that you might want to connect to.
> >>>
> >>> Also note that, if you want to bridge a STA interface onto anything
> else,
> >>> it'll need to be in "WDS" mode _and_ the the AP to which it's
> connecting
> >>> will also need to be in "WDS" mode (note the "option wds '1'",
> >>> in my example above), because the standard "3-address mode" of Wi-Fi
> >>> isn't bridgeable (and note that WDS "4-address mode" is bridgeable,
> >>> but not standardised across different platforms--so you're probably
> >>> OK so long as all of your equipment is running Linux and using
> >>> the same Wi-Fi driver, but don't expect to bridge a STA interface
> >>> that's connected non-Linux Wi-Fi router).
> >>>
> >>> At least, I've seen this work with Atheros chips. There are some
> >>> notes in the wiki about how Broadcom chips have their own, different
> >>> solution implemented in hardware; and about how some drivers
> >>> don't support this stuff at all....
> >>
> >> Actually 3-address mode bridging is possible with the help of relayd
> >
> > That's not actually "3-address mode bridging", though--
> > it's relaying (done entirely through a userspace daemon,
> > which AFAICT actually relays only IPv4, ARP, and DHCP packets).
>
> OK, yes technically it's not bridging :)
>
> >> and it even works quite good.
> >> But there is an issue (also mentioned in a parallel thread): when
> >> client interface cannot connect then AP interface doesn't come up
> >> also. Which may not be a problem unless you want to bridge ethernet
> >> there also.
> >> On the other hand you may not be able to switch the main AP into
> >> 4-address mode so relayd is a way out.
> >
> > It may be a solution.
> >
> > When I tried it a few months back (in Barrier Breaker),
> > relayd wasn't really working for me....
> >
> > I know that's a terrible (non-)description; I don't specifically
> > remember what seemed to be going wrong, except that there was
> > a lot of traffic not reliably getting through to where it was supposed
> to,
> > and that it was confusing, and that I was able to slightly improve
> > the situation by fiddling with some of the options that the init-script
> > passed to relayd (IIRC, I had some success using "-I" on only one
> interface
> > and "-i" on the other), but I didn't have time to dig in and actually
> > understand what wasn't working--just switching to 4-address mode and
> having
> > OpenWrt set up a kernel-level bridge w/ brctl was a more expedient
> > path for me to get something working reliably at the time.
> >
> > Actually, if anyone can offer guesses as to what my issues
> > with relayd might have actually been, I'd be glad to hear them :)
> >
> > I'm not specifically aware of a reason why IPv4+ARP+DHCP relaying
> > should have been insufficient for what I was doing (I wasn't
> > running any weird non-IP protocols...).
> >
> > Maybe someone can point me to a basic explanation of what
> > sort of "ARP cache and host route management" the "-I" option
> > is actually doing--and why I might need to disable it on one
> > of my interfaces?
> >
>
> I was using trunk around March-April this year and didn't have any
> problems. So I would suggest just trying newer version.
>
>
> Regards,
> Roman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/f055f7e2/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From sscapi at gmail.com  Thu Aug  6 10:01:28 2015
From: sscapi at gmail.com (Sylwek ScApi)
Date: Thu, 6 Aug 2015 16:01:28 +0200
Subject: [OpenWrt-Devel] [PATCH v3] lantiq: get more status information
 from xDSL
In-Reply-To: <CALPCC5wd1x65PxN9FhKs1gDGhzgUCpTqmdevCPHbtQz80k16kw@mail.gmail.com>
References: <1438839704-7187-1-git-send-email-Eckert.Florian@googlemail.com>
 <55C3099B.20807@gmail.com>
 <CALPCC5wd1x65PxN9FhKs1gDGhzgUCpTqmdevCPHbtQz80k16kw@mail.gmail.com>
Message-ID: <CAJSWe5ZaLfNh2Jd08fJsn0=xWCFqZXYBQ+p7j-Bm-UkGqwOsoA@mail.gmail.com>

I don't know that You done something wrong, You misunderstood me, as
example We will use this part of patch:
:
@@ -226,16 +609,21 @@ line_state() {
                fi
        else
                if [ "$ls" = "0x801" ]; then
-                       echo "Line State:               UP [$ls: $s]"
+                       echo "Line State:                               UP
[$ls: $s]"
                else
-                       echo "Line State:               DOWN [$ls: $s]"
+                       echo "Line State:
 DOWN [$ls: $s]"
                fi
        fi
 }

Why You replace tab separated "words" with space separated "words" ?

Patch is send correctly but why replace "tabs" ?

My thunderbird is white space broken so You need to look in Your source
patch for reference.

Best Regards

2015-08-06 11:52 GMT+02:00 Florian Eckert <eckert.florian at googlemail.com>:

> Hello Petela
>
> sorry but i dont understand your question!
>
> I checked out openwrt with git and edited the file. After that i made
> "git format-patch -1" and then "git send-email --to
> openwrt-devel at lists.openwrt.org
> 0001-lantiq-get-more-status-information-from-xDSL.patch". I used the
> same whitespaces in this file as in the other functions of this file
> -> in this case it was an tab. What did i made wrong?
>
> Kind Regards Flo
>
> 2015-08-06 9:15 GMT+02:00 Sylwester Petela <sscapi at gmail.com>:
> > W dniu 2015-08-06 o 07:41, feckert pisze:
> >
> >> Signed-off-by: Florian Eckert <Eckert.Florian at googlemail.com>
> >> Signed-off-by: Helge Mader <hmader at tdt.de>
> >> Tested-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
> >> Tested-by: Andre Heider <a.heider at gmail.com>
> >> ---
> >>
> >> v2 fix annex and line mode comma
> >> v2 fix latency to ms
> >> v3 fix latency syntax quotation error "x ms"
> >> v3 fix echo "----" separation removed from status function
> >>
> >>   .../lantiq/base-files/lib/functions/lantiq_dsl.sh  |  412
> >> +++++++++++++++++++-
> >>   1 file changed, 400 insertions(+), 12 deletions(-)
> >>   mode change 100644 => 100755
> >> target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
> >>
> >> diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
> >> b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
> >> old mode 100644
> >> new mode 100755
> >> index 56b8652..7809d01
> >> --- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
> >> +++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
> >> @@ -19,6 +19,9 @@ dsl_cmd() {
> >>   dsl_val() {
> >>         echo $(expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*')
> >>   }
> >> +dsl_string() {
> >> +       echo $(expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))')
> >> +}
> >>     #
> >>   # Simple divide by 10 routine to cope with one decimal place
> >> @@ -49,6 +52,16 @@ scale() {
> >>         fi
> >>   }
> >>   +scale_latency() {
> >> +       local val=$1
> >> +       local a
> >> +       local b
> >> +
> >> +       a=$(expr $val / 100)
> >> +       b=$(expr $val % 100)
> >> +       printf "%d.%d ms" ${a} ${b}
> >> +}
> >> +
> >>   #
> >>   # Read the data rates for both directions
> >>   #
> >> @@ -77,7 +90,7 @@ data_rates() {
> >>                 echo "dsl.data_rate_down_s=\"$sdrd\""
> >>                 echo "dsl.data_rate_up_s=\"$sdru\""
> >>         else
> >> -               echo "Data Rate:                ${sdrd}/s / ${sdru}/s"
> >> +               echo "Data Rate:                                Down:
> >> ${sdrd}/s / Up: ${sdru}/s"
> >>         fi
> >>   }
> >>   @@ -92,11 +105,340 @@ chipset() {
> >>         vig=$(dsl_cmd vig)
> >>         cs=$(dsl_val "$vig" DSL_ChipSetType)
> >>         csv=$(dsl_val "$vig" DSL_ChipSetHWVersion)
> >> +       csfw=$(dsl_val "$vig" DSL_ChipSetFWVersion)
> >> +       csapi=$(dsl_val "$vig" DSL_DriverVersionApi)
> >>         if [ "$action" = "lucistat" ]; then
> >>                 echo "dsl.chipset=\"${cs} ${csv}\""
> >> +               echo "dsl.firmware_version=\"${csfw}\""
> >> +               echo "dsl.api_version=\"${csapi}\""
> >>         else
> >> -               echo "Chipset:          ${cs} ${csv}"
> >> +               echo "Chipset:                                  ${cs}
> >> ${csv}"
> >> +               echo "Firmware Version:                         ${csfw}"
> >> +               echo "API Version:
> ${csapi}"
> >> +       fi
> >> +}
> >> +
> >> +#
> >> +# Vendor information
> >> +#
> >> +vendor() {
> >> +       local lig
> >> +       local vid
> >> +       local svid
> >> +
> >> +       lig=$(dsl_cmd g997lig 1)
> >> +       vid=$(dsl_string "$lig" G994VendorID)
> >> +       svid=$(dsl_string "$lig" SystemVendorID)
> >> +
> >> +       if [ "$action" = "lucistat" ]; then
> >> +               echo "dsl.atuc_vendor_id=\"${vid}\""
> >> +               echo "dsl.atuc_system_vendor_id=\"${svid}\""
> >> +       else
> >> +               echo "ATU-C Vendor ID:                          ${vid}"
> >> +               echo "ATU-C System Vendor ID:                   ${svid}"
> >> +       fi
> >> +}
> >> +
> >> +#
> >> +# XTSE capabilities
> >> +#
> >> +xtse() {
> >> +       local xtusesg
> >> +       local xtse1
> >> +       local xtse2
> >> +       local xtse3
> >> +       local xtse4
> >> +       local xtse5
> >> +       local xtse6
> >> +       local xtse7
> >> +       local xtse8
> >> +
> >> +       local xtse_s=""
> >> +
> >> +       local annex_s=""
> >> +       local line_mode_s=""
> >> +       local cmd=""
> >> +
> >> +       xtusesg=$(dsl_cmd g997xtusesg)
> >> +       xtse1=$(dsl_val "$xtusesg" XTSE1)
> >> +       xtse2=$(dsl_val "$xtusesg" XTSE2)
> >> +       xtse3=$(dsl_val "$xtusesg" XTSE3)
> >> +       xtse4=$(dsl_val "$xtusesg" XTSE4)
> >> +       xtse5=$(dsl_val "$xtusesg" XTSE5)
> >> +       xtse6=$(dsl_val "$xtusesg" XTSE6)
> >> +       xtse7=$(dsl_val "$xtusesg" XTSE7)
> >> +       xtse8=$(dsl_val "$xtusesg" XTSE8)
> >> +
> >> +       # Evaluate Annex (according to G.997.1, 7.3.1.1.1)
> >> +       if [ $((xtse1 & 13)) != 0 \
> >> +       -o $((xtse2 & 1)) != 0 \
> >> +       -o $((xtse3 & 12)) != 0 \
> >> +       -o $((xtse4 & 3)) != 0 \
> >> +       -o $((xtse6 & 3)) != 0 \
> >> +       -o $((xtse8 & 1)) != 0 ]; then
> >> +               annex_s=" A,"
> >> +       fi
> >> +
> >> +       if [ $((xtse1 & 48)) != 0 \
> >> +       -o $((xtse2 & 2)) != 0 \
> >> +       -o $((xtse3 & 48)) != 0 \
> >> +       -o $((xtse6 & 12)) != 0 \
> >> +       -o $((xtse8 & 2)) != 0 ]; then
> >> +               annex_s="$annex_s B,"
> >> +       fi
> >> +
> >> +       if [ $((xtse1 & 194)) != 0 \
> >> +       -o $((xtse2 & 12)) != 0 \
> >> +       -o $((xtse8 & 4)) != 0 ]; then
> >> +               annex_s="$annex_s C,"
> >> +       fi
> >> +
> >> +       if [ $((xtse4 & 48)) != 0 \
> >> +       -o $((xtse5 & 3)) != 0 \
> >> +       -o $((xtse6 & 192)) != 0 ]; then
> >> +               annex_s="$annex_s I,"
> >> +       fi
> >> +
> >> +       if [ $((xtse4 & 192)) != 0 \
> >> +       -o $((xtse7 & 3)) != 0 ]; then
> >> +               annex_s="$annex_s J,"
> >> +       fi
> >> +
> >> +       if [ $((xtse5 & 60)) != 0 ]; then
> >> +               annex_s="$annex_s L,"
> >> +       fi
> >> +
> >> +       if [ $((xtse5 & 192)) != 0 \
> >> +       -o $((xtse7 & 12)) != 0 ]; then
> >> +               annex_s="$annex_s M,"
> >> +       fi
> >> +
> >> +       annex_s=`echo ${annex_s:1}`
> >> +       annex_s=`echo ${annex_s%?}`
> >> +
> >> +       # Evaluate Line Mode (according to G.997.1, 7.3.1.1.1)
> >> +
> >> +       # Regional standard: ANSI T1.413
> >> +       if [ $((xtse1 & 1)) != 0  ]; then
> >> +               line_mode_s=" T1.413,"
> >> +       fi
> >> +
> >> +       # Regional standard: TS 101 388
> >> +       if [ $((xtse1 & 1)) != 0  ]; then
> >> +               line_mode_s="$line_mode_s TS 101 388,"
> >> +       fi
> >> +
> >> +       if [ $((xtse1 & 252)) != 0  ]; then
> >> +               line_mode_s="$line_mode_s G.992.1 (ADSL),"
> >> +       fi
> >> +
> >> +       if [ $((xtse2 & 15)) != 0  ]; then
> >> +               line_mode_s="$line_mode_s G.992.2 (ADSL lite),"
> >> +       fi
> >> +
> >> +       if [ $((xtse3 & 60)) != 0 \
> >> +       -o $((xtse4 & 240)) != 0 \
> >> +       -o $((xtse5 & 252)) != 0  ]; then
> >> +               line_mode_s="$line_mode_s G.992.3 (ADSL2),"
> >> +       fi
> >> +
> >> +       if [ $((xtse4 & 3)) != 0 \
> >> +       -o $((xtse5 & 3)) != 0  ]; then
> >> +               line_mode_s="$line_mode_s G.992.4 (ADSL2 lite),"
> >> +       fi
> >> +
> >> +       if [ $((xtse6 & 199)) != 0 \
> >> +       -o $((xtse7 & 15)) != 0  ]; then
> >> +               line_mode_s="$line_mode_s G.992.5 (ADSL2+),"
> >> +       fi
> >> +
> >> +       if [ $((xtse8 & 7)) != 0  ]; then
> >> +               line_mode_s="$line_mode_s G.993.2 (VDSL2),"
> >> +       fi
> >> +
> >> +       #!!! PROPRIETARY & INTERMEDIATE USE !!!
> >> +       if [ $((xtse8 & 128)) != 0  ]; then
> >> +               line_mode_s="$line_mode_s G.993.1 (VDSL),"
> >> +       fi
> >> +
> >> +       line_mode_s=`echo ${line_mode_s:1}`
> >> +       line_mode_s=`echo ${line_mode_s%?}`
> >> +
> >> +       xtse_s="${xtse1}, ${xtse2}, ${xtse3}, ${xtse4}, ${xtse5},
> >> ${xtse6}, ${xtse7}, ${xtse8}"
> >> +
> >> +       if [ "$action" = "lucistat" ]; then
> >> +               echo "dsl.xtse1=$xtse1"
> >> +               echo "dsl.xtse2=$xtse2"
> >> +               echo "dsl.xtse3=$xtse3"
> >> +               echo "dsl.xtse4=$xtse4"
> >> +               echo "dsl.xtse5=$xtse5"
> >> +               echo "dsl.xtse6=$xtse6"
> >> +               echo "dsl.xtse7=$xtse7"
> >> +               echo "dsl.xtse8=$xtse8"
> >> +               echo "dsl.xtse_s=\"$xtse_s\""
> >> +               echo "dsl.annex_s=\"${annex_s}\""
> >> +               echo "dsl.line_mode_s=\"${line_mode_s}\""
> >> +       else
> >> +               echo "XTSE Capabilities:
> ${xtse_s}"
> >> +               echo "Annex:
> >> ${annex_s}"
> >> +               echo "Line Mode:
> >> ${line_mode_s}"
> >> +       fi
> >> +}
> >> +
> >> +#
> >> +# Power Management Mode
> >> +#
> >> +power_mode() {
> >> +       local pmsg=$(dsl_cmd g997pmsg)
> >> +       local pm=$(dsl_val "$pmsg" nPowerManagementStatus);
> >> +       local s;
> >> +
> >> +       case "$pm" in
> >> +               "-1")           s="Power management state is not
> >> available" ;;
> >> +               "0")            s="L0 - Synchronized" ;;
> >> +               "1")            s="L1 - Power Down Data transmission
> >> (G.992.2)" ;;
> >> +               "2")            s="L2 - Power Down Data transmission
> >> (G.992.3 and G.992.4)" ;;
> >> +               "3")            s="L3 - No power" ;;
> >> +               *)              s="unknown" ;;
> >> +       esac
> >> +
> >> +       if [ "$action" = "lucistat" ]; then
> >> +               echo "dsl.power_mode_num=$pm"
> >> +               echo "dsl.power_mode_s=\"$s\""
> >> +       else
> >> +               echo "Power Management Mode:                    $s"
> >> +       fi
> >> +}
> >> +
> >> +#
> >> +# Latency type (interleave delay)
> >> +#
> >> +latency_delay() {
> >> +       local csg
> >> +
> >> +       local idu
> >> +       local idu_s;
> >> +       local sidu
> >> +
> >> +       local idd
> >> +       local idd_s;
> >> +       local sidd
> >> +
> >> +       csg=$(dsl_cmd g997csg 0 1)
> >> +       idd=$(dsl_val "$csg" ActualInterleaveDelay)
> >> +
> >> +       csg=$(dsl_cmd g997csg 0 0)
> >> +       idu=$(dsl_val "$csg" ActualInterleaveDelay)
> >> +
> >> +       [ -z "$idd" ] && idd=0
> >> +       [ -z "$idu" ] && idu=0
> >> +
> >> +       if [ "$idd" > 100 ]; then
> >> +               idd_s="Interleave"
> >> +       else
> >> +               idd_s="Fast"
> >> +       fi
> >> +
> >> +       if [ "$idu" > 100 ]; then
> >> +               idu_s="Interleave"
> >> +       else
> >> +               idu_s="Fast"
> >> +       fi
> >> +
> >> +       sidu=$(scale_latency $idu)
> >> +       sidd=$(scale_latency $idd)
> >> +
> >> +       if [ "$action" = "lucistat" ]; then
> >> +               echo "dsl.latency_num_down=\"$sidu\""
> >> +               echo "dsl.latency_num_up=\"$sidd\""
> >> +               echo "dsl.latency_s_down=\"$idd_s\""
> >> +               echo "dsl.latency_s_up=\"$idu_s\""
> >> +       else
> >> +               echo "Latency / Interleave Delay:               Down:
> >> ${idd_s} (${sidd}) / Up: ${idu_s} (${sidu})"
> >> +       fi
> >> +}
> >> +
> >> +#
> >> +# Errors
> >> +#
> >> +errors() {
> >> +       local lsctg
> >> +       local dpctg
> >> +       local ccsg
> >> +       local esf
> >> +       local esn
> >> +       local sesf
> >> +       local sesn
> >> +       local lossf
> >> +       local lossn
> >> +       local uasf
> >> +       local uasn
> >> +
> >> +       local crc_pf
> >> +       local crc_pn
> >> +       local crcp_pf
> >> +       local crcp_pn
> >> +       local hecf
> >> +       local hecn
> >> +
> >> +       local fecn
> >> +       local fecf
> >> +
> >> +       lsctg=$(dsl_cmd pmlsctg 1)
> >> +       esf=$(dsl_val "$lsctg" nES)
> >> +       sesf=$(dsl_val "$lsctg" nSES)
> >> +       lossf=$(dsl_val "$lsctg" nLOSS)
> >> +       uasf=$(dsl_val "$lsctg" nUAS)
> >> +
> >> +       lsctg=$(dsl_cmd pmlsctg 0)
> >> +       esn=$(dsl_val "$lsctg" nES)
> >> +       sesn=$(dsl_val "$lsctg" nSES)
> >> +       lossn=$(dsl_val "$lsctg" nLOSS)
> >> +       uasn=$(dsl_val "$lsctg" nUAS)
> >> +
> >> +       dpctg=$(dsl_cmd pmdpctg 0 1)
> >> +       hecf=$(dsl_val "$dpctg" nHEC)
> >> +       crc_pf=$(dsl_val "$dpctg" nCRC_P)
> >> +       crcp_pf=$(dsl_val "$dpctg" nCRCP_P)
> >> +
> >> +       dpctg=$(dsl_cmd pmdpctg 0 0)
> >> +       hecn=$(dsl_val "$dpctg" nHEC)
> >> +       crc_pn=$(dsl_val "$dpctg" nCRC_P)
> >> +       crcp_pn=$(dsl_val "$dpctg" nCRCP_P)
> >> +
> >> +       ccsg=$(dsl_cmd pmccsg 0 1 0)
> >> +       fecf=$(dsl_val "$ccsg" nFEC)
> >> +
> >> +       ccsg=$(dsl_cmd pmccsg 0 0 0)
> >> +       fecn=$(dsl_val "$ccsg" nFEC)
> >> +
> >> +       if [ "$action" = "lucistat" ]; then
> >> +               echo "dsl.errors_fec_near=$fecn"
> >> +               echo "dsl.errors_fec_far=$fecf"
> >> +               echo "dsl.errors_es_near=$esn"
> >> +               echo "dsl.errors_es_far=$esf"
> >> +               echo "dsl.errors_ses_near=$sesn"
> >> +               echo "dsl.errors_ses_far=$sesf"
> >> +               echo "dsl.errors_loss_near=$lossn"
> >> +               echo "dsl.errors_loss_far=$lossf"
> >> +               echo "dsl.errors_uas_near=$uasn"
> >> +               echo "dsl.errors_uas_far=$uasf"
> >> +               echo "dsl.errors_hec_near=$hecn"
> >> +               echo "dsl.errors_hec_far=$hecf"
> >> +               echo "dsl.errors_crc_p_near=$crc_pn"
> >> +               echo "dsl.errors_crc_p_far=$crc_pf"
> >> +               echo "dsl.errors_crcp_p_near=$crcp_pn"
> >> +               echo "dsl.errors_crcp_p_far=$crcp_pf"
> >> +       else
> >> +               echo "Forward Error Correction Seconds (FECS):  Near:
> >> ${fecn} / Far: ${fecf}"
> >> +               echo "Errored seconds (ES):                     Near:
> >> ${esn} / Far: ${esf}"
> >> +               echo "Severely Errored Seconds (SES):           Near:
> >> ${sesn} / Far: ${sesf}"
> >> +               echo "Loss of Signal Seconds (LOSS):            Near:
> >> ${lossn} / Far: ${lossf}"
> >> +               echo "Unavailable Seconds (UAS):                Near:
> >> ${uasn} / Far: ${uasf}"
> >> +               echo "Header Error Code Errors (HEC):           Near:
> >> ${hecn} / Far: ${hecf}"
> >> +               echo "Non Pre-emtive CRC errors (CRC_P):        Near:
> >> ${crcp_pn} / Far: ${crcp_pf}"
> >> +               echo "Pre-emtive CRC errors (CRCP_P):           Near:
> >> ${crcp_pn} / Far: ${crcp_pf}"
> >>         fi
> >>   }
> >>   @@ -118,11 +460,6 @@ line_uptime() {
> >>         [ -z "$et" ] && et=0
> >>   -     if [ "$action" = "lucistat" ]; then
> >> -               echo "dsl.line_uptime=${et}"
> >> -               return
> >> -       fi
> >> -
> >>         d=$(expr $et / 86400)
> >>         etr=$(expr $et % 86400)
> >>         h=$(expr $etr / 3600)
> >> @@ -137,7 +474,16 @@ line_uptime() {
> >>         [ "${d}" -ne 0 ] && rc="${d}d ${rc}"
> >>         [ -z "$rc" ] && rc="down"
> >> -       echo "Line Uptime:              ${rc}"
> >> +
> >> +
> >> +       if [ "$action" = "lucistat" ]; then
> >> +               echo "dsl.line_uptime=${et}"
> >> +               echo "dsl.line_uptime_s=\"${rc}\""
> >> +       else
> >> +
> >> +               echo "Line Uptime Seconds:                      ${et}"
> >> +               echo "Line Uptime:                              ${rc}"
> >> +       fi
> >>   }
> >>     #
> >> @@ -147,35 +493,72 @@ line_data() {
> >>         local lsg
> >>         local latnu
> >>         local latnd
> >> +       local satnu
> >> +       local satnd
> >>         local snru
> >>         local snrd
> >> +       local attndru
> >> +       local attndrd
> >> +       local sattndru
> >> +       local sattndrd
> >> +       local actatpu
> >> +       local actatpd
> >>         lsg=$(dsl_cmd g997lsg 1 1)
> >>         latnd=$(dsl_val "$lsg" LATN)
> >> +       satnd=$(dsl_val "$lsg" SATN)
> >>         snrd=$(dsl_val "$lsg" SNR)
> >> +       attndrd=$(dsl_val "$lsg" ATTNDR)
> >> +       actatpd=$(dsl_val "$lsg" ACTATP)
> >>         lsg=$(dsl_cmd g997lsg 0 1)
> >>         latnu=$(dsl_val "$lsg" LATN)
> >> +       satnu=$(dsl_val "$lsg" SATN)
> >>         snru=$(dsl_val "$lsg" SNR)
> >> +       attndru=$(dsl_val "$lsg" ATTNDR)
> >> +       actatpu=$(dsl_val "$lsg" ACTATP)
> >>         [ -z "$latnd" ] && latnd=0
> >>         [ -z "$latnu" ] && latnu=0
> >> +       [ -z "$satnd" ] && satnd=0
> >> +       [ -z "$satnu" ] && satnu=0
> >>         [ -z "$snrd" ] && snrd=0
> >>         [ -z "$snru" ] && snru=0
> >>         latnd=$(dbt $latnd)
> >>         latnu=$(dbt $latnu)
> >> +       satnd=$(dbt $satnd)
> >> +       satnu=$(dbt $satnu)
> >>         snrd=$(dbt $snrd)
> >>         snru=$(dbt $snru)
> >> +       actatpd=$(dbt $actatpd)
> >> +       actatpu=$(dbt $actatpu)
> >> +
> >> +       [ -z "$attndrd" ] && attndrd=0
> >> +       [ -z "$attndru" ] && attndru=0
> >> +
> >> +       sattndrd=$(scale $attndrd)
> >> +       sattndru=$(scale $attndru)
> >>
> >>         if [ "$action" = "lucistat" ]; then
> >>                 echo "dsl.line_attenuation_down=$latnd"
> >>                 echo "dsl.line_attenuation_up=$latnu"
> >>                 echo "dsl.noise_margin_down=$snrd"
> >>                 echo "dsl.noise_margin_up=$snru"
> >> +               echo "dsl.signal_attenuation_down=$satnd"
> >> +               echo "dsl.signal_attenuation_up=$satnu"
> >> +               echo "dsl.actatp_down=$actatpd"
> >> +               echo "dsl.actatp_up=$actatpu"
> >> +               echo "dsl.max_data_rate_down=$attndrd"
> >> +               echo "dsl.max_data_rate_up=$attndru"
> >> +               echo "dsl.max_data_rate_down_s=\"$sattndrd\""
> >> +               echo "dsl.max_data_rate_up_s=\"$sattndru\""
> >>         else
> >> -               echo "Line Attenuation: ${latnd}dB / ${latnu}dB"
> >> -               echo "Noise Margin:             ${snrd}dB / ${snru}dB"
> >> +               echo "Line Attenuation (LATN):                  Down:
> >> ${latnd}dB / Up: ${latnu}dB"
> >> +               echo "Signal Attenuation (SATN):                Down:
> >> ${satnd}dB / Up: ${satnu}dB"
> >> +               echo "Noise Margin (SNR):                       Down:
> >> ${snrd}dB / Up: ${snru}dB"
> >> +               echo "Aggregate Transmit Power(ACTATP):         Down:
> >> ${actatpd}dB / Up: ${actatpu}dB"
> >> +               echo "Max. Attainable Data Rate (ATTNDR):       Down:
> >> ${sattndrd}/s / Up: ${sattndru}/s"
> >>         fi
> >>   }
> >>   @@ -226,16 +609,21 @@ line_state() {
> >>                 fi
> >>         else
> >>                 if [ "$ls" = "0x801" ]; then
> >> -                       echo "Line State:               UP [$ls: $s]"
> >> +                       echo "Line State:
>  UP
> >> [$ls: $s]"
> >>                 else
> >> -                       echo "Line State:               DOWN [$ls: $s]"
> >> +                       echo "Line State:
> >> DOWN [$ls: $s]"
> >>                 fi
> >>         fi
> >>   }
> >
> >
> > Above change intrigues me a lot.
> > Is this patch intended whitespace broken or by mistake every "tab is
> > converted into "space"?
> >
> >
> >>     status() {
> >> +       vendor
> >>         chipset
> >> +       xtse
> >>         line_state
> >> +       errors
> >> +       power_mode
> >> +       latency_delay
> >>         data_rates
> >>         line_data
> >>         line_uptime
> >
> >
>
>
>
> --
> Mit freundlichen Gr??en
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/f700cd9b/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Thu Aug  6 11:26:26 2015
From: linus.luessing at c0d3.blue (Linus =?utf-8?Q?L=C3=BCssing?=)
Date: Thu, 6 Aug 2015 17:26:26 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 1/3] bridge: Fix
 multicast_to_unicast feature by hairpin+isolate
In-Reply-To: <55C1F357.7010801@openwrt.org>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
 <1438729208-3556-2-git-send-email-linus.luessing@c0d3.blue>
 <55C1F357.7010801@openwrt.org>
Message-ID: <20150806152626.GC3023@odroid>

On Wed, Aug 05, 2015 at 01:28:23PM +0200, Felix Fietkau wrote:
> This patch turns on hairpin mode and assumes that the driver script
> checks the multicast_to_unicast flag.
> This is somewhat broken, since you only consider the hostapd.sh script,
> but there are other driver implementations out there (including some
> out-of-tree ones).
> I think a better approach would be to check the conditions that are used
> to enable hairpin mode and use them to alter the vif isolate options in
> the json data.
> You could do this from within netifd-wireless.sh, and drop the hostapd
> change entirely.

Okay, sounds good, will do that!
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From lynxis at fe80.eu  Thu Aug  6 11:28:00 2015
From: lynxis at fe80.eu (Alexander Couzens)
Date: Thu,  6 Aug 2015 17:28:00 +0200
Subject: [OpenWrt-Devel] [PATCH] busybox: lock: implement -n "Fail rather
	than wait"
Message-ID: <1438874880-9094-1-git-send-email-lynxis@fe80.eu>

lock -n is similiar to flock -n. If the lock was already taken,
fail with exit code = 1 and write error message to stderr.

example:
if ! lock -n /tmp/foo ; then
	echo lock exits.
else
	echo lock was free. But is locked now.
fi
> lock was free. But is locked now.
> lock exists.

Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 package/utils/busybox/patches/220-add_lock_util.patch | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
index f42edcb..08f489a 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -33,9 +33,11 @@
  lib-$(CONFIG_MAKEDEVS)    += makedevs.o
  lib-$(CONFIG_MAN)         += man.o
  lib-$(CONFIG_MICROCOM)    += microcom.o
+Index: busybox-1.23.2/miscutils/lock.c
+===================================================================
 --- /dev/null
-+++ b/miscutils/lock.c
-@@ -0,0 +1,135 @@
++++ busybox-1.23.2/miscutils/lock.c
+@@ -0,0 +1,145 @@
 +/*
 + * Copyright (C) 2006 Felix Fietkau <nbd at openwrt.org>
 + *
@@ -56,6 +58,7 @@
 +static int unlock = 0;
 +static int shared = 0;
 +static int waitonly = 0;
++static int failinsteadwait = 0;
 +static int fd;
 +static char *file;
 +
@@ -65,6 +68,7 @@
 +	                "	-s	Use shared locking\n"
 +	                "	-u	Unlock\n"
 +	                "	-w	Wait for the lock to become free, don't acquire lock\n"
++			"	-n	Fail rather than wait\n"
 +					"\n", name);
 +	exit(1);
 +}
@@ -95,6 +99,8 @@
 +static int do_lock(void)
 +{
 +	int pid;
++	int ret;
++	int flags;
 +	char pidstr[8];
 +
 +	if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) {
@@ -104,7 +110,10 @@
 +		}
 +	}
 +
-+	if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) {
++	flags = shared ? LOCK_SH : LOCK_EX;
++	flags |= failinsteadwait ? LOCK_NB : 0;
++
++	if ((ret = flock(fd, flags)) < 0) {
 +		fprintf(stderr, "Can't lock %s\n", file);
 +		return 1;
 +	}
@@ -156,6 +165,9 @@
 +				case 'u':
 +					unlock = 1;
 +					break;
++				case 'n':
++					failinsteadwait = 1;
++					break;
 +			}
 +		}
 +		c--;
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From afkar.ec at gmail.com  Thu Aug  6 11:59:07 2015
From: afkar.ec at gmail.com (Afkar Rafique)
Date: Thu, 6 Aug 2015 23:59:07 +0800
Subject: [OpenWrt-Devel] Separate Default SSID for 2.4GHz and 5GHz
Message-ID: <CAHb30NpLnaaDo-XtCjRMHZL562uEKoqzy8WSQquDcQPqpyymPA@mail.gmail.com>

Hi Everyone,

I am working on AR93XX openWrt project. I have to configure the wifi0 as
2.4GHz and 5Ghz as per the selection of user. Mainly I have to add
selection in the GUI to switch between 2.4GHz and 5GHz. I have to keep two
separate default SSID for 2.4GHz and 5GHz.

Could anyone can help me that how I can keep two separate configuration and
how I can handle this in software.  I mean to say how I can thin into GUI
and can handle backend.


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/2959781b/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From marcelo at feitoza.com.br  Thu Aug  6 14:10:38 2015
From: marcelo at feitoza.com.br (Marcelo Feitoza Parisi)
Date: Thu, 6 Aug 2015 15:10:38 -0300
Subject: [OpenWrt-Devel] RB2011UiAS-RM Mikrotik/Routerboard
In-Reply-To: <CAPYE8sHP_h2JmouzAWCDeZLBoMqX=grizJop_F4dwx_gMGwifA@mail.gmail.com>
References: <CAPYE8sHP_h2JmouzAWCDeZLBoMqX=grizJop_F4dwx_gMGwifA@mail.gmail.com>
Message-ID: <CAPYE8sFbYxvXdAa6decbPxs3Mn1K6orw5-SMv5c3JY2yOjhW0A@mail.gmail.com>

Hello all,

Could someone please assist? I'm still getting a lot of packet loss:

306 packets transmitted, 176 packets received, 42% packet loss

round-trip min/avg/max = 0.717/0.835/5.253 ms


Thanks,

Marcelo

2015-07-28 16:23 GMT-03:00 Marcelo Feitoza Parisi <marcelo at feitoza.com.br>:

> I have this device, and I am getting in trouble getting the gigabit
> ethernet ports to work.
> I've tried the patches described here:
> https://lists.openwrt.org/pipermail/openwrt-devel/2014-December/029949.html
>
> I've tried with values: 0x3e000000, 0x06000000 and 0x6f000000.
>
> On 0x3e000000, I can get the device to ping, but it looses a lot of
> packages, sometimes almost 80% packet loss. On the other values the device
> doesn't even ping.
>
> Can anyone assist?
>
> Thanks,
> Marcelo Parisi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/44e17f47/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From mschiffer at universe-factory.net  Thu Aug  6 15:21:07 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu, 6 Aug 2015 21:21:07 +0200
Subject: [OpenWrt-Devel] Unable to get TP9343/QCA9561 WLAN working with
 ath9k (was: ar71xx: fix TP-LINK TL-WR941ND v6 support)
In-Reply-To: <55C2CCB1.3050409@universe-factory.net>
References: <e87ef2eb25c510165aaa0f7be290d78d2d0c4b99.1438821655.git.mschiffer@universe-factory.net>
 <55C2CCB1.3050409@universe-factory.net>
Message-ID: <55C3B3A3.6060101@universe-factory.net>

Hi,
as I've already written on the OpenWrt ML, I'm currently porting OpenWrt
to the TP-LINK TL-WR941ND v6, which uses a TP9343 SoC (which is
confusingly part of the QCA956x series). The WMAC identifies as QCA9561
(0x600 rev 0).

I'm unable to get the WLAN working at all. The TX seems to work fine (at
least I can see the beacons when I put the card into AP mode), but RX is
completely dead (iw scan is empty, etc...).

As I'm not familar with ath9k, I need some help debugging this. I'm
using the OpenWrt trunk, which contains a recent version of mac80211
based on wireless-testing, it already contains the patches "ath9k_hw:
fix device ID check for AR956x" and "ath9k: Fix register definitions for
QCA956x".

I've attached a dump of all debugfs information ath9k provides while the
WLAN is configured in IBSS mode in a cell that should be quite active.

Thanks in advance,
Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phy0.tar
Type: application/x-tar
Size: 38400 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/10fba1ae/attachment.tar>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/10fba1ae/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From eckert.florian at googlemail.com  Thu Aug  6 15:40:45 2015
From: eckert.florian at googlemail.com (Florian Eckert)
Date: Thu, 6 Aug 2015 21:40:45 +0200
Subject: [OpenWrt-Devel] [PATCH v3] lantiq: get more status information
 from xDSL
In-Reply-To: <CAJSWe5ZaLfNh2Jd08fJsn0=xWCFqZXYBQ+p7j-Bm-UkGqwOsoA@mail.gmail.com>
References: <1438839704-7187-1-git-send-email-Eckert.Florian@googlemail.com>
 <55C3099B.20807@gmail.com>
 <CALPCC5wd1x65PxN9FhKs1gDGhzgUCpTqmdevCPHbtQz80k16kw@mail.gmail.com>
 <CAJSWe5ZaLfNh2Jd08fJsn0=xWCFqZXYBQ+p7j-Bm-UkGqwOsoA@mail.gmail.com>
Message-ID: <CALPCC5y35hb2sN1EBgJKS8MOg7AW_hFA7bW8FTp4NRpUCLzHtQ@mail.gmail.com>

Am 06.08.2015 4:01 nachm. schrieb "Sylwek ScApi" <sscapi at gmail.com>:
>
> I don't know that You done something wrong, You misunderstood me, as
example We will use this part of patch:
> :
> @@ -226,16 +609,21 @@ line_state() {
>                 fi
>         else
>                 if [ "$ls" = "0x801" ]; then
> -                       echo "Line State:               UP [$ls: $s]"
> +                       echo "Line State:
 UP [$ls: $s]"
>                 else
> -                       echo "Line State:               DOWN [$ls: $s]"
> +                       echo "Line State:
 DOWN [$ls: $s]"
>                 fi
>         fi
>  }
>
> Why You replace tab separated "words" with space separated "words" ?
I replaced this with space so i get a well formated output for "dsl_control
status", If i use 3 tabs the out put will get too fare left on screen i
think. I could change it If you want.
>
> Patch is send correctly but why replace "tabs" ?
>
> My thunderbird is white space broken so You need to look in Your source
patch for reference.
>
> Best Regards
>
> 2015-08-06 11:52 GMT+02:00 Florian Eckert <eckert.florian at googlemail.com>:
>>
>> Hello Petela
>>
>> sorry but i dont understand your question!
>>
>> I checked out openwrt with git and edited the file. After that i made
>> "git format-patch -1" and then "git send-email --to
>> openwrt-devel at lists.openwrt.org
>> 0001-lantiq-get-more-status-information-from-xDSL.patch". I used the
>> same whitespaces in this file as in the other functions of this file
>> -> in this case it was an tab. What did i made wrong?
>>
>> Kind Regards Flo
>>
>> 2015-08-06 9:15 GMT+02:00 Sylwester Petela <sscapi at gmail.com>:
>> > W dniu 2015-08-06 o 07:41, feckert pisze:
>> >
>> >> Signed-off-by: Florian Eckert <Eckert.Florian at googlemail.com>
>> >> Signed-off-by: Helge Mader <hmader at tdt.de>
>> >> Tested-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
>> >> Tested-by: Andre Heider <a.heider at gmail.com>
>> >> ---
>> >>
>> >> v2 fix annex and line mode comma
>> >> v2 fix latency to ms
>> >> v3 fix latency syntax quotation error "x ms"
>> >> v3 fix echo "----" separation removed from status function
>> >>
>> >>   .../lantiq/base-files/lib/functions/lantiq_dsl.sh  |  412
>> >> +++++++++++++++++++-
>> >>   1 file changed, 400 insertions(+), 12 deletions(-)
>> >>   mode change 100644 => 100755
>> >> target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> >>
>> >> diff --git
a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> >> b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> >> old mode 100644
>> >> new mode 100755
>> >> index 56b8652..7809d01
>> >> --- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> >> +++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
>> >> @@ -19,6 +19,9 @@ dsl_cmd() {
>> >>   dsl_val() {
>> >>         echo $(expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*')
>> >>   }
>> >> +dsl_string() {
>> >> +       echo $(expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))')
>> >> +}
>> >>     #
>> >>   # Simple divide by 10 routine to cope with one decimal place
>> >> @@ -49,6 +52,16 @@ scale() {
>> >>         fi
>> >>   }
>> >>   +scale_latency() {
>> >> +       local val=$1
>> >> +       local a
>> >> +       local b
>> >> +
>> >> +       a=$(expr $val / 100)
>> >> +       b=$(expr $val % 100)
>> >> +       printf "%d.%d ms" ${a} ${b}
>> >> +}
>> >> +
>> >>   #
>> >>   # Read the data rates for both directions
>> >>   #
>> >> @@ -77,7 +90,7 @@ data_rates() {
>> >>                 echo "dsl.data_rate_down_s=\"$sdrd\""
>> >>                 echo "dsl.data_rate_up_s=\"$sdru\""
>> >>         else
>> >> -               echo "Data Rate:                ${sdrd}/s / ${sdru}/s"
>> >> +               echo "Data Rate:                                Down:
>> >> ${sdrd}/s / Up: ${sdru}/s"
>> >>         fi
>> >>   }
>> >>   @@ -92,11 +105,340 @@ chipset() {
>> >>         vig=$(dsl_cmd vig)
>> >>         cs=$(dsl_val "$vig" DSL_ChipSetType)
>> >>         csv=$(dsl_val "$vig" DSL_ChipSetHWVersion)
>> >> +       csfw=$(dsl_val "$vig" DSL_ChipSetFWVersion)
>> >> +       csapi=$(dsl_val "$vig" DSL_DriverVersionApi)
>> >>         if [ "$action" = "lucistat" ]; then
>> >>                 echo "dsl.chipset=\"${cs} ${csv}\""
>> >> +               echo "dsl.firmware_version=\"${csfw}\""
>> >> +               echo "dsl.api_version=\"${csapi}\""
>> >>         else
>> >> -               echo "Chipset:          ${cs} ${csv}"
>> >> +               echo "Chipset:                                  ${cs}
>> >> ${csv}"
>> >> +               echo "Firmware Version:
 ${csfw}"
>> >> +               echo "API Version:
${csapi}"
>> >> +       fi
>> >> +}
>> >> +
>> >> +#
>> >> +# Vendor information
>> >> +#
>> >> +vendor() {
>> >> +       local lig
>> >> +       local vid
>> >> +       local svid
>> >> +
>> >> +       lig=$(dsl_cmd g997lig 1)
>> >> +       vid=$(dsl_string "$lig" G994VendorID)
>> >> +       svid=$(dsl_string "$lig" SystemVendorID)
>> >> +
>> >> +       if [ "$action" = "lucistat" ]; then
>> >> +               echo "dsl.atuc_vendor_id=\"${vid}\""
>> >> +               echo "dsl.atuc_system_vendor_id=\"${svid}\""
>> >> +       else
>> >> +               echo "ATU-C Vendor ID:
${vid}"
>> >> +               echo "ATU-C System Vendor ID:
 ${svid}"
>> >> +       fi
>> >> +}
>> >> +
>> >> +#
>> >> +# XTSE capabilities
>> >> +#
>> >> +xtse() {
>> >> +       local xtusesg
>> >> +       local xtse1
>> >> +       local xtse2
>> >> +       local xtse3
>> >> +       local xtse4
>> >> +       local xtse5
>> >> +       local xtse6
>> >> +       local xtse7
>> >> +       local xtse8
>> >> +
>> >> +       local xtse_s=""
>> >> +
>> >> +       local annex_s=""
>> >> +       local line_mode_s=""
>> >> +       local cmd=""
>> >> +
>> >> +       xtusesg=$(dsl_cmd g997xtusesg)
>> >> +       xtse1=$(dsl_val "$xtusesg" XTSE1)
>> >> +       xtse2=$(dsl_val "$xtusesg" XTSE2)
>> >> +       xtse3=$(dsl_val "$xtusesg" XTSE3)
>> >> +       xtse4=$(dsl_val "$xtusesg" XTSE4)
>> >> +       xtse5=$(dsl_val "$xtusesg" XTSE5)
>> >> +       xtse6=$(dsl_val "$xtusesg" XTSE6)
>> >> +       xtse7=$(dsl_val "$xtusesg" XTSE7)
>> >> +       xtse8=$(dsl_val "$xtusesg" XTSE8)
>> >> +
>> >> +       # Evaluate Annex (according to G.997.1, 7.3.1.1.1)
>> >> +       if [ $((xtse1 & 13)) != 0 \
>> >> +       -o $((xtse2 & 1)) != 0 \
>> >> +       -o $((xtse3 & 12)) != 0 \
>> >> +       -o $((xtse4 & 3)) != 0 \
>> >> +       -o $((xtse6 & 3)) != 0 \
>> >> +       -o $((xtse8 & 1)) != 0 ]; then
>> >> +               annex_s=" A,"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse1 & 48)) != 0 \
>> >> +       -o $((xtse2 & 2)) != 0 \
>> >> +       -o $((xtse3 & 48)) != 0 \
>> >> +       -o $((xtse6 & 12)) != 0 \
>> >> +       -o $((xtse8 & 2)) != 0 ]; then
>> >> +               annex_s="$annex_s B,"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse1 & 194)) != 0 \
>> >> +       -o $((xtse2 & 12)) != 0 \
>> >> +       -o $((xtse8 & 4)) != 0 ]; then
>> >> +               annex_s="$annex_s C,"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse4 & 48)) != 0 \
>> >> +       -o $((xtse5 & 3)) != 0 \
>> >> +       -o $((xtse6 & 192)) != 0 ]; then
>> >> +               annex_s="$annex_s I,"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse4 & 192)) != 0 \
>> >> +       -o $((xtse7 & 3)) != 0 ]; then
>> >> +               annex_s="$annex_s J,"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse5 & 60)) != 0 ]; then
>> >> +               annex_s="$annex_s L,"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse5 & 192)) != 0 \
>> >> +       -o $((xtse7 & 12)) != 0 ]; then
>> >> +               annex_s="$annex_s M,"
>> >> +       fi
>> >> +
>> >> +       annex_s=`echo ${annex_s:1}`
>> >> +       annex_s=`echo ${annex_s%?}`
>> >> +
>> >> +       # Evaluate Line Mode (according to G.997.1, 7.3.1.1.1)
>> >> +
>> >> +       # Regional standard: ANSI T1.413
>> >> +       if [ $((xtse1 & 1)) != 0  ]; then
>> >> +               line_mode_s=" T1.413,"
>> >> +       fi
>> >> +
>> >> +       # Regional standard: TS 101 388
>> >> +       if [ $((xtse1 & 1)) != 0  ]; then
>> >> +               line_mode_s="$line_mode_s TS 101 388,"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse1 & 252)) != 0  ]; then
>> >> +               line_mode_s="$line_mode_s G.992.1 (ADSL),"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse2 & 15)) != 0  ]; then
>> >> +               line_mode_s="$line_mode_s G.992.2 (ADSL lite),"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse3 & 60)) != 0 \
>> >> +       -o $((xtse4 & 240)) != 0 \
>> >> +       -o $((xtse5 & 252)) != 0  ]; then
>> >> +               line_mode_s="$line_mode_s G.992.3 (ADSL2),"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse4 & 3)) != 0 \
>> >> +       -o $((xtse5 & 3)) != 0  ]; then
>> >> +               line_mode_s="$line_mode_s G.992.4 (ADSL2 lite),"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse6 & 199)) != 0 \
>> >> +       -o $((xtse7 & 15)) != 0  ]; then
>> >> +               line_mode_s="$line_mode_s G.992.5 (ADSL2+),"
>> >> +       fi
>> >> +
>> >> +       if [ $((xtse8 & 7)) != 0  ]; then
>> >> +               line_mode_s="$line_mode_s G.993.2 (VDSL2),"
>> >> +       fi
>> >> +
>> >> +       #!!! PROPRIETARY & INTERMEDIATE USE !!!
>> >> +       if [ $((xtse8 & 128)) != 0  ]; then
>> >> +               line_mode_s="$line_mode_s G.993.1 (VDSL),"
>> >> +       fi
>> >> +
>> >> +       line_mode_s=`echo ${line_mode_s:1}`
>> >> +       line_mode_s=`echo ${line_mode_s%?}`
>> >> +
>> >> +       xtse_s="${xtse1}, ${xtse2}, ${xtse3}, ${xtse4}, ${xtse5},
>> >> ${xtse6}, ${xtse7}, ${xtse8}"
>> >> +
>> >> +       if [ "$action" = "lucistat" ]; then
>> >> +               echo "dsl.xtse1=$xtse1"
>> >> +               echo "dsl.xtse2=$xtse2"
>> >> +               echo "dsl.xtse3=$xtse3"
>> >> +               echo "dsl.xtse4=$xtse4"
>> >> +               echo "dsl.xtse5=$xtse5"
>> >> +               echo "dsl.xtse6=$xtse6"
>> >> +               echo "dsl.xtse7=$xtse7"
>> >> +               echo "dsl.xtse8=$xtse8"
>> >> +               echo "dsl.xtse_s=\"$xtse_s\""
>> >> +               echo "dsl.annex_s=\"${annex_s}\""
>> >> +               echo "dsl.line_mode_s=\"${line_mode_s}\""
>> >> +       else
>> >> +               echo "XTSE Capabilities:
${xtse_s}"
>> >> +               echo "Annex:
>> >> ${annex_s}"
>> >> +               echo "Line Mode:
>> >> ${line_mode_s}"
>> >> +       fi
>> >> +}
>> >> +
>> >> +#
>> >> +# Power Management Mode
>> >> +#
>> >> +power_mode() {
>> >> +       local pmsg=$(dsl_cmd g997pmsg)
>> >> +       local pm=$(dsl_val "$pmsg" nPowerManagementStatus);
>> >> +       local s;
>> >> +
>> >> +       case "$pm" in
>> >> +               "-1")           s="Power management state is not
>> >> available" ;;
>> >> +               "0")            s="L0 - Synchronized" ;;
>> >> +               "1")            s="L1 - Power Down Data transmission
>> >> (G.992.2)" ;;
>> >> +               "2")            s="L2 - Power Down Data transmission
>> >> (G.992.3 and G.992.4)" ;;
>> >> +               "3")            s="L3 - No power" ;;
>> >> +               *)              s="unknown" ;;
>> >> +       esac
>> >> +
>> >> +       if [ "$action" = "lucistat" ]; then
>> >> +               echo "dsl.power_mode_num=$pm"
>> >> +               echo "dsl.power_mode_s=\"$s\""
>> >> +       else
>> >> +               echo "Power Management Mode:                    $s"
>> >> +       fi
>> >> +}
>> >> +
>> >> +#
>> >> +# Latency type (interleave delay)
>> >> +#
>> >> +latency_delay() {
>> >> +       local csg
>> >> +
>> >> +       local idu
>> >> +       local idu_s;
>> >> +       local sidu
>> >> +
>> >> +       local idd
>> >> +       local idd_s;
>> >> +       local sidd
>> >> +
>> >> +       csg=$(dsl_cmd g997csg 0 1)
>> >> +       idd=$(dsl_val "$csg" ActualInterleaveDelay)
>> >> +
>> >> +       csg=$(dsl_cmd g997csg 0 0)
>> >> +       idu=$(dsl_val "$csg" ActualInterleaveDelay)
>> >> +
>> >> +       [ -z "$idd" ] && idd=0
>> >> +       [ -z "$idu" ] && idu=0
>> >> +
>> >> +       if [ "$idd" > 100 ]; then
>> >> +               idd_s="Interleave"
>> >> +       else
>> >> +               idd_s="Fast"
>> >> +       fi
>> >> +
>> >> +       if [ "$idu" > 100 ]; then
>> >> +               idu_s="Interleave"
>> >> +       else
>> >> +               idu_s="Fast"
>> >> +       fi
>> >> +
>> >> +       sidu=$(scale_latency $idu)
>> >> +       sidd=$(scale_latency $idd)
>> >> +
>> >> +       if [ "$action" = "lucistat" ]; then
>> >> +               echo "dsl.latency_num_down=\"$sidu\""
>> >> +               echo "dsl.latency_num_up=\"$sidd\""
>> >> +               echo "dsl.latency_s_down=\"$idd_s\""
>> >> +               echo "dsl.latency_s_up=\"$idu_s\""
>> >> +       else
>> >> +               echo "Latency / Interleave Delay:               Down:
>> >> ${idd_s} (${sidd}) / Up: ${idu_s} (${sidu})"
>> >> +       fi
>> >> +}
>> >> +
>> >> +#
>> >> +# Errors
>> >> +#
>> >> +errors() {
>> >> +       local lsctg
>> >> +       local dpctg
>> >> +       local ccsg
>> >> +       local esf
>> >> +       local esn
>> >> +       local sesf
>> >> +       local sesn
>> >> +       local lossf
>> >> +       local lossn
>> >> +       local uasf
>> >> +       local uasn
>> >> +
>> >> +       local crc_pf
>> >> +       local crc_pn
>> >> +       local crcp_pf
>> >> +       local crcp_pn
>> >> +       local hecf
>> >> +       local hecn
>> >> +
>> >> +       local fecn
>> >> +       local fecf
>> >> +
>> >> +       lsctg=$(dsl_cmd pmlsctg 1)
>> >> +       esf=$(dsl_val "$lsctg" nES)
>> >> +       sesf=$(dsl_val "$lsctg" nSES)
>> >> +       lossf=$(dsl_val "$lsctg" nLOSS)
>> >> +       uasf=$(dsl_val "$lsctg" nUAS)
>> >> +
>> >> +       lsctg=$(dsl_cmd pmlsctg 0)
>> >> +       esn=$(dsl_val "$lsctg" nES)
>> >> +       sesn=$(dsl_val "$lsctg" nSES)
>> >> +       lossn=$(dsl_val "$lsctg" nLOSS)
>> >> +       uasn=$(dsl_val "$lsctg" nUAS)
>> >> +
>> >> +       dpctg=$(dsl_cmd pmdpctg 0 1)
>> >> +       hecf=$(dsl_val "$dpctg" nHEC)
>> >> +       crc_pf=$(dsl_val "$dpctg" nCRC_P)
>> >> +       crcp_pf=$(dsl_val "$dpctg" nCRCP_P)
>> >> +
>> >> +       dpctg=$(dsl_cmd pmdpctg 0 0)
>> >> +       hecn=$(dsl_val "$dpctg" nHEC)
>> >> +       crc_pn=$(dsl_val "$dpctg" nCRC_P)
>> >> +       crcp_pn=$(dsl_val "$dpctg" nCRCP_P)
>> >> +
>> >> +       ccsg=$(dsl_cmd pmccsg 0 1 0)
>> >> +       fecf=$(dsl_val "$ccsg" nFEC)
>> >> +
>> >> +       ccsg=$(dsl_cmd pmccsg 0 0 0)
>> >> +       fecn=$(dsl_val "$ccsg" nFEC)
>> >> +
>> >> +       if [ "$action" = "lucistat" ]; then
>> >> +               echo "dsl.errors_fec_near=$fecn"
>> >> +               echo "dsl.errors_fec_far=$fecf"
>> >> +               echo "dsl.errors_es_near=$esn"
>> >> +               echo "dsl.errors_es_far=$esf"
>> >> +               echo "dsl.errors_ses_near=$sesn"
>> >> +               echo "dsl.errors_ses_far=$sesf"
>> >> +               echo "dsl.errors_loss_near=$lossn"
>> >> +               echo "dsl.errors_loss_far=$lossf"
>> >> +               echo "dsl.errors_uas_near=$uasn"
>> >> +               echo "dsl.errors_uas_far=$uasf"
>> >> +               echo "dsl.errors_hec_near=$hecn"
>> >> +               echo "dsl.errors_hec_far=$hecf"
>> >> +               echo "dsl.errors_crc_p_near=$crc_pn"
>> >> +               echo "dsl.errors_crc_p_far=$crc_pf"
>> >> +               echo "dsl.errors_crcp_p_near=$crcp_pn"
>> >> +               echo "dsl.errors_crcp_p_far=$crcp_pf"
>> >> +       else
>> >> +               echo "Forward Error Correction Seconds (FECS):  Near:
>> >> ${fecn} / Far: ${fecf}"
>> >> +               echo "Errored seconds (ES):                     Near:
>> >> ${esn} / Far: ${esf}"
>> >> +               echo "Severely Errored Seconds (SES):           Near:
>> >> ${sesn} / Far: ${sesf}"
>> >> +               echo "Loss of Signal Seconds (LOSS):            Near:
>> >> ${lossn} / Far: ${lossf}"
>> >> +               echo "Unavailable Seconds (UAS):                Near:
>> >> ${uasn} / Far: ${uasf}"
>> >> +               echo "Header Error Code Errors (HEC):           Near:
>> >> ${hecn} / Far: ${hecf}"
>> >> +               echo "Non Pre-emtive CRC errors (CRC_P):        Near:
>> >> ${crcp_pn} / Far: ${crcp_pf}"
>> >> +               echo "Pre-emtive CRC errors (CRCP_P):           Near:
>> >> ${crcp_pn} / Far: ${crcp_pf}"
>> >>         fi
>> >>   }
>> >>   @@ -118,11 +460,6 @@ line_uptime() {
>> >>         [ -z "$et" ] && et=0
>> >>   -     if [ "$action" = "lucistat" ]; then
>> >> -               echo "dsl.line_uptime=${et}"
>> >> -               return
>> >> -       fi
>> >> -
>> >>         d=$(expr $et / 86400)
>> >>         etr=$(expr $et % 86400)
>> >>         h=$(expr $etr / 3600)
>> >> @@ -137,7 +474,16 @@ line_uptime() {
>> >>         [ "${d}" -ne 0 ] && rc="${d}d ${rc}"
>> >>         [ -z "$rc" ] && rc="down"
>> >> -       echo "Line Uptime:              ${rc}"
>> >> +
>> >> +
>> >> +       if [ "$action" = "lucistat" ]; then
>> >> +               echo "dsl.line_uptime=${et}"
>> >> +               echo "dsl.line_uptime_s=\"${rc}\""
>> >> +       else
>> >> +
>> >> +               echo "Line Uptime Seconds:                      ${et}"
>> >> +               echo "Line Uptime:                              ${rc}"
>> >> +       fi
>> >>   }
>> >>     #
>> >> @@ -147,35 +493,72 @@ line_data() {
>> >>         local lsg
>> >>         local latnu
>> >>         local latnd
>> >> +       local satnu
>> >> +       local satnd
>> >>         local snru
>> >>         local snrd
>> >> +       local attndru
>> >> +       local attndrd
>> >> +       local sattndru
>> >> +       local sattndrd
>> >> +       local actatpu
>> >> +       local actatpd
>> >>         lsg=$(dsl_cmd g997lsg 1 1)
>> >>         latnd=$(dsl_val "$lsg" LATN)
>> >> +       satnd=$(dsl_val "$lsg" SATN)
>> >>         snrd=$(dsl_val "$lsg" SNR)
>> >> +       attndrd=$(dsl_val "$lsg" ATTNDR)
>> >> +       actatpd=$(dsl_val "$lsg" ACTATP)
>> >>         lsg=$(dsl_cmd g997lsg 0 1)
>> >>         latnu=$(dsl_val "$lsg" LATN)
>> >> +       satnu=$(dsl_val "$lsg" SATN)
>> >>         snru=$(dsl_val "$lsg" SNR)
>> >> +       attndru=$(dsl_val "$lsg" ATTNDR)
>> >> +       actatpu=$(dsl_val "$lsg" ACTATP)
>> >>         [ -z "$latnd" ] && latnd=0
>> >>         [ -z "$latnu" ] && latnu=0
>> >> +       [ -z "$satnd" ] && satnd=0
>> >> +       [ -z "$satnu" ] && satnu=0
>> >>         [ -z "$snrd" ] && snrd=0
>> >>         [ -z "$snru" ] && snru=0
>> >>         latnd=$(dbt $latnd)
>> >>         latnu=$(dbt $latnu)
>> >> +       satnd=$(dbt $satnd)
>> >> +       satnu=$(dbt $satnu)
>> >>         snrd=$(dbt $snrd)
>> >>         snru=$(dbt $snru)
>> >> +       actatpd=$(dbt $actatpd)
>> >> +       actatpu=$(dbt $actatpu)
>> >> +
>> >> +       [ -z "$attndrd" ] && attndrd=0
>> >> +       [ -z "$attndru" ] && attndru=0
>> >> +
>> >> +       sattndrd=$(scale $attndrd)
>> >> +       sattndru=$(scale $attndru)
>> >>
>> >>         if [ "$action" = "lucistat" ]; then
>> >>                 echo "dsl.line_attenuation_down=$latnd"
>> >>                 echo "dsl.line_attenuation_up=$latnu"
>> >>                 echo "dsl.noise_margin_down=$snrd"
>> >>                 echo "dsl.noise_margin_up=$snru"
>> >> +               echo "dsl.signal_attenuation_down=$satnd"
>> >> +               echo "dsl.signal_attenuation_up=$satnu"
>> >> +               echo "dsl.actatp_down=$actatpd"
>> >> +               echo "dsl.actatp_up=$actatpu"
>> >> +               echo "dsl.max_data_rate_down=$attndrd"
>> >> +               echo "dsl.max_data_rate_up=$attndru"
>> >> +               echo "dsl.max_data_rate_down_s=\"$sattndrd\""
>> >> +               echo "dsl.max_data_rate_up_s=\"$sattndru\""
>> >>         else
>> >> -               echo "Line Attenuation: ${latnd}dB / ${latnu}dB"
>> >> -               echo "Noise Margin:             ${snrd}dB / ${snru}dB"
>> >> +               echo "Line Attenuation (LATN):                  Down:
>> >> ${latnd}dB / Up: ${latnu}dB"
>> >> +               echo "Signal Attenuation (SATN):                Down:
>> >> ${satnd}dB / Up: ${satnu}dB"
>> >> +               echo "Noise Margin (SNR):                       Down:
>> >> ${snrd}dB / Up: ${snru}dB"
>> >> +               echo "Aggregate Transmit Power(ACTATP):         Down:
>> >> ${actatpd}dB / Up: ${actatpu}dB"
>> >> +               echo "Max. Attainable Data Rate (ATTNDR):       Down:
>> >> ${sattndrd}/s / Up: ${sattndru}/s"
>> >>         fi
>> >>   }
>> >>   @@ -226,16 +609,21 @@ line_state() {
>> >>                 fi
>> >>         else
>> >>                 if [ "$ls" = "0x801" ]; then
>> >> -                       echo "Line State:               UP [$ls: $s]"
>> >> +                       echo "Line State:
   UP
>> >> [$ls: $s]"
>> >>                 else
>> >> -                       echo "Line State:               DOWN [$ls:
$s]"
>> >> +                       echo "Line State:
>> >> DOWN [$ls: $s]"
>> >>                 fi
>> >>         fi
>> >>   }
>> >
>> >
>> > Above change intrigues me a lot.
>> > Is this patch intended whitespace broken or by mistake every "tab is
>> > converted into "space"?
>> >
>> >
>> >>     status() {
>> >> +       vendor
>> >>         chipset
>> >> +       xtse
>> >>         line_state
>> >> +       errors
>> >> +       power_mode
>> >> +       latency_delay
>> >>         data_rates
>> >>         line_data
>> >>         line_uptime
>> >
>> >
>>
>>
>>
>> --
>> Mit freundlichen Gr??en
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/cd7a5f68/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Thu Aug  6 16:10:12 2015
From: linus.luessing at c0d3.blue (Linus =?utf-8?Q?L=C3=BCssing?=)
Date: Thu, 6 Aug 2015 22:10:12 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 2/3] bridge: Allow setting
 multicast_to_unicast option
In-Reply-To: <55C1F5B4.10007@openwrt.org>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
 <1438729208-3556-3-git-send-email-linus.luessing@c0d3.blue>
 <55C1F5B4.10007@openwrt.org>
Message-ID: <20150806201012.GC3046@odroid>

On Wed, Aug 05, 2015 at 01:38:28PM +0200, Felix Fietkau wrote:
> On 2015-08-05 01:00, Linus L?ssing wrote:
> > With this patch the multicast_to_unicast feature can be disabled for all
> > wireless interfaces via an according option on the uci bridge interface.
> > 
> > This patch also exports the setting information to wireless handler
> > scripts. The hostapd script will need that information to determine
> > whether to enable or disable ap-isolation, for instance.
> > 
> > Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
> I think it would be better to store these flags in the bridge config
> instead of the generic device config, and either add a blob_buf argument
> in struct device_hotplug_ops -> prepare, or add a new callback get_info,
> which adds the bridge info for use in the wireless json.

These would then be options per bridge, but not per bridge port,
wouldn't they?

For the multicast_to_unicast feature, okay (currently this patch
only allows setting it "globally" for a bridge but not on a bridge
port basis - though I was thinking about maybe making it bridge
port specific once someone needs that). For the multicast_router
option I'd need that on a bridge port basis.

> 
> I would like to avoid polluting the generic device options with bridge
> specific stuff.
> 
> This patch should probably be merged with the previous one afterwards,
> since the first one without any other changes will cause regressions.

Regressions, where/why? If this patch were ommitted from this
patchset then no harm should be done (unless I'm missing
something?).

Cheers, Linus
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Thu Aug  6 17:00:44 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Thu, 6 Aug 2015 23:00:44 +0200
Subject: [OpenWrt-Devel] [PATCH] busybox: lock: implement -n "Fail
	rather than wait"
In-Reply-To: <1438874880-9094-1-git-send-email-lynxis@fe80.eu>
References: <1438874880-9094-1-git-send-email-lynxis@fe80.eu>
Message-ID: <55C3CAFC.6070002@openwrt.org>

On 2015-08-06 17:28, Alexander Couzens wrote:
> lock -n is similiar to flock -n. If the lock was already taken,
> fail with exit code = 1 and write error message to stderr.
> 
> example:
> if ! lock -n /tmp/foo ; then
> 	echo lock exits.
> else
> 	echo lock was free. But is locked now.
> fi
>> lock was free. But is locked now.
>> lock exists.
> 
> Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
> ---
>  package/utils/busybox/patches/220-add_lock_util.patch | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
> index f42edcb..08f489a 100644
> --- a/package/utils/busybox/patches/220-add_lock_util.patch
> +++ b/package/utils/busybox/patches/220-add_lock_util.patch
> @@ -33,9 +33,11 @@
>   lib-$(CONFIG_MAKEDEVS)    += makedevs.o
>   lib-$(CONFIG_MAN)         += man.o
>   lib-$(CONFIG_MICROCOM)    += microcom.o
> +Index: busybox-1.23.2/miscutils/lock.c
> +===================================================================
>  --- /dev/null
> -+++ b/miscutils/lock.c
> -@@ -0,0 +1,135 @@
> ++++ busybox-1.23.2/miscutils/lock.c
> +@@ -0,0 +1,145 @@
Please use the right refresh method or run make package/busybox/refresh.

> @@ -65,6 +68,7 @@
>  +	                "	-s	Use shared locking\n"
>  +	                "	-u	Unlock\n"
>  +	                "	-w	Wait for the lock to become free, don't acquire lock\n"
> ++			"	-n	Fail rather than wait\n"
>  +					"\n", name);
>  +	exit(1);
>  +}
> @@ -104,7 +110,10 @@
>  +		}
>  +	}
>  +
> -+	if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) {
> ++	flags = shared ? LOCK_SH : LOCK_EX;
> ++	flags |= failinsteadwait ? LOCK_NB : 0;
> ++
> ++	if ((ret = flock(fd, flags)) < 0) {
>  +		fprintf(stderr, "Can't lock %s\n", file);
>  +		return 1;
>  +	}
"failinsteadwait" sounds a bit quirky, how about something like
"try_lock" instead. Same applies for the description.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Thu Aug  6 17:09:02 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Thu, 6 Aug 2015 23:09:02 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 2/3] bridge: Allow setting
 multicast_to_unicast option
In-Reply-To: <20150806201012.GC3046@odroid>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
 <1438729208-3556-3-git-send-email-linus.luessing@c0d3.blue>
 <55C1F5B4.10007@openwrt.org> <20150806201012.GC3046@odroid>
Message-ID: <55C3CCEE.8060802@openwrt.org>

On 2015-08-06 22:10, Linus L?ssing wrote:
> On Wed, Aug 05, 2015 at 01:38:28PM +0200, Felix Fietkau wrote:
>> On 2015-08-05 01:00, Linus L?ssing wrote:
>> > With this patch the multicast_to_unicast feature can be disabled for all
>> > wireless interfaces via an according option on the uci bridge interface.
>> > 
>> > This patch also exports the setting information to wireless handler
>> > scripts. The hostapd script will need that information to determine
>> > whether to enable or disable ap-isolation, for instance.
>> > 
>> > Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
>> I think it would be better to store these flags in the bridge config
>> instead of the generic device config, and either add a blob_buf argument
>> in struct device_hotplug_ops -> prepare, or add a new callback get_info,
>> which adds the bridge info for use in the wireless json.
> 
> These would then be options per bridge, but not per bridge port,
> wouldn't they?
Right.

> For the multicast_to_unicast feature, okay (currently this patch
> only allows setting it "globally" for a bridge but not on a bridge
> port basis - though I was thinking about maybe making it bridge
> port specific once someone needs that). For the multicast_router
> option I'd need that on a bridge port basis.
OK, then leave it as device options for now until we have a better way
of specifiying bridge port settings. Same for multicast_to_unicast.

>> I would like to avoid polluting the generic device options with bridge
>> specific stuff.
>> 
>> This patch should probably be merged with the previous one afterwards,
>> since the first one without any other changes will cause regressions.
> 
> Regressions, where/why? If this patch were ommitted from this
> patchset then no harm should be done (unless I'm missing
> something?).
The regression is: patch 1 enables hairpin mode for wireless interfaces,
with the assumption that the wireless script enables isolate mode for
multicast-to-unicast enable configurations.
The wireless script can only do that if patch 2 is applies, because that
one passes the required options.
The regression disappears after you rework patch 1 as discussed.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From mathieu at codeaurora.org  Thu Aug  6 22:28:39 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Thu,  6 Aug 2015 19:28:39 -0700
Subject: [OpenWrt-Devel] [PATCH 0/3] ipq806x: add NAND flash support
Message-ID: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>

This patch serie adds support for the integrated NAND flash controller
available on AP148. Most of the patches are backported from LKML, with
minor modifications.

This is kernel level support & enablement for now. Support for proper
MTD partitioning will come later and will be necessary to boot from
it.

Mathieu Olivari (3):
  ipq806x: Add ADM support
  ipq806x: add NAND flash controller support
  ipq806x: enable NAND flash support in the kernel

 target/linux/ipq806x/Makefile                      |    2 +-
 target/linux/ipq806x/config-3.18                   |   20 +
 target/linux/ipq806x/config-4.1                    |   18 +
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |    2 +-
 .../150-dmaengine-Rework-dma_chan_get.patch        |   70 +
 ...Remove-the-need-to-declare-device_control.patch |   27 +
 ...ake-channel-allocation-callbacks-optional.patch |   62 +
 ...engine-Introduce-a-device_config-callback.patch |   51 +
 ...aengine-Add-device_terminate_all-callback.patch |   47 +
 ...-bindings-qcom_adm-Fix-channel-specifiers.patch |   76 +
 .../156-dmaengine-Add-ADM-driver.patch             |  958 +++++++++
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   54 +
 .../160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch |   74 +
 ...g-to-access-bad-block-markers-in-raw-mode.patch |   84 +
 ...-mtd-nand-Qualcomm-NAND-controller-driver.patch | 2024 ++++++++++++++++++++
 ...63-dt-bindings-qcom_nandc-Add-DT-bindings.patch |   82 +
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   50 +
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   79 +
 ...dd-support-for-NSS-GMAC-clocks-and-resets.patch |   20 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   11 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   10 +-
 ...-bindings-qcom_adm-Fix-channel-specifiers.patch |   76 +
 .../patches-4.1/156-dmaengine-Add-ADM-driver.patch |  962 ++++++++++
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   54 +
 ...g-to-access-bad-block-markers-in-raw-mode.patch |   84 +
 ...-mtd-nand-Qualcomm-NAND-controller-driver.patch | 2024 ++++++++++++++++++++
 ...63-dt-bindings-qcom_nandc-Add-DT-bindings.patch |   82 +
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   50 +
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   76 +
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   11 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |    7 +-
 31 files changed, 7218 insertions(+), 29 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/151-dmaengine-Remove-the-need-to-declare-device_control.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/152-dmaengine-Make-channel-allocation-callbacks-optional.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/153-dmaengine-Introduce-a-device_config-callback.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/154-dmaengine-Add-device_terminate_all-callback.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/156-dmaengine-Add-ADM-driver.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch

-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Thu Aug  6 22:28:40 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Thu,  6 Aug 2015 19:28:40 -0700
Subject: [OpenWrt-Devel] [PATCH 1/3] ipq806x: Add ADM support
In-Reply-To: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
References: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438914522-24637-2-git-send-email-mathieu@codeaurora.org>

These are cherry-picked & backported from LKML:
*https://lkml.org/lkml/2015/3/17/19

They are enabled on both 3.18 and 4.1 kernel. Patches 150 to 154 are
applying changes merged since 3.18; they enable mechanisms used by the
ADM driver.

ADM engine is used by the NAND controller, so it is necessary to
bring-up NAND flash support.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/config-3.18                   |   1 +
 target/linux/ipq806x/config-4.1                    |   1 +
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   2 +-
 .../150-dmaengine-Rework-dma_chan_get.patch        |  70 ++
 ...Remove-the-need-to-declare-device_control.patch |  27 +
 ...ake-channel-allocation-callbacks-optional.patch |  62 ++
 ...engine-Introduce-a-device_config-callback.patch |  51 ++
 ...aengine-Add-device_terminate_all-callback.patch |  47 +
 ...-bindings-qcom_adm-Fix-channel-specifiers.patch |  76 ++
 .../156-dmaengine-Add-ADM-driver.patch             | 958 ++++++++++++++++++++
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |  54 ++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   7 +-
 ...-bindings-qcom_adm-Fix-channel-specifiers.patch |  76 ++
 .../patches-4.1/156-dmaengine-Add-ADM-driver.patch | 962 +++++++++++++++++++++
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |  54 ++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 18 files changed, 2448 insertions(+), 8 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/151-dmaengine-Remove-the-need-to-declare-device_control.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/152-dmaengine-Make-channel-allocation-callbacks-optional.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/153-dmaengine-Introduce-a-device_config-callback.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/154-dmaengine-Add-device_terminate_all-callback.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/156-dmaengine-Add-ADM-driver.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index f5bd58e..feedfd9 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -327,6 +327,7 @@ CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_PTP_1588_CLOCK=y
+# CONFIG_QCOM_ADM is not set
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index e3cff2f..0262e7a 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -341,6 +341,7 @@ CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_PTP_1588_CLOCK=y
+# CONFIG_QCOM_ADM is not set
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
diff --git a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
index 8f17397..5fee6ad 100644
--- a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
+++ b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -109,5 +109,29 @@
+@@ -114,5 +114,29 @@
  		sata at 29000000 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch b/target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch
new file mode 100644
index 0000000..880e67c
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch
@@ -0,0 +1,70 @@
+From d2f4f99db3e9ec8b063cf2e45704e2bb95428317 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime.ripard at free-electrons.com>
+Date: Mon, 17 Nov 2014 14:41:58 +0100
+Subject: [PATCH] dmaengine: Rework dma_chan_get
+
+dma_chan_get uses a rather interesting error handling and code path.
+
+Change it to something more usual in the kernel.
+
+Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
+Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
+Signed-off-by: Vinod Koul <vinod.koul at intel.com>
+---
+ drivers/dma/dmaengine.c | 36 +++++++++++++++++++-----------------
+ 1 file changed, 19 insertions(+), 17 deletions(-)
+
+--- a/drivers/dma/dmaengine.c
++++ b/drivers/dma/dmaengine.c
+@@ -222,31 +222,33 @@ static void balance_ref_count(struct dma
+  */
+ static int dma_chan_get(struct dma_chan *chan)
+ {
+-	int err = -ENODEV;
+ 	struct module *owner = dma_chan_to_owner(chan);
++	int ret;
+ 
++	/* The channel is already in use, update client count */
+ 	if (chan->client_count) {
+ 		__module_get(owner);
+-		err = 0;
+-	} else if (try_module_get(owner))
+-		err = 0;
++		goto out;
++	}
+ 
+-	if (err == 0)
+-		chan->client_count++;
++	if (!try_module_get(owner))
++		return -ENODEV;
+ 
+ 	/* allocate upon first client reference */
+-	if (chan->client_count == 1 && err == 0) {
+-		int desc_cnt = chan->device->device_alloc_chan_resources(chan);
+-
+-		if (desc_cnt < 0) {
+-			err = desc_cnt;
+-			chan->client_count = 0;
+-			module_put(owner);
+-		} else if (!dma_has_cap(DMA_PRIVATE, chan->device->cap_mask))
+-			balance_ref_count(chan);
+-	}
+-
+-	return err;
++	ret = chan->device->device_alloc_chan_resources(chan);
++	if (ret < 0)
++		goto err_out;
++
++	if (!dma_has_cap(DMA_PRIVATE, chan->device->cap_mask))
++		balance_ref_count(chan);
++
++out:
++	chan->client_count++;
++	return 0;
++
++err_out:
++	module_put(owner);
++	return ret;
+ }
+ 
+ /**
diff --git a/target/linux/ipq806x/patches-3.18/151-dmaengine-Remove-the-need-to-declare-device_control.patch b/target/linux/ipq806x/patches-3.18/151-dmaengine-Remove-the-need-to-declare-device_control.patch
new file mode 100644
index 0000000..b24a10b
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/151-dmaengine-Remove-the-need-to-declare-device_control.patch
@@ -0,0 +1,27 @@
+From 4f8ef9f4140cc286d7d1cf9237da7a7439e4fc0b Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime.ripard at free-electrons.com>
+Date: Mon, 17 Nov 2014 14:42:03 +0100
+Subject: [PATCH] dmaengine: Remove the need to declare device_control
+
+In order to migrate the drivers without triggering a BUG_ON for the converted
+drivers, which would cause bisectability issues, we need to remove that check
+before removing the device_control function entirely.
+
+Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
+Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
+Signed-off-by: Vinod Koul <vinod.koul at intel.com>
+---
+ drivers/dma/dmaengine.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/drivers/dma/dmaengine.c
++++ b/drivers/dma/dmaengine.c
+@@ -814,8 +814,6 @@ int dma_async_device_register(struct dma
+ 		!device->device_prep_dma_sg);
+ 	BUG_ON(dma_has_cap(DMA_CYCLIC, device->cap_mask) &&
+ 		!device->device_prep_dma_cyclic);
+-	BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) &&
+-		!device->device_control);
+ 	BUG_ON(dma_has_cap(DMA_INTERLEAVE, device->cap_mask) &&
+ 		!device->device_prep_interleaved_dma);
+ 
diff --git a/target/linux/ipq806x/patches-3.18/152-dmaengine-Make-channel-allocation-callbacks-optional.patch b/target/linux/ipq806x/patches-3.18/152-dmaengine-Make-channel-allocation-callbacks-optional.patch
new file mode 100644
index 0000000..6337259
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/152-dmaengine-Make-channel-allocation-callbacks-optional.patch
@@ -0,0 +1,62 @@
+From c4b54a648e682f678c338619df848233a6babc46 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime.ripard at free-electrons.com>
+Date: Mon, 17 Nov 2014 14:41:59 +0100
+Subject: [PATCH] dmaengine: Make channel allocation callbacks optional
+
+Nowadays, some drivers don't have anything in there channel allocation
+callbacks anymore.
+
+Remove the BUG_ON if those callbacks aren't implemented, in order to allow
+drivers to not implement them.
+
+Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
+Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
+Signed-off-by: Vinod Koul <vinod.koul at intel.com>
+---
+ drivers/dma/dmaengine.c | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+--- a/drivers/dma/dmaengine.c
++++ b/drivers/dma/dmaengine.c
+@@ -235,9 +235,11 @@ static int dma_chan_get(struct dma_chan
+ 		return -ENODEV;
+ 
+ 	/* allocate upon first client reference */
+-	ret = chan->device->device_alloc_chan_resources(chan);
+-	if (ret < 0)
+-		goto err_out;
++	if (chan->device->device_alloc_chan_resources) {
++		ret = chan->device->device_alloc_chan_resources(chan);
++		if (ret < 0)
++			goto err_out;
++	}
+ 
+ 	if (!dma_has_cap(DMA_PRIVATE, chan->device->cap_mask))
+ 		balance_ref_count(chan);
+@@ -259,11 +261,15 @@ err_out:
+  */
+ static void dma_chan_put(struct dma_chan *chan)
+ {
++	/* This channel is not in use, bail out */
+ 	if (!chan->client_count)
+-		return; /* this channel failed alloc_chan_resources */
++		return;
++
+ 	chan->client_count--;
+ 	module_put(dma_chan_to_owner(chan));
+-	if (chan->client_count == 0)
++
++	/* This channel is not in use anymore, free it */
++	if (!chan->client_count && chan->device->device_free_chan_resources)
+ 		chan->device->device_free_chan_resources(chan);
+ }
+ 
+@@ -817,8 +823,6 @@ int dma_async_device_register(struct dma
+ 	BUG_ON(dma_has_cap(DMA_INTERLEAVE, device->cap_mask) &&
+ 		!device->device_prep_interleaved_dma);
+ 
+-	BUG_ON(!device->device_alloc_chan_resources);
+-	BUG_ON(!device->device_free_chan_resources);
+ 	BUG_ON(!device->device_tx_status);
+ 	BUG_ON(!device->device_issue_pending);
+ 	BUG_ON(!device->dev);
diff --git a/target/linux/ipq806x/patches-3.18/153-dmaengine-Introduce-a-device_config-callback.patch b/target/linux/ipq806x/patches-3.18/153-dmaengine-Introduce-a-device_config-callback.patch
new file mode 100644
index 0000000..ced452f
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/153-dmaengine-Introduce-a-device_config-callback.patch
@@ -0,0 +1,51 @@
+From 94a73e30dfe6722e9f4ef19f7892901d7d00eab1 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime.ripard at free-electrons.com>
+Date: Mon, 17 Nov 2014 14:42:00 +0100
+Subject: [PATCH] dmaengine: Introduce a device_config callback
+
+The fact that the channel configuration is done in device_control is rather
+misleading, since it's not really advertised as such, plus, the fact that the
+framework exposes a function of its own makes it not really intuitive, while
+we're losing the type checking whenever we pass that unsigned long argument.
+
+Add a device_config callback to dma_device, with a fallback on the old
+behaviour for now for existing drivers to opt in.
+
+Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
+Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
+Signed-off-by: Vinod Koul <vinod.koul at intel.com>
+---
+ include/linux/dmaengine.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/include/linux/dmaengine.h
++++ b/include/linux/dmaengine.h
+@@ -607,6 +607,8 @@ struct dma_tx_state {
+  *	The function takes a buffer of size buf_len. The callback function will
+  *	be called after period_len bytes have been transferred.
+  * @device_prep_interleaved_dma: Transfer expression in a generic way.
++ * @device_config: Pushes a new configuration to a channel, return 0 or an error
++ *	code
+  * @device_control: manipulate all pending operations on a channel, returns
+  *	zero or error code
+  * @device_tx_status: poll for transaction completion, the optional
+@@ -673,6 +675,9 @@ struct dma_device {
+ 	struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
+ 		struct dma_chan *chan, struct dma_interleaved_template *xt,
+ 		unsigned long flags);
++
++	int (*device_config)(struct dma_chan *chan,
++			     struct dma_slave_config *config);
+ 	int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
+ 		unsigned long arg);
+ 
+@@ -696,6 +701,9 @@ static inline int dmaengine_device_contr
+ static inline int dmaengine_slave_config(struct dma_chan *chan,
+ 					  struct dma_slave_config *config)
+ {
++	if (chan->device->device_config)
++		return chan->device->device_config(chan, config);
++
+ 	return dmaengine_device_control(chan, DMA_SLAVE_CONFIG,
+ 			(unsigned long)config);
+ }
diff --git a/target/linux/ipq806x/patches-3.18/154-dmaengine-Add-device_terminate_all-callback.patch b/target/linux/ipq806x/patches-3.18/154-dmaengine-Add-device_terminate_all-callback.patch
new file mode 100644
index 0000000..422f7fb
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/154-dmaengine-Add-device_terminate_all-callback.patch
@@ -0,0 +1,47 @@
+From 7fa0cf462daa6f6121b332b87833d7f5bdb515c0 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime.ripard at free-electrons.com>
+Date: Mon, 17 Nov 2014 14:42:02 +0100
+Subject: [PATCH] dmaengine: Add device_terminate_all callback
+
+Split out the terminate_all command from device_control to a dma_device
+callback. In order to preserve backward capability, still rely on
+device_control if no such callback has been implemented.
+
+Eventually, this will allow to create a generic dma_slave_caps callback.
+
+Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
+Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
+Signed-off-by: Vinod Koul <vinod.koul at intel.com>
+---
+ include/linux/dmaengine.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/include/linux/dmaengine.h
++++ b/include/linux/dmaengine.h
+@@ -611,6 +611,8 @@ struct dma_tx_state {
+  *	code
+  * @device_control: manipulate all pending operations on a channel, returns
+  *	zero or error code
++ * @device_terminate_all: Aborts all transfers on a channel. Returns 0
++ *	or an error code
+  * @device_tx_status: poll for transaction completion, the optional
+  *	txstate parameter can be supplied with a pointer to get a
+  *	struct with auxiliary transfer status information, otherwise the call
+@@ -680,6 +682,7 @@ struct dma_device {
+ 			     struct dma_slave_config *config);
+ 	int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
+ 		unsigned long arg);
++	int (*device_terminate_all)(struct dma_chan *chan);
+ 
+ 	enum dma_status (*device_tx_status)(struct dma_chan *chan,
+ 					    dma_cookie_t cookie,
+@@ -789,6 +792,9 @@ static inline int dma_get_slave_caps(str
+ 
+ static inline int dmaengine_terminate_all(struct dma_chan *chan)
+ {
++	if (chan->device->device_terminate_all)
++		return chan->device->device_terminate_all(chan);
++
+ 	return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
+ }
+ 
diff --git a/target/linux/ipq806x/patches-3.18/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch b/target/linux/ipq806x/patches-3.18/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
new file mode 100644
index 0000000..4f5c0ef
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
@@ -0,0 +1,76 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v6,1/2] dt/bindings: qcom_adm: Fix channel specifiers
+From: Andy Gross <agross at codeaurora.org>
+X-Patchwork-Id: 6027361
+Message-Id: <1426571172-9711-2-git-send-email-agross at codeaurora.org>
+To: Vinod Koul <vinod.koul at intel.com>
+Cc: devicetree at vger.kernel.org, dmaengine at vger.kernel.org,
+	linux-arm-msm at vger.kernel.org, linux-kernel at vger.kernel.org,
+	linux-arm-kernel at lists.infradead.org, Kumar Gala <galak at codeaurora.org>,
+	Bjorn Andersson <bjorn.andersson at sonymobile.com>,
+	Andy Gross <agross at codeaurora.org>
+Date: Tue, 17 Mar 2015 00:46:11 -0500
+
+This patch removes the crci information from the dma channel property.  At least
+one client device requires using more than one CRCI value for a channel.  This
+does not match the current binding and the crci information needs to be removed.
+
+Instead, the client device will provide this information via other means.
+
+Signed-off-by: Andy Gross <agross at codeaurora.org>
+
+---
+Documentation/devicetree/bindings/dma/qcom_adm.txt |   16 ++++++----------
+ 1 file changed, 6 insertions(+), 10 deletions(-)
+
+--- a/Documentation/devicetree/bindings/dma/qcom_adm.txt
++++ b/Documentation/devicetree/bindings/dma/qcom_adm.txt
+@@ -4,8 +4,7 @@ Required properties:
+ - compatible: must contain "qcom,adm" for IPQ/APQ8064 and MSM8960
+ - reg: Address range for DMA registers
+ - interrupts: Should contain one interrupt shared by all channels
+-- #dma-cells: must be <2>.  First cell denotes the channel number.  Second cell
+-  denotes CRCI (client rate control interface) flow control assignment.
++- #dma-cells: must be <1>.  First cell denotes the channel number.
+ - clocks: Should contain the core clock and interface clock.
+ - clock-names: Must contain "core" for the core clock and "iface" for the
+   interface clock.
+@@ -22,7 +21,7 @@ Example:
+ 			compatible = "qcom,adm";
+ 			reg = <0x18300000 0x100000>;
+ 			interrupts = <0 170 0>;
+-			#dma-cells = <2>;
++			#dma-cells = <1>;
+ 
+ 			clocks = <&gcc ADM0_CLK>, <&gcc ADM0_PBUS_CLK>;
+ 			clock-names = "core", "iface";
+@@ -35,15 +34,12 @@ Example:
+ 			qcom,ee = <0>;
+ 		};
+ 
+-DMA clients must use the format descripted in the dma.txt file, using a three
++DMA clients must use the format descripted in the dma.txt file, using a two
+ cell specifier for each channel.
+ 
+-Each dmas request consists of 3 cells:
++Each dmas request consists of two cells:
+  1. phandle pointing to the DMA controller
+  2. channel number
+- 3. CRCI assignment, if applicable.  If no CRCI flow control is required, use 0.
+-    The CRCI is used for flow control.  It identifies the peripheral device that
+-    is the source/destination for the transferred data.
+ 
+ Example:
+ 
+@@ -56,7 +52,7 @@ Example:
+ 
+ 		cs-gpios = <&qcom_pinmux 20 0>;
+ 
+-		dmas = <&adm_dma 6 9>,
+-			<&adm_dma 5 10>;
++		dmas = <&adm_dma 6>,
++			<&adm_dma 5>;
+ 		dma-names = "rx", "tx";
+ 	};
diff --git a/target/linux/ipq806x/patches-3.18/156-dmaengine-Add-ADM-driver.patch b/target/linux/ipq806x/patches-3.18/156-dmaengine-Add-ADM-driver.patch
new file mode 100644
index 0000000..16d000e
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/156-dmaengine-Add-ADM-driver.patch
@@ -0,0 +1,958 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v6,2/2] dmaengine: Add ADM driver
+From: Andy Gross <agross at codeaurora.org>
+X-Patchwork-Id: 6027351
+Message-Id: <1426571172-9711-3-git-send-email-agross at codeaurora.org>
+To: Vinod Koul <vinod.koul at intel.com>
+Cc: devicetree at vger.kernel.org, dmaengine at vger.kernel.org,
+	linux-arm-msm at vger.kernel.org, linux-kernel at vger.kernel.org,
+	linux-arm-kernel at lists.infradead.org, Kumar Gala <galak at codeaurora.org>,
+	Bjorn Andersson <bjorn.andersson at sonymobile.com>,
+	Andy Gross <agross at codeaurora.org>
+Date: Tue, 17 Mar 2015 00:46:12 -0500
+
+Add the DMA engine driver for the QCOM Application Data Mover (ADM) DMA
+controller found in the MSM8x60 and IPQ/APQ8064 platforms.
+
+The ADM supports both memory to memory transactions and memory
+to/from peripheral device transactions.  The controller also provides flow
+control capabilities for transactions to/from peripheral devices.
+
+The initial release of this driver supports slave transfers to/from peripherals
+and also incorporates CRCI (client rate control interface) flow control.
+
+Signed-off-by: Andy Gross <agross at codeaurora.org>
+Reviewed-by: sricharan <sricharan at codeaurora.org>
+
+---
+drivers/dma/Kconfig    |   10 +
+ drivers/dma/Makefile   |    1 +
+ drivers/dma/qcom_adm.c |  900 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 911 insertions(+)
+ create mode 100644 drivers/dma/qcom_adm.c
+
+--- a/drivers/dma/Kconfig
++++ b/drivers/dma/Kconfig
+@@ -457,4 +457,14 @@ config QCOM_BAM_DMA
+ 	  Enable support for the QCOM BAM DMA controller.  This controller
+ 	  provides DMA capabilities for a variety of on-chip devices.
+ 
++config QCOM_ADM
++	tristate "Qualcomm ADM support"
++	depends on ARCH_QCOM || (COMPILE_TEST && OF && ARM)
++	select DMA_ENGINE
++	select DMA_VIRTUAL_CHANNELS
++	---help---
++	  Enable support for the Qualcomm ADM DMA controller.  This controller
++	  provides DMA capabilities for both general purpose and on-chip
++	  peripheral devices.
++
+ endif
+--- /dev/null
++++ b/drivers/dma/qcom_adm.c
+@@ -0,0 +1,896 @@
++/*
++ * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/io.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <linux/interrupt.h>
++#include <linux/dma-mapping.h>
++#include <linux/scatterlist.h>
++#include <linux/device.h>
++#include <linux/platform_device.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
++#include <linux/of_irq.h>
++#include <linux/of_dma.h>
++#include <linux/reset.h>
++#include <linux/clk.h>
++#include <linux/dmaengine.h>
++
++#include "dmaengine.h"
++#include "virt-dma.h"
++
++/* ADM registers - calculated from channel number and security domain */
++#define ADM_CHAN_MULTI			0x4
++#define ADM_CI_MULTI			0x4
++#define ADM_CRCI_MULTI			0x4
++#define ADM_EE_MULTI			0x800
++#define ADM_CHAN_OFFS(chan)		(ADM_CHAN_MULTI * chan)
++#define ADM_EE_OFFS(ee)			(ADM_EE_MULTI * ee)
++#define ADM_CHAN_EE_OFFS(chan, ee)	(ADM_CHAN_OFFS(chan) + ADM_EE_OFFS(ee))
++#define ADM_CHAN_OFFS(chan)		(ADM_CHAN_MULTI * chan)
++#define ADM_CI_OFFS(ci)			(ADM_CHAN_OFF(ci))
++#define ADM_CH_CMD_PTR(chan, ee)	(ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_CH_RSLT(chan, ee)		(0x40 + ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_CH_FLUSH_STATE0(chan, ee)	(0x80 + ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_CH_STATUS_SD(chan, ee)	(0x200 + ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_CH_CONF(chan)		(0x240 + ADM_CHAN_OFFS(chan))
++#define ADM_CH_RSLT_CONF(chan, ee)	(0x300 + ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_SEC_DOMAIN_IRQ_STATUS(ee)	(0x380 + ADM_EE_OFFS(ee))
++#define ADM_CI_CONF(ci)			(0x390 + ci * ADM_CI_MULTI)
++#define ADM_GP_CTL			0x3d8
++#define ADM_CRCI_CTL(crci, ee)		(0x400 + crci * ADM_CRCI_MULTI + \
++						ADM_EE_OFFS(ee))
++
++/* channel status */
++#define ADM_CH_STATUS_VALID	BIT(1)
++
++/* channel result */
++#define ADM_CH_RSLT_VALID	BIT(31)
++#define ADM_CH_RSLT_ERR		BIT(3)
++#define ADM_CH_RSLT_FLUSH	BIT(2)
++#define ADM_CH_RSLT_TPD		BIT(1)
++
++/* channel conf */
++#define ADM_CH_CONF_SHADOW_EN		BIT(12)
++#define ADM_CH_CONF_MPU_DISABLE		BIT(11)
++#define ADM_CH_CONF_PERM_MPU_CONF	BIT(9)
++#define ADM_CH_CONF_FORCE_RSLT_EN	BIT(7)
++#define ADM_CH_CONF_SEC_DOMAIN(ee)	(((ee & 0x3) << 4) | ((ee & 0x4) << 11))
++
++/* channel result conf */
++#define ADM_CH_RSLT_CONF_FLUSH_EN	BIT(1)
++#define ADM_CH_RSLT_CONF_IRQ_EN		BIT(0)
++
++/* CRCI CTL */
++#define ADM_CRCI_CTL_MUX_SEL	BIT(18)
++#define ADM_CRCI_CTL_RST	BIT(17)
++
++/* CI configuration */
++#define ADM_CI_RANGE_END(x)	(x << 24)
++#define ADM_CI_RANGE_START(x)	(x << 16)
++#define ADM_CI_BURST_4_WORDS	BIT(2)
++#define ADM_CI_BURST_8_WORDS	BIT(3)
++
++/* GP CTL */
++#define ADM_GP_CTL_LP_EN	BIT(12)
++#define ADM_GP_CTL_LP_CNT(x)	(x << 8)
++
++/* Command pointer list entry */
++#define ADM_CPLE_LP		BIT(31)
++#define ADM_CPLE_CMD_PTR_LIST	BIT(29)
++
++/* Command list entry */
++#define ADM_CMD_LC		BIT(31)
++#define ADM_CMD_DST_CRCI(n)	(((n) & 0xf) << 7)
++#define ADM_CMD_SRC_CRCI(n)	(((n) & 0xf) << 3)
++
++#define ADM_CMD_TYPE_SINGLE	0x0
++#define ADM_CMD_TYPE_BOX	0x3
++
++#define ADM_CRCI_MUX_SEL	BIT(4)
++#define ADM_DESC_ALIGN		8
++#define ADM_MAX_XFER		(SZ_64K-1)
++#define ADM_MAX_ROWS		(SZ_64K-1)
++#define ADM_MAX_CHANNELS	16
++
++struct adm_desc_hw_box {
++	u32 cmd;
++	u32 src_addr;
++	u32 dst_addr;
++	u32 row_len;
++	u32 num_rows;
++	u32 row_offset;
++};
++
++struct adm_desc_hw_single {
++	u32 cmd;
++	u32 src_addr;
++	u32 dst_addr;
++	u32 len;
++};
++
++struct adm_async_desc {
++	struct virt_dma_desc vd;
++	struct adm_device *adev;
++
++	size_t length;
++	enum dma_transfer_direction dir;
++	dma_addr_t dma_addr;
++	size_t dma_len;
++
++	void *cpl;
++	dma_addr_t cp_addr;
++	u32 crci;
++	u32 mux;
++	u32 blk_size;
++};
++
++struct adm_chan {
++	struct virt_dma_chan vc;
++	struct adm_device *adev;
++
++	/* parsed from DT */
++	u32 id;			/* channel id */
++
++	struct adm_async_desc *curr_txd;
++	struct dma_slave_config slave;
++	struct list_head node;
++
++	int error;
++	int initialized;
++};
++
++static inline struct adm_chan *to_adm_chan(struct dma_chan *common)
++{
++	return container_of(common, struct adm_chan, vc.chan);
++}
++
++struct adm_device {
++	void __iomem *regs;
++	struct device *dev;
++	struct dma_device common;
++	struct device_dma_parameters dma_parms;
++	struct adm_chan *channels;
++
++	u32 ee;
++
++	struct clk *core_clk;
++	struct clk *iface_clk;
++
++	struct reset_control *clk_reset;
++	struct reset_control *c0_reset;
++	struct reset_control *c1_reset;
++	struct reset_control *c2_reset;
++	int irq;
++};
++
++/**
++ * adm_free_chan - Frees dma resources associated with the specific channel
++ *
++ * Free all allocated descriptors associated with this channel
++ *
++ */
++static void adm_free_chan(struct dma_chan *chan)
++{
++	/* free all queued descriptors */
++	vchan_free_chan_resources(to_virt_chan(chan));
++}
++
++/**
++ * adm_get_blksize - Get block size from burst value
++ *
++ */
++static int adm_get_blksize(unsigned int burst)
++{
++	int ret;
++
++	switch (burst) {
++	case 16:
++	case 32:
++	case 64:
++	case 128:
++		ret = ffs(burst>>4) - 1;
++		break;
++	case 192:
++		ret = 4;
++		break;
++	case 256:
++		ret = 5;
++		break;
++	default:
++		ret = -EINVAL;
++		break;
++	}
++
++	return ret;
++}
++
++/**
++ * adm_process_fc_descriptors - Process descriptors for flow controlled xfers
++ *
++ * @achan: ADM channel
++ * @desc: Descriptor memory pointer
++ * @sg: Scatterlist entry
++ * @crci: CRCI value
++ * @burst: Burst size of transaction
++ * @direction: DMA transfer direction
++ */
++static void *adm_process_fc_descriptors(struct adm_chan *achan,
++	void *desc, struct scatterlist *sg, u32 crci, u32 burst,
++	enum dma_transfer_direction direction)
++{
++	struct adm_desc_hw_box *box_desc = NULL;
++	struct adm_desc_hw_single *single_desc;
++	u32 remainder = sg_dma_len(sg);
++	u32 rows, row_offset, crci_cmd;
++	u32 mem_addr = sg_dma_address(sg);
++	u32 *incr_addr = &mem_addr;
++	u32 *src, *dst;
++
++	if (direction == DMA_DEV_TO_MEM) {
++		crci_cmd = ADM_CMD_SRC_CRCI(crci);
++		row_offset = burst;
++		src = &achan->slave.src_addr;
++		dst = &mem_addr;
++	} else {
++		crci_cmd = ADM_CMD_DST_CRCI(crci);
++		row_offset = burst << 16;
++		src = &mem_addr;
++		dst = &achan->slave.dst_addr;
++	}
++
++	while (remainder >= burst) {
++		box_desc = desc;
++		box_desc->cmd = ADM_CMD_TYPE_BOX | crci_cmd;
++		box_desc->row_offset = row_offset;
++		box_desc->src_addr = *src;
++		box_desc->dst_addr = *dst;
++
++		rows = remainder / burst;
++		rows = min_t(u32, rows, ADM_MAX_ROWS);
++		box_desc->num_rows = rows << 16 | rows;
++		box_desc->row_len = burst << 16 | burst;
++
++		*incr_addr += burst * rows;
++		remainder -= burst * rows;
++		desc += sizeof(*box_desc);
++	}
++
++	/* if leftover bytes, do one single descriptor */
++	if (remainder) {
++		single_desc = desc;
++		single_desc->cmd = ADM_CMD_TYPE_SINGLE | crci_cmd;
++		single_desc->len = remainder;
++		single_desc->src_addr = *src;
++		single_desc->dst_addr = *dst;
++		desc += sizeof(*single_desc);
++
++		if (sg_is_last(sg))
++			single_desc->cmd |= ADM_CMD_LC;
++	} else {
++		if (box_desc && sg_is_last(sg))
++			box_desc->cmd |= ADM_CMD_LC;
++	}
++
++	return desc;
++}
++
++/**
++ * adm_process_non_fc_descriptors - Process descriptors for non-fc xfers
++ *
++ * @achan: ADM channel
++ * @desc: Descriptor memory pointer
++ * @sg: Scatterlist entry
++ * @direction: DMA transfer direction
++ */
++static void *adm_process_non_fc_descriptors(struct adm_chan *achan,
++	void *desc, struct scatterlist *sg,
++	enum dma_transfer_direction direction)
++{
++	struct adm_desc_hw_single *single_desc;
++	u32 remainder = sg_dma_len(sg);
++	u32 mem_addr = sg_dma_address(sg);
++	u32 *incr_addr = &mem_addr;
++	u32 *src, *dst;
++
++	if (direction == DMA_DEV_TO_MEM) {
++		src = &achan->slave.src_addr;
++		dst = &mem_addr;
++	} else {
++		src = &mem_addr;
++		dst = &achan->slave.dst_addr;
++	}
++
++	do {
++		single_desc = desc;
++		single_desc->cmd = ADM_CMD_TYPE_SINGLE;
++		single_desc->src_addr = *src;
++		single_desc->dst_addr = *dst;
++		single_desc->len = (remainder > ADM_MAX_XFER) ?
++				ADM_MAX_XFER : remainder;
++
++		remainder -= single_desc->len;
++		*incr_addr += single_desc->len;
++		desc += sizeof(*single_desc);
++	} while (remainder);
++
++	/* set last command if this is the end of the whole transaction */
++	if (sg_is_last(sg))
++		single_desc->cmd |= ADM_CMD_LC;
++
++	return desc;
++}
++
++/**
++ * adm_prep_slave_sg - Prep slave sg transaction
++ *
++ * @chan: dma channel
++ * @sgl: scatter gather list
++ * @sg_len: length of sg
++ * @direction: DMA transfer direction
++ * @flags: DMA flags
++ * @context: transfer context (unused)
++ */
++static struct dma_async_tx_descriptor *adm_prep_slave_sg(struct dma_chan *chan,
++	struct scatterlist *sgl, unsigned int sg_len,
++	enum dma_transfer_direction direction, unsigned long flags,
++	void *context)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	struct adm_device *adev = achan->adev;
++	struct adm_async_desc *async_desc;
++	struct scatterlist *sg;
++	u32 i, burst;
++	u32 single_count = 0, box_count = 0, crci = 0;
++	void *desc;
++	u32 *cple;
++	int blk_size = 0;
++
++	if (!is_slave_direction(direction)) {
++		dev_err(adev->dev, "invalid dma direction\n");
++		return NULL;
++	}
++
++	/*
++	 * get burst value from slave configuration
++	 */
++	burst = (direction == DMA_MEM_TO_DEV) ?
++		achan->slave.dst_maxburst :
++		achan->slave.src_maxburst;
++
++	/* if using flow control, validate burst and crci values */
++	if (achan->slave.device_fc) {
++
++		blk_size = adm_get_blksize(burst);
++		if (blk_size < 0) {
++			dev_err(adev->dev, "invalid burst value: %d\n",
++				burst);
++			return ERR_PTR(-EINVAL);
++		}
++
++		crci = achan->slave.slave_id & 0xf;
++		if (!crci || achan->slave.slave_id > 0x1f) {
++			dev_err(adev->dev, "invalid crci value\n");
++			return ERR_PTR(-EINVAL);
++		}
++	}
++
++	/* iterate through sgs and compute allocation size of structures */
++	for_each_sg(sgl, sg, sg_len, i) {
++		if (achan->slave.device_fc) {
++			box_count += DIV_ROUND_UP(sg_dma_len(sg) / burst,
++						  ADM_MAX_ROWS);
++			if (sg_dma_len(sg) % burst)
++				single_count++;
++		} else {
++			single_count += DIV_ROUND_UP(sg_dma_len(sg),
++						     ADM_MAX_XFER);
++		}
++	}
++
++	async_desc = kzalloc(sizeof(*async_desc), GFP_NOWAIT);
++	if (!async_desc)
++		return ERR_PTR(-ENOMEM);
++
++	if (crci)
++		async_desc->mux = achan->slave.slave_id & ADM_CRCI_MUX_SEL ?
++					ADM_CRCI_CTL_MUX_SEL : 0;
++	async_desc->crci = crci;
++	async_desc->blk_size = blk_size;
++	async_desc->dma_len = single_count * sizeof(struct adm_desc_hw_single) +
++				box_count * sizeof(struct adm_desc_hw_box) +
++				sizeof(*cple) + 2 * ADM_DESC_ALIGN;
++
++	async_desc->cpl = dma_alloc_writecombine(adev->dev, async_desc->dma_len,
++				&async_desc->dma_addr, GFP_NOWAIT);
++
++	if (!async_desc->cpl) {
++		kfree(async_desc);
++		return ERR_PTR(-ENOMEM);
++	}
++
++	async_desc->adev = adev;
++
++	/* both command list entry and descriptors must be 8 byte aligned */
++	cple = PTR_ALIGN(async_desc->cpl, ADM_DESC_ALIGN);
++	desc = PTR_ALIGN(cple + 1, ADM_DESC_ALIGN);
++
++	/* init cmd list */
++	*cple = ADM_CPLE_LP;
++	*cple |= (desc - async_desc->cpl + async_desc->dma_addr) >> 3;
++
++	for_each_sg(sgl, sg, sg_len, i) {
++		async_desc->length += sg_dma_len(sg);
++
++		if (achan->slave.device_fc)
++			desc = adm_process_fc_descriptors(achan, desc, sg, crci,
++							burst, direction);
++		else
++			desc = adm_process_non_fc_descriptors(achan, desc, sg,
++							   direction);
++	}
++
++	return vchan_tx_prep(&achan->vc, &async_desc->vd, flags);
++}
++
++/**
++ * adm_terminate_all - terminate all transactions on a channel
++ * @achan: adm dma channel
++ *
++ * Dequeues and frees all transactions, aborts current transaction
++ * No callbacks are done
++ *
++ */
++static int adm_terminate_all(struct dma_chan *chan)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	struct adm_device *adev = achan->adev;
++	unsigned long flags;
++	LIST_HEAD(head);
++
++	spin_lock_irqsave(&achan->vc.lock, flags);
++	vchan_get_all_descriptors(&achan->vc, &head);
++
++	/* send flush command to terminate current transaction */
++	writel_relaxed(0x0,
++		adev->regs + ADM_CH_FLUSH_STATE0(achan->id, adev->ee));
++
++	spin_unlock_irqrestore(&achan->vc.lock, flags);
++
++	vchan_dma_desc_free_list(&achan->vc, &head);
++
++	return 0;
++}
++
++static int adm_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	unsigned long flag;
++
++	spin_lock_irqsave(&achan->vc.lock, flag);
++	memcpy(&achan->slave, cfg, sizeof(struct dma_slave_config));
++	spin_unlock_irqrestore(&achan->vc.lock, flag);
++
++	return 0;
++}
++
++/**
++ * adm_start_dma - start next transaction
++ * @achan - ADM dma channel
++ */
++static void adm_start_dma(struct adm_chan *achan)
++{
++	struct virt_dma_desc *vd = vchan_next_desc(&achan->vc);
++	struct adm_device *adev = achan->adev;
++	struct adm_async_desc *async_desc;
++
++	lockdep_assert_held(&achan->vc.lock);
++
++	if (!vd)
++		return;
++
++	list_del(&vd->node);
++
++	/* write next command list out to the CMD FIFO */
++	async_desc = container_of(vd, struct adm_async_desc, vd);
++	achan->curr_txd = async_desc;
++
++	/* reset channel error */
++	achan->error = 0;
++
++	if (!achan->initialized) {
++		/* enable interrupts */
++		writel(ADM_CH_CONF_SHADOW_EN |
++		       ADM_CH_CONF_PERM_MPU_CONF |
++		       ADM_CH_CONF_MPU_DISABLE |
++		       ADM_CH_CONF_SEC_DOMAIN(adev->ee),
++		       adev->regs + ADM_CH_CONF(achan->id));
++
++		writel(ADM_CH_RSLT_CONF_IRQ_EN | ADM_CH_RSLT_CONF_FLUSH_EN,
++			adev->regs + ADM_CH_RSLT_CONF(achan->id, adev->ee));
++
++		achan->initialized = 1;
++	}
++
++	/* set the crci block size if this transaction requires CRCI */
++	if (async_desc->crci) {
++		writel(async_desc->mux | async_desc->blk_size,
++			adev->regs + ADM_CRCI_CTL(async_desc->crci, adev->ee));
++	}
++
++	/* make sure IRQ enable doesn't get reordered */
++	wmb();
++
++	/* write next command list out to the CMD FIFO */
++	writel(ALIGN(async_desc->dma_addr, ADM_DESC_ALIGN) >> 3,
++		adev->regs + ADM_CH_CMD_PTR(achan->id, adev->ee));
++}
++
++/**
++ * adm_dma_irq - irq handler for ADM controller
++ * @irq: IRQ of interrupt
++ * @data: callback data
++ *
++ * IRQ handler for the bam controller
++ */
++static irqreturn_t adm_dma_irq(int irq, void *data)
++{
++	struct adm_device *adev = data;
++	u32 srcs, i;
++	struct adm_async_desc *async_desc;
++	unsigned long flags;
++
++	srcs = readl_relaxed(adev->regs +
++			ADM_SEC_DOMAIN_IRQ_STATUS(adev->ee));
++
++	for (i = 0; i < ADM_MAX_CHANNELS; i++) {
++		struct adm_chan *achan = &adev->channels[i];
++		u32 status, result;
++
++		if (srcs & BIT(i)) {
++			status = readl_relaxed(adev->regs +
++				ADM_CH_STATUS_SD(i, adev->ee));
++
++			/* if no result present, skip */
++			if (!(status & ADM_CH_STATUS_VALID))
++				continue;
++
++			result = readl_relaxed(adev->regs +
++				ADM_CH_RSLT(i, adev->ee));
++
++			/* no valid results, skip */
++			if (!(result & ADM_CH_RSLT_VALID))
++				continue;
++
++			/* flag error if transaction was flushed or failed */
++			if (result & (ADM_CH_RSLT_ERR | ADM_CH_RSLT_FLUSH))
++				achan->error = 1;
++
++			spin_lock_irqsave(&achan->vc.lock, flags);
++			async_desc = achan->curr_txd;
++
++			achan->curr_txd = NULL;
++
++			if (async_desc) {
++				vchan_cookie_complete(&async_desc->vd);
++
++				/* kick off next DMA */
++				adm_start_dma(achan);
++			}
++
++			spin_unlock_irqrestore(&achan->vc.lock, flags);
++		}
++	}
++
++	return IRQ_HANDLED;
++}
++
++/**
++ * adm_tx_status - returns status of transaction
++ * @chan: dma channel
++ * @cookie: transaction cookie
++ * @txstate: DMA transaction state
++ *
++ * Return status of dma transaction
++ */
++static enum dma_status adm_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
++	struct dma_tx_state *txstate)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	struct virt_dma_desc *vd;
++	enum dma_status ret;
++	unsigned long flags;
++	size_t residue = 0;
++
++	ret = dma_cookie_status(chan, cookie, txstate);
++	if (ret == DMA_COMPLETE || !txstate)
++		return ret;
++
++	spin_lock_irqsave(&achan->vc.lock, flags);
++
++	vd = vchan_find_desc(&achan->vc, cookie);
++	if (vd)
++		residue = container_of(vd, struct adm_async_desc, vd)->length;
++
++	spin_unlock_irqrestore(&achan->vc.lock, flags);
++
++	/*
++	 * residue is either the full length if it is in the issued list, or 0
++	 * if it is in progress.  We have no reliable way of determining
++	 * anything inbetween
++	*/
++	dma_set_residue(txstate, residue);
++
++	if (achan->error)
++		return DMA_ERROR;
++
++	return ret;
++}
++
++/**
++ * adm_issue_pending - starts pending transactions
++ * @chan: dma channel
++ *
++ * Issues all pending transactions and starts DMA
++ */
++static void adm_issue_pending(struct dma_chan *chan)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	unsigned long flags;
++
++	spin_lock_irqsave(&achan->vc.lock, flags);
++
++	if (vchan_issue_pending(&achan->vc) && !achan->curr_txd)
++		adm_start_dma(achan);
++	spin_unlock_irqrestore(&achan->vc.lock, flags);
++}
++
++/**
++ * adm_dma_free_desc - free descriptor memory
++ * @vd: virtual descriptor
++ *
++ */
++static void adm_dma_free_desc(struct virt_dma_desc *vd)
++{
++	struct adm_async_desc *async_desc = container_of(vd,
++			struct adm_async_desc, vd);
++
++	dma_free_writecombine(async_desc->adev->dev, async_desc->dma_len,
++		async_desc->cpl, async_desc->dma_addr);
++	kfree(async_desc);
++}
++
++static void adm_channel_init(struct adm_device *adev, struct adm_chan *achan,
++	u32 index)
++{
++	achan->id = index;
++	achan->adev = adev;
++
++	vchan_init(&achan->vc, &adev->common);
++	achan->vc.desc_free = adm_dma_free_desc;
++}
++
++static int adm_dma_probe(struct platform_device *pdev)
++{
++	struct adm_device *adev;
++	struct resource *iores;
++	int ret;
++	u32 i;
++
++	adev = devm_kzalloc(&pdev->dev, sizeof(*adev), GFP_KERNEL);
++	if (!adev)
++		return -ENOMEM;
++
++	adev->dev = &pdev->dev;
++
++	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	adev->regs = devm_ioremap_resource(&pdev->dev, iores);
++	if (IS_ERR(adev->regs))
++		return PTR_ERR(adev->regs);
++
++	adev->irq = platform_get_irq(pdev, 0);
++	if (adev->irq < 0)
++		return adev->irq;
++
++	ret = of_property_read_u32(pdev->dev.of_node, "qcom,ee", &adev->ee);
++	if (ret) {
++		dev_err(adev->dev, "Execution environment unspecified\n");
++		return ret;
++	}
++
++	adev->core_clk = devm_clk_get(adev->dev, "core");
++	if (IS_ERR(adev->core_clk))
++		return PTR_ERR(adev->core_clk);
++
++	ret = clk_prepare_enable(adev->core_clk);
++	if (ret) {
++		dev_err(adev->dev, "failed to prepare/enable core clock\n");
++		return ret;
++	}
++
++	adev->iface_clk = devm_clk_get(adev->dev, "iface");
++	if (IS_ERR(adev->iface_clk)) {
++		ret = PTR_ERR(adev->iface_clk);
++		goto err_disable_core_clk;
++	}
++
++	ret = clk_prepare_enable(adev->iface_clk);
++	if (ret) {
++		dev_err(adev->dev, "failed to prepare/enable iface clock\n");
++		goto err_disable_core_clk;
++	}
++
++	adev->clk_reset = devm_reset_control_get(&pdev->dev, "clk");
++	if (IS_ERR(adev->clk_reset)) {
++		dev_err(adev->dev, "failed to get ADM0 reset\n");
++		ret = PTR_ERR(adev->clk_reset);
++		goto err_disable_clks;
++	}
++
++	adev->c0_reset = devm_reset_control_get(&pdev->dev, "c0");
++	if (IS_ERR(adev->c0_reset)) {
++		dev_err(adev->dev, "failed to get ADM0 C0 reset\n");
++		ret = PTR_ERR(adev->c0_reset);
++		goto err_disable_clks;
++	}
++
++	adev->c1_reset = devm_reset_control_get(&pdev->dev, "c1");
++	if (IS_ERR(adev->c1_reset)) {
++		dev_err(adev->dev, "failed to get ADM0 C1 reset\n");
++		ret = PTR_ERR(adev->c1_reset);
++		goto err_disable_clks;
++	}
++
++	adev->c2_reset = devm_reset_control_get(&pdev->dev, "c2");
++	if (IS_ERR(adev->c2_reset)) {
++		dev_err(adev->dev, "failed to get ADM0 C2 reset\n");
++		ret = PTR_ERR(adev->c2_reset);
++		goto err_disable_clks;
++	}
++
++	reset_control_assert(adev->clk_reset);
++	reset_control_assert(adev->c0_reset);
++	reset_control_assert(adev->c1_reset);
++	reset_control_assert(adev->c2_reset);
++
++	reset_control_deassert(adev->clk_reset);
++	reset_control_deassert(adev->c0_reset);
++	reset_control_deassert(adev->c1_reset);
++	reset_control_deassert(adev->c2_reset);
++
++	adev->channels = devm_kcalloc(adev->dev, ADM_MAX_CHANNELS,
++				sizeof(*adev->channels), GFP_KERNEL);
++
++	if (!adev->channels) {
++		ret = -ENOMEM;
++		goto err_disable_clks;
++	}
++
++	/* allocate and initialize channels */
++	INIT_LIST_HEAD(&adev->common.channels);
++
++	for (i = 0; i < ADM_MAX_CHANNELS; i++)
++		adm_channel_init(adev, &adev->channels[i], i);
++
++	/* reset CRCIs */
++	for (i = 0; i < 16; i++)
++		writel(ADM_CRCI_CTL_RST, adev->regs +
++			ADM_CRCI_CTL(i, adev->ee));
++
++	/* configure client interfaces */
++	writel(ADM_CI_RANGE_START(0x40) | ADM_CI_RANGE_END(0xb0) |
++		ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(0));
++	writel(ADM_CI_RANGE_START(0x2a) | ADM_CI_RANGE_END(0x2c) |
++		ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(1));
++	writel(ADM_CI_RANGE_START(0x12) | ADM_CI_RANGE_END(0x28) |
++		ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(2));
++	writel(ADM_GP_CTL_LP_EN | ADM_GP_CTL_LP_CNT(0xf),
++		adev->regs + ADM_GP_CTL);
++
++	ret = devm_request_irq(adev->dev, adev->irq, adm_dma_irq,
++			0, "adm_dma", adev);
++	if (ret)
++		goto err_disable_clks;
++
++	platform_set_drvdata(pdev, adev);
++
++	adev->common.dev = adev->dev;
++	adev->common.dev->dma_parms = &adev->dma_parms;
++
++	/* set capabilities */
++	dma_cap_zero(adev->common.cap_mask);
++	dma_cap_set(DMA_SLAVE, adev->common.cap_mask);
++	dma_cap_set(DMA_PRIVATE, adev->common.cap_mask);
++
++	/* initialize dmaengine apis */
++	adev->common.device_free_chan_resources = adm_free_chan;
++	adev->common.device_prep_slave_sg = adm_prep_slave_sg;
++	adev->common.device_issue_pending = adm_issue_pending;
++	adev->common.device_tx_status = adm_tx_status;
++	adev->common.device_terminate_all = adm_terminate_all;
++	adev->common.device_config = adm_slave_config;
++
++	ret = dma_async_device_register(&adev->common);
++	if (ret) {
++		dev_err(adev->dev, "failed to register dma async device\n");
++		goto err_disable_clks;
++	}
++
++	ret = of_dma_controller_register(pdev->dev.of_node,
++					 of_dma_xlate_by_chan_id,
++					 &adev->common);
++	if (ret)
++		goto err_unregister_dma;
++
++	return 0;
++
++err_unregister_dma:
++	dma_async_device_unregister(&adev->common);
++err_disable_clks:
++	clk_disable_unprepare(adev->iface_clk);
++err_disable_core_clk:
++	clk_disable_unprepare(adev->core_clk);
++
++	return ret;
++}
++
++static int adm_dma_remove(struct platform_device *pdev)
++{
++	struct adm_device *adev = platform_get_drvdata(pdev);
++	struct adm_chan *achan;
++	u32 i;
++
++	of_dma_controller_free(pdev->dev.of_node);
++	dma_async_device_unregister(&adev->common);
++
++	for (i = 0; i < ADM_MAX_CHANNELS; i++) {
++		achan = &adev->channels[i];
++
++		/* mask IRQs for this channel/EE pair */
++		writel(0, adev->regs + ADM_CH_RSLT_CONF(achan->id, adev->ee));
++
++		adm_terminate_all(&adev->channels[i].vc.chan);
++	}
++
++	devm_free_irq(adev->dev, adev->irq, adev);
++
++	clk_disable_unprepare(adev->core_clk);
++	clk_disable_unprepare(adev->iface_clk);
++
++	return 0;
++}
++
++static const struct of_device_id adm_of_match[] = {
++	{ .compatible = "qcom,adm", },
++	{}
++};
++MODULE_DEVICE_TABLE(of, adm_of_match);
++
++static struct platform_driver adm_dma_driver = {
++	.probe = adm_dma_probe,
++	.remove = adm_dma_remove,
++	.driver = {
++		.name = "adm-dma-engine",
++		.of_match_table = adm_of_match,
++	},
++};
++
++module_platform_driver(adm_dma_driver);
++
++MODULE_AUTHOR("Andy Gross <agross at codeaurora.org>");
++MODULE_DESCRIPTION("QCOM ADM DMA engine driver");
++MODULE_LICENSE("GPL v2");
+--- a/drivers/dma/Makefile
++++ b/drivers/dma/Makefile
+@@ -49,3 +49,4 @@ obj-y += xilinx/
+ obj-$(CONFIG_INTEL_MIC_X100_DMA) += mic_x100_dma.o
+ obj-$(CONFIG_NBPFAXI_DMA) += nbpfaxi.o
+ obj-$(CONFIG_DMA_SUN6I) += sun6i-dma.o
++obj-$(CONFIG_QCOM_ADM) += qcom_adm.o
diff --git a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
new file mode 100644
index 0000000..64b0022
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -0,0 +1,54 @@
+From 1fb18acab2d71e7e4efd9c10492edb1baf84dcc0 Mon Sep 17 00:00:00 2001
+From: Andy Gross <agross at codeaurora.org>
+Date: Wed, 20 May 2015 15:41:07 +0530
+Subject: [PATCH] ARM: DT: ipq8064: Add ADM device node
+
+This patch adds support for the ADM DMA on the IPQ8064 SOC
+
+Signed-off-by: Andy Gross <agross at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064-ap148.dts |  4 ++++
+ arch/arm/boot/dts/qcom-ipq8064.dtsi      | 21 +++++++++++++++++++++
+ 2 files changed, 25 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -90,6 +90,10 @@
+ 
+ 				cs-gpios = <&qcom_pinmux 20 0>;
+ 
++				dmas = <&adm_dma 6>,
++					<&adm_dma 5>;
++				dma-names = "rx", "tx";
++
+ 				flash: m25p80 at 0 {
+ 					compatible = "s25fl256s1";
+ 					#address-cells = <1>;
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -657,5 +657,25 @@
+ 			};
+ 		};
+ 
++		adm_dma: dma at 18300000 {
++			compatible = "qcom,adm";
++			reg = <0x18300000 0x100000>;
++			interrupts = <0 170 0>;
++			#dma-cells = <1>;
++
++			clocks = <&gcc ADM0_CLK>, <&gcc ADM0_PBUS_CLK>;
++			clock-names = "core", "iface";
++
++			resets = <&gcc ADM0_RESET>,
++				 <&gcc ADM0_PBUS_RESET>,
++				 <&gcc ADM0_C0_RESET>,
++				 <&gcc ADM0_C1_RESET>,
++				 <&gcc ADM0_C2_RESET>;
++			reset-names = "clk", "pbus", "c0", "c1", "c2";
++			qcom,ee = <0>;
++
++			status = "disabled";
++		};
++
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index e1b41d8..73b8edf 100644
--- a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -170,5 +180,33 @@
+@@ -174,5 +184,33 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index c7177d4..5213d62 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -208,5 +218,26 @@
+@@ -212,5 +222,26 @@
  				reg = <4>;
  			};
  		};
@@ -116,8 +116,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -657,5 +657,90 @@
- 			};
+@@ -677,5 +677,91 @@
+ 			status = "disabled";
  		};
  
 +		nss_common: syscon at 03000000 {
@@ -205,5 +205,6 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +
 +			status = "disabled";
 +		};
++
  	};
  };
diff --git a/target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch b/target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
new file mode 100644
index 0000000..4f5c0ef
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
@@ -0,0 +1,76 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v6,1/2] dt/bindings: qcom_adm: Fix channel specifiers
+From: Andy Gross <agross at codeaurora.org>
+X-Patchwork-Id: 6027361
+Message-Id: <1426571172-9711-2-git-send-email-agross at codeaurora.org>
+To: Vinod Koul <vinod.koul at intel.com>
+Cc: devicetree at vger.kernel.org, dmaengine at vger.kernel.org,
+	linux-arm-msm at vger.kernel.org, linux-kernel at vger.kernel.org,
+	linux-arm-kernel at lists.infradead.org, Kumar Gala <galak at codeaurora.org>,
+	Bjorn Andersson <bjorn.andersson at sonymobile.com>,
+	Andy Gross <agross at codeaurora.org>
+Date: Tue, 17 Mar 2015 00:46:11 -0500
+
+This patch removes the crci information from the dma channel property.  At least
+one client device requires using more than one CRCI value for a channel.  This
+does not match the current binding and the crci information needs to be removed.
+
+Instead, the client device will provide this information via other means.
+
+Signed-off-by: Andy Gross <agross at codeaurora.org>
+
+---
+Documentation/devicetree/bindings/dma/qcom_adm.txt |   16 ++++++----------
+ 1 file changed, 6 insertions(+), 10 deletions(-)
+
+--- a/Documentation/devicetree/bindings/dma/qcom_adm.txt
++++ b/Documentation/devicetree/bindings/dma/qcom_adm.txt
+@@ -4,8 +4,7 @@ Required properties:
+ - compatible: must contain "qcom,adm" for IPQ/APQ8064 and MSM8960
+ - reg: Address range for DMA registers
+ - interrupts: Should contain one interrupt shared by all channels
+-- #dma-cells: must be <2>.  First cell denotes the channel number.  Second cell
+-  denotes CRCI (client rate control interface) flow control assignment.
++- #dma-cells: must be <1>.  First cell denotes the channel number.
+ - clocks: Should contain the core clock and interface clock.
+ - clock-names: Must contain "core" for the core clock and "iface" for the
+   interface clock.
+@@ -22,7 +21,7 @@ Example:
+ 			compatible = "qcom,adm";
+ 			reg = <0x18300000 0x100000>;
+ 			interrupts = <0 170 0>;
+-			#dma-cells = <2>;
++			#dma-cells = <1>;
+ 
+ 			clocks = <&gcc ADM0_CLK>, <&gcc ADM0_PBUS_CLK>;
+ 			clock-names = "core", "iface";
+@@ -35,15 +34,12 @@ Example:
+ 			qcom,ee = <0>;
+ 		};
+ 
+-DMA clients must use the format descripted in the dma.txt file, using a three
++DMA clients must use the format descripted in the dma.txt file, using a two
+ cell specifier for each channel.
+ 
+-Each dmas request consists of 3 cells:
++Each dmas request consists of two cells:
+  1. phandle pointing to the DMA controller
+  2. channel number
+- 3. CRCI assignment, if applicable.  If no CRCI flow control is required, use 0.
+-    The CRCI is used for flow control.  It identifies the peripheral device that
+-    is the source/destination for the transferred data.
+ 
+ Example:
+ 
+@@ -56,7 +52,7 @@ Example:
+ 
+ 		cs-gpios = <&qcom_pinmux 20 0>;
+ 
+-		dmas = <&adm_dma 6 9>,
+-			<&adm_dma 5 10>;
++		dmas = <&adm_dma 6>,
++			<&adm_dma 5>;
+ 		dma-names = "rx", "tx";
+ 	};
diff --git a/target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch b/target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch
new file mode 100644
index 0000000..29e8eaa
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch
@@ -0,0 +1,962 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v6,2/2] dmaengine: Add ADM driver
+From: Andy Gross <agross at codeaurora.org>
+X-Patchwork-Id: 6027351
+Message-Id: <1426571172-9711-3-git-send-email-agross at codeaurora.org>
+To: Vinod Koul <vinod.koul at intel.com>
+Cc: devicetree at vger.kernel.org, dmaengine at vger.kernel.org,
+	linux-arm-msm at vger.kernel.org, linux-kernel at vger.kernel.org,
+	linux-arm-kernel at lists.infradead.org, Kumar Gala <galak at codeaurora.org>,
+	Bjorn Andersson <bjorn.andersson at sonymobile.com>,
+	Andy Gross <agross at codeaurora.org>
+Date: Tue, 17 Mar 2015 00:46:12 -0500
+
+Add the DMA engine driver for the QCOM Application Data Mover (ADM) DMA
+controller found in the MSM8x60 and IPQ/APQ8064 platforms.
+
+The ADM supports both memory to memory transactions and memory
+to/from peripheral device transactions.  The controller also provides flow
+control capabilities for transactions to/from peripheral devices.
+
+The initial release of this driver supports slave transfers to/from peripherals
+and also incorporates CRCI (client rate control interface) flow control.
+
+Signed-off-by: Andy Gross <agross at codeaurora.org>
+Reviewed-by: sricharan <sricharan at codeaurora.org>
+
+---
+drivers/dma/Kconfig    |   10 +
+ drivers/dma/Makefile   |    1 +
+ drivers/dma/qcom_adm.c |  900 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 911 insertions(+)
+ create mode 100644 drivers/dma/qcom_adm.c
+
+--- a/drivers/dma/Kconfig
++++ b/drivers/dma/Kconfig
+@@ -492,4 +492,14 @@ config QCOM_BAM_DMA
+ 	  Enable support for the QCOM BAM DMA controller.  This controller
+ 	  provides DMA capabilities for a variety of on-chip devices.
+ 
++config QCOM_ADM
++	tristate "Qualcomm ADM support"
++	depends on ARCH_QCOM || (COMPILE_TEST && OF && ARM)
++	select DMA_ENGINE
++	select DMA_VIRTUAL_CHANNELS
++	---help---
++	  Enable support for the Qualcomm ADM DMA controller.  This controller
++	  provides DMA capabilities for both general purpose and on-chip
++	  peripheral devices.
++
+ endif
+--- /dev/null
++++ b/drivers/dma/qcom_adm.c
+@@ -0,0 +1,900 @@
++/*
++ * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/io.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <linux/interrupt.h>
++#include <linux/dma-mapping.h>
++#include <linux/scatterlist.h>
++#include <linux/device.h>
++#include <linux/platform_device.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
++#include <linux/of_irq.h>
++#include <linux/of_dma.h>
++#include <linux/reset.h>
++#include <linux/clk.h>
++#include <linux/dmaengine.h>
++
++#include "dmaengine.h"
++#include "virt-dma.h"
++
++/* ADM registers - calculated from channel number and security domain */
++#define ADM_CHAN_MULTI			0x4
++#define ADM_CI_MULTI			0x4
++#define ADM_CRCI_MULTI			0x4
++#define ADM_EE_MULTI			0x800
++#define ADM_CHAN_OFFS(chan)		(ADM_CHAN_MULTI * chan)
++#define ADM_EE_OFFS(ee)			(ADM_EE_MULTI * ee)
++#define ADM_CHAN_EE_OFFS(chan, ee)	(ADM_CHAN_OFFS(chan) + ADM_EE_OFFS(ee))
++#define ADM_CHAN_OFFS(chan)		(ADM_CHAN_MULTI * chan)
++#define ADM_CI_OFFS(ci)			(ADM_CHAN_OFF(ci))
++#define ADM_CH_CMD_PTR(chan, ee)	(ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_CH_RSLT(chan, ee)		(0x40 + ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_CH_FLUSH_STATE0(chan, ee)	(0x80 + ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_CH_STATUS_SD(chan, ee)	(0x200 + ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_CH_CONF(chan)		(0x240 + ADM_CHAN_OFFS(chan))
++#define ADM_CH_RSLT_CONF(chan, ee)	(0x300 + ADM_CHAN_EE_OFFS(chan, ee))
++#define ADM_SEC_DOMAIN_IRQ_STATUS(ee)	(0x380 + ADM_EE_OFFS(ee))
++#define ADM_CI_CONF(ci)			(0x390 + ci * ADM_CI_MULTI)
++#define ADM_GP_CTL			0x3d8
++#define ADM_CRCI_CTL(crci, ee)		(0x400 + crci * ADM_CRCI_MULTI + \
++						ADM_EE_OFFS(ee))
++
++/* channel status */
++#define ADM_CH_STATUS_VALID	BIT(1)
++
++/* channel result */
++#define ADM_CH_RSLT_VALID	BIT(31)
++#define ADM_CH_RSLT_ERR		BIT(3)
++#define ADM_CH_RSLT_FLUSH	BIT(2)
++#define ADM_CH_RSLT_TPD		BIT(1)
++
++/* channel conf */
++#define ADM_CH_CONF_SHADOW_EN		BIT(12)
++#define ADM_CH_CONF_MPU_DISABLE		BIT(11)
++#define ADM_CH_CONF_PERM_MPU_CONF	BIT(9)
++#define ADM_CH_CONF_FORCE_RSLT_EN	BIT(7)
++#define ADM_CH_CONF_SEC_DOMAIN(ee)	(((ee & 0x3) << 4) | ((ee & 0x4) << 11))
++
++/* channel result conf */
++#define ADM_CH_RSLT_CONF_FLUSH_EN	BIT(1)
++#define ADM_CH_RSLT_CONF_IRQ_EN		BIT(0)
++
++/* CRCI CTL */
++#define ADM_CRCI_CTL_MUX_SEL	BIT(18)
++#define ADM_CRCI_CTL_RST	BIT(17)
++
++/* CI configuration */
++#define ADM_CI_RANGE_END(x)	(x << 24)
++#define ADM_CI_RANGE_START(x)	(x << 16)
++#define ADM_CI_BURST_4_WORDS	BIT(2)
++#define ADM_CI_BURST_8_WORDS	BIT(3)
++
++/* GP CTL */
++#define ADM_GP_CTL_LP_EN	BIT(12)
++#define ADM_GP_CTL_LP_CNT(x)	(x << 8)
++
++/* Command pointer list entry */
++#define ADM_CPLE_LP		BIT(31)
++#define ADM_CPLE_CMD_PTR_LIST	BIT(29)
++
++/* Command list entry */
++#define ADM_CMD_LC		BIT(31)
++#define ADM_CMD_DST_CRCI(n)	(((n) & 0xf) << 7)
++#define ADM_CMD_SRC_CRCI(n)	(((n) & 0xf) << 3)
++
++#define ADM_CMD_TYPE_SINGLE	0x0
++#define ADM_CMD_TYPE_BOX	0x3
++
++#define ADM_CRCI_MUX_SEL	BIT(4)
++#define ADM_DESC_ALIGN		8
++#define ADM_MAX_XFER		(SZ_64K-1)
++#define ADM_MAX_ROWS		(SZ_64K-1)
++#define ADM_MAX_CHANNELS	16
++
++struct adm_desc_hw_box {
++	u32 cmd;
++	u32 src_addr;
++	u32 dst_addr;
++	u32 row_len;
++	u32 num_rows;
++	u32 row_offset;
++};
++
++struct adm_desc_hw_single {
++	u32 cmd;
++	u32 src_addr;
++	u32 dst_addr;
++	u32 len;
++};
++
++struct adm_async_desc {
++	struct virt_dma_desc vd;
++	struct adm_device *adev;
++
++	size_t length;
++	enum dma_transfer_direction dir;
++	dma_addr_t dma_addr;
++	size_t dma_len;
++
++	void *cpl;
++	dma_addr_t cp_addr;
++	u32 crci;
++	u32 mux;
++	u32 blk_size;
++};
++
++struct adm_chan {
++	struct virt_dma_chan vc;
++	struct adm_device *adev;
++
++	/* parsed from DT */
++	u32 id;			/* channel id */
++
++	struct adm_async_desc *curr_txd;
++	struct dma_slave_config slave;
++	struct list_head node;
++
++	int error;
++	int initialized;
++};
++
++static inline struct adm_chan *to_adm_chan(struct dma_chan *common)
++{
++	return container_of(common, struct adm_chan, vc.chan);
++}
++
++struct adm_device {
++	void __iomem *regs;
++	struct device *dev;
++	struct dma_device common;
++	struct device_dma_parameters dma_parms;
++	struct adm_chan *channels;
++
++	u32 ee;
++
++	struct clk *core_clk;
++	struct clk *iface_clk;
++
++	struct reset_control *clk_reset;
++	struct reset_control *c0_reset;
++	struct reset_control *c1_reset;
++	struct reset_control *c2_reset;
++	int irq;
++};
++
++/**
++ * adm_free_chan - Frees dma resources associated with the specific channel
++ *
++ * Free all allocated descriptors associated with this channel
++ *
++ */
++static void adm_free_chan(struct dma_chan *chan)
++{
++	/* free all queued descriptors */
++	vchan_free_chan_resources(to_virt_chan(chan));
++}
++
++/**
++ * adm_get_blksize - Get block size from burst value
++ *
++ */
++static int adm_get_blksize(unsigned int burst)
++{
++	int ret;
++
++	switch (burst) {
++	case 16:
++	case 32:
++	case 64:
++	case 128:
++		ret = ffs(burst>>4) - 1;
++		break;
++	case 192:
++		ret = 4;
++		break;
++	case 256:
++		ret = 5;
++		break;
++	default:
++		ret = -EINVAL;
++		break;
++	}
++
++	return ret;
++}
++
++/**
++ * adm_process_fc_descriptors - Process descriptors for flow controlled xfers
++ *
++ * @achan: ADM channel
++ * @desc: Descriptor memory pointer
++ * @sg: Scatterlist entry
++ * @crci: CRCI value
++ * @burst: Burst size of transaction
++ * @direction: DMA transfer direction
++ */
++static void *adm_process_fc_descriptors(struct adm_chan *achan,
++	void *desc, struct scatterlist *sg, u32 crci, u32 burst,
++	enum dma_transfer_direction direction)
++{
++	struct adm_desc_hw_box *box_desc = NULL;
++	struct adm_desc_hw_single *single_desc;
++	u32 remainder = sg_dma_len(sg);
++	u32 rows, row_offset, crci_cmd;
++	u32 mem_addr = sg_dma_address(sg);
++	u32 *incr_addr = &mem_addr;
++	u32 *src, *dst;
++
++	if (direction == DMA_DEV_TO_MEM) {
++		crci_cmd = ADM_CMD_SRC_CRCI(crci);
++		row_offset = burst;
++		src = &achan->slave.src_addr;
++		dst = &mem_addr;
++	} else {
++		crci_cmd = ADM_CMD_DST_CRCI(crci);
++		row_offset = burst << 16;
++		src = &mem_addr;
++		dst = &achan->slave.dst_addr;
++	}
++
++	while (remainder >= burst) {
++		box_desc = desc;
++		box_desc->cmd = ADM_CMD_TYPE_BOX | crci_cmd;
++		box_desc->row_offset = row_offset;
++		box_desc->src_addr = *src;
++		box_desc->dst_addr = *dst;
++
++		rows = remainder / burst;
++		rows = min_t(u32, rows, ADM_MAX_ROWS);
++		box_desc->num_rows = rows << 16 | rows;
++		box_desc->row_len = burst << 16 | burst;
++
++		*incr_addr += burst * rows;
++		remainder -= burst * rows;
++		desc += sizeof(*box_desc);
++	}
++
++	/* if leftover bytes, do one single descriptor */
++	if (remainder) {
++		single_desc = desc;
++		single_desc->cmd = ADM_CMD_TYPE_SINGLE | crci_cmd;
++		single_desc->len = remainder;
++		single_desc->src_addr = *src;
++		single_desc->dst_addr = *dst;
++		desc += sizeof(*single_desc);
++
++		if (sg_is_last(sg))
++			single_desc->cmd |= ADM_CMD_LC;
++	} else {
++		if (box_desc && sg_is_last(sg))
++			box_desc->cmd |= ADM_CMD_LC;
++	}
++
++	return desc;
++}
++
++/**
++ * adm_process_non_fc_descriptors - Process descriptors for non-fc xfers
++ *
++ * @achan: ADM channel
++ * @desc: Descriptor memory pointer
++ * @sg: Scatterlist entry
++ * @direction: DMA transfer direction
++ */
++static void *adm_process_non_fc_descriptors(struct adm_chan *achan,
++	void *desc, struct scatterlist *sg,
++	enum dma_transfer_direction direction)
++{
++	struct adm_desc_hw_single *single_desc;
++	u32 remainder = sg_dma_len(sg);
++	u32 mem_addr = sg_dma_address(sg);
++	u32 *incr_addr = &mem_addr;
++	u32 *src, *dst;
++
++	if (direction == DMA_DEV_TO_MEM) {
++		src = &achan->slave.src_addr;
++		dst = &mem_addr;
++	} else {
++		src = &mem_addr;
++		dst = &achan->slave.dst_addr;
++	}
++
++	do {
++		single_desc = desc;
++		single_desc->cmd = ADM_CMD_TYPE_SINGLE;
++		single_desc->src_addr = *src;
++		single_desc->dst_addr = *dst;
++		single_desc->len = (remainder > ADM_MAX_XFER) ?
++				ADM_MAX_XFER : remainder;
++
++		remainder -= single_desc->len;
++		*incr_addr += single_desc->len;
++		desc += sizeof(*single_desc);
++	} while (remainder);
++
++	/* set last command if this is the end of the whole transaction */
++	if (sg_is_last(sg))
++		single_desc->cmd |= ADM_CMD_LC;
++
++	return desc;
++}
++
++/**
++ * adm_prep_slave_sg - Prep slave sg transaction
++ *
++ * @chan: dma channel
++ * @sgl: scatter gather list
++ * @sg_len: length of sg
++ * @direction: DMA transfer direction
++ * @flags: DMA flags
++ * @context: transfer context (unused)
++ */
++static struct dma_async_tx_descriptor *adm_prep_slave_sg(struct dma_chan *chan,
++	struct scatterlist *sgl, unsigned int sg_len,
++	enum dma_transfer_direction direction, unsigned long flags,
++	void *context)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	struct adm_device *adev = achan->adev;
++	struct adm_async_desc *async_desc;
++	struct scatterlist *sg;
++	u32 i, burst;
++	u32 single_count = 0, box_count = 0, crci = 0;
++	void *desc;
++	u32 *cple;
++	int blk_size = 0;
++
++	if (!is_slave_direction(direction)) {
++		dev_err(adev->dev, "invalid dma direction\n");
++		return NULL;
++	}
++
++	/*
++	 * get burst value from slave configuration
++	 */
++	burst = (direction == DMA_MEM_TO_DEV) ?
++		achan->slave.dst_maxburst :
++		achan->slave.src_maxburst;
++
++	/* if using flow control, validate burst and crci values */
++	if (achan->slave.device_fc) {
++
++		blk_size = adm_get_blksize(burst);
++		if (blk_size < 0) {
++			dev_err(adev->dev, "invalid burst value: %d\n",
++				burst);
++			return ERR_PTR(-EINVAL);
++		}
++
++		crci = achan->slave.slave_id & 0xf;
++		if (!crci || achan->slave.slave_id > 0x1f) {
++			dev_err(adev->dev, "invalid crci value\n");
++			return ERR_PTR(-EINVAL);
++		}
++	}
++
++	/* iterate through sgs and compute allocation size of structures */
++	for_each_sg(sgl, sg, sg_len, i) {
++		if (achan->slave.device_fc) {
++			box_count += DIV_ROUND_UP(sg_dma_len(sg) / burst,
++						  ADM_MAX_ROWS);
++			if (sg_dma_len(sg) % burst)
++				single_count++;
++		} else {
++			single_count += DIV_ROUND_UP(sg_dma_len(sg),
++						     ADM_MAX_XFER);
++		}
++	}
++
++	async_desc = kzalloc(sizeof(*async_desc), GFP_NOWAIT);
++	if (!async_desc)
++		return ERR_PTR(-ENOMEM);
++
++	if (crci)
++		async_desc->mux = achan->slave.slave_id & ADM_CRCI_MUX_SEL ?
++					ADM_CRCI_CTL_MUX_SEL : 0;
++	async_desc->crci = crci;
++	async_desc->blk_size = blk_size;
++	async_desc->dma_len = single_count * sizeof(struct adm_desc_hw_single) +
++				box_count * sizeof(struct adm_desc_hw_box) +
++				sizeof(*cple) + 2 * ADM_DESC_ALIGN;
++
++	async_desc->cpl = dma_alloc_writecombine(adev->dev, async_desc->dma_len,
++				&async_desc->dma_addr, GFP_NOWAIT);
++
++	if (!async_desc->cpl) {
++		kfree(async_desc);
++		return ERR_PTR(-ENOMEM);
++	}
++
++	async_desc->adev = adev;
++
++	/* both command list entry and descriptors must be 8 byte aligned */
++	cple = PTR_ALIGN(async_desc->cpl, ADM_DESC_ALIGN);
++	desc = PTR_ALIGN(cple + 1, ADM_DESC_ALIGN);
++
++	/* init cmd list */
++	*cple = ADM_CPLE_LP;
++	*cple |= (desc - async_desc->cpl + async_desc->dma_addr) >> 3;
++
++	for_each_sg(sgl, sg, sg_len, i) {
++		async_desc->length += sg_dma_len(sg);
++
++		if (achan->slave.device_fc)
++			desc = adm_process_fc_descriptors(achan, desc, sg, crci,
++							burst, direction);
++		else
++			desc = adm_process_non_fc_descriptors(achan, desc, sg,
++							   direction);
++	}
++
++	return vchan_tx_prep(&achan->vc, &async_desc->vd, flags);
++}
++
++/**
++ * adm_terminate_all - terminate all transactions on a channel
++ * @achan: adm dma channel
++ *
++ * Dequeues and frees all transactions, aborts current transaction
++ * No callbacks are done
++ *
++ */
++static int adm_terminate_all(struct dma_chan *chan)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	struct adm_device *adev = achan->adev;
++	unsigned long flags;
++	LIST_HEAD(head);
++
++	spin_lock_irqsave(&achan->vc.lock, flags);
++	vchan_get_all_descriptors(&achan->vc, &head);
++
++	/* send flush command to terminate current transaction */
++	writel_relaxed(0x0,
++		adev->regs + ADM_CH_FLUSH_STATE0(achan->id, adev->ee));
++
++	spin_unlock_irqrestore(&achan->vc.lock, flags);
++
++	vchan_dma_desc_free_list(&achan->vc, &head);
++
++	return 0;
++}
++
++static int adm_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	unsigned long flag;
++
++	spin_lock_irqsave(&achan->vc.lock, flag);
++	memcpy(&achan->slave, cfg, sizeof(struct dma_slave_config));
++	spin_unlock_irqrestore(&achan->vc.lock, flag);
++
++	return 0;
++}
++
++/**
++ * adm_start_dma - start next transaction
++ * @achan - ADM dma channel
++ */
++static void adm_start_dma(struct adm_chan *achan)
++{
++	struct virt_dma_desc *vd = vchan_next_desc(&achan->vc);
++	struct adm_device *adev = achan->adev;
++	struct adm_async_desc *async_desc;
++
++	lockdep_assert_held(&achan->vc.lock);
++
++	if (!vd)
++		return;
++
++	list_del(&vd->node);
++
++	/* write next command list out to the CMD FIFO */
++	async_desc = container_of(vd, struct adm_async_desc, vd);
++	achan->curr_txd = async_desc;
++
++	/* reset channel error */
++	achan->error = 0;
++
++	if (!achan->initialized) {
++		/* enable interrupts */
++		writel(ADM_CH_CONF_SHADOW_EN |
++		       ADM_CH_CONF_PERM_MPU_CONF |
++		       ADM_CH_CONF_MPU_DISABLE |
++		       ADM_CH_CONF_SEC_DOMAIN(adev->ee),
++		       adev->regs + ADM_CH_CONF(achan->id));
++
++		writel(ADM_CH_RSLT_CONF_IRQ_EN | ADM_CH_RSLT_CONF_FLUSH_EN,
++			adev->regs + ADM_CH_RSLT_CONF(achan->id, adev->ee));
++
++		achan->initialized = 1;
++	}
++
++	/* set the crci block size if this transaction requires CRCI */
++	if (async_desc->crci) {
++		writel(async_desc->mux | async_desc->blk_size,
++			adev->regs + ADM_CRCI_CTL(async_desc->crci, adev->ee));
++	}
++
++	/* make sure IRQ enable doesn't get reordered */
++	wmb();
++
++	/* write next command list out to the CMD FIFO */
++	writel(ALIGN(async_desc->dma_addr, ADM_DESC_ALIGN) >> 3,
++		adev->regs + ADM_CH_CMD_PTR(achan->id, adev->ee));
++}
++
++/**
++ * adm_dma_irq - irq handler for ADM controller
++ * @irq: IRQ of interrupt
++ * @data: callback data
++ *
++ * IRQ handler for the bam controller
++ */
++static irqreturn_t adm_dma_irq(int irq, void *data)
++{
++	struct adm_device *adev = data;
++	u32 srcs, i;
++	struct adm_async_desc *async_desc;
++	unsigned long flags;
++
++	srcs = readl_relaxed(adev->regs +
++			ADM_SEC_DOMAIN_IRQ_STATUS(adev->ee));
++
++	for (i = 0; i < ADM_MAX_CHANNELS; i++) {
++		struct adm_chan *achan = &adev->channels[i];
++		u32 status, result;
++
++		if (srcs & BIT(i)) {
++			status = readl_relaxed(adev->regs +
++				ADM_CH_STATUS_SD(i, adev->ee));
++
++			/* if no result present, skip */
++			if (!(status & ADM_CH_STATUS_VALID))
++				continue;
++
++			result = readl_relaxed(adev->regs +
++				ADM_CH_RSLT(i, adev->ee));
++
++			/* no valid results, skip */
++			if (!(result & ADM_CH_RSLT_VALID))
++				continue;
++
++			/* flag error if transaction was flushed or failed */
++			if (result & (ADM_CH_RSLT_ERR | ADM_CH_RSLT_FLUSH))
++				achan->error = 1;
++
++			spin_lock_irqsave(&achan->vc.lock, flags);
++			async_desc = achan->curr_txd;
++
++			achan->curr_txd = NULL;
++
++			if (async_desc) {
++				vchan_cookie_complete(&async_desc->vd);
++
++				/* kick off next DMA */
++				adm_start_dma(achan);
++			}
++
++			spin_unlock_irqrestore(&achan->vc.lock, flags);
++		}
++	}
++
++	return IRQ_HANDLED;
++}
++
++/**
++ * adm_tx_status - returns status of transaction
++ * @chan: dma channel
++ * @cookie: transaction cookie
++ * @txstate: DMA transaction state
++ *
++ * Return status of dma transaction
++ */
++static enum dma_status adm_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
++	struct dma_tx_state *txstate)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	struct virt_dma_desc *vd;
++	enum dma_status ret;
++	unsigned long flags;
++	size_t residue = 0;
++
++	ret = dma_cookie_status(chan, cookie, txstate);
++	if (ret == DMA_COMPLETE || !txstate)
++		return ret;
++
++	spin_lock_irqsave(&achan->vc.lock, flags);
++
++	vd = vchan_find_desc(&achan->vc, cookie);
++	if (vd)
++		residue = container_of(vd, struct adm_async_desc, vd)->length;
++
++	spin_unlock_irqrestore(&achan->vc.lock, flags);
++
++	/*
++	 * residue is either the full length if it is in the issued list, or 0
++	 * if it is in progress.  We have no reliable way of determining
++	 * anything inbetween
++	*/
++	dma_set_residue(txstate, residue);
++
++	if (achan->error)
++		return DMA_ERROR;
++
++	return ret;
++}
++
++/**
++ * adm_issue_pending - starts pending transactions
++ * @chan: dma channel
++ *
++ * Issues all pending transactions and starts DMA
++ */
++static void adm_issue_pending(struct dma_chan *chan)
++{
++	struct adm_chan *achan = to_adm_chan(chan);
++	unsigned long flags;
++
++	spin_lock_irqsave(&achan->vc.lock, flags);
++
++	if (vchan_issue_pending(&achan->vc) && !achan->curr_txd)
++		adm_start_dma(achan);
++	spin_unlock_irqrestore(&achan->vc.lock, flags);
++}
++
++/**
++ * adm_dma_free_desc - free descriptor memory
++ * @vd: virtual descriptor
++ *
++ */
++static void adm_dma_free_desc(struct virt_dma_desc *vd)
++{
++	struct adm_async_desc *async_desc = container_of(vd,
++			struct adm_async_desc, vd);
++
++	dma_free_writecombine(async_desc->adev->dev, async_desc->dma_len,
++		async_desc->cpl, async_desc->dma_addr);
++	kfree(async_desc);
++}
++
++static void adm_channel_init(struct adm_device *adev, struct adm_chan *achan,
++	u32 index)
++{
++	achan->id = index;
++	achan->adev = adev;
++
++	vchan_init(&achan->vc, &adev->common);
++	achan->vc.desc_free = adm_dma_free_desc;
++}
++
++static int adm_dma_probe(struct platform_device *pdev)
++{
++	struct adm_device *adev;
++	struct resource *iores;
++	int ret;
++	u32 i;
++
++	adev = devm_kzalloc(&pdev->dev, sizeof(*adev), GFP_KERNEL);
++	if (!adev)
++		return -ENOMEM;
++
++	adev->dev = &pdev->dev;
++
++	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	adev->regs = devm_ioremap_resource(&pdev->dev, iores);
++	if (IS_ERR(adev->regs))
++		return PTR_ERR(adev->regs);
++
++	adev->irq = platform_get_irq(pdev, 0);
++	if (adev->irq < 0)
++		return adev->irq;
++
++	ret = of_property_read_u32(pdev->dev.of_node, "qcom,ee", &adev->ee);
++	if (ret) {
++		dev_err(adev->dev, "Execution environment unspecified\n");
++		return ret;
++	}
++
++	adev->core_clk = devm_clk_get(adev->dev, "core");
++	if (IS_ERR(adev->core_clk))
++		return PTR_ERR(adev->core_clk);
++
++	ret = clk_prepare_enable(adev->core_clk);
++	if (ret) {
++		dev_err(adev->dev, "failed to prepare/enable core clock\n");
++		return ret;
++	}
++
++	adev->iface_clk = devm_clk_get(adev->dev, "iface");
++	if (IS_ERR(adev->iface_clk)) {
++		ret = PTR_ERR(adev->iface_clk);
++		goto err_disable_core_clk;
++	}
++
++	ret = clk_prepare_enable(adev->iface_clk);
++	if (ret) {
++		dev_err(adev->dev, "failed to prepare/enable iface clock\n");
++		goto err_disable_core_clk;
++	}
++
++	adev->clk_reset = devm_reset_control_get(&pdev->dev, "clk");
++	if (IS_ERR(adev->clk_reset)) {
++		dev_err(adev->dev, "failed to get ADM0 reset\n");
++		ret = PTR_ERR(adev->clk_reset);
++		goto err_disable_clks;
++	}
++
++	adev->c0_reset = devm_reset_control_get(&pdev->dev, "c0");
++	if (IS_ERR(adev->c0_reset)) {
++		dev_err(adev->dev, "failed to get ADM0 C0 reset\n");
++		ret = PTR_ERR(adev->c0_reset);
++		goto err_disable_clks;
++	}
++
++	adev->c1_reset = devm_reset_control_get(&pdev->dev, "c1");
++	if (IS_ERR(adev->c1_reset)) {
++		dev_err(adev->dev, "failed to get ADM0 C1 reset\n");
++		ret = PTR_ERR(adev->c1_reset);
++		goto err_disable_clks;
++	}
++
++	adev->c2_reset = devm_reset_control_get(&pdev->dev, "c2");
++	if (IS_ERR(adev->c2_reset)) {
++		dev_err(adev->dev, "failed to get ADM0 C2 reset\n");
++		ret = PTR_ERR(adev->c2_reset);
++		goto err_disable_clks;
++	}
++
++	reset_control_assert(adev->clk_reset);
++	reset_control_assert(adev->c0_reset);
++	reset_control_assert(adev->c1_reset);
++	reset_control_assert(adev->c2_reset);
++
++	reset_control_deassert(adev->clk_reset);
++	reset_control_deassert(adev->c0_reset);
++	reset_control_deassert(adev->c1_reset);
++	reset_control_deassert(adev->c2_reset);
++
++	adev->channels = devm_kcalloc(adev->dev, ADM_MAX_CHANNELS,
++				sizeof(*adev->channels), GFP_KERNEL);
++
++	if (!adev->channels) {
++		ret = -ENOMEM;
++		goto err_disable_clks;
++	}
++
++	/* allocate and initialize channels */
++	INIT_LIST_HEAD(&adev->common.channels);
++
++	for (i = 0; i < ADM_MAX_CHANNELS; i++)
++		adm_channel_init(adev, &adev->channels[i], i);
++
++	/* reset CRCIs */
++	for (i = 0; i < 16; i++)
++		writel(ADM_CRCI_CTL_RST, adev->regs +
++			ADM_CRCI_CTL(i, adev->ee));
++
++	/* configure client interfaces */
++	writel(ADM_CI_RANGE_START(0x40) | ADM_CI_RANGE_END(0xb0) |
++		ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(0));
++	writel(ADM_CI_RANGE_START(0x2a) | ADM_CI_RANGE_END(0x2c) |
++		ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(1));
++	writel(ADM_CI_RANGE_START(0x12) | ADM_CI_RANGE_END(0x28) |
++		ADM_CI_BURST_8_WORDS, adev->regs + ADM_CI_CONF(2));
++	writel(ADM_GP_CTL_LP_EN | ADM_GP_CTL_LP_CNT(0xf),
++		adev->regs + ADM_GP_CTL);
++
++	ret = devm_request_irq(adev->dev, adev->irq, adm_dma_irq,
++			0, "adm_dma", adev);
++	if (ret)
++		goto err_disable_clks;
++
++	platform_set_drvdata(pdev, adev);
++
++	adev->common.dev = adev->dev;
++	adev->common.dev->dma_parms = &adev->dma_parms;
++
++	/* set capabilities */
++	dma_cap_zero(adev->common.cap_mask);
++	dma_cap_set(DMA_SLAVE, adev->common.cap_mask);
++	dma_cap_set(DMA_PRIVATE, adev->common.cap_mask);
++
++	/* initialize dmaengine apis */
++	adev->common.directions = BIT(DMA_DEV_TO_MEM | DMA_MEM_TO_DEV);
++	adev->common.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR;
++	adev->common.src_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
++	adev->common.dst_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
++	adev->common.device_free_chan_resources = adm_free_chan;
++	adev->common.device_prep_slave_sg = adm_prep_slave_sg;
++	adev->common.device_issue_pending = adm_issue_pending;
++	adev->common.device_tx_status = adm_tx_status;
++	adev->common.device_terminate_all = adm_terminate_all;
++	adev->common.device_config = adm_slave_config;
++
++	ret = dma_async_device_register(&adev->common);
++	if (ret) {
++		dev_err(adev->dev, "failed to register dma async device\n");
++		goto err_disable_clks;
++	}
++
++	ret = of_dma_controller_register(pdev->dev.of_node,
++					 of_dma_xlate_by_chan_id,
++					 &adev->common);
++	if (ret)
++		goto err_unregister_dma;
++
++	return 0;
++
++err_unregister_dma:
++	dma_async_device_unregister(&adev->common);
++err_disable_clks:
++	clk_disable_unprepare(adev->iface_clk);
++err_disable_core_clk:
++	clk_disable_unprepare(adev->core_clk);
++
++	return ret;
++}
++
++static int adm_dma_remove(struct platform_device *pdev)
++{
++	struct adm_device *adev = platform_get_drvdata(pdev);
++	struct adm_chan *achan;
++	u32 i;
++
++	of_dma_controller_free(pdev->dev.of_node);
++	dma_async_device_unregister(&adev->common);
++
++	for (i = 0; i < ADM_MAX_CHANNELS; i++) {
++		achan = &adev->channels[i];
++
++		/* mask IRQs for this channel/EE pair */
++		writel(0, adev->regs + ADM_CH_RSLT_CONF(achan->id, adev->ee));
++
++		adm_terminate_all(&adev->channels[i].vc.chan);
++	}
++
++	devm_free_irq(adev->dev, adev->irq, adev);
++
++	clk_disable_unprepare(adev->core_clk);
++	clk_disable_unprepare(adev->iface_clk);
++
++	return 0;
++}
++
++static const struct of_device_id adm_of_match[] = {
++	{ .compatible = "qcom,adm", },
++	{}
++};
++MODULE_DEVICE_TABLE(of, adm_of_match);
++
++static struct platform_driver adm_dma_driver = {
++	.probe = adm_dma_probe,
++	.remove = adm_dma_remove,
++	.driver = {
++		.name = "adm-dma-engine",
++		.of_match_table = adm_of_match,
++	},
++};
++
++module_platform_driver(adm_dma_driver);
++
++MODULE_AUTHOR("Andy Gross <agross at codeaurora.org>");
++MODULE_DESCRIPTION("QCOM ADM DMA engine driver");
++MODULE_LICENSE("GPL v2");
+--- a/drivers/dma/Makefile
++++ b/drivers/dma/Makefile
+@@ -54,3 +54,4 @@ obj-$(CONFIG_NBPFAXI_DMA) += nbpfaxi.o
+ obj-$(CONFIG_DMA_SUN6I) += sun6i-dma.o
+ obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o
+ obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
++obj-$(CONFIG_QCOM_ADM) += qcom_adm.o
diff --git a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
new file mode 100644
index 0000000..bb9a194
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -0,0 +1,54 @@
+From 1fb18acab2d71e7e4efd9c10492edb1baf84dcc0 Mon Sep 17 00:00:00 2001
+From: Andy Gross <agross at codeaurora.org>
+Date: Wed, 20 May 2015 15:41:07 +0530
+Subject: [PATCH] ARM: DT: ipq8064: Add ADM device node
+
+This patch adds support for the ADM DMA on the IPQ8064 SOC
+
+Signed-off-by: Andy Gross <agross at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064-ap148.dts |  4 ++++
+ arch/arm/boot/dts/qcom-ipq8064.dtsi      | 21 +++++++++++++++++++++
+ 2 files changed, 25 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -90,6 +90,10 @@
+ 
+ 				cs-gpios = <&qcom_pinmux 20 0>;
+ 
++				dmas = <&adm_dma 6>,
++					<&adm_dma 5>;
++				dma-names = "rx", "tx";
++
+ 				flash: m25p80 at 0 {
+ 					compatible = "s25fl256s1";
+ 					#address-cells = <1>;
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -595,5 +595,25 @@
+ 
+ 			status = "disabled";
+ 		};
++
++		adm_dma: dma at 18300000 {
++			compatible = "qcom,adm";
++			reg = <0x18300000 0x100000>;
++			interrupts = <0 170 0>;
++			#dma-cells = <1>;
++
++			clocks = <&gcc ADM0_CLK>, <&gcc ADM0_PBUS_CLK>;
++			clock-names = "core", "iface";
++
++			resets = <&gcc ADM0_RESET>,
++				 <&gcc ADM0_PBUS_RESET>,
++				 <&gcc ADM0_C0_RESET>,
++				 <&gcc ADM0_C1_RESET>,
++				 <&gcc ADM0_C2_RESET>;
++			reset-names = "clk", "pbus", "c0", "c1", "c2";
++			qcom,ee = <0>;
++
++			status = "disabled";
++		};
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index d17ff44..1af0660 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -146,5 +156,33 @@
+@@ -150,5 +160,33 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index ce45089..c8dafab 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -184,5 +194,26 @@
+@@ -188,5 +198,26 @@
  				reg = <4>;
  			};
  		};
@@ -116,7 +116,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -595,5 +595,91 @@
+@@ -615,5 +615,91 @@
  
  			status = "disabled";
  		};
-- 
2.1.4

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Thu Aug  6 22:28:41 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Thu,  6 Aug 2015 19:28:41 -0700
Subject: [OpenWrt-Devel] [PATCH 2/3] ipq806x: add NAND flash controller
	support
In-Reply-To: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
References: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438914522-24637-3-git-send-email-mathieu@codeaurora.org>

These patches add support for ipq806x NAND flash controller. Most of
these are cherry-picked & backported from LKML:
*https://lkml.org/lkml/2015/8/3/16

This patch just modifies the kernel code, but doesn't change the config.
It should be harmless.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 .../160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch |   74 +
 ...g-to-access-bad-block-markers-in-raw-mode.patch |   84 +
 ...-mtd-nand-Qualcomm-NAND-controller-driver.patch | 2024 ++++++++++++++++++++
 ...63-dt-bindings-qcom_nandc-Add-DT-bindings.patch |   82 +
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   50 +
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   79 +
 ...dd-support-for-NSS-GMAC-clocks-and-resets.patch |   20 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   11 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |    7 +-
 ...g-to-access-bad-block-markers-in-raw-mode.patch |   84 +
 ...-mtd-nand-Qualcomm-NAND-controller-driver.patch | 2024 ++++++++++++++++++++
 ...63-dt-bindings-qcom_nandc-Add-DT-bindings.patch |   82 +
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   50 +
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   76 +
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   11 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |    7 +-
 16 files changed, 4739 insertions(+), 26 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch

diff --git a/target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch b/target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
new file mode 100644
index 0000000..77d29d8
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
@@ -0,0 +1,74 @@
+From 4c385b25fab119144bffb255ad77712fe586ac10 Mon Sep 17 00:00:00 2001
+From: Archit Taneja <architt at codeaurora.org>
+Date: Thu, 2 Apr 2015 11:20:41 +0530
+Subject: [PATCH] clk: qcom: Add EBI2 clocks for IPQ806x
+
+The NAND controller within EBI2 requires EBI2_CLK and
+EBI2_ALWAYS_ON_CLK clocks.  Create structs for these clocks so
+that they can be used by the NAND controller driver. Add an entry
+for EBI2_AON_CLK in the gcc-ipq806x DT binding document.
+
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
+---
+ drivers/clk/qcom/gcc-ipq806x.c               | 32 ++++++++++++++++++++++++++++
+ include/dt-bindings/clock/qcom,gcc-ipq806x.h |  1 +
+ 2 files changed, 33 insertions(+)
+
+--- a/drivers/clk/qcom/gcc-ipq806x.c
++++ b/drivers/clk/qcom/gcc-ipq806x.c
+@@ -2239,6 +2239,36 @@ static struct clk_branch usb_fs1_h_clk =
+ 	},
+ };
+ 
++static struct clk_branch ebi2_clk = {
++	.hwcg_reg = 0x3b00,
++	.hwcg_bit = 6,
++	.halt_reg = 0x2fcc,
++	.halt_bit = 1,
++	.clkr = {
++		.enable_reg = 0x3b00,
++		.enable_mask = BIT(4),
++		.hw.init = &(struct clk_init_data){
++			.name = "ebi2_clk",
++			.ops = &clk_branch_ops,
++			.flags = CLK_IS_ROOT,
++		},
++	},
++};
++
++static struct clk_branch ebi2_aon_clk = {
++	.halt_reg = 0x2fcc,
++	.halt_bit = 0,
++	.clkr = {
++		.enable_reg = 0x3b00,
++		.enable_mask = BIT(8),
++		.hw.init = &(struct clk_init_data){
++			.name = "ebi2_always_on_clk",
++			.ops = &clk_branch_ops,
++			.flags = CLK_IS_ROOT,
++		},
++	},
++};
++
+ static struct clk_regmap *gcc_ipq806x_clks[] = {
+ 	[PLL0] = &pll0.clkr,
+ 	[PLL0_VOTE] = &pll0_vote,
+@@ -2341,6 +2371,8 @@ static struct clk_regmap *gcc_ipq806x_cl
+ 	[USB_FS1_XCVR_SRC] = &usb_fs1_xcvr_clk_src.clkr,
+ 	[USB_FS1_XCVR_CLK] = &usb_fs1_xcvr_clk.clkr,
+ 	[USB_FS1_SYSTEM_CLK] = &usb_fs1_sys_clk.clkr,
++	[EBI2_CLK] = &ebi2_clk.clkr,
++	[EBI2_AON_CLK] = &ebi2_aon_clk.clkr,
+ 	[PLL9] = &hfpll0.clkr,
+ 	[PLL10] = &hfpll1.clkr,
+ 	[PLL12] = &hfpll_l2.clkr,
+--- a/include/dt-bindings/clock/qcom,gcc-ipq806x.h
++++ b/include/dt-bindings/clock/qcom,gcc-ipq806x.h
+@@ -289,5 +289,6 @@
+ #define UBI32_CORE2_CLK_SRC			278
+ #define UBI32_CORE1_CLK				279
+ #define UBI32_CORE2_CLK				280
++#define EBI2_AON_CLK				281
+ 
+ #endif
diff --git a/target/linux/ipq806x/patches-3.18/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch b/target/linux/ipq806x/patches-3.18/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
new file mode 100644
index 0000000..3fb4785
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
@@ -0,0 +1,84 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,
+	1/5] mtd: nand: Create a BBT flag to access bad block markers in raw
+	mode
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927081
+Message-Id: <1438578498-32254-2-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>
+Date: Mon,  3 Aug 2015 10:38:14 +0530
+
+Some controllers can access the factory bad block marker from OOB only
+when they read it in raw mode. When ECC is enabled, these controllers
+discard reading/writing bad block markers, preventing access to them
+altogether.
+
+The bbt driver assumes MTD_OPS_PLACE_OOB when scanning for bad blocks.
+This results in the nand driver's ecc->read_oob() op to be called, which
+works with ECC enabled.
+
+Create a new BBT option flag that tells nand_bbt to force the mode to
+MTD_OPS_RAW. This would result in the correct op being called for the
+underlying nand controller driver.
+
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+drivers/mtd/nand/nand_base.c | 6 +++++-
+ drivers/mtd/nand/nand_bbt.c  | 6 +++++-
+ include/linux/mtd/bbm.h      | 7 +++++++
+ 3 files changed, 17 insertions(+), 2 deletions(-)
+
+--- a/drivers/mtd/nand/nand_base.c
++++ b/drivers/mtd/nand/nand_base.c
+@@ -396,7 +396,11 @@ static int nand_default_block_markbad(st
+ 	} else {
+ 		ops.len = ops.ooblen = 1;
+ 	}
+-	ops.mode = MTD_OPS_PLACE_OOB;
++
++	if (unlikely(chip->bbt_options & NAND_BBT_ACCESS_BBM_RAW))
++		ops.mode = MTD_OPS_RAW;
++	else
++		ops.mode = MTD_OPS_PLACE_OOB;
+ 
+ 	/* Write to first/last page(s) if necessary */
+ 	if (chip->bbt_options & NAND_BBT_SCANLASTPAGE)
+--- a/drivers/mtd/nand/nand_bbt.c
++++ b/drivers/mtd/nand/nand_bbt.c
+@@ -423,7 +423,11 @@ static int scan_block_fast(struct mtd_in
+ 	ops.oobbuf = buf;
+ 	ops.ooboffs = 0;
+ 	ops.datbuf = NULL;
+-	ops.mode = MTD_OPS_PLACE_OOB;
++
++	if (unlikely(bd->options & NAND_BBT_ACCESS_BBM_RAW))
++		ops.mode = MTD_OPS_RAW;
++	else
++		ops.mode = MTD_OPS_PLACE_OOB;
+ 
+ 	for (j = 0; j < numpages; j++) {
+ 		/*
+--- a/include/linux/mtd/bbm.h
++++ b/include/linux/mtd/bbm.h
+@@ -116,6 +116,13 @@ struct nand_bbt_descr {
+ #define NAND_BBT_NO_OOB_BBM	0x00080000
+ 
+ /*
++ * Force MTD_OPS_RAW mode when trying to access bad block markes from OOB. To
++ * be used by controllers which can access BBM only when ECC is disabled, i.e,
++ * when in RAW access mode
++ */
++#define NAND_BBT_ACCESS_BBM_RAW	0x00100000
++
++/*
+  * Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr
+  * was allocated dynamicaly and must be freed in nand_release(). Has no meaning
+  * in nand_chip.bbt_options.
diff --git a/target/linux/ipq806x/patches-3.18/162-mtd-nand-Qualcomm-NAND-controller-driver.patch b/target/linux/ipq806x/patches-3.18/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
new file mode 100644
index 0000000..6172f7d
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
@@ -0,0 +1,2024 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,2/5] mtd: nand: Qualcomm NAND controller driver
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927101
+Message-Id: <1438578498-32254-3-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>
+Date: Mon,  3 Aug 2015 10:38:15 +0530
+
+The Qualcomm NAND controller is found in SoCs like IPQ806x, MSM7xx,
+MDM9x15 series.
+
+It exists as a sub block inside the IPs EBI2 (External Bus Interface 2)
+and QPIC (Qualcomm Parallel Interface Controller). These IPs provide a
+broader interface for external slow peripheral devices such as LCD and
+NAND/NOR flash memory or SRAM like interfaces.
+
+We add support for the NAND controller found within EBI2. For the SoCs
+of our interest, we only use the NAND controller within EBI2. Therefore,
+it's safe for us to assume that the NAND controller is a standalone block
+within the SoC.
+
+The controller supports 512B, 2kB, 4kB and 8kB page 8-bit and 16-bit NAND
+flash devices. It contains a HW ECC block that supports BCH ECC (4, 8 and
+16 bit correction/step) and RS ECC(4 bit correction/step) that covers main
+and spare data. The controller contains an internal 512 byte page buffer
+to which we read/write via DMA. The EBI2 type NAND controller uses ADM DMA
+for register read/write and data transfers. The controller performs page
+reads and writes at a codeword/step level of 512 bytes. It can support up
+to 2 external chips of different configurations.
+
+The driver prepares register read and write configuration descriptors for
+each codeword, followed by data descriptors to read or write data from the
+controller's internal buffer. It uses a single ADM DMA channel that we get
+via dmaengine API. The controller requires 2 ADM CRCIs for command and
+data flow control. These are passed via DT.
+
+The ecc layout used by the controller is syndrome like, but we can't use
+the standard syndrome ecc ops because of several reasons. First, the amount
+of data bytes covered by ecc isn't same in each step. Second, writing to
+free oob space requires us writing to the entire step in which the oob
+lies. This forces us to create our own ecc ops.
+
+One more difference is how the controller accesses the bad block marker.
+The controller ignores reading the marker when ECC is enabled. ECC needs
+to be explicity disabled to read or write to the bad block marker. For
+this reason, we use the newly created flag NAND_BBT_ACCESS_BBM_RAW to
+read the factory provided bad block markers.
+
+v3:
+- Refactor dma functions for maximum reuse
+- Use dma_slave_confing on stack
+- optimize and clean upempty_page_fixup using memchr_inv
+- ensure portability with dma register reads using le32_* funcs
+- use NAND_USE_BOUNCE_BUFFER instead of doing it ourselves
+- fix handling of return values of dmaengine funcs
+- constify wherever possible
+- Remove dependency on ADM DMA in Kconfig
+- Misc fixes and clean ups
+
+v2:
+- Use new BBT flag that allows us to read BBM in raw mode
+- reduce memcpy-s in the driver
+- some refactor and clean ups because of above changes
+
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+drivers/mtd/nand/Kconfig      |    7 +
+ drivers/mtd/nand/Makefile     |    1 +
+ drivers/mtd/nand/qcom_nandc.c | 1913 +++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 1921 insertions(+)
+ create mode 100644 drivers/mtd/nand/qcom_nandc.c
+
+--- a/drivers/mtd/nand/Kconfig
++++ b/drivers/mtd/nand/Kconfig
+@@ -516,4 +516,11 @@ config MTD_NAND_XWAY
+ 	  Enables support for NAND Flash chips on Lantiq XWAY SoCs. NAND is attached
+ 	  to the External Bus Unit (EBU).
+ 
++config MTD_NAND_QCOM
++	tristate "Support for NAND on QCOM SoCs"
++	depends on ARCH_QCOM
++	help
++	  Enables support for NAND flash chips on SoCs containing the EBI2 NAND
++	  controller. This controller is found on IPQ806x SoC.
++
+ endif # MTD_NAND
+--- /dev/null
++++ b/drivers/mtd/nand/qcom_nandc.c
+@@ -0,0 +1,1918 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This software is licensed under the terms of the GNU General Public
++ * License version 2, as published by the Free Software Foundation, and
++ * may be copied, distributed, and modified under those terms.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/clk.h>
++#include <linux/slab.h>
++#include <linux/bitops.h>
++#include <linux/dma-mapping.h>
++#include <linux/dmaengine.h>
++#include <linux/module.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/partitions.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/of_mtd.h>
++#include <linux/delay.h>
++
++/* NANDc reg offsets */
++#define NAND_FLASH_CMD			0x00
++#define NAND_ADDR0			0x04
++#define NAND_ADDR1			0x08
++#define NAND_FLASH_CHIP_SELECT		0x0c
++#define NAND_EXEC_CMD			0x10
++#define NAND_FLASH_STATUS		0x14
++#define NAND_BUFFER_STATUS		0x18
++#define NAND_DEV0_CFG0			0x20
++#define NAND_DEV0_CFG1			0x24
++#define NAND_DEV0_ECC_CFG		0x28
++#define NAND_DEV1_ECC_CFG		0x2c
++#define NAND_DEV1_CFG0			0x30
++#define NAND_DEV1_CFG1			0x34
++#define NAND_READ_ID			0x40
++#define NAND_READ_STATUS		0x44
++#define NAND_DEV_CMD0			0xa0
++#define NAND_DEV_CMD1			0xa4
++#define NAND_DEV_CMD2			0xa8
++#define NAND_DEV_CMD_VLD		0xac
++#define SFLASHC_BURST_CFG		0xe0
++#define NAND_ERASED_CW_DETECT_CFG	0xe8
++#define NAND_ERASED_CW_DETECT_STATUS	0xec
++#define NAND_EBI2_ECC_BUF_CFG		0xf0
++#define FLASH_BUF_ACC			0x100
++
++#define NAND_CTRL			0xf00
++#define NAND_VERSION			0xf08
++#define NAND_READ_LOCATION_0		0xf20
++#define NAND_READ_LOCATION_1		0xf24
++
++/* dummy register offsets, used by write_reg_dma */
++#define NAND_DEV_CMD1_RESTORE		0xdead
++#define NAND_DEV_CMD_VLD_RESTORE	0xbeef
++
++/* NAND_FLASH_CMD bits */
++#define PAGE_ACC			BIT(4)
++#define LAST_PAGE			BIT(5)
++
++/* NAND_FLASH_CHIP_SELECT bits */
++#define NAND_DEV_SEL			0
++#define DM_EN				BIT(2)
++
++/* NAND_FLASH_STATUS bits */
++#define FS_OP_ERR			BIT(4)
++#define FS_READY_BSY_N			BIT(5)
++#define FS_MPU_ERR			BIT(8)
++#define FS_DEVICE_STS_ERR		BIT(16)
++#define FS_DEVICE_WP			BIT(23)
++
++/* NAND_BUFFER_STATUS bits */
++#define BS_UNCORRECTABLE_BIT		BIT(8)
++#define BS_CORRECTABLE_ERR_MSK		0x1f
++
++/* NAND_DEVn_CFG0 bits */
++#define DISABLE_STATUS_AFTER_WRITE	4
++#define CW_PER_PAGE			6
++#define UD_SIZE_BYTES			9
++#define ECC_PARITY_SIZE_BYTES_RS	19
++#define SPARE_SIZE_BYTES		23
++#define NUM_ADDR_CYCLES			27
++#define STATUS_BFR_READ			30
++#define SET_RD_MODE_AFTER_STATUS	31
++
++/* NAND_DEVn_CFG0 bits */
++#define DEV0_CFG1_ECC_DISABLE		0
++#define WIDE_FLASH			1
++#define NAND_RECOVERY_CYCLES		2
++#define CS_ACTIVE_BSY			5
++#define BAD_BLOCK_BYTE_NUM		6
++#define BAD_BLOCK_IN_SPARE_AREA		16
++#define WR_RD_BSY_GAP			17
++#define ENABLE_BCH_ECC			27
++
++/* NAND_DEV0_ECC_CFG bits */
++#define ECC_CFG_ECC_DISABLE		0
++#define ECC_SW_RESET			1
++#define ECC_MODE			4
++#define ECC_PARITY_SIZE_BYTES_BCH	8
++#define ECC_NUM_DATA_BYTES		16
++#define ECC_FORCE_CLK_OPEN		30
++
++/* NAND_DEV_CMD1 bits */
++#define READ_ADDR			0
++
++/* NAND_DEV_CMD_VLD bits */
++#define READ_START_VLD			0
++
++/* NAND_EBI2_ECC_BUF_CFG bits */
++#define NUM_STEPS			0
++
++/* NAND_ERASED_CW_DETECT_CFG bits */
++#define ERASED_CW_ECC_MASK		1
++#define AUTO_DETECT_RES			0
++#define MASK_ECC			(1 << ERASED_CW_ECC_MASK)
++#define RESET_ERASED_DET		(1 << AUTO_DETECT_RES)
++#define ACTIVE_ERASED_DET		(0 << AUTO_DETECT_RES)
++#define CLR_ERASED_PAGE_DET		(RESET_ERASED_DET | MASK_ECC)
++#define SET_ERASED_PAGE_DET		(ACTIVE_ERASED_DET | MASK_ECC)
++
++/* NAND_ERASED_CW_DETECT_STATUS bits */
++#define PAGE_ALL_ERASED			BIT(7)
++#define CODEWORD_ALL_ERASED		BIT(6)
++#define PAGE_ERASED			BIT(5)
++#define CODEWORD_ERASED			BIT(4)
++#define ERASED_PAGE			(PAGE_ALL_ERASED | PAGE_ERASED)
++#define ERASED_CW			(CODEWORD_ALL_ERASED | CODEWORD_ERASED)
++
++/* Version Mask */
++#define NAND_VERSION_MAJOR_MASK		0xf0000000
++#define NAND_VERSION_MAJOR_SHIFT	28
++#define NAND_VERSION_MINOR_MASK		0x0fff0000
++#define NAND_VERSION_MINOR_SHIFT	16
++
++/* NAND OP_CMDs */
++#define PAGE_READ			0x2
++#define PAGE_READ_WITH_ECC		0x3
++#define PAGE_READ_WITH_ECC_SPARE	0x4
++#define PROGRAM_PAGE			0x6
++#define PAGE_PROGRAM_WITH_ECC		0x7
++#define PROGRAM_PAGE_SPARE		0x9
++#define BLOCK_ERASE			0xa
++#define FETCH_ID			0xb
++#define RESET_DEVICE			0xd
++
++/*
++ * the NAND controller performs reads/writes with ECC in 516 byte chunks.
++ * the driver calls the chunks 'step' or 'codeword' interchangeably
++ */
++#define NANDC_STEP_SIZE			512
++
++/*
++ * the largest page size we support is 8K, this will have 16 steps/codewords
++ * of 512 bytes each
++ */
++#define	MAX_NUM_STEPS			(SZ_8K / NANDC_STEP_SIZE)
++
++/* we read at most 3 registers per codeword scan */
++#define MAX_REG_RD			(3 * MAX_NUM_STEPS)
++
++/* ECC modes */
++#define ECC_NONE	BIT(0)
++#define ECC_RS_4BIT	BIT(1)
++#define	ECC_BCH_4BIT	BIT(2)
++#define	ECC_BCH_8BIT	BIT(3)
++
++struct desc_info {
++	struct list_head list;
++
++	enum dma_transfer_direction dir;
++	struct scatterlist sgl;
++	struct dma_async_tx_descriptor *dma_desc;
++};
++
++/*
++ * holds the current register values that we want to write. acts as a contiguous
++ * chunk of memory which we use to write the controller registers through DMA.
++ */
++struct nandc_regs {
++	u32 cmd;
++	u32 addr0;
++	u32 addr1;
++	u32 chip_sel;
++	u32 exec;
++
++	u32 cfg0;
++	u32 cfg1;
++	u32 ecc_bch_cfg;
++
++	u32 clrflashstatus;
++	u32 clrreadstatus;
++
++	u32 cmd1;
++	u32 vld;
++
++	u32 orig_cmd1;
++	u32 orig_vld;
++
++	u32 ecc_buf_cfg;
++};
++
++/*
++ * @cmd_crci:			ADM DMA CRCI for command flow control
++ * @data_crci:			ADM DMA CRCI for data flow control
++ * @list:			DMA descriptor list (list of desc_infos)
++ * @dma_done:			completion param to denote end of last
++ *				descriptor in the list
++ * @data_buffer:		our local DMA buffer for page read/writes,
++ *				used when we can't use the buffer provided
++ *				by upper layers directly
++ * @buf_size/count/start:	markers for chip->read_buf/write_buf functions
++ * @reg_read_buf:		buffer for reading register data via DMA
++ * @reg_read_pos:		marker for data read in reg_read_buf
++ * @cfg0, cfg1, cfg0_raw..:	NANDc register configurations needed for
++ *				ecc/non-ecc mode for the current nand flash
++ *				device
++ * @regs:			a contiguous chunk of memory for DMA register
++ *				writes
++ * @ecc_strength:		4 bit or 8 bit ecc, received via DT
++ * @bus_width:			8 bit or 16 bit NAND bus width, received via DT
++ * @ecc_modes:			supported ECC modes by the current controller,
++ *				initialized via DT match data
++ * @cw_size:			the number of bytes in a single step/codeword
++ *				of a page, consisting of all data, ecc, spare
++ *				and reserved bytes
++ * @cw_data:			the number of bytes within a codeword protected
++ *				by ECC
++ * @bch_enabled:		flag to tell whether BCH or RS ECC mode is used
++ * @status:			value to be returned if NAND_CMD_STATUS command
++ *				is executed
++ */
++struct qcom_nandc_data {
++	struct platform_device *pdev;
++	struct device *dev;
++
++	void __iomem *base;
++	struct resource *res;
++
++	struct clk *core_clk;
++	struct clk *aon_clk;
++
++	/* DMA stuff */
++	struct dma_chan *chan;
++	struct dma_slave_config	slave_conf;
++	unsigned int cmd_crci;
++	unsigned int data_crci;
++	struct list_head list;
++	struct completion dma_done;
++
++	/* MTD stuff */
++	struct nand_chip chip;
++	struct mtd_info mtd;
++
++	/* local data buffer and markers */
++	u8		*data_buffer;
++	int		buf_size;
++	int		buf_count;
++	int		buf_start;
++
++	/* local buffer to read back registers */
++	u32 *reg_read_buf;
++	int reg_read_pos;
++
++	/* required configs */
++	u32 cfg0, cfg1;
++	u32 cfg0_raw, cfg1_raw;
++	u32 ecc_buf_cfg;
++	u32 ecc_bch_cfg;
++	u32 clrflashstatus;
++	u32 clrreadstatus;
++	u32 sflashc_burst_cfg;
++	u32 cmd1, vld;
++
++	/* register state */
++	struct nandc_regs *regs;
++
++	/* things we get from DT */
++	int ecc_strength;
++	int bus_width;
++
++	u32 ecc_modes;
++
++	/* misc params */
++	int cw_size;
++	int cw_data;
++	bool use_ecc;
++	bool bch_enabled;
++	u8 status;
++	int last_command;
++};
++
++static inline u32 nandc_read(struct qcom_nandc_data *this, int offset)
++{
++	return ioread32(this->base + offset);
++}
++
++static inline void nandc_write(struct qcom_nandc_data *this, int offset,
++			       u32 val)
++{
++	iowrite32(val, this->base + offset);
++}
++
++/* helper to configure address register values */
++static void set_address(struct qcom_nandc_data *this, u16 column, int page)
++{
++	struct nand_chip *chip = &this->chip;
++	struct nandc_regs *regs = this->regs;
++
++	if (chip->options & NAND_BUSWIDTH_16)
++		column >>= 1;
++
++	regs->addr0 = page << 16 | column;
++	regs->addr1 = page >> 16 & 0xff;
++}
++
++/*
++ * update_rw_regs:	set up read/write register values, these will be
++ *			written to the NAND controller registers via DMA
++ *
++ * @num_cw:		number of steps for the read/write operation
++ * @read:		read or write operation
++ */
++static void update_rw_regs(struct qcom_nandc_data *this, int num_cw, bool read)
++{
++	struct nandc_regs *regs = this->regs;
++
++	if (read) {
++		if (this->use_ecc)
++			regs->cmd = PAGE_READ_WITH_ECC | PAGE_ACC | LAST_PAGE;
++		else
++			regs->cmd = PAGE_READ | PAGE_ACC | LAST_PAGE;
++	} else {
++			regs->cmd = PROGRAM_PAGE | PAGE_ACC | LAST_PAGE;
++	}
++
++	if (this->use_ecc) {
++		regs->cfg0 = (this->cfg0 & ~(7U << CW_PER_PAGE)) |
++				(num_cw - 1) << CW_PER_PAGE;
++
++		regs->cfg1 = this->cfg1;
++		regs->ecc_bch_cfg = this->ecc_bch_cfg;
++	} else {
++		regs->cfg0 = (this->cfg0_raw & ~(7U << CW_PER_PAGE)) |
++				(num_cw - 1) << CW_PER_PAGE;
++
++		regs->cfg1 = this->cfg1_raw;
++		regs->ecc_bch_cfg = 1 << ECC_CFG_ECC_DISABLE;
++	}
++
++	regs->ecc_buf_cfg = this->ecc_buf_cfg;
++	regs->clrflashstatus = this->clrflashstatus;
++	regs->clrreadstatus = this->clrreadstatus;
++	regs->exec = 1;
++}
++
++static int prep_dma_desc(struct qcom_nandc_data *this, bool read, int reg_off,
++			 const void *vaddr, int size, bool flow_control)
++{
++	struct desc_info *desc;
++	struct dma_async_tx_descriptor *dma_desc;
++	struct scatterlist *sgl;
++	struct dma_slave_config slave_conf;
++	int r;
++
++	desc = kzalloc(sizeof(*desc), GFP_KERNEL);
++	if (!desc)
++		return -ENOMEM;
++
++	list_add_tail(&desc->list, &this->list);
++
++	sgl = &desc->sgl;
++
++	sg_init_one(sgl, vaddr, size);
++
++	desc->dir = read ? DMA_DEV_TO_MEM : DMA_MEM_TO_DEV;
++
++	r = dma_map_sg(this->dev, sgl, 1, desc->dir);
++	if (r == 0) {
++		r = -ENOMEM;
++		goto err;
++	}
++
++	memset(&slave_conf, 0x00, sizeof(slave_conf));
++
++	slave_conf.device_fc = flow_control;
++	if (read) {
++		slave_conf.src_maxburst = 16;
++		slave_conf.src_addr = this->res->start + reg_off;
++		slave_conf.slave_id = this->data_crci;
++	} else {
++		slave_conf.dst_maxburst = 16;
++		slave_conf.dst_addr = this->res->start + reg_off;
++		slave_conf.slave_id = this->cmd_crci;
++	}
++
++	r = dmaengine_slave_config(this->chan, &slave_conf);
++	if (r) {
++		dev_err(this->dev, "failed to configure dma channel\n");
++		goto err;
++	}
++
++	dma_desc = dmaengine_prep_slave_sg(this->chan, sgl, 1, desc->dir, 0);
++	if (!dma_desc) {
++		dev_err(this->dev, "failed to prepare desc\n");
++		r = -EINVAL;
++		goto err;
++	}
++
++	desc->dma_desc = dma_desc;
++
++	return 0;
++err:
++	kfree(desc);
++
++	return r;
++}
++
++/*
++ * read_reg_dma:	prepares a descriptor to read a given number of
++ *			contiguous registers to the reg_read_buf pointer
++ *
++ * @first:		offset of the first register in the contiguous block
++ * @num_regs:		number of registers to read
++ */
++static int read_reg_dma(struct qcom_nandc_data *this, int first, int num_regs)
++{
++	bool flow_control = false;
++	void *vaddr;
++	int size;
++
++	if (first == NAND_READ_ID || first == NAND_FLASH_STATUS)
++		flow_control = true;
++
++	size = num_regs * sizeof(u32);
++	vaddr = this->reg_read_buf + this->reg_read_pos;
++	this->reg_read_pos += num_regs;
++
++	return prep_dma_desc(this, true, first, vaddr, size, flow_control);
++}
++
++/*
++ * write_reg_dma:	prepares a descriptor to write a given number of
++ *			contiguous registers
++ *
++ * @first:		offset of the first register in the contiguous block
++ * @num_regs:		number of registers to write
++ */
++static int write_reg_dma(struct qcom_nandc_data *this, int first, int num_regs)
++{
++	bool flow_control = false;
++	struct nandc_regs *regs = this->regs;
++	void *vaddr;
++	int size;
++
++	switch (first) {
++	case NAND_FLASH_CMD:
++		vaddr = &regs->cmd;
++		flow_control = true;
++		break;
++	case NAND_EXEC_CMD:
++		vaddr = &regs->exec;
++		break;
++	case NAND_FLASH_STATUS:
++		vaddr = &regs->clrflashstatus;
++		break;
++	case NAND_DEV0_CFG0:
++		vaddr = &regs->cfg0;
++		break;
++	case NAND_READ_STATUS:
++		vaddr = &regs->clrreadstatus;
++		break;
++	case NAND_DEV_CMD1:
++		vaddr = &regs->cmd1;
++		break;
++	case NAND_DEV_CMD1_RESTORE:
++		first = NAND_DEV_CMD1;
++		vaddr = &regs->orig_cmd1;
++		break;
++	case NAND_DEV_CMD_VLD:
++		vaddr = &regs->vld;
++		break;
++	case NAND_DEV_CMD_VLD_RESTORE:
++		first = NAND_DEV_CMD_VLD;
++		vaddr = &regs->orig_vld;
++		break;
++	case NAND_EBI2_ECC_BUF_CFG:
++		vaddr = &regs->ecc_buf_cfg;
++		break;
++	default:
++		dev_err(this->dev, "invalid starting register\n");
++		return -EINVAL;
++	}
++
++	size = num_regs * sizeof(u32);
++
++	return prep_dma_desc(this, false, first, vaddr, size, flow_control);
++}
++
++/*
++ * read_data_dma:	prepares a DMA descriptor to transfer data from the
++ *			controller's internal buffer to the buffer 'vaddr'
++ *
++ * @reg_off:		offset within the controller's data buffer
++ * @vaddr:		virtual address of the buffer we want to write to
++ * @size:		DMA transaction size in bytes
++ */
++static int read_data_dma(struct qcom_nandc_data *this, int reg_off,
++			 const u8 *vaddr, int size)
++{
++	return prep_dma_desc(this, true, reg_off, vaddr, size, false);
++}
++
++/*
++ * write_data_dma:	prepares a DMA descriptor to transfer data from
++ *			'vaddr' to the controller's internal buffer
++ *
++ * @reg_off:		offset within the controller's data buffer
++ * @vaddr:		virtual address of the buffer we want to read from
++ * @size:		DMA transaction size in bytes
++ */
++static int write_data_dma(struct qcom_nandc_data *this, int reg_off,
++			  const u8 *vaddr, int size)
++{
++	return prep_dma_desc(this, false, reg_off, vaddr, size, false);
++}
++
++/*
++ * helper to prepare dma descriptors to configure registers needed for reading a
++ * codeword/step in a page
++ */
++static void config_cw_read(struct qcom_nandc_data *this)
++{
++	write_reg_dma(this, NAND_FLASH_CMD, 3);
++	write_reg_dma(this, NAND_DEV0_CFG0, 3);
++	write_reg_dma(this, NAND_EBI2_ECC_BUF_CFG, 1);
++
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_FLASH_STATUS, 2);
++	read_reg_dma(this, NAND_ERASED_CW_DETECT_STATUS, 1);
++}
++
++/*
++ * helpers to prepare dma descriptors used to configure registers needed for
++ * writing a codeword/step in a page
++ */
++static void config_cw_write_pre(struct qcom_nandc_data *this)
++{
++	write_reg_dma(this, NAND_FLASH_CMD, 3);
++	write_reg_dma(this, NAND_DEV0_CFG0, 3);
++	write_reg_dma(this, NAND_EBI2_ECC_BUF_CFG, 1);
++}
++
++static void config_cw_write_post(struct qcom_nandc_data *this)
++{
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_FLASH_STATUS, 1);
++
++	write_reg_dma(this, NAND_FLASH_STATUS, 1);
++	write_reg_dma(this, NAND_READ_STATUS, 1);
++}
++
++/*
++ * the following functions are used within chip->cmdfunc() to perform different
++ * NAND_CMD_* commands
++ */
++
++/* sets up descriptors for NAND_CMD_PARAM */
++static int nandc_param(struct qcom_nandc_data *this)
++{
++	struct nandc_regs *regs = this->regs;
++
++	/*
++	 * NAND_CMD_PARAM is called before we know much about the FLASH chip
++	 * in use. we configure the controller to perform a raw read of 512
++	 * bytes to read onfi params
++	 */
++	regs->cmd = PAGE_READ | PAGE_ACC | LAST_PAGE;
++	regs->addr0 = 0;
++	regs->addr1 = 0;
++	regs->cfg0 =  0 << CW_PER_PAGE
++			| 512 << UD_SIZE_BYTES
++			| 5 << NUM_ADDR_CYCLES
++			| 0 << SPARE_SIZE_BYTES;
++
++	regs->cfg1 =  7 << NAND_RECOVERY_CYCLES
++			| 0 << CS_ACTIVE_BSY
++			| 17 << BAD_BLOCK_BYTE_NUM
++			| 1 << BAD_BLOCK_IN_SPARE_AREA
++			| 2 << WR_RD_BSY_GAP
++			| 0 << WIDE_FLASH
++			| 1 << DEV0_CFG1_ECC_DISABLE;
++
++	regs->ecc_bch_cfg = 1 << ECC_CFG_ECC_DISABLE;
++
++	/* configure CMD1 and VLD for ONFI param probing */
++	regs->vld = (this->vld & ~(1 << READ_START_VLD))
++			| 0 << READ_START_VLD;
++
++	regs->cmd1 = (this->cmd1 & ~(0xFF << READ_ADDR))
++			| NAND_CMD_PARAM << READ_ADDR;
++
++	regs->exec = 1;
++
++	regs->orig_cmd1 = this->cmd1;
++	regs->orig_vld = this->vld;
++
++	write_reg_dma(this, NAND_DEV_CMD_VLD, 1);
++	write_reg_dma(this, NAND_DEV_CMD1, 1);
++
++	this->buf_count = 512;
++	memset(this->data_buffer, 0xff, this->buf_count);
++
++	config_cw_read(this);
++
++	read_data_dma(this, FLASH_BUF_ACC, this->data_buffer, this->buf_count);
++
++	/* restore CMD1 and VLD regs */
++	write_reg_dma(this, NAND_DEV_CMD1_RESTORE, 1);
++	write_reg_dma(this, NAND_DEV_CMD_VLD_RESTORE, 1);
++
++	return 0;
++}
++
++/* sets up descriptors for NAND_CMD_ERASE1 */
++static int erase_block(struct qcom_nandc_data *this, int page_addr)
++{
++	struct nandc_regs *regs = this->regs;
++
++	regs->cmd = BLOCK_ERASE | PAGE_ACC | LAST_PAGE;
++	regs->addr0 = page_addr;
++	regs->addr1 = 0;
++	regs->cfg0 = this->cfg0_raw & ~(7 << CW_PER_PAGE);
++	regs->cfg1 = this->cfg1_raw;
++	regs->exec = 1;
++	regs->clrflashstatus = this->clrflashstatus;
++	regs->clrreadstatus = this->clrreadstatus;
++
++	write_reg_dma(this, NAND_FLASH_CMD, 3);
++	write_reg_dma(this, NAND_DEV0_CFG0, 2);
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_FLASH_STATUS, 1);
++
++	write_reg_dma(this, NAND_FLASH_STATUS, 1);
++	write_reg_dma(this, NAND_READ_STATUS, 1);
++
++	return 0;
++}
++
++/* sets up descriptors for NAND_CMD_READID */
++static int read_id(struct qcom_nandc_data *this, int column)
++{
++	struct nandc_regs *regs = this->regs;
++
++	if (column == -1)
++		return 0;
++
++	regs->cmd = FETCH_ID;
++	regs->addr0 = column;
++	regs->addr1 = 0;
++	regs->chip_sel = DM_EN;
++	regs->exec = 1;
++
++	write_reg_dma(this, NAND_FLASH_CMD, 4);
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_READ_ID, 1);
++
++	return 0;
++}
++
++/* sets up descriptors for NAND_CMD_RESET */
++static int reset(struct qcom_nandc_data *this)
++{
++	struct nandc_regs *regs = this->regs;
++
++	regs->cmd = RESET_DEVICE;
++	regs->exec = 1;
++
++	write_reg_dma(this, NAND_FLASH_CMD, 1);
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_FLASH_STATUS, 1);
++
++	return 0;
++}
++
++/* helpers to submit/free our list of dma descriptors */
++static void dma_callback(void *param)
++{
++	struct qcom_nandc_data *this = param;
++	struct completion *c = &this->dma_done;
++
++	complete(c);
++}
++
++static int submit_descs(struct qcom_nandc_data *this)
++{
++	struct completion *c = &this->dma_done;
++	struct desc_info *desc;
++	int r;
++
++	init_completion(c);
++
++	list_for_each_entry(desc, &this->list, list) {
++		/*
++		 * we add a callback to the last descriptor in our list to
++		 * notify completion of command
++		 */
++		if (list_is_last(&desc->list, &this->list)) {
++			desc->dma_desc->callback = dma_callback;
++			desc->dma_desc->callback_param = this;
++		}
++
++		dmaengine_submit(desc->dma_desc);
++	}
++
++	dma_async_issue_pending(this->chan);
++
++	r = wait_for_completion_timeout(c, msecs_to_jiffies(500));
++	if (!r)
++		return -ETIMEDOUT;
++
++	return 0;
++}
++
++static void free_descs(struct qcom_nandc_data *this)
++{
++	struct desc_info *desc, *n;
++
++	list_for_each_entry_safe(desc, n, &this->list, list) {
++		list_del(&desc->list);
++		dma_unmap_sg(this->dev, &desc->sgl, 1, desc->dir);
++		kfree(desc);
++	}
++}
++
++/* reset the register read buffer for next NAND operation */
++static void clear_read_regs(struct qcom_nandc_data *this)
++{
++	this->reg_read_pos = 0;
++	memset(this->reg_read_buf, 0, MAX_REG_RD * sizeof(*this->reg_read_buf));
++}
++
++static void pre_command(struct qcom_nandc_data *this, int command)
++{
++	this->buf_count = 0;
++	this->buf_start = 0;
++	this->use_ecc = false;
++	this->last_command = command;
++
++	clear_read_regs(this);
++}
++
++/*
++ * this is called after NAND_CMD_PAGEPROG and NAND_CMD_ERASE1 to set our
++ * privately maintained status byte, this status byte can be read after
++ * NAND_CMD_STATUS is called
++ */
++static void parse_erase_write_errors(struct qcom_nandc_data *this, int command)
++{
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int num_cw;
++	int i;
++
++	num_cw = command == NAND_CMD_PAGEPROG ? ecc->steps : 1;
++
++	for (i = 0; i < num_cw; i++) {
++		__le32 flash_status = le32_to_cpu(this->reg_read_buf[i]);
++
++		if (flash_status & FS_MPU_ERR)
++			this->status &= ~NAND_STATUS_WP;
++
++		if (flash_status & FS_OP_ERR || (i == (num_cw - 1) &&
++				(flash_status & FS_DEVICE_STS_ERR)))
++			this->status |= NAND_STATUS_FAIL;
++	}
++}
++
++static void post_command(struct qcom_nandc_data *this, int command)
++{
++	switch (command) {
++	case NAND_CMD_READID:
++		memcpy(this->data_buffer, this->reg_read_buf, this->buf_count);
++		break;
++	case NAND_CMD_PAGEPROG:
++	case NAND_CMD_ERASE1:
++		parse_erase_write_errors(this, command);
++		break;
++	default:
++		break;
++	}
++}
++
++/*
++ * Implements chip->cmdfunc. It's  only used for a limited set of commands.
++ * The rest of the commands wouldn't be called by upper layers. For example,
++ * NAND_CMD_READOOB would never be called because we have our own versions
++ * of read_oob ops for nand_ecc_ctrl.
++ */
++static void qcom_nandc_command(struct mtd_info *mtd, unsigned int command,
++			 int column, int page_addr)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	struct qcom_nandc_data *this = chip->priv;
++	bool wait = false;
++	int r = 0;
++
++	pre_command(this, command);
++
++	switch (command) {
++	case NAND_CMD_RESET:
++		r = reset(this);
++		wait = true;
++		break;
++
++	case NAND_CMD_READID:
++		this->buf_count = 4;
++		r = read_id(this, column);
++		wait = true;
++		break;
++
++	case NAND_CMD_PARAM:
++		r = nandc_param(this);
++		wait = true;
++		break;
++
++	case NAND_CMD_ERASE1:
++		r = erase_block(this, page_addr);
++		wait = true;
++		break;
++
++	case NAND_CMD_READ0:
++		/* we read the entire page for now */
++		WARN_ON(column != 0);
++
++		this->use_ecc = true;
++		set_address(this, 0, page_addr);
++		update_rw_regs(this, ecc->steps, true);
++		break;
++
++	case NAND_CMD_SEQIN:
++		WARN_ON(column != 0);
++		set_address(this, 0, page_addr);
++		break;
++
++	case NAND_CMD_PAGEPROG:
++	case NAND_CMD_STATUS:
++	case NAND_CMD_NONE:
++	default:
++		break;
++	}
++
++	if (r) {
++		dev_err(this->dev, "failure executing command %d\n",
++			command);
++		free_descs(this);
++		return;
++	}
++
++	if (wait) {
++		r = submit_descs(this);
++		if (r)
++			dev_err(this->dev,
++				"failure submitting descs for command %d\n",
++				command);
++	}
++
++	free_descs(this);
++
++	post_command(this, command);
++}
++
++/*
++ * when using RS ECC, the NAND controller flags an error when reading an
++ * erased page. however, there are special characters at certain offsets when
++ * we read the erased page. we check here if the page is really empty. if so,
++ * we replace the magic characters with 0xffs
++ */
++static bool empty_page_fixup(struct qcom_nandc_data *this, u8 *data_buf)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int cwperpage = ecc->steps;
++	u8 orig1[MAX_NUM_STEPS], orig2[MAX_NUM_STEPS];
++	int i, j;
++
++	/* if BCH is enabled, HW will take care of detecting erased pages */
++	if (this->bch_enabled || !this->use_ecc)
++		return false;
++
++	for (i = 0; i < cwperpage; i++) {
++		u8 *empty1, *empty2;
++		__le32 flash_status = le32_to_cpu(this->reg_read_buf[3 * i]);
++
++		/*
++		 * an erased page flags an error in NAND_FLASH_STATUS, check if
++		 * the page is erased by looking for 0x54s at offsets 3 and 175
++		 * from the beginning of each codeword
++		 */
++		if (!(flash_status & FS_OP_ERR))
++			break;
++
++		empty1 = &data_buf[3 + i * this->cw_data];
++		empty2 = &data_buf[175 + i * this->cw_data];
++
++		/*
++		 * if the error wasn't because of an erased page, bail out and
++		 * and let someone else do the error checking
++		 */
++		if ((*empty1 == 0x54 && *empty2 == 0xff) ||
++				(*empty1 == 0xff && *empty2 == 0x54)) {
++			orig1[i] = *empty1;
++			orig2[i] = *empty2;
++
++			*empty1 = 0xff;
++			*empty2 = 0xff;
++		} else {
++			break;
++		}
++	}
++
++	if (i < cwperpage || memchr_inv(data_buf, 0xff, mtd->writesize))
++		goto not_empty;
++
++	/*
++	 * tell the caller that the page was empty and is fixed up, so that
++	 * parse_read_errors() doesn't think it's an error
++	 */
++	return true;
++
++not_empty:
++	/* restore original values if not empty*/
++	for (j = 0; j < i; j++) {
++		data_buf[3 + j * this->cw_data] = orig1[j];
++		data_buf[175 + j * this->cw_data] = orig2[j];
++	}
++
++	return false;
++}
++
++struct read_stats {
++	__le32 flash;
++	__le32 buffer;
++	__le32 erased_cw;
++};
++
++/*
++ * reads back status registers set by the controller to notify page read
++ * errors. this is equivalent to what 'ecc->correct()' would do.
++ */
++static int parse_read_errors(struct qcom_nandc_data *this, bool erased_page)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int cwperpage = ecc->steps;
++	unsigned int max_bitflips = 0;
++	int i;
++
++	for (i = 0; i < cwperpage; i++) {
++		int stat;
++		struct read_stats *buf;
++
++		buf = (struct read_stats *) (this->reg_read_buf + 3 * i);
++
++		buf->flash = le32_to_cpu(buf->flash);
++		buf->buffer = le32_to_cpu(buf->buffer);
++		buf->erased_cw = le32_to_cpu(buf->erased_cw);
++
++		if (buf->flash & (FS_OP_ERR | FS_MPU_ERR)) {
++
++			/* ignore erased codeword errors */
++			if (this->bch_enabled) {
++				if ((buf->erased_cw & ERASED_CW) == ERASED_CW)
++					continue;
++			} else if (erased_page) {
++				continue;
++			}
++
++			if (buf->buffer & BS_UNCORRECTABLE_BIT) {
++				mtd->ecc_stats.failed++;
++				continue;
++			}
++		}
++
++		stat = buf->buffer & BS_CORRECTABLE_ERR_MSK;
++		mtd->ecc_stats.corrected += stat;
++
++		max_bitflips = max_t(unsigned int, max_bitflips, stat);
++	}
++
++	return max_bitflips;
++}
++
++/*
++ * helper to perform the actual page read operation, used by ecc->read_page()
++ * and ecc->read_oob()
++ */
++static int read_page_low(struct qcom_nandc_data *this, u8 *data_buf,
++			 u8 *oob_buf)
++{
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int i, r;
++
++	/* queue cmd descs for each codeword */
++	for (i = 0; i < ecc->steps; i++) {
++		int data_size, oob_size;
++
++		if (i == (ecc->steps - 1)) {
++			data_size = ecc->size - ((ecc->steps - 1) << 2);
++			oob_size = (ecc->steps << 2) + ecc->bytes;
++		} else {
++			data_size = this->cw_data;
++			oob_size = ecc->bytes;
++		}
++
++		config_cw_read(this);
++
++		if (data_buf)
++			read_data_dma(this, FLASH_BUF_ACC, data_buf, data_size);
++
++		if (oob_buf)
++			read_data_dma(this, FLASH_BUF_ACC + data_size, oob_buf,
++					oob_size);
++
++		if (data_buf)
++			data_buf += data_size;
++		if (oob_buf)
++			oob_buf += oob_size;
++	}
++
++	r = submit_descs(this);
++	if (r)
++		dev_err(this->dev, "failure to read page/oob\n");
++
++	free_descs(this);
++
++	return r;
++}
++
++/*
++ * a helper that copies the last step/codeword of a page (containing free oob)
++ * into our local buffer
++ */
++static int copy_last_cw(struct qcom_nandc_data *this, bool use_ecc, int page)
++{
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int size;
++	int r;
++
++	clear_read_regs(this);
++
++	size = use_ecc ? this->cw_data : this->cw_size;
++
++	/* prepare a clean read buffer */
++	memset(this->data_buffer, 0xff, size);
++
++	this->use_ecc = use_ecc;
++	set_address(this, this->cw_size * (ecc->steps - 1), page);
++	update_rw_regs(this, 1, true);
++
++	config_cw_read(this);
++
++	read_data_dma(this, FLASH_BUF_ACC, this->data_buffer, size);
++
++	r = submit_descs(this);
++	if (r)
++		dev_err(this->dev, "failed to copy last codeword\n");
++
++	free_descs(this);
++
++	return r;
++}
++
++/* implements ecc->read_page() */
++static int qcom_nandc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
++				uint8_t *buf, int oob_required, int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	u8 *data_buf, *oob_buf = NULL;
++	bool erased_page;
++	int r;
++
++	data_buf = buf;
++	oob_buf = oob_required ? chip->oob_poi : NULL;
++
++	r = read_page_low(this, data_buf, oob_buf);
++	if (r) {
++		dev_err(this->dev, "failure to read page\n");
++		return r;
++	}
++
++	erased_page = empty_page_fixup(this, data_buf);
++
++	return parse_read_errors(this, erased_page);
++}
++
++/* implements ecc->read_oob() */
++static int qcom_nandc_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
++			       int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int r;
++
++	clear_read_regs(this);
++
++	this->use_ecc = true;
++	set_address(this, 0, page);
++	update_rw_regs(this, ecc->steps, true);
++
++	r = read_page_low(this, NULL, chip->oob_poi);
++	if (r)
++		dev_err(this->dev, "failure to read oob\n");
++
++	return r;
++}
++
++/* implements ecc->read_oob_raw(), used to read the bad block marker flag */
++static int qcom_nandc_read_oob_raw(struct mtd_info *mtd, struct nand_chip *chip,
++				   int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	uint8_t *oob = chip->oob_poi;
++	int start, length;
++	int r;
++
++	/*
++	 * configure registers for a raw page read, the address is set to the
++	 * beginning of the last codeword, we don't care about reading ecc
++	 * portion of oob, just the free stuff
++	 */
++	r = copy_last_cw(this, false, page);
++	if (r)
++		return r;
++
++	/*
++	 * reading raw oob has 2 parts, first the bad block byte, then the
++	 * actual free oob region. perform a memcpy in two steps
++	 */
++	start = mtd->writesize - (this->cw_size * (ecc->steps - 1));
++	length = chip->options & NAND_BUSWIDTH_16 ? 2 : 1;
++
++	memcpy(oob, this->data_buffer + start, length);
++
++	oob += length;
++
++	start = this->cw_data - (ecc->steps << 2) + 1;
++	length = ecc->steps << 2;
++
++	memcpy(oob, this->data_buffer + start, length);
++
++	return 0;
++}
++
++/* implements ecc->write_page() */
++static int qcom_nandc_write_page(struct mtd_info *mtd, struct nand_chip *chip,
++				 const uint8_t *buf, int oob_required)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	u8 *data_buf, *oob_buf;
++	int i, r = 0;
++
++	clear_read_regs(this);
++
++	data_buf = (u8 *) buf;
++	oob_buf = chip->oob_poi;
++
++	this->use_ecc = true;
++	update_rw_regs(this, ecc->steps, false);
++
++	for (i = 0; i < ecc->steps; i++) {
++		int data_size, oob_size;
++
++		if (i == (ecc->steps - 1)) {
++			data_size = ecc->size - ((ecc->steps - 1) << 2);
++			oob_size = (ecc->steps << 2) + ecc->bytes;
++		} else {
++			data_size = this->cw_data;
++			oob_size = ecc->bytes;
++		}
++
++		config_cw_write_pre(this);
++		write_data_dma(this, FLASH_BUF_ACC, data_buf, data_size);
++
++		/*
++		 * we don't really need to write anything to oob for the
++		 * first n - 1 codewords since these oob regions just
++		 * contain ecc that's written by the controller itself
++		 */
++		if (i == (ecc->steps - 1))
++			write_data_dma(this, FLASH_BUF_ACC + data_size,
++					oob_buf, oob_size);
++		config_cw_write_post(this);
++
++		data_buf += data_size;
++		oob_buf += oob_size;
++	}
++
++	r = submit_descs(this);
++	if (r)
++		dev_err(this->dev, "failure to write page\n");
++
++	free_descs(this);
++
++	return r;
++}
++
++/*
++ * implements ecc->write_oob()
++ *
++ * the NAND controller cannot write only data or only oob within a codeword,
++ * since ecc is calculated for the combined codeword. we first copy the
++ * entire contents for the last codeword(data + oob), replace the old oob
++ * with the new one in chip->oob_poi, and then write the entire codeword.
++ * this read-copy-write operation results in a slight perormance loss.
++ */
++static int qcom_nandc_write_oob(struct mtd_info *mtd, struct nand_chip *chip,
++				int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	uint8_t *oob = chip->oob_poi;
++	int free_boff;
++	int data_size, oob_size;
++	int r, status = 0;
++
++	r = copy_last_cw(this, true, page);
++	if (r)
++		return r;
++
++	clear_read_regs(this);
++
++	/* calculate the data and oob size for the last codeword/step */
++	data_size = ecc->size - ((ecc->steps - 1) << 2);
++	oob_size = (ecc->steps << 2) + ecc->bytes;
++
++	/*
++	 * the location of spare data in the oob buffer, we could also use
++	 * ecc->layout.oobfree here
++	 */
++	free_boff = ecc->bytes * (ecc->steps - 1);
++
++	/* override new oob content to last codeword */
++	memcpy(this->data_buffer + data_size, oob + free_boff, oob_size);
++
++	this->use_ecc = true;
++	set_address(this, this->cw_size * (ecc->steps - 1), page);
++	update_rw_regs(this, 1, false);
++
++	config_cw_write_pre(this);
++	write_data_dma(this, FLASH_BUF_ACC, this->data_buffer,
++		data_size + oob_size);
++	config_cw_write_post(this);
++
++	r = submit_descs(this);
++
++	free_descs(this);
++
++	if (r) {
++		dev_err(this->dev, "failure to write oob\n");
++		return -EIO;
++	}
++
++	chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
++
++	status = chip->waitfunc(mtd, chip);
++
++	return status & NAND_STATUS_FAIL ? -EIO : 0;
++}
++
++/* implements ecc->write_oob_raw(), used to write bad block marker flag */
++static int qcom_nandc_write_oob_raw(struct mtd_info *mtd,
++				    struct nand_chip *chip, int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	uint8_t *oob = chip->oob_poi;
++	int start, length;
++	int r, status = 0;
++
++	r = copy_last_cw(this, false, page);
++	if (r)
++		return r;
++
++	clear_read_regs(this);
++
++	/*
++	 * writing raw oob has 2 parts, first the bad block region, then the
++	 * actual free region
++	 */
++	start = mtd->writesize - (this->cw_size * (ecc->steps - 1));
++	length = chip->options & NAND_BUSWIDTH_16 ? 2 : 1;
++
++	memcpy(this->data_buffer + start, oob, length);
++
++	oob += length;
++
++	start = this->cw_data - (ecc->steps << 2) + 1;
++	length = ecc->steps << 2;
++
++	memcpy(this->data_buffer + start, oob, length);
++
++	/* prepare write */
++	this->use_ecc = false;
++	set_address(this, this->cw_size * (ecc->steps - 1), page);
++	update_rw_regs(this, 1, false);
++
++	config_cw_write_pre(this);
++	write_data_dma(this, FLASH_BUF_ACC, this->data_buffer, this->cw_size);
++	config_cw_write_post(this);
++
++	r = submit_descs(this);
++
++	free_descs(this);
++
++	if (r) {
++		dev_err(this->dev, "failure to write updated oob\n");
++		return -EIO;
++	}
++
++	chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
++
++	status = chip->waitfunc(mtd, chip);
++
++	return status & NAND_STATUS_FAIL ? -EIO : 0;
++}
++
++/*
++ * the three functions below implement chip->read_byte(), chip->read_buf()
++ * and chip->write_buf() respectively. these aren't used for
++ * reading/writing page data, they are used for smaller data like reading
++ * id, status etc
++ */
++static uint8_t qcom_nandc_read_byte(struct mtd_info *mtd)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct qcom_nandc_data *this = chip->priv;
++	uint8_t *buf = this->data_buffer;
++	uint8_t ret = 0x0;
++
++	if (this->last_command == NAND_CMD_STATUS) {
++		ret = this->status;
++
++		this->status = NAND_STATUS_READY | NAND_STATUS_WP;
++
++		return ret;
++	}
++
++	if (this->buf_start < this->buf_count)
++		ret = buf[this->buf_start++];
++
++	return ret;
++}
++
++static void qcom_nandc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct qcom_nandc_data *this = chip->priv;
++	int real_len = min_t(size_t, len, this->buf_count - this->buf_start);
++
++	memcpy(buf, this->data_buffer + this->buf_start, real_len);
++	this->buf_start += real_len;
++}
++
++static void qcom_nandc_write_buf(struct mtd_info *mtd, const uint8_t *buf,
++		int len)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct qcom_nandc_data *this = chip->priv;
++	int real_len = min_t(size_t, len, this->buf_count - this->buf_start);
++
++	memcpy(this->data_buffer + this->buf_start, buf, real_len);
++
++	this->buf_start += real_len;
++}
++
++/* we support only one external chip for now */
++static void qcom_nandc_select_chip(struct mtd_info *mtd, int chipnr)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct qcom_nandc_data *this = chip->priv;
++
++	if (chipnr <= 0)
++		return;
++
++	dev_warn(this->dev, "invalid chip select\n");
++}
++
++/*
++ * NAND controller page layout info
++ *
++ * |-----------------------|	  |---------------------------------|
++ * |		xx.......xx|	  |		*********xx.......xx|
++ * |	DATA	xx..ECC..xx|	  |	DATA	**SPARE**xx..ECC..xx|
++ * |   (516)	xx.......xx|	  |  (516-n*4)	**(n*4)**xx.......xx|
++ * |		xx.......xx|	  |		*********xx.......xx|
++ * |-----------------------|	  |---------------------------------|
++ *     codeword 1,2..n-1			codeword n
++ *  <---(528/532 Bytes)---->	   <-------(528/532 Bytes)---------->
++ *
++ * n = number of codewords in the page
++ * . = ECC bytes
++ * * = spare bytes
++ * x = unused/reserved bytes
++ *
++ * 2K page: n = 4, spare = 16 bytes
++ * 4K page: n = 8, spare = 32 bytes
++ * 8K page: n = 16, spare = 64 bytes
++ *
++ * the qcom nand controller operates at a sub page/codeword level. each
++ * codeword is 528 and 532 bytes for 4 bit and 8 bit ECC modes respectively.
++ * the number of ECC bytes vary based on the ECC strength and the bus width.
++ *
++ * the first n - 1 codewords contains 516 bytes of user data, the remaining
++ * 12/16 bytes consist of ECC and reserved data. The nth codeword contains
++ * both user data and spare(oobavail) bytes that sum up to 516 bytes.
++ *
++ * the layout described above is used by the controller when the ECC block is
++ * enabled. When we read a page with ECC enabled, the unused/reserved bytes are
++ * skipped and not copied to our internal buffer. therefore, the nand_ecclayout
++ * layouts defined below doesn't consider the positions occupied by the reserved
++ * bytes
++ *
++ * when the ECC block is disabled, one unused byte (or two for 16 bit bus width)
++ * in the last codeword is the position of bad block marker. the bad block
++ * marker cannot be accessed when ECC is enabled.
++ *
++ */
++
++/*
++ * Layouts for different page sizes and ecc modes. We skip the eccpos field
++ * since it isn't needed for this driver
++ */
++
++/* 2K page, 4 bit ECC */
++static struct nand_ecclayout layout_oob_64 = {
++	.eccbytes	= 40,
++	.oobfree	= {
++				{ 30, 16 },
++			  },
++};
++
++/* 4K page, 4 bit ECC, 8/16 bit bus width */
++static struct nand_ecclayout layout_oob_128 = {
++	.eccbytes	= 80,
++	.oobfree	= {
++				{ 70, 32 },
++			  },
++};
++
++/* 4K page, 8 bit ECC, 8 bit bus width */
++static struct nand_ecclayout layout_oob_224_x8 = {
++	.eccbytes	= 104,
++	.oobfree	= {
++				{ 91, 32 },
++			  },
++};
++
++/* 4K page, 8 bit ECC, 16 bit bus width */
++static struct nand_ecclayout layout_oob_224_x16 = {
++	.eccbytes	= 112,
++	.oobfree	= {
++				{ 98, 32 },
++			  },
++};
++
++/* 8K page, 4 bit ECC, 8/16 bit bus width */
++static struct nand_ecclayout layout_oob_256 = {
++	.eccbytes	= 160,
++	.oobfree	= {
++				{ 151, 64 },
++			  },
++};
++
++/*
++ * this is called before scan_ident, we do some minimal configurations so
++ * that reading ID and ONFI params work
++ */
++static void qcom_nandc_pre_init(struct qcom_nandc_data *this)
++{
++	/* kill onenand */
++	nandc_write(this, SFLASHC_BURST_CFG, 0);
++
++	/* enable ADM DMA */
++	nandc_write(this, NAND_FLASH_CHIP_SELECT, DM_EN);
++
++	/* save the original values of these registers */
++	this->cmd1 = nandc_read(this, NAND_DEV_CMD1);
++	this->vld = nandc_read(this, NAND_DEV_CMD_VLD);
++
++	/* initial status value */
++	this->status = NAND_STATUS_READY | NAND_STATUS_WP;
++}
++
++static int qcom_nandc_ecc_init(struct qcom_nandc_data *this)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int cwperpage;
++	bool wide_bus;
++
++	/* the nand controller fetches codewords/chunks of 512 bytes */
++	cwperpage = mtd->writesize >> 9;
++
++	ecc->strength = this->ecc_strength;
++
++	wide_bus = chip->options & NAND_BUSWIDTH_16 ? true : false;
++
++	if (ecc->strength >= 8) {
++		/* 8 bit ECC defaults to BCH ECC on all platforms */
++		ecc->bytes = wide_bus ? 14 : 13;
++	} else {
++		/*
++		 * if the controller supports BCH for 4 bit ECC, the controller
++		 * uses lesser bytes for ECC. If RS is used, the ECC bytes is
++		 * always 10 bytes
++		 */
++		if (this->ecc_modes & ECC_BCH_4BIT)
++			ecc->bytes = wide_bus ? 8 : 7;
++		else
++			ecc->bytes = 10;
++	}
++
++	/* each step consists of 512 bytes of data */
++	ecc->size = NANDC_STEP_SIZE;
++
++	ecc->read_page		= qcom_nandc_read_page;
++	ecc->read_oob		= qcom_nandc_read_oob;
++	ecc->write_page		= qcom_nandc_write_page;
++	ecc->write_oob		= qcom_nandc_write_oob;
++
++	/*
++	 * the bad block marker is readable only when we read the page with ECC
++	 * disabled. all the ops above run with ECC enabled. We need raw read
++	 * and write function for oob in order to access bad block marker.
++	 */
++	ecc->read_oob_raw	= qcom_nandc_read_oob_raw;
++	ecc->write_oob_raw	= qcom_nandc_write_oob_raw;
++
++	switch (mtd->oobsize) {
++	case 64:
++		ecc->layout = &layout_oob_64;
++		break;
++	case 128:
++		ecc->layout = &layout_oob_128;
++		break;
++	case 224:
++		if (wide_bus)
++			ecc->layout = &layout_oob_224_x16;
++		else
++			ecc->layout = &layout_oob_224_x8;
++		break;
++	case 256:
++		ecc->layout = &layout_oob_256;
++		break;
++	default:
++		dev_err(this->dev, "unsupported NAND device, oobsize %d\n",
++			mtd->oobsize);
++		return -ENODEV;
++	}
++
++	ecc->mode = NAND_ECC_HW;
++
++	/* enable ecc by default */
++	this->use_ecc = true;
++
++	return 0;
++}
++
++static void qcom_nandc_hw_post_init(struct qcom_nandc_data *this)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int cwperpage = mtd->writesize / ecc->size;
++	int spare_bytes, bad_block_byte;
++	bool wide_bus;
++	int ecc_mode = 0;
++
++	wide_bus = chip->options & NAND_BUSWIDTH_16 ? true : false;
++
++	if (ecc->strength >= 8) {
++		this->cw_size = 532;
++
++		spare_bytes = wide_bus ? 0 : 2;
++
++		this->bch_enabled = true;
++		ecc_mode = 1;
++	} else {
++		this->cw_size = 528;
++
++		if (this->ecc_modes & ECC_BCH_4BIT) {
++			spare_bytes = wide_bus ? 2 : 4;
++
++			this->bch_enabled = true;
++			ecc_mode = 0;
++		} else {
++			spare_bytes = wide_bus ? 0 : 1;
++		}
++	}
++
++	/*
++	 * DATA_UD_BYTES varies based on whether the read/write command protects
++	 * spare data with ECC too. We protect spare data by default, so we set
++	 * it to main + spare data, which are 512 and 4 bytes respectively.
++	 */
++	this->cw_data = 516;
++
++	bad_block_byte = mtd->writesize - this->cw_size * (cwperpage - 1) + 1;
++
++	this->cfg0 = (cwperpage - 1) << CW_PER_PAGE
++				| this->cw_data << UD_SIZE_BYTES
++				| 0 << DISABLE_STATUS_AFTER_WRITE
++				| 5 << NUM_ADDR_CYCLES
++				| ecc->bytes << ECC_PARITY_SIZE_BYTES_RS
++				| 0 << STATUS_BFR_READ
++				| 1 << SET_RD_MODE_AFTER_STATUS
++				| spare_bytes << SPARE_SIZE_BYTES;
++
++	this->cfg1 = 7 << NAND_RECOVERY_CYCLES
++				| 0 <<  CS_ACTIVE_BSY
++				| bad_block_byte << BAD_BLOCK_BYTE_NUM
++				| 0 << BAD_BLOCK_IN_SPARE_AREA
++				| 2 << WR_RD_BSY_GAP
++				| wide_bus << WIDE_FLASH
++				| this->bch_enabled << ENABLE_BCH_ECC;
++
++	this->cfg0_raw = (cwperpage - 1) << CW_PER_PAGE
++				| this->cw_size << UD_SIZE_BYTES
++				| 5 << NUM_ADDR_CYCLES
++				| 0 << SPARE_SIZE_BYTES;
++
++	this->cfg1_raw = 7 << NAND_RECOVERY_CYCLES
++				| 0 << CS_ACTIVE_BSY
++				| 17 << BAD_BLOCK_BYTE_NUM
++				| 1 << BAD_BLOCK_IN_SPARE_AREA
++				| 2 << WR_RD_BSY_GAP
++				| wide_bus << WIDE_FLASH
++				| 1 << DEV0_CFG1_ECC_DISABLE;
++
++	this->ecc_bch_cfg = this->bch_enabled << ECC_CFG_ECC_DISABLE
++				| 0 << ECC_SW_RESET
++				| this->cw_data << ECC_NUM_DATA_BYTES
++				| 1 << ECC_FORCE_CLK_OPEN
++				| ecc_mode << ECC_MODE
++				| ecc->bytes << ECC_PARITY_SIZE_BYTES_BCH;
++
++	this->ecc_buf_cfg = 0x203 << NUM_STEPS;
++
++	this->clrflashstatus = FS_READY_BSY_N;
++	this->clrreadstatus = 0xc0;
++
++	dev_dbg(this->dev,
++		"cfg0 %x cfg1 %x ecc_buf_cfg %x ecc_bch cfg %x cw_size %d cw_data %d strength %d parity_bytes %d steps %d\n",
++		this->cfg0, this->cfg1, this->ecc_buf_cfg,
++		this->ecc_bch_cfg, this->cw_size, this->cw_data,
++		ecc->strength, ecc->bytes, cwperpage);
++}
++
++static int qcom_nandc_alloc(struct qcom_nandc_data *this)
++{
++	int r;
++
++	r = dma_set_coherent_mask(this->dev, DMA_BIT_MASK(32));
++	if (r) {
++		dev_err(this->dev, "failed to set DMA mask\n");
++		return r;
++	}
++
++	/*
++	 * we use the internal buffer for reading ONFI params, reading small
++	 * data like ID and status, and preforming read-copy-write operations
++	 * when writing to a codeword partially. 532 is the maximum possible
++	 * size of a codeword for our nand controller
++	 */
++	this->buf_size = 532;
++
++	this->data_buffer = devm_kzalloc(this->dev, this->buf_size, GFP_KERNEL);
++	if (!this->data_buffer)
++		return -ENOMEM;
++
++	this->regs = devm_kzalloc(this->dev, sizeof(*this->regs), GFP_KERNEL);
++	if (!this->regs)
++		return -ENOMEM;
++
++	this->reg_read_buf = devm_kzalloc(this->dev,
++				MAX_REG_RD * sizeof(*this->reg_read_buf),
++				GFP_KERNEL);
++	if (!this->reg_read_buf)
++		return -ENOMEM;
++
++	INIT_LIST_HEAD(&this->list);
++
++	this->chan = dma_request_slave_channel(this->dev, "rxtx");
++	if (!this->chan) {
++		dev_err(this->dev, "failed to request slave channel\n");
++		return -ENODEV;
++	}
++
++	return 0;
++}
++
++static void qcom_nandc_unalloc(struct qcom_nandc_data *this)
++{
++	dma_release_channel(this->chan);
++}
++
++static int qcom_nandc_init(struct qcom_nandc_data *this)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct device_node *np = this->dev->of_node;
++	struct mtd_part_parser_data ppdata = { .of_node = np };
++	int r;
++
++	mtd->priv = chip;
++	mtd->name = "qcom-nandc";
++	mtd->owner = THIS_MODULE;
++
++	chip->priv = this;
++
++	chip->cmdfunc		= qcom_nandc_command;
++	chip->select_chip	= qcom_nandc_select_chip;
++	chip->read_byte		= qcom_nandc_read_byte;
++	chip->read_buf		= qcom_nandc_read_buf;
++	chip->write_buf		= qcom_nandc_write_buf;
++
++	chip->options |= NAND_NO_SUBPAGE_WRITE | NAND_USE_BOUNCE_BUFFER;
++	if (this->bus_width == 16)
++		chip->options |= NAND_BUSWIDTH_16;
++
++	chip->bbt_options = NAND_BBT_ACCESS_BBM_RAW;
++	if (of_get_nand_on_flash_bbt(np))
++		chip->bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
++
++	qcom_nandc_pre_init(this);
++
++	r = nand_scan_ident(mtd, 1, NULL);
++	if (r)
++		return r;
++
++	r = qcom_nandc_ecc_init(this);
++	if (r)
++		return r;
++
++	qcom_nandc_hw_post_init(this);
++
++	r = nand_scan_tail(mtd);
++	if (r)
++		return r;
++
++	return mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
++}
++
++static int qcom_nandc_parse_dt(struct platform_device *pdev)
++{
++	struct qcom_nandc_data *this = platform_get_drvdata(pdev);
++	struct device_node *np = this->dev->of_node;
++	int r;
++
++	this->ecc_strength = of_get_nand_ecc_strength(np);
++	if (this->ecc_strength < 0) {
++		dev_warn(this->dev,
++			"incorrect ecc strength, setting to 4 bits/step\n");
++		this->ecc_strength = 4;
++	}
++
++	this->bus_width = of_get_nand_bus_width(np);
++	if (this->bus_width < 0) {
++		dev_warn(this->dev, "incorrect bus width, setting to 8\n");
++		this->bus_width = 8;
++	}
++
++	r = of_property_read_u32(np, "qcom,cmd-crci", &this->cmd_crci);
++	if (r) {
++		dev_err(this->dev, "command CRCI unspecified\n");
++		return r;
++	}
++
++	r = of_property_read_u32(np, "qcom,data-crci", &this->data_crci);
++	if (r) {
++		dev_err(this->dev, "data CRCI unspecified\n");
++		return r;
++	}
++
++	return 0;
++}
++
++static int qcom_nandc_probe(struct platform_device *pdev)
++{
++	struct qcom_nandc_data *this;
++	const struct of_device_id *match;
++	int r;
++
++	this = devm_kzalloc(&pdev->dev, sizeof(*this), GFP_KERNEL);
++	if (!this)
++		return -ENOMEM;
++
++	platform_set_drvdata(pdev, this);
++
++	this->pdev = pdev;
++	this->dev  = &pdev->dev;
++
++	match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev);
++	if (!match) {
++		dev_err(&pdev->dev, "failed to match device\n");
++		return -ENODEV;
++	}
++
++	if (!match->data) {
++		dev_err(&pdev->dev, "failed to get device data\n");
++		return -ENODEV;
++	}
++
++	this->ecc_modes = (u32) match->data;
++
++	this->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	this->base = devm_ioremap_resource(&pdev->dev, this->res);
++	if (IS_ERR(this->base))
++		return PTR_ERR(this->base);
++
++	this->core_clk = devm_clk_get(&pdev->dev, "core");
++	if (IS_ERR(this->core_clk))
++		return PTR_ERR(this->core_clk);
++
++	this->aon_clk = devm_clk_get(&pdev->dev, "aon");
++	if (IS_ERR(this->aon_clk))
++		return PTR_ERR(this->aon_clk);
++
++	r = qcom_nandc_parse_dt(pdev);
++	if (r)
++		return r;
++
++	r = qcom_nandc_alloc(this);
++	if (r)
++		return r;
++
++	r = clk_prepare_enable(this->core_clk);
++	if (r)
++		goto err_core_clk;
++
++	r = clk_prepare_enable(this->aon_clk);
++	if (r)
++		goto err_aon_clk;
++
++	r = qcom_nandc_init(this);
++	if (r)
++		goto err_init;
++
++	return 0;
++
++err_init:
++	clk_disable_unprepare(this->aon_clk);
++err_aon_clk:
++	clk_disable_unprepare(this->core_clk);
++err_core_clk:
++	qcom_nandc_unalloc(this);
++
++	return r;
++}
++
++static int qcom_nandc_remove(struct platform_device *pdev)
++{
++	struct qcom_nandc_data *this = platform_get_drvdata(pdev);
++
++	qcom_nandc_unalloc(this);
++
++	clk_disable_unprepare(this->aon_clk);
++	clk_disable_unprepare(this->core_clk);
++
++	return 0;
++}
++
++#define EBI2_NANDC_ECC_MODES	(ECC_RS_4BIT | ECC_BCH_8BIT)
++
++/*
++ * data will hold a struct pointer containing more differences once we support
++ * more IPs
++ */
++static const struct of_device_id qcom_nandc_of_match[] = {
++	{	.compatible = "qcom,ebi2-nandc",
++		.data = (void *) EBI2_NANDC_ECC_MODES,
++	},
++	{}
++};
++MODULE_DEVICE_TABLE(of, qcom_nandc_of_match);
++
++static struct platform_driver qcom_nandc_driver = {
++	.driver = {
++		.name = "qcom-nandc",
++		.of_match_table = qcom_nandc_of_match,
++	},
++	.probe   = qcom_nandc_probe,
++	.remove  = qcom_nandc_remove,
++};
++module_platform_driver(qcom_nandc_driver);
++
++MODULE_AUTHOR("Archit Taneja <architt at codeaurora.org>");
++MODULE_DESCRIPTION("Qualcomm NAND Controller driver");
++MODULE_LICENSE("GPL v2");
+--- a/drivers/mtd/nand/Makefile
++++ b/drivers/mtd/nand/Makefile
+@@ -50,5 +50,6 @@ obj-$(CONFIG_MTD_NAND_JZ4740)		+= jz4740
+ obj-$(CONFIG_MTD_NAND_GPMI_NAND)	+= gpmi-nand/
+ obj-$(CONFIG_MTD_NAND_XWAY)		+= xway_nand.o
+ obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH)	+= bcm47xxnflash/
++obj-$(CONFIG_MTD_NAND_QCOM)		+= qcom_nandc.o
+ 
+ nand-objs := nand_base.o nand_bbt.o nand_timings.o
diff --git a/target/linux/ipq806x/patches-3.18/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch b/target/linux/ipq806x/patches-3.18/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
new file mode 100644
index 0000000..6530eb1
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
@@ -0,0 +1,82 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,3/5] dt/bindings: qcom_nandc: Add DT bindings
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927141
+Message-Id: <1438578498-32254-4-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>, devicetree at vger.kernel.org
+Date: Mon,  3 Aug 2015 10:38:16 +0530
+
+Add DT bindings document for the Qualcomm NAND controller driver.
+
+Cc: devicetree at vger.kernel.org
+
+v3:
+- Don't use '0x' when specifying nand controller address space
+- Add optional property for on-flash bbt usage
+
+Acked-by: Andy Gross <agross at codeaurora.org>
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+.../devicetree/bindings/mtd/qcom_nandc.txt         | 49 ++++++++++++++++++++++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+@@ -0,0 +1,49 @@
++* Qualcomm NAND controller
++
++Required properties:
++- compatible:		should be "qcom,ebi2-nand" for IPQ806x
++- reg:			MMIO address range
++- clocks:		must contain core clock and always on clock
++- clock-names:		must contain "core" for the core clock and "aon" for the
++			always on clock
++- dmas:			DMA specifier, consisting of a phandle to the ADM DMA
++			controller node and the channel number to be used for
++			NAND. Refer to dma.txt and qcom_adm.txt for more details
++- dma-names:		must be "rxtx"
++- qcom,cmd-crci:	must contain the ADM command type CRCI block instance
++			number specified for the NAND controller on the given
++			platform
++- qcom,data-crci:	must contain the ADM data type CRCI block instance
++			number specified for the NAND controller on the given
++			platform
++
++Optional properties:
++- nand-bus-width:	bus width. Must be 8 or 16. If not present, 8 is chosen
++			as default
++
++- nand-ecc-strength:	number of bits to correct per ECC step. Must be 4 or 8
++			bits. If not present, 4 is chosen as default
++- nand-on-flash-bbt:	Create/use on-flash bad block table
++
++The device tree may optionally contain sub-nodes describing partitions of the
++address space. See partition.txt for more detail.
++
++Example:
++
++nand at 1ac00000 {
++	compatible = "qcom,ebi2-nandc";
++	reg = <0x1ac00000 0x800>;
++
++	clocks = <&gcc EBI2_CLK>,
++		 <&gcc EBI2_AON_CLK>;
++	clock-names = "core", "aon";
++
++	dmas = <&adm_dma 3>;
++	dma-names = "rxtx";
++	qcom,cmd-crci = <15>;
++	qcom,data-crci = <3>;
++
++	partition at 0 {
++	...
++	};
++};
diff --git a/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
new file mode 100644
index 0000000..a2742b7
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -0,0 +1,50 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,4/5] arm: qcom: dts: Add NAND controller node for ipq806x
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927121
+Message-Id: <1438578498-32254-5-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>, devicetree at vger.kernel.org
+Date: Mon,  3 Aug 2015 10:38:17 +0530
+
+The nand controller in IPQ806x is of the 'EBI2 type'. Use the corresponding
+compatible string.
+
+Cc: devicetree at vger.kernel.org
+
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -677,5 +677,21 @@
+ 			status = "disabled";
+ 		};
+ 
++		nand at 1ac00000 {
++			compatible = "qcom,ebi2-nandc";
++			reg = <0x1ac00000 0x800>;
++
++			clocks = <&gcc EBI2_CLK>,
++				 <&gcc EBI2_AON_CLK>;
++			clock-names = "core", "aon";
++
++			dmas = <&adm_dma 3>;
++			dma-names = "rxtx";
++			qcom,cmd-crci = <15>;
++			qcom,data-crci = <3>;
++
++			status = "disabled";
++		};
++
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
new file mode 100644
index 0000000..94e4e6b
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -0,0 +1,79 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,5/5] arm: qcom: dts: Enable NAND node on IPQ8064 AP148 platform
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927091
+Message-Id: <1438578498-32254-6-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>, devicetree at vger.kernel.org
+Date: Mon,  3 Aug 2015 10:38:18 +0530
+
+Enable the NAND controller node on the AP148 platform. Provide pinmux
+information.
+
+Cc: devicetree at vger.kernel.org
+
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -61,6 +61,31 @@
+ 					bias-none;
+ 				};
+ 			};
++
++			nand_pins: nand_pins {
++				mux {
++					pins = "gpio34", "gpio35", "gpio36",
++					       "gpio37", "gpio38", "gpio39",
++					       "gpio40", "gpio41", "gpio42",
++					       "gpio43", "gpio44", "gpio45",
++					       "gpio46", "gpio47";
++					function = "nand";
++					drive-strength = <10>;
++					bias-disable;
++				};
++
++				pullups {
++					pins = "gpio39";
++					bias-pull-up;
++				};
++
++				hold {
++					pins = "gpio40", "gpio41", "gpio42",
++					       "gpio43", "gpio44", "gpio45",
++					       "gpio46", "gpio47";
++					bias-bus-hold;
++				};
++			};
+ 		};
+ 
+ 		gsbi at 16300000 {
+@@ -174,5 +199,19 @@
+ 			pinctrl-0 = <&pcie1_pins>;
+ 			pinctrl-names = "default";
+ 		};
++
++		nand at 1ac00000 {
++			status = "ok";
++
++			pinctrl-0 = <&nand_pins>;
++			pinctrl-names = "default";
++
++			nand-ecc-strength = <4>;
++			nand-bus-width = <8>;
++		};
+ 	};
+ };
++
++&adm_dma {
++	status = "ok";
++};
diff --git a/target/linux/ipq806x/patches-3.18/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch b/target/linux/ipq806x/patches-3.18/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
index d7d6b69..22d28ac 100644
--- a/target/linux/ipq806x/patches-3.18/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
+++ b/target/linux/ipq806x/patches-3.18/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
@@ -86,7 +86,7 @@ Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
  static struct freq_tbl clk_tbl_gsbi_uart[] = {
  	{  1843200, P_PLL8, 2,  6, 625 },
  	{  3686400, P_PLL8, 2, 12, 625 },
-@@ -2239,6 +2290,472 @@ static struct clk_branch usb_fs1_h_clk =
+@@ -2269,6 +2320,472 @@ static struct clk_branch ebi2_aon_clk =
  	},
  };
  
@@ -559,7 +559,7 @@ Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
  static struct clk_regmap *gcc_ipq806x_clks[] = {
  	[PLL0] = &pll0.clkr,
  	[PLL0_VOTE] = &pll0_vote,
-@@ -2247,6 +2764,7 @@ static struct clk_regmap *gcc_ipq806x_cl
+@@ -2277,6 +2794,7 @@ static struct clk_regmap *gcc_ipq806x_cl
  	[PLL8_VOTE] = &pll8_vote,
  	[PLL14] = &pll14.clkr,
  	[PLL14_VOTE] = &pll14_vote,
@@ -567,7 +567,7 @@ Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
  	[GSBI1_UART_SRC] = &gsbi1_uart_src.clkr,
  	[GSBI1_UART_CLK] = &gsbi1_uart_clk.clkr,
  	[GSBI2_UART_SRC] = &gsbi2_uart_src.clkr,
-@@ -2344,6 +2862,18 @@ static struct clk_regmap *gcc_ipq806x_cl
+@@ -2376,6 +2894,18 @@ static struct clk_regmap *gcc_ipq806x_cl
  	[PLL9] = &hfpll0.clkr,
  	[PLL10] = &hfpll1.clkr,
  	[PLL12] = &hfpll_l2.clkr,
@@ -586,7 +586,7 @@ Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
  };
  
  static const struct qcom_reset_map gcc_ipq806x_resets[] = {
-@@ -2462,6 +2992,48 @@ static const struct qcom_reset_map gcc_i
+@@ -2494,6 +3024,48 @@ static const struct qcom_reset_map gcc_i
  	[USB30_1_PHY_RESET] = { 0x3b58, 0 },
  	[NSSFB0_RESET] = { 0x3b60, 6 },
  	[NSSFB1_RESET] = { 0x3b60, 7 },
@@ -635,7 +635,7 @@ Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
  };
  
  static const struct regmap_config gcc_ipq806x_regmap_config = {
-@@ -2490,6 +3062,8 @@ static int gcc_ipq806x_probe(struct plat
+@@ -2522,6 +3094,8 @@ static int gcc_ipq806x_probe(struct plat
  {
  	struct clk *clk;
  	struct device *dev = &pdev->dev;
@@ -644,7 +644,7 @@ Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
  
  	/* Temporary until RPM clocks supported */
  	clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 25000000);
-@@ -2500,7 +3074,25 @@ static int gcc_ipq806x_probe(struct plat
+@@ -2532,7 +3106,25 @@ static int gcc_ipq806x_probe(struct plat
  	if (IS_ERR(clk))
  		return PTR_ERR(clk);
  
@@ -673,12 +673,12 @@ Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
  static int gcc_ipq806x_remove(struct platform_device *pdev)
 --- a/include/dt-bindings/clock/qcom,gcc-ipq806x.h
 +++ b/include/dt-bindings/clock/qcom,gcc-ipq806x.h
-@@ -289,5 +289,7 @@
- #define UBI32_CORE2_CLK_SRC			278
+@@ -290,5 +290,7 @@
  #define UBI32_CORE1_CLK				279
  #define UBI32_CORE2_CLK				280
-+#define NSSTCM_CLK_SRC				281
-+#define NSSTCM_CLK				282
+ #define EBI2_AON_CLK				281
++#define NSSTCM_CLK_SRC				282
++#define NSSTCM_CLK				283
  
  #endif
 --- a/include/dt-bindings/reset/qcom,gcc-ipq806x.h
diff --git a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 73b8edf..75ebfe6 100644
--- a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -22,8 +22,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  	};
  
  	chosen {
-@@ -61,6 +62,15 @@
- 					bias-none;
+@@ -86,6 +87,15 @@
+ 					bias-bus-hold;
  				};
  			};
 +
@@ -38,9 +38,9 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -174,5 +184,33 @@
- 			pinctrl-0 = <&pcie1_pins>;
- 			pinctrl-names = "default";
+@@ -209,6 +219,34 @@
+ 			nand-ecc-strength = <4>;
+ 			nand-bus-width = <8>;
  		};
 +
 +		mdio0: mdio {
@@ -72,6 +72,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		};
  	};
  };
+ 
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 @@ -16,6 +16,7 @@
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 5213d62..72a9f8b 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -71,6 +71,16 @@
+@@ -96,6 +96,16 @@
  					bias-disable;
  				};
  			};
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -212,5 +222,26 @@
+@@ -247,6 +257,27 @@
  				reg = <4>;
  			};
  		};
@@ -56,6 +56,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		};
  	};
  };
+ 
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 @@ -75,6 +75,14 @@
@@ -116,7 +117,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -677,5 +677,91 @@
+@@ -693,5 +693,91 @@
  			status = "disabled";
  		};
  
diff --git a/target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch b/target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
new file mode 100644
index 0000000..088b8cb
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
@@ -0,0 +1,84 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,
+	1/5] mtd: nand: Create a BBT flag to access bad block markers in raw
+	mode
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927081
+Message-Id: <1438578498-32254-2-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>
+Date: Mon,  3 Aug 2015 10:38:14 +0530
+
+Some controllers can access the factory bad block marker from OOB only
+when they read it in raw mode. When ECC is enabled, these controllers
+discard reading/writing bad block markers, preventing access to them
+altogether.
+
+The bbt driver assumes MTD_OPS_PLACE_OOB when scanning for bad blocks.
+This results in the nand driver's ecc->read_oob() op to be called, which
+works with ECC enabled.
+
+Create a new BBT option flag that tells nand_bbt to force the mode to
+MTD_OPS_RAW. This would result in the correct op being called for the
+underlying nand controller driver.
+
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+drivers/mtd/nand/nand_base.c | 6 +++++-
+ drivers/mtd/nand/nand_bbt.c  | 6 +++++-
+ include/linux/mtd/bbm.h      | 7 +++++++
+ 3 files changed, 17 insertions(+), 2 deletions(-)
+
+--- a/drivers/mtd/nand/nand_base.c
++++ b/drivers/mtd/nand/nand_base.c
+@@ -395,7 +395,11 @@ static int nand_default_block_markbad(st
+ 	} else {
+ 		ops.len = ops.ooblen = 1;
+ 	}
+-	ops.mode = MTD_OPS_PLACE_OOB;
++
++	if (unlikely(chip->bbt_options & NAND_BBT_ACCESS_BBM_RAW))
++		ops.mode = MTD_OPS_RAW;
++	else
++		ops.mode = MTD_OPS_PLACE_OOB;
+ 
+ 	/* Write to first/last page(s) if necessary */
+ 	if (chip->bbt_options & NAND_BBT_SCANLASTPAGE)
+--- a/drivers/mtd/nand/nand_bbt.c
++++ b/drivers/mtd/nand/nand_bbt.c
+@@ -423,7 +423,11 @@ static int scan_block_fast(struct mtd_in
+ 	ops.oobbuf = buf;
+ 	ops.ooboffs = 0;
+ 	ops.datbuf = NULL;
+-	ops.mode = MTD_OPS_PLACE_OOB;
++
++	if (unlikely(bd->options & NAND_BBT_ACCESS_BBM_RAW))
++		ops.mode = MTD_OPS_RAW;
++	else
++		ops.mode = MTD_OPS_PLACE_OOB;
+ 
+ 	for (j = 0; j < numpages; j++) {
+ 		/*
+--- a/include/linux/mtd/bbm.h
++++ b/include/linux/mtd/bbm.h
+@@ -116,6 +116,13 @@ struct nand_bbt_descr {
+ #define NAND_BBT_NO_OOB_BBM	0x00080000
+ 
+ /*
++ * Force MTD_OPS_RAW mode when trying to access bad block markes from OOB. To
++ * be used by controllers which can access BBM only when ECC is disabled, i.e,
++ * when in RAW access mode
++ */
++#define NAND_BBT_ACCESS_BBM_RAW	0x00100000
++
++/*
+  * Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr
+  * was allocated dynamicaly and must be freed in nand_release(). Has no meaning
+  * in nand_chip.bbt_options.
diff --git a/target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch b/target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
new file mode 100644
index 0000000..4be7ecb
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
@@ -0,0 +1,2024 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,2/5] mtd: nand: Qualcomm NAND controller driver
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927101
+Message-Id: <1438578498-32254-3-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>
+Date: Mon,  3 Aug 2015 10:38:15 +0530
+
+The Qualcomm NAND controller is found in SoCs like IPQ806x, MSM7xx,
+MDM9x15 series.
+
+It exists as a sub block inside the IPs EBI2 (External Bus Interface 2)
+and QPIC (Qualcomm Parallel Interface Controller). These IPs provide a
+broader interface for external slow peripheral devices such as LCD and
+NAND/NOR flash memory or SRAM like interfaces.
+
+We add support for the NAND controller found within EBI2. For the SoCs
+of our interest, we only use the NAND controller within EBI2. Therefore,
+it's safe for us to assume that the NAND controller is a standalone block
+within the SoC.
+
+The controller supports 512B, 2kB, 4kB and 8kB page 8-bit and 16-bit NAND
+flash devices. It contains a HW ECC block that supports BCH ECC (4, 8 and
+16 bit correction/step) and RS ECC(4 bit correction/step) that covers main
+and spare data. The controller contains an internal 512 byte page buffer
+to which we read/write via DMA. The EBI2 type NAND controller uses ADM DMA
+for register read/write and data transfers. The controller performs page
+reads and writes at a codeword/step level of 512 bytes. It can support up
+to 2 external chips of different configurations.
+
+The driver prepares register read and write configuration descriptors for
+each codeword, followed by data descriptors to read or write data from the
+controller's internal buffer. It uses a single ADM DMA channel that we get
+via dmaengine API. The controller requires 2 ADM CRCIs for command and
+data flow control. These are passed via DT.
+
+The ecc layout used by the controller is syndrome like, but we can't use
+the standard syndrome ecc ops because of several reasons. First, the amount
+of data bytes covered by ecc isn't same in each step. Second, writing to
+free oob space requires us writing to the entire step in which the oob
+lies. This forces us to create our own ecc ops.
+
+One more difference is how the controller accesses the bad block marker.
+The controller ignores reading the marker when ECC is enabled. ECC needs
+to be explicity disabled to read or write to the bad block marker. For
+this reason, we use the newly created flag NAND_BBT_ACCESS_BBM_RAW to
+read the factory provided bad block markers.
+
+v3:
+- Refactor dma functions for maximum reuse
+- Use dma_slave_confing on stack
+- optimize and clean upempty_page_fixup using memchr_inv
+- ensure portability with dma register reads using le32_* funcs
+- use NAND_USE_BOUNCE_BUFFER instead of doing it ourselves
+- fix handling of return values of dmaengine funcs
+- constify wherever possible
+- Remove dependency on ADM DMA in Kconfig
+- Misc fixes and clean ups
+
+v2:
+- Use new BBT flag that allows us to read BBM in raw mode
+- reduce memcpy-s in the driver
+- some refactor and clean ups because of above changes
+
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+drivers/mtd/nand/Kconfig      |    7 +
+ drivers/mtd/nand/Makefile     |    1 +
+ drivers/mtd/nand/qcom_nandc.c | 1913 +++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 1921 insertions(+)
+ create mode 100644 drivers/mtd/nand/qcom_nandc.c
+
+--- a/drivers/mtd/nand/Kconfig
++++ b/drivers/mtd/nand/Kconfig
+@@ -530,4 +530,11 @@ config MTD_NAND_HISI504
+ 	help
+ 	  Enables support for NAND controller on Hisilicon SoC Hip04.
+ 
++config MTD_NAND_QCOM
++	tristate "Support for NAND on QCOM SoCs"
++	depends on ARCH_QCOM
++	help
++	  Enables support for NAND flash chips on SoCs containing the EBI2 NAND
++	  controller. This controller is found on IPQ806x SoC.
++
+ endif # MTD_NAND
+--- /dev/null
++++ b/drivers/mtd/nand/qcom_nandc.c
+@@ -0,0 +1,1918 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This software is licensed under the terms of the GNU General Public
++ * License version 2, as published by the Free Software Foundation, and
++ * may be copied, distributed, and modified under those terms.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/clk.h>
++#include <linux/slab.h>
++#include <linux/bitops.h>
++#include <linux/dma-mapping.h>
++#include <linux/dmaengine.h>
++#include <linux/module.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/partitions.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/of_mtd.h>
++#include <linux/delay.h>
++
++/* NANDc reg offsets */
++#define NAND_FLASH_CMD			0x00
++#define NAND_ADDR0			0x04
++#define NAND_ADDR1			0x08
++#define NAND_FLASH_CHIP_SELECT		0x0c
++#define NAND_EXEC_CMD			0x10
++#define NAND_FLASH_STATUS		0x14
++#define NAND_BUFFER_STATUS		0x18
++#define NAND_DEV0_CFG0			0x20
++#define NAND_DEV0_CFG1			0x24
++#define NAND_DEV0_ECC_CFG		0x28
++#define NAND_DEV1_ECC_CFG		0x2c
++#define NAND_DEV1_CFG0			0x30
++#define NAND_DEV1_CFG1			0x34
++#define NAND_READ_ID			0x40
++#define NAND_READ_STATUS		0x44
++#define NAND_DEV_CMD0			0xa0
++#define NAND_DEV_CMD1			0xa4
++#define NAND_DEV_CMD2			0xa8
++#define NAND_DEV_CMD_VLD		0xac
++#define SFLASHC_BURST_CFG		0xe0
++#define NAND_ERASED_CW_DETECT_CFG	0xe8
++#define NAND_ERASED_CW_DETECT_STATUS	0xec
++#define NAND_EBI2_ECC_BUF_CFG		0xf0
++#define FLASH_BUF_ACC			0x100
++
++#define NAND_CTRL			0xf00
++#define NAND_VERSION			0xf08
++#define NAND_READ_LOCATION_0		0xf20
++#define NAND_READ_LOCATION_1		0xf24
++
++/* dummy register offsets, used by write_reg_dma */
++#define NAND_DEV_CMD1_RESTORE		0xdead
++#define NAND_DEV_CMD_VLD_RESTORE	0xbeef
++
++/* NAND_FLASH_CMD bits */
++#define PAGE_ACC			BIT(4)
++#define LAST_PAGE			BIT(5)
++
++/* NAND_FLASH_CHIP_SELECT bits */
++#define NAND_DEV_SEL			0
++#define DM_EN				BIT(2)
++
++/* NAND_FLASH_STATUS bits */
++#define FS_OP_ERR			BIT(4)
++#define FS_READY_BSY_N			BIT(5)
++#define FS_MPU_ERR			BIT(8)
++#define FS_DEVICE_STS_ERR		BIT(16)
++#define FS_DEVICE_WP			BIT(23)
++
++/* NAND_BUFFER_STATUS bits */
++#define BS_UNCORRECTABLE_BIT		BIT(8)
++#define BS_CORRECTABLE_ERR_MSK		0x1f
++
++/* NAND_DEVn_CFG0 bits */
++#define DISABLE_STATUS_AFTER_WRITE	4
++#define CW_PER_PAGE			6
++#define UD_SIZE_BYTES			9
++#define ECC_PARITY_SIZE_BYTES_RS	19
++#define SPARE_SIZE_BYTES		23
++#define NUM_ADDR_CYCLES			27
++#define STATUS_BFR_READ			30
++#define SET_RD_MODE_AFTER_STATUS	31
++
++/* NAND_DEVn_CFG0 bits */
++#define DEV0_CFG1_ECC_DISABLE		0
++#define WIDE_FLASH			1
++#define NAND_RECOVERY_CYCLES		2
++#define CS_ACTIVE_BSY			5
++#define BAD_BLOCK_BYTE_NUM		6
++#define BAD_BLOCK_IN_SPARE_AREA		16
++#define WR_RD_BSY_GAP			17
++#define ENABLE_BCH_ECC			27
++
++/* NAND_DEV0_ECC_CFG bits */
++#define ECC_CFG_ECC_DISABLE		0
++#define ECC_SW_RESET			1
++#define ECC_MODE			4
++#define ECC_PARITY_SIZE_BYTES_BCH	8
++#define ECC_NUM_DATA_BYTES		16
++#define ECC_FORCE_CLK_OPEN		30
++
++/* NAND_DEV_CMD1 bits */
++#define READ_ADDR			0
++
++/* NAND_DEV_CMD_VLD bits */
++#define READ_START_VLD			0
++
++/* NAND_EBI2_ECC_BUF_CFG bits */
++#define NUM_STEPS			0
++
++/* NAND_ERASED_CW_DETECT_CFG bits */
++#define ERASED_CW_ECC_MASK		1
++#define AUTO_DETECT_RES			0
++#define MASK_ECC			(1 << ERASED_CW_ECC_MASK)
++#define RESET_ERASED_DET		(1 << AUTO_DETECT_RES)
++#define ACTIVE_ERASED_DET		(0 << AUTO_DETECT_RES)
++#define CLR_ERASED_PAGE_DET		(RESET_ERASED_DET | MASK_ECC)
++#define SET_ERASED_PAGE_DET		(ACTIVE_ERASED_DET | MASK_ECC)
++
++/* NAND_ERASED_CW_DETECT_STATUS bits */
++#define PAGE_ALL_ERASED			BIT(7)
++#define CODEWORD_ALL_ERASED		BIT(6)
++#define PAGE_ERASED			BIT(5)
++#define CODEWORD_ERASED			BIT(4)
++#define ERASED_PAGE			(PAGE_ALL_ERASED | PAGE_ERASED)
++#define ERASED_CW			(CODEWORD_ALL_ERASED | CODEWORD_ERASED)
++
++/* Version Mask */
++#define NAND_VERSION_MAJOR_MASK		0xf0000000
++#define NAND_VERSION_MAJOR_SHIFT	28
++#define NAND_VERSION_MINOR_MASK		0x0fff0000
++#define NAND_VERSION_MINOR_SHIFT	16
++
++/* NAND OP_CMDs */
++#define PAGE_READ			0x2
++#define PAGE_READ_WITH_ECC		0x3
++#define PAGE_READ_WITH_ECC_SPARE	0x4
++#define PROGRAM_PAGE			0x6
++#define PAGE_PROGRAM_WITH_ECC		0x7
++#define PROGRAM_PAGE_SPARE		0x9
++#define BLOCK_ERASE			0xa
++#define FETCH_ID			0xb
++#define RESET_DEVICE			0xd
++
++/*
++ * the NAND controller performs reads/writes with ECC in 516 byte chunks.
++ * the driver calls the chunks 'step' or 'codeword' interchangeably
++ */
++#define NANDC_STEP_SIZE			512
++
++/*
++ * the largest page size we support is 8K, this will have 16 steps/codewords
++ * of 512 bytes each
++ */
++#define	MAX_NUM_STEPS			(SZ_8K / NANDC_STEP_SIZE)
++
++/* we read at most 3 registers per codeword scan */
++#define MAX_REG_RD			(3 * MAX_NUM_STEPS)
++
++/* ECC modes */
++#define ECC_NONE	BIT(0)
++#define ECC_RS_4BIT	BIT(1)
++#define	ECC_BCH_4BIT	BIT(2)
++#define	ECC_BCH_8BIT	BIT(3)
++
++struct desc_info {
++	struct list_head list;
++
++	enum dma_transfer_direction dir;
++	struct scatterlist sgl;
++	struct dma_async_tx_descriptor *dma_desc;
++};
++
++/*
++ * holds the current register values that we want to write. acts as a contiguous
++ * chunk of memory which we use to write the controller registers through DMA.
++ */
++struct nandc_regs {
++	u32 cmd;
++	u32 addr0;
++	u32 addr1;
++	u32 chip_sel;
++	u32 exec;
++
++	u32 cfg0;
++	u32 cfg1;
++	u32 ecc_bch_cfg;
++
++	u32 clrflashstatus;
++	u32 clrreadstatus;
++
++	u32 cmd1;
++	u32 vld;
++
++	u32 orig_cmd1;
++	u32 orig_vld;
++
++	u32 ecc_buf_cfg;
++};
++
++/*
++ * @cmd_crci:			ADM DMA CRCI for command flow control
++ * @data_crci:			ADM DMA CRCI for data flow control
++ * @list:			DMA descriptor list (list of desc_infos)
++ * @dma_done:			completion param to denote end of last
++ *				descriptor in the list
++ * @data_buffer:		our local DMA buffer for page read/writes,
++ *				used when we can't use the buffer provided
++ *				by upper layers directly
++ * @buf_size/count/start:	markers for chip->read_buf/write_buf functions
++ * @reg_read_buf:		buffer for reading register data via DMA
++ * @reg_read_pos:		marker for data read in reg_read_buf
++ * @cfg0, cfg1, cfg0_raw..:	NANDc register configurations needed for
++ *				ecc/non-ecc mode for the current nand flash
++ *				device
++ * @regs:			a contiguous chunk of memory for DMA register
++ *				writes
++ * @ecc_strength:		4 bit or 8 bit ecc, received via DT
++ * @bus_width:			8 bit or 16 bit NAND bus width, received via DT
++ * @ecc_modes:			supported ECC modes by the current controller,
++ *				initialized via DT match data
++ * @cw_size:			the number of bytes in a single step/codeword
++ *				of a page, consisting of all data, ecc, spare
++ *				and reserved bytes
++ * @cw_data:			the number of bytes within a codeword protected
++ *				by ECC
++ * @bch_enabled:		flag to tell whether BCH or RS ECC mode is used
++ * @status:			value to be returned if NAND_CMD_STATUS command
++ *				is executed
++ */
++struct qcom_nandc_data {
++	struct platform_device *pdev;
++	struct device *dev;
++
++	void __iomem *base;
++	struct resource *res;
++
++	struct clk *core_clk;
++	struct clk *aon_clk;
++
++	/* DMA stuff */
++	struct dma_chan *chan;
++	struct dma_slave_config	slave_conf;
++	unsigned int cmd_crci;
++	unsigned int data_crci;
++	struct list_head list;
++	struct completion dma_done;
++
++	/* MTD stuff */
++	struct nand_chip chip;
++	struct mtd_info mtd;
++
++	/* local data buffer and markers */
++	u8		*data_buffer;
++	int		buf_size;
++	int		buf_count;
++	int		buf_start;
++
++	/* local buffer to read back registers */
++	u32 *reg_read_buf;
++	int reg_read_pos;
++
++	/* required configs */
++	u32 cfg0, cfg1;
++	u32 cfg0_raw, cfg1_raw;
++	u32 ecc_buf_cfg;
++	u32 ecc_bch_cfg;
++	u32 clrflashstatus;
++	u32 clrreadstatus;
++	u32 sflashc_burst_cfg;
++	u32 cmd1, vld;
++
++	/* register state */
++	struct nandc_regs *regs;
++
++	/* things we get from DT */
++	int ecc_strength;
++	int bus_width;
++
++	u32 ecc_modes;
++
++	/* misc params */
++	int cw_size;
++	int cw_data;
++	bool use_ecc;
++	bool bch_enabled;
++	u8 status;
++	int last_command;
++};
++
++static inline u32 nandc_read(struct qcom_nandc_data *this, int offset)
++{
++	return ioread32(this->base + offset);
++}
++
++static inline void nandc_write(struct qcom_nandc_data *this, int offset,
++			       u32 val)
++{
++	iowrite32(val, this->base + offset);
++}
++
++/* helper to configure address register values */
++static void set_address(struct qcom_nandc_data *this, u16 column, int page)
++{
++	struct nand_chip *chip = &this->chip;
++	struct nandc_regs *regs = this->regs;
++
++	if (chip->options & NAND_BUSWIDTH_16)
++		column >>= 1;
++
++	regs->addr0 = page << 16 | column;
++	regs->addr1 = page >> 16 & 0xff;
++}
++
++/*
++ * update_rw_regs:	set up read/write register values, these will be
++ *			written to the NAND controller registers via DMA
++ *
++ * @num_cw:		number of steps for the read/write operation
++ * @read:		read or write operation
++ */
++static void update_rw_regs(struct qcom_nandc_data *this, int num_cw, bool read)
++{
++	struct nandc_regs *regs = this->regs;
++
++	if (read) {
++		if (this->use_ecc)
++			regs->cmd = PAGE_READ_WITH_ECC | PAGE_ACC | LAST_PAGE;
++		else
++			regs->cmd = PAGE_READ | PAGE_ACC | LAST_PAGE;
++	} else {
++			regs->cmd = PROGRAM_PAGE | PAGE_ACC | LAST_PAGE;
++	}
++
++	if (this->use_ecc) {
++		regs->cfg0 = (this->cfg0 & ~(7U << CW_PER_PAGE)) |
++				(num_cw - 1) << CW_PER_PAGE;
++
++		regs->cfg1 = this->cfg1;
++		regs->ecc_bch_cfg = this->ecc_bch_cfg;
++	} else {
++		regs->cfg0 = (this->cfg0_raw & ~(7U << CW_PER_PAGE)) |
++				(num_cw - 1) << CW_PER_PAGE;
++
++		regs->cfg1 = this->cfg1_raw;
++		regs->ecc_bch_cfg = 1 << ECC_CFG_ECC_DISABLE;
++	}
++
++	regs->ecc_buf_cfg = this->ecc_buf_cfg;
++	regs->clrflashstatus = this->clrflashstatus;
++	regs->clrreadstatus = this->clrreadstatus;
++	regs->exec = 1;
++}
++
++static int prep_dma_desc(struct qcom_nandc_data *this, bool read, int reg_off,
++			 const void *vaddr, int size, bool flow_control)
++{
++	struct desc_info *desc;
++	struct dma_async_tx_descriptor *dma_desc;
++	struct scatterlist *sgl;
++	struct dma_slave_config slave_conf;
++	int r;
++
++	desc = kzalloc(sizeof(*desc), GFP_KERNEL);
++	if (!desc)
++		return -ENOMEM;
++
++	list_add_tail(&desc->list, &this->list);
++
++	sgl = &desc->sgl;
++
++	sg_init_one(sgl, vaddr, size);
++
++	desc->dir = read ? DMA_DEV_TO_MEM : DMA_MEM_TO_DEV;
++
++	r = dma_map_sg(this->dev, sgl, 1, desc->dir);
++	if (r == 0) {
++		r = -ENOMEM;
++		goto err;
++	}
++
++	memset(&slave_conf, 0x00, sizeof(slave_conf));
++
++	slave_conf.device_fc = flow_control;
++	if (read) {
++		slave_conf.src_maxburst = 16;
++		slave_conf.src_addr = this->res->start + reg_off;
++		slave_conf.slave_id = this->data_crci;
++	} else {
++		slave_conf.dst_maxburst = 16;
++		slave_conf.dst_addr = this->res->start + reg_off;
++		slave_conf.slave_id = this->cmd_crci;
++	}
++
++	r = dmaengine_slave_config(this->chan, &slave_conf);
++	if (r) {
++		dev_err(this->dev, "failed to configure dma channel\n");
++		goto err;
++	}
++
++	dma_desc = dmaengine_prep_slave_sg(this->chan, sgl, 1, desc->dir, 0);
++	if (!dma_desc) {
++		dev_err(this->dev, "failed to prepare desc\n");
++		r = -EINVAL;
++		goto err;
++	}
++
++	desc->dma_desc = dma_desc;
++
++	return 0;
++err:
++	kfree(desc);
++
++	return r;
++}
++
++/*
++ * read_reg_dma:	prepares a descriptor to read a given number of
++ *			contiguous registers to the reg_read_buf pointer
++ *
++ * @first:		offset of the first register in the contiguous block
++ * @num_regs:		number of registers to read
++ */
++static int read_reg_dma(struct qcom_nandc_data *this, int first, int num_regs)
++{
++	bool flow_control = false;
++	void *vaddr;
++	int size;
++
++	if (first == NAND_READ_ID || first == NAND_FLASH_STATUS)
++		flow_control = true;
++
++	size = num_regs * sizeof(u32);
++	vaddr = this->reg_read_buf + this->reg_read_pos;
++	this->reg_read_pos += num_regs;
++
++	return prep_dma_desc(this, true, first, vaddr, size, flow_control);
++}
++
++/*
++ * write_reg_dma:	prepares a descriptor to write a given number of
++ *			contiguous registers
++ *
++ * @first:		offset of the first register in the contiguous block
++ * @num_regs:		number of registers to write
++ */
++static int write_reg_dma(struct qcom_nandc_data *this, int first, int num_regs)
++{
++	bool flow_control = false;
++	struct nandc_regs *regs = this->regs;
++	void *vaddr;
++	int size;
++
++	switch (first) {
++	case NAND_FLASH_CMD:
++		vaddr = &regs->cmd;
++		flow_control = true;
++		break;
++	case NAND_EXEC_CMD:
++		vaddr = &regs->exec;
++		break;
++	case NAND_FLASH_STATUS:
++		vaddr = &regs->clrflashstatus;
++		break;
++	case NAND_DEV0_CFG0:
++		vaddr = &regs->cfg0;
++		break;
++	case NAND_READ_STATUS:
++		vaddr = &regs->clrreadstatus;
++		break;
++	case NAND_DEV_CMD1:
++		vaddr = &regs->cmd1;
++		break;
++	case NAND_DEV_CMD1_RESTORE:
++		first = NAND_DEV_CMD1;
++		vaddr = &regs->orig_cmd1;
++		break;
++	case NAND_DEV_CMD_VLD:
++		vaddr = &regs->vld;
++		break;
++	case NAND_DEV_CMD_VLD_RESTORE:
++		first = NAND_DEV_CMD_VLD;
++		vaddr = &regs->orig_vld;
++		break;
++	case NAND_EBI2_ECC_BUF_CFG:
++		vaddr = &regs->ecc_buf_cfg;
++		break;
++	default:
++		dev_err(this->dev, "invalid starting register\n");
++		return -EINVAL;
++	}
++
++	size = num_regs * sizeof(u32);
++
++	return prep_dma_desc(this, false, first, vaddr, size, flow_control);
++}
++
++/*
++ * read_data_dma:	prepares a DMA descriptor to transfer data from the
++ *			controller's internal buffer to the buffer 'vaddr'
++ *
++ * @reg_off:		offset within the controller's data buffer
++ * @vaddr:		virtual address of the buffer we want to write to
++ * @size:		DMA transaction size in bytes
++ */
++static int read_data_dma(struct qcom_nandc_data *this, int reg_off,
++			 const u8 *vaddr, int size)
++{
++	return prep_dma_desc(this, true, reg_off, vaddr, size, false);
++}
++
++/*
++ * write_data_dma:	prepares a DMA descriptor to transfer data from
++ *			'vaddr' to the controller's internal buffer
++ *
++ * @reg_off:		offset within the controller's data buffer
++ * @vaddr:		virtual address of the buffer we want to read from
++ * @size:		DMA transaction size in bytes
++ */
++static int write_data_dma(struct qcom_nandc_data *this, int reg_off,
++			  const u8 *vaddr, int size)
++{
++	return prep_dma_desc(this, false, reg_off, vaddr, size, false);
++}
++
++/*
++ * helper to prepare dma descriptors to configure registers needed for reading a
++ * codeword/step in a page
++ */
++static void config_cw_read(struct qcom_nandc_data *this)
++{
++	write_reg_dma(this, NAND_FLASH_CMD, 3);
++	write_reg_dma(this, NAND_DEV0_CFG0, 3);
++	write_reg_dma(this, NAND_EBI2_ECC_BUF_CFG, 1);
++
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_FLASH_STATUS, 2);
++	read_reg_dma(this, NAND_ERASED_CW_DETECT_STATUS, 1);
++}
++
++/*
++ * helpers to prepare dma descriptors used to configure registers needed for
++ * writing a codeword/step in a page
++ */
++static void config_cw_write_pre(struct qcom_nandc_data *this)
++{
++	write_reg_dma(this, NAND_FLASH_CMD, 3);
++	write_reg_dma(this, NAND_DEV0_CFG0, 3);
++	write_reg_dma(this, NAND_EBI2_ECC_BUF_CFG, 1);
++}
++
++static void config_cw_write_post(struct qcom_nandc_data *this)
++{
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_FLASH_STATUS, 1);
++
++	write_reg_dma(this, NAND_FLASH_STATUS, 1);
++	write_reg_dma(this, NAND_READ_STATUS, 1);
++}
++
++/*
++ * the following functions are used within chip->cmdfunc() to perform different
++ * NAND_CMD_* commands
++ */
++
++/* sets up descriptors for NAND_CMD_PARAM */
++static int nandc_param(struct qcom_nandc_data *this)
++{
++	struct nandc_regs *regs = this->regs;
++
++	/*
++	 * NAND_CMD_PARAM is called before we know much about the FLASH chip
++	 * in use. we configure the controller to perform a raw read of 512
++	 * bytes to read onfi params
++	 */
++	regs->cmd = PAGE_READ | PAGE_ACC | LAST_PAGE;
++	regs->addr0 = 0;
++	regs->addr1 = 0;
++	regs->cfg0 =  0 << CW_PER_PAGE
++			| 512 << UD_SIZE_BYTES
++			| 5 << NUM_ADDR_CYCLES
++			| 0 << SPARE_SIZE_BYTES;
++
++	regs->cfg1 =  7 << NAND_RECOVERY_CYCLES
++			| 0 << CS_ACTIVE_BSY
++			| 17 << BAD_BLOCK_BYTE_NUM
++			| 1 << BAD_BLOCK_IN_SPARE_AREA
++			| 2 << WR_RD_BSY_GAP
++			| 0 << WIDE_FLASH
++			| 1 << DEV0_CFG1_ECC_DISABLE;
++
++	regs->ecc_bch_cfg = 1 << ECC_CFG_ECC_DISABLE;
++
++	/* configure CMD1 and VLD for ONFI param probing */
++	regs->vld = (this->vld & ~(1 << READ_START_VLD))
++			| 0 << READ_START_VLD;
++
++	regs->cmd1 = (this->cmd1 & ~(0xFF << READ_ADDR))
++			| NAND_CMD_PARAM << READ_ADDR;
++
++	regs->exec = 1;
++
++	regs->orig_cmd1 = this->cmd1;
++	regs->orig_vld = this->vld;
++
++	write_reg_dma(this, NAND_DEV_CMD_VLD, 1);
++	write_reg_dma(this, NAND_DEV_CMD1, 1);
++
++	this->buf_count = 512;
++	memset(this->data_buffer, 0xff, this->buf_count);
++
++	config_cw_read(this);
++
++	read_data_dma(this, FLASH_BUF_ACC, this->data_buffer, this->buf_count);
++
++	/* restore CMD1 and VLD regs */
++	write_reg_dma(this, NAND_DEV_CMD1_RESTORE, 1);
++	write_reg_dma(this, NAND_DEV_CMD_VLD_RESTORE, 1);
++
++	return 0;
++}
++
++/* sets up descriptors for NAND_CMD_ERASE1 */
++static int erase_block(struct qcom_nandc_data *this, int page_addr)
++{
++	struct nandc_regs *regs = this->regs;
++
++	regs->cmd = BLOCK_ERASE | PAGE_ACC | LAST_PAGE;
++	regs->addr0 = page_addr;
++	regs->addr1 = 0;
++	regs->cfg0 = this->cfg0_raw & ~(7 << CW_PER_PAGE);
++	regs->cfg1 = this->cfg1_raw;
++	regs->exec = 1;
++	regs->clrflashstatus = this->clrflashstatus;
++	regs->clrreadstatus = this->clrreadstatus;
++
++	write_reg_dma(this, NAND_FLASH_CMD, 3);
++	write_reg_dma(this, NAND_DEV0_CFG0, 2);
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_FLASH_STATUS, 1);
++
++	write_reg_dma(this, NAND_FLASH_STATUS, 1);
++	write_reg_dma(this, NAND_READ_STATUS, 1);
++
++	return 0;
++}
++
++/* sets up descriptors for NAND_CMD_READID */
++static int read_id(struct qcom_nandc_data *this, int column)
++{
++	struct nandc_regs *regs = this->regs;
++
++	if (column == -1)
++		return 0;
++
++	regs->cmd = FETCH_ID;
++	regs->addr0 = column;
++	regs->addr1 = 0;
++	regs->chip_sel = DM_EN;
++	regs->exec = 1;
++
++	write_reg_dma(this, NAND_FLASH_CMD, 4);
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_READ_ID, 1);
++
++	return 0;
++}
++
++/* sets up descriptors for NAND_CMD_RESET */
++static int reset(struct qcom_nandc_data *this)
++{
++	struct nandc_regs *regs = this->regs;
++
++	regs->cmd = RESET_DEVICE;
++	regs->exec = 1;
++
++	write_reg_dma(this, NAND_FLASH_CMD, 1);
++	write_reg_dma(this, NAND_EXEC_CMD, 1);
++
++	read_reg_dma(this, NAND_FLASH_STATUS, 1);
++
++	return 0;
++}
++
++/* helpers to submit/free our list of dma descriptors */
++static void dma_callback(void *param)
++{
++	struct qcom_nandc_data *this = param;
++	struct completion *c = &this->dma_done;
++
++	complete(c);
++}
++
++static int submit_descs(struct qcom_nandc_data *this)
++{
++	struct completion *c = &this->dma_done;
++	struct desc_info *desc;
++	int r;
++
++	init_completion(c);
++
++	list_for_each_entry(desc, &this->list, list) {
++		/*
++		 * we add a callback to the last descriptor in our list to
++		 * notify completion of command
++		 */
++		if (list_is_last(&desc->list, &this->list)) {
++			desc->dma_desc->callback = dma_callback;
++			desc->dma_desc->callback_param = this;
++		}
++
++		dmaengine_submit(desc->dma_desc);
++	}
++
++	dma_async_issue_pending(this->chan);
++
++	r = wait_for_completion_timeout(c, msecs_to_jiffies(500));
++	if (!r)
++		return -ETIMEDOUT;
++
++	return 0;
++}
++
++static void free_descs(struct qcom_nandc_data *this)
++{
++	struct desc_info *desc, *n;
++
++	list_for_each_entry_safe(desc, n, &this->list, list) {
++		list_del(&desc->list);
++		dma_unmap_sg(this->dev, &desc->sgl, 1, desc->dir);
++		kfree(desc);
++	}
++}
++
++/* reset the register read buffer for next NAND operation */
++static void clear_read_regs(struct qcom_nandc_data *this)
++{
++	this->reg_read_pos = 0;
++	memset(this->reg_read_buf, 0, MAX_REG_RD * sizeof(*this->reg_read_buf));
++}
++
++static void pre_command(struct qcom_nandc_data *this, int command)
++{
++	this->buf_count = 0;
++	this->buf_start = 0;
++	this->use_ecc = false;
++	this->last_command = command;
++
++	clear_read_regs(this);
++}
++
++/*
++ * this is called after NAND_CMD_PAGEPROG and NAND_CMD_ERASE1 to set our
++ * privately maintained status byte, this status byte can be read after
++ * NAND_CMD_STATUS is called
++ */
++static void parse_erase_write_errors(struct qcom_nandc_data *this, int command)
++{
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int num_cw;
++	int i;
++
++	num_cw = command == NAND_CMD_PAGEPROG ? ecc->steps : 1;
++
++	for (i = 0; i < num_cw; i++) {
++		__le32 flash_status = le32_to_cpu(this->reg_read_buf[i]);
++
++		if (flash_status & FS_MPU_ERR)
++			this->status &= ~NAND_STATUS_WP;
++
++		if (flash_status & FS_OP_ERR || (i == (num_cw - 1) &&
++				(flash_status & FS_DEVICE_STS_ERR)))
++			this->status |= NAND_STATUS_FAIL;
++	}
++}
++
++static void post_command(struct qcom_nandc_data *this, int command)
++{
++	switch (command) {
++	case NAND_CMD_READID:
++		memcpy(this->data_buffer, this->reg_read_buf, this->buf_count);
++		break;
++	case NAND_CMD_PAGEPROG:
++	case NAND_CMD_ERASE1:
++		parse_erase_write_errors(this, command);
++		break;
++	default:
++		break;
++	}
++}
++
++/*
++ * Implements chip->cmdfunc. It's  only used for a limited set of commands.
++ * The rest of the commands wouldn't be called by upper layers. For example,
++ * NAND_CMD_READOOB would never be called because we have our own versions
++ * of read_oob ops for nand_ecc_ctrl.
++ */
++static void qcom_nandc_command(struct mtd_info *mtd, unsigned int command,
++			 int column, int page_addr)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	struct qcom_nandc_data *this = chip->priv;
++	bool wait = false;
++	int r = 0;
++
++	pre_command(this, command);
++
++	switch (command) {
++	case NAND_CMD_RESET:
++		r = reset(this);
++		wait = true;
++		break;
++
++	case NAND_CMD_READID:
++		this->buf_count = 4;
++		r = read_id(this, column);
++		wait = true;
++		break;
++
++	case NAND_CMD_PARAM:
++		r = nandc_param(this);
++		wait = true;
++		break;
++
++	case NAND_CMD_ERASE1:
++		r = erase_block(this, page_addr);
++		wait = true;
++		break;
++
++	case NAND_CMD_READ0:
++		/* we read the entire page for now */
++		WARN_ON(column != 0);
++
++		this->use_ecc = true;
++		set_address(this, 0, page_addr);
++		update_rw_regs(this, ecc->steps, true);
++		break;
++
++	case NAND_CMD_SEQIN:
++		WARN_ON(column != 0);
++		set_address(this, 0, page_addr);
++		break;
++
++	case NAND_CMD_PAGEPROG:
++	case NAND_CMD_STATUS:
++	case NAND_CMD_NONE:
++	default:
++		break;
++	}
++
++	if (r) {
++		dev_err(this->dev, "failure executing command %d\n",
++			command);
++		free_descs(this);
++		return;
++	}
++
++	if (wait) {
++		r = submit_descs(this);
++		if (r)
++			dev_err(this->dev,
++				"failure submitting descs for command %d\n",
++				command);
++	}
++
++	free_descs(this);
++
++	post_command(this, command);
++}
++
++/*
++ * when using RS ECC, the NAND controller flags an error when reading an
++ * erased page. however, there are special characters at certain offsets when
++ * we read the erased page. we check here if the page is really empty. if so,
++ * we replace the magic characters with 0xffs
++ */
++static bool empty_page_fixup(struct qcom_nandc_data *this, u8 *data_buf)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int cwperpage = ecc->steps;
++	u8 orig1[MAX_NUM_STEPS], orig2[MAX_NUM_STEPS];
++	int i, j;
++
++	/* if BCH is enabled, HW will take care of detecting erased pages */
++	if (this->bch_enabled || !this->use_ecc)
++		return false;
++
++	for (i = 0; i < cwperpage; i++) {
++		u8 *empty1, *empty2;
++		__le32 flash_status = le32_to_cpu(this->reg_read_buf[3 * i]);
++
++		/*
++		 * an erased page flags an error in NAND_FLASH_STATUS, check if
++		 * the page is erased by looking for 0x54s at offsets 3 and 175
++		 * from the beginning of each codeword
++		 */
++		if (!(flash_status & FS_OP_ERR))
++			break;
++
++		empty1 = &data_buf[3 + i * this->cw_data];
++		empty2 = &data_buf[175 + i * this->cw_data];
++
++		/*
++		 * if the error wasn't because of an erased page, bail out and
++		 * and let someone else do the error checking
++		 */
++		if ((*empty1 == 0x54 && *empty2 == 0xff) ||
++				(*empty1 == 0xff && *empty2 == 0x54)) {
++			orig1[i] = *empty1;
++			orig2[i] = *empty2;
++
++			*empty1 = 0xff;
++			*empty2 = 0xff;
++		} else {
++			break;
++		}
++	}
++
++	if (i < cwperpage || memchr_inv(data_buf, 0xff, mtd->writesize))
++		goto not_empty;
++
++	/*
++	 * tell the caller that the page was empty and is fixed up, so that
++	 * parse_read_errors() doesn't think it's an error
++	 */
++	return true;
++
++not_empty:
++	/* restore original values if not empty*/
++	for (j = 0; j < i; j++) {
++		data_buf[3 + j * this->cw_data] = orig1[j];
++		data_buf[175 + j * this->cw_data] = orig2[j];
++	}
++
++	return false;
++}
++
++struct read_stats {
++	__le32 flash;
++	__le32 buffer;
++	__le32 erased_cw;
++};
++
++/*
++ * reads back status registers set by the controller to notify page read
++ * errors. this is equivalent to what 'ecc->correct()' would do.
++ */
++static int parse_read_errors(struct qcom_nandc_data *this, bool erased_page)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int cwperpage = ecc->steps;
++	unsigned int max_bitflips = 0;
++	int i;
++
++	for (i = 0; i < cwperpage; i++) {
++		int stat;
++		struct read_stats *buf;
++
++		buf = (struct read_stats *) (this->reg_read_buf + 3 * i);
++
++		buf->flash = le32_to_cpu(buf->flash);
++		buf->buffer = le32_to_cpu(buf->buffer);
++		buf->erased_cw = le32_to_cpu(buf->erased_cw);
++
++		if (buf->flash & (FS_OP_ERR | FS_MPU_ERR)) {
++
++			/* ignore erased codeword errors */
++			if (this->bch_enabled) {
++				if ((buf->erased_cw & ERASED_CW) == ERASED_CW)
++					continue;
++			} else if (erased_page) {
++				continue;
++			}
++
++			if (buf->buffer & BS_UNCORRECTABLE_BIT) {
++				mtd->ecc_stats.failed++;
++				continue;
++			}
++		}
++
++		stat = buf->buffer & BS_CORRECTABLE_ERR_MSK;
++		mtd->ecc_stats.corrected += stat;
++
++		max_bitflips = max_t(unsigned int, max_bitflips, stat);
++	}
++
++	return max_bitflips;
++}
++
++/*
++ * helper to perform the actual page read operation, used by ecc->read_page()
++ * and ecc->read_oob()
++ */
++static int read_page_low(struct qcom_nandc_data *this, u8 *data_buf,
++			 u8 *oob_buf)
++{
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int i, r;
++
++	/* queue cmd descs for each codeword */
++	for (i = 0; i < ecc->steps; i++) {
++		int data_size, oob_size;
++
++		if (i == (ecc->steps - 1)) {
++			data_size = ecc->size - ((ecc->steps - 1) << 2);
++			oob_size = (ecc->steps << 2) + ecc->bytes;
++		} else {
++			data_size = this->cw_data;
++			oob_size = ecc->bytes;
++		}
++
++		config_cw_read(this);
++
++		if (data_buf)
++			read_data_dma(this, FLASH_BUF_ACC, data_buf, data_size);
++
++		if (oob_buf)
++			read_data_dma(this, FLASH_BUF_ACC + data_size, oob_buf,
++					oob_size);
++
++		if (data_buf)
++			data_buf += data_size;
++		if (oob_buf)
++			oob_buf += oob_size;
++	}
++
++	r = submit_descs(this);
++	if (r)
++		dev_err(this->dev, "failure to read page/oob\n");
++
++	free_descs(this);
++
++	return r;
++}
++
++/*
++ * a helper that copies the last step/codeword of a page (containing free oob)
++ * into our local buffer
++ */
++static int copy_last_cw(struct qcom_nandc_data *this, bool use_ecc, int page)
++{
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int size;
++	int r;
++
++	clear_read_regs(this);
++
++	size = use_ecc ? this->cw_data : this->cw_size;
++
++	/* prepare a clean read buffer */
++	memset(this->data_buffer, 0xff, size);
++
++	this->use_ecc = use_ecc;
++	set_address(this, this->cw_size * (ecc->steps - 1), page);
++	update_rw_regs(this, 1, true);
++
++	config_cw_read(this);
++
++	read_data_dma(this, FLASH_BUF_ACC, this->data_buffer, size);
++
++	r = submit_descs(this);
++	if (r)
++		dev_err(this->dev, "failed to copy last codeword\n");
++
++	free_descs(this);
++
++	return r;
++}
++
++/* implements ecc->read_page() */
++static int qcom_nandc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
++				uint8_t *buf, int oob_required, int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	u8 *data_buf, *oob_buf = NULL;
++	bool erased_page;
++	int r;
++
++	data_buf = buf;
++	oob_buf = oob_required ? chip->oob_poi : NULL;
++
++	r = read_page_low(this, data_buf, oob_buf);
++	if (r) {
++		dev_err(this->dev, "failure to read page\n");
++		return r;
++	}
++
++	erased_page = empty_page_fixup(this, data_buf);
++
++	return parse_read_errors(this, erased_page);
++}
++
++/* implements ecc->read_oob() */
++static int qcom_nandc_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
++			       int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int r;
++
++	clear_read_regs(this);
++
++	this->use_ecc = true;
++	set_address(this, 0, page);
++	update_rw_regs(this, ecc->steps, true);
++
++	r = read_page_low(this, NULL, chip->oob_poi);
++	if (r)
++		dev_err(this->dev, "failure to read oob\n");
++
++	return r;
++}
++
++/* implements ecc->read_oob_raw(), used to read the bad block marker flag */
++static int qcom_nandc_read_oob_raw(struct mtd_info *mtd, struct nand_chip *chip,
++				   int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	uint8_t *oob = chip->oob_poi;
++	int start, length;
++	int r;
++
++	/*
++	 * configure registers for a raw page read, the address is set to the
++	 * beginning of the last codeword, we don't care about reading ecc
++	 * portion of oob, just the free stuff
++	 */
++	r = copy_last_cw(this, false, page);
++	if (r)
++		return r;
++
++	/*
++	 * reading raw oob has 2 parts, first the bad block byte, then the
++	 * actual free oob region. perform a memcpy in two steps
++	 */
++	start = mtd->writesize - (this->cw_size * (ecc->steps - 1));
++	length = chip->options & NAND_BUSWIDTH_16 ? 2 : 1;
++
++	memcpy(oob, this->data_buffer + start, length);
++
++	oob += length;
++
++	start = this->cw_data - (ecc->steps << 2) + 1;
++	length = ecc->steps << 2;
++
++	memcpy(oob, this->data_buffer + start, length);
++
++	return 0;
++}
++
++/* implements ecc->write_page() */
++static int qcom_nandc_write_page(struct mtd_info *mtd, struct nand_chip *chip,
++				 const uint8_t *buf, int oob_required)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	u8 *data_buf, *oob_buf;
++	int i, r = 0;
++
++	clear_read_regs(this);
++
++	data_buf = (u8 *) buf;
++	oob_buf = chip->oob_poi;
++
++	this->use_ecc = true;
++	update_rw_regs(this, ecc->steps, false);
++
++	for (i = 0; i < ecc->steps; i++) {
++		int data_size, oob_size;
++
++		if (i == (ecc->steps - 1)) {
++			data_size = ecc->size - ((ecc->steps - 1) << 2);
++			oob_size = (ecc->steps << 2) + ecc->bytes;
++		} else {
++			data_size = this->cw_data;
++			oob_size = ecc->bytes;
++		}
++
++		config_cw_write_pre(this);
++		write_data_dma(this, FLASH_BUF_ACC, data_buf, data_size);
++
++		/*
++		 * we don't really need to write anything to oob for the
++		 * first n - 1 codewords since these oob regions just
++		 * contain ecc that's written by the controller itself
++		 */
++		if (i == (ecc->steps - 1))
++			write_data_dma(this, FLASH_BUF_ACC + data_size,
++					oob_buf, oob_size);
++		config_cw_write_post(this);
++
++		data_buf += data_size;
++		oob_buf += oob_size;
++	}
++
++	r = submit_descs(this);
++	if (r)
++		dev_err(this->dev, "failure to write page\n");
++
++	free_descs(this);
++
++	return r;
++}
++
++/*
++ * implements ecc->write_oob()
++ *
++ * the NAND controller cannot write only data or only oob within a codeword,
++ * since ecc is calculated for the combined codeword. we first copy the
++ * entire contents for the last codeword(data + oob), replace the old oob
++ * with the new one in chip->oob_poi, and then write the entire codeword.
++ * this read-copy-write operation results in a slight perormance loss.
++ */
++static int qcom_nandc_write_oob(struct mtd_info *mtd, struct nand_chip *chip,
++				int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	uint8_t *oob = chip->oob_poi;
++	int free_boff;
++	int data_size, oob_size;
++	int r, status = 0;
++
++	r = copy_last_cw(this, true, page);
++	if (r)
++		return r;
++
++	clear_read_regs(this);
++
++	/* calculate the data and oob size for the last codeword/step */
++	data_size = ecc->size - ((ecc->steps - 1) << 2);
++	oob_size = (ecc->steps << 2) + ecc->bytes;
++
++	/*
++	 * the location of spare data in the oob buffer, we could also use
++	 * ecc->layout.oobfree here
++	 */
++	free_boff = ecc->bytes * (ecc->steps - 1);
++
++	/* override new oob content to last codeword */
++	memcpy(this->data_buffer + data_size, oob + free_boff, oob_size);
++
++	this->use_ecc = true;
++	set_address(this, this->cw_size * (ecc->steps - 1), page);
++	update_rw_regs(this, 1, false);
++
++	config_cw_write_pre(this);
++	write_data_dma(this, FLASH_BUF_ACC, this->data_buffer,
++		data_size + oob_size);
++	config_cw_write_post(this);
++
++	r = submit_descs(this);
++
++	free_descs(this);
++
++	if (r) {
++		dev_err(this->dev, "failure to write oob\n");
++		return -EIO;
++	}
++
++	chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
++
++	status = chip->waitfunc(mtd, chip);
++
++	return status & NAND_STATUS_FAIL ? -EIO : 0;
++}
++
++/* implements ecc->write_oob_raw(), used to write bad block marker flag */
++static int qcom_nandc_write_oob_raw(struct mtd_info *mtd,
++				    struct nand_chip *chip, int page)
++{
++	struct qcom_nandc_data *this = chip->priv;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	uint8_t *oob = chip->oob_poi;
++	int start, length;
++	int r, status = 0;
++
++	r = copy_last_cw(this, false, page);
++	if (r)
++		return r;
++
++	clear_read_regs(this);
++
++	/*
++	 * writing raw oob has 2 parts, first the bad block region, then the
++	 * actual free region
++	 */
++	start = mtd->writesize - (this->cw_size * (ecc->steps - 1));
++	length = chip->options & NAND_BUSWIDTH_16 ? 2 : 1;
++
++	memcpy(this->data_buffer + start, oob, length);
++
++	oob += length;
++
++	start = this->cw_data - (ecc->steps << 2) + 1;
++	length = ecc->steps << 2;
++
++	memcpy(this->data_buffer + start, oob, length);
++
++	/* prepare write */
++	this->use_ecc = false;
++	set_address(this, this->cw_size * (ecc->steps - 1), page);
++	update_rw_regs(this, 1, false);
++
++	config_cw_write_pre(this);
++	write_data_dma(this, FLASH_BUF_ACC, this->data_buffer, this->cw_size);
++	config_cw_write_post(this);
++
++	r = submit_descs(this);
++
++	free_descs(this);
++
++	if (r) {
++		dev_err(this->dev, "failure to write updated oob\n");
++		return -EIO;
++	}
++
++	chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
++
++	status = chip->waitfunc(mtd, chip);
++
++	return status & NAND_STATUS_FAIL ? -EIO : 0;
++}
++
++/*
++ * the three functions below implement chip->read_byte(), chip->read_buf()
++ * and chip->write_buf() respectively. these aren't used for
++ * reading/writing page data, they are used for smaller data like reading
++ * id, status etc
++ */
++static uint8_t qcom_nandc_read_byte(struct mtd_info *mtd)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct qcom_nandc_data *this = chip->priv;
++	uint8_t *buf = this->data_buffer;
++	uint8_t ret = 0x0;
++
++	if (this->last_command == NAND_CMD_STATUS) {
++		ret = this->status;
++
++		this->status = NAND_STATUS_READY | NAND_STATUS_WP;
++
++		return ret;
++	}
++
++	if (this->buf_start < this->buf_count)
++		ret = buf[this->buf_start++];
++
++	return ret;
++}
++
++static void qcom_nandc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct qcom_nandc_data *this = chip->priv;
++	int real_len = min_t(size_t, len, this->buf_count - this->buf_start);
++
++	memcpy(buf, this->data_buffer + this->buf_start, real_len);
++	this->buf_start += real_len;
++}
++
++static void qcom_nandc_write_buf(struct mtd_info *mtd, const uint8_t *buf,
++		int len)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct qcom_nandc_data *this = chip->priv;
++	int real_len = min_t(size_t, len, this->buf_count - this->buf_start);
++
++	memcpy(this->data_buffer + this->buf_start, buf, real_len);
++
++	this->buf_start += real_len;
++}
++
++/* we support only one external chip for now */
++static void qcom_nandc_select_chip(struct mtd_info *mtd, int chipnr)
++{
++	struct nand_chip *chip = mtd->priv;
++	struct qcom_nandc_data *this = chip->priv;
++
++	if (chipnr <= 0)
++		return;
++
++	dev_warn(this->dev, "invalid chip select\n");
++}
++
++/*
++ * NAND controller page layout info
++ *
++ * |-----------------------|	  |---------------------------------|
++ * |		xx.......xx|	  |		*********xx.......xx|
++ * |	DATA	xx..ECC..xx|	  |	DATA	**SPARE**xx..ECC..xx|
++ * |   (516)	xx.......xx|	  |  (516-n*4)	**(n*4)**xx.......xx|
++ * |		xx.......xx|	  |		*********xx.......xx|
++ * |-----------------------|	  |---------------------------------|
++ *     codeword 1,2..n-1			codeword n
++ *  <---(528/532 Bytes)---->	   <-------(528/532 Bytes)---------->
++ *
++ * n = number of codewords in the page
++ * . = ECC bytes
++ * * = spare bytes
++ * x = unused/reserved bytes
++ *
++ * 2K page: n = 4, spare = 16 bytes
++ * 4K page: n = 8, spare = 32 bytes
++ * 8K page: n = 16, spare = 64 bytes
++ *
++ * the qcom nand controller operates at a sub page/codeword level. each
++ * codeword is 528 and 532 bytes for 4 bit and 8 bit ECC modes respectively.
++ * the number of ECC bytes vary based on the ECC strength and the bus width.
++ *
++ * the first n - 1 codewords contains 516 bytes of user data, the remaining
++ * 12/16 bytes consist of ECC and reserved data. The nth codeword contains
++ * both user data and spare(oobavail) bytes that sum up to 516 bytes.
++ *
++ * the layout described above is used by the controller when the ECC block is
++ * enabled. When we read a page with ECC enabled, the unused/reserved bytes are
++ * skipped and not copied to our internal buffer. therefore, the nand_ecclayout
++ * layouts defined below doesn't consider the positions occupied by the reserved
++ * bytes
++ *
++ * when the ECC block is disabled, one unused byte (or two for 16 bit bus width)
++ * in the last codeword is the position of bad block marker. the bad block
++ * marker cannot be accessed when ECC is enabled.
++ *
++ */
++
++/*
++ * Layouts for different page sizes and ecc modes. We skip the eccpos field
++ * since it isn't needed for this driver
++ */
++
++/* 2K page, 4 bit ECC */
++static struct nand_ecclayout layout_oob_64 = {
++	.eccbytes	= 40,
++	.oobfree	= {
++				{ 30, 16 },
++			  },
++};
++
++/* 4K page, 4 bit ECC, 8/16 bit bus width */
++static struct nand_ecclayout layout_oob_128 = {
++	.eccbytes	= 80,
++	.oobfree	= {
++				{ 70, 32 },
++			  },
++};
++
++/* 4K page, 8 bit ECC, 8 bit bus width */
++static struct nand_ecclayout layout_oob_224_x8 = {
++	.eccbytes	= 104,
++	.oobfree	= {
++				{ 91, 32 },
++			  },
++};
++
++/* 4K page, 8 bit ECC, 16 bit bus width */
++static struct nand_ecclayout layout_oob_224_x16 = {
++	.eccbytes	= 112,
++	.oobfree	= {
++				{ 98, 32 },
++			  },
++};
++
++/* 8K page, 4 bit ECC, 8/16 bit bus width */
++static struct nand_ecclayout layout_oob_256 = {
++	.eccbytes	= 160,
++	.oobfree	= {
++				{ 151, 64 },
++			  },
++};
++
++/*
++ * this is called before scan_ident, we do some minimal configurations so
++ * that reading ID and ONFI params work
++ */
++static void qcom_nandc_pre_init(struct qcom_nandc_data *this)
++{
++	/* kill onenand */
++	nandc_write(this, SFLASHC_BURST_CFG, 0);
++
++	/* enable ADM DMA */
++	nandc_write(this, NAND_FLASH_CHIP_SELECT, DM_EN);
++
++	/* save the original values of these registers */
++	this->cmd1 = nandc_read(this, NAND_DEV_CMD1);
++	this->vld = nandc_read(this, NAND_DEV_CMD_VLD);
++
++	/* initial status value */
++	this->status = NAND_STATUS_READY | NAND_STATUS_WP;
++}
++
++static int qcom_nandc_ecc_init(struct qcom_nandc_data *this)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int cwperpage;
++	bool wide_bus;
++
++	/* the nand controller fetches codewords/chunks of 512 bytes */
++	cwperpage = mtd->writesize >> 9;
++
++	ecc->strength = this->ecc_strength;
++
++	wide_bus = chip->options & NAND_BUSWIDTH_16 ? true : false;
++
++	if (ecc->strength >= 8) {
++		/* 8 bit ECC defaults to BCH ECC on all platforms */
++		ecc->bytes = wide_bus ? 14 : 13;
++	} else {
++		/*
++		 * if the controller supports BCH for 4 bit ECC, the controller
++		 * uses lesser bytes for ECC. If RS is used, the ECC bytes is
++		 * always 10 bytes
++		 */
++		if (this->ecc_modes & ECC_BCH_4BIT)
++			ecc->bytes = wide_bus ? 8 : 7;
++		else
++			ecc->bytes = 10;
++	}
++
++	/* each step consists of 512 bytes of data */
++	ecc->size = NANDC_STEP_SIZE;
++
++	ecc->read_page		= qcom_nandc_read_page;
++	ecc->read_oob		= qcom_nandc_read_oob;
++	ecc->write_page		= qcom_nandc_write_page;
++	ecc->write_oob		= qcom_nandc_write_oob;
++
++	/*
++	 * the bad block marker is readable only when we read the page with ECC
++	 * disabled. all the ops above run with ECC enabled. We need raw read
++	 * and write function for oob in order to access bad block marker.
++	 */
++	ecc->read_oob_raw	= qcom_nandc_read_oob_raw;
++	ecc->write_oob_raw	= qcom_nandc_write_oob_raw;
++
++	switch (mtd->oobsize) {
++	case 64:
++		ecc->layout = &layout_oob_64;
++		break;
++	case 128:
++		ecc->layout = &layout_oob_128;
++		break;
++	case 224:
++		if (wide_bus)
++			ecc->layout = &layout_oob_224_x16;
++		else
++			ecc->layout = &layout_oob_224_x8;
++		break;
++	case 256:
++		ecc->layout = &layout_oob_256;
++		break;
++	default:
++		dev_err(this->dev, "unsupported NAND device, oobsize %d\n",
++			mtd->oobsize);
++		return -ENODEV;
++	}
++
++	ecc->mode = NAND_ECC_HW;
++
++	/* enable ecc by default */
++	this->use_ecc = true;
++
++	return 0;
++}
++
++static void qcom_nandc_hw_post_init(struct qcom_nandc_data *this)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct nand_ecc_ctrl *ecc = &chip->ecc;
++	int cwperpage = mtd->writesize / ecc->size;
++	int spare_bytes, bad_block_byte;
++	bool wide_bus;
++	int ecc_mode = 0;
++
++	wide_bus = chip->options & NAND_BUSWIDTH_16 ? true : false;
++
++	if (ecc->strength >= 8) {
++		this->cw_size = 532;
++
++		spare_bytes = wide_bus ? 0 : 2;
++
++		this->bch_enabled = true;
++		ecc_mode = 1;
++	} else {
++		this->cw_size = 528;
++
++		if (this->ecc_modes & ECC_BCH_4BIT) {
++			spare_bytes = wide_bus ? 2 : 4;
++
++			this->bch_enabled = true;
++			ecc_mode = 0;
++		} else {
++			spare_bytes = wide_bus ? 0 : 1;
++		}
++	}
++
++	/*
++	 * DATA_UD_BYTES varies based on whether the read/write command protects
++	 * spare data with ECC too. We protect spare data by default, so we set
++	 * it to main + spare data, which are 512 and 4 bytes respectively.
++	 */
++	this->cw_data = 516;
++
++	bad_block_byte = mtd->writesize - this->cw_size * (cwperpage - 1) + 1;
++
++	this->cfg0 = (cwperpage - 1) << CW_PER_PAGE
++				| this->cw_data << UD_SIZE_BYTES
++				| 0 << DISABLE_STATUS_AFTER_WRITE
++				| 5 << NUM_ADDR_CYCLES
++				| ecc->bytes << ECC_PARITY_SIZE_BYTES_RS
++				| 0 << STATUS_BFR_READ
++				| 1 << SET_RD_MODE_AFTER_STATUS
++				| spare_bytes << SPARE_SIZE_BYTES;
++
++	this->cfg1 = 7 << NAND_RECOVERY_CYCLES
++				| 0 <<  CS_ACTIVE_BSY
++				| bad_block_byte << BAD_BLOCK_BYTE_NUM
++				| 0 << BAD_BLOCK_IN_SPARE_AREA
++				| 2 << WR_RD_BSY_GAP
++				| wide_bus << WIDE_FLASH
++				| this->bch_enabled << ENABLE_BCH_ECC;
++
++	this->cfg0_raw = (cwperpage - 1) << CW_PER_PAGE
++				| this->cw_size << UD_SIZE_BYTES
++				| 5 << NUM_ADDR_CYCLES
++				| 0 << SPARE_SIZE_BYTES;
++
++	this->cfg1_raw = 7 << NAND_RECOVERY_CYCLES
++				| 0 << CS_ACTIVE_BSY
++				| 17 << BAD_BLOCK_BYTE_NUM
++				| 1 << BAD_BLOCK_IN_SPARE_AREA
++				| 2 << WR_RD_BSY_GAP
++				| wide_bus << WIDE_FLASH
++				| 1 << DEV0_CFG1_ECC_DISABLE;
++
++	this->ecc_bch_cfg = this->bch_enabled << ECC_CFG_ECC_DISABLE
++				| 0 << ECC_SW_RESET
++				| this->cw_data << ECC_NUM_DATA_BYTES
++				| 1 << ECC_FORCE_CLK_OPEN
++				| ecc_mode << ECC_MODE
++				| ecc->bytes << ECC_PARITY_SIZE_BYTES_BCH;
++
++	this->ecc_buf_cfg = 0x203 << NUM_STEPS;
++
++	this->clrflashstatus = FS_READY_BSY_N;
++	this->clrreadstatus = 0xc0;
++
++	dev_dbg(this->dev,
++		"cfg0 %x cfg1 %x ecc_buf_cfg %x ecc_bch cfg %x cw_size %d cw_data %d strength %d parity_bytes %d steps %d\n",
++		this->cfg0, this->cfg1, this->ecc_buf_cfg,
++		this->ecc_bch_cfg, this->cw_size, this->cw_data,
++		ecc->strength, ecc->bytes, cwperpage);
++}
++
++static int qcom_nandc_alloc(struct qcom_nandc_data *this)
++{
++	int r;
++
++	r = dma_set_coherent_mask(this->dev, DMA_BIT_MASK(32));
++	if (r) {
++		dev_err(this->dev, "failed to set DMA mask\n");
++		return r;
++	}
++
++	/*
++	 * we use the internal buffer for reading ONFI params, reading small
++	 * data like ID and status, and preforming read-copy-write operations
++	 * when writing to a codeword partially. 532 is the maximum possible
++	 * size of a codeword for our nand controller
++	 */
++	this->buf_size = 532;
++
++	this->data_buffer = devm_kzalloc(this->dev, this->buf_size, GFP_KERNEL);
++	if (!this->data_buffer)
++		return -ENOMEM;
++
++	this->regs = devm_kzalloc(this->dev, sizeof(*this->regs), GFP_KERNEL);
++	if (!this->regs)
++		return -ENOMEM;
++
++	this->reg_read_buf = devm_kzalloc(this->dev,
++				MAX_REG_RD * sizeof(*this->reg_read_buf),
++				GFP_KERNEL);
++	if (!this->reg_read_buf)
++		return -ENOMEM;
++
++	INIT_LIST_HEAD(&this->list);
++
++	this->chan = dma_request_slave_channel(this->dev, "rxtx");
++	if (!this->chan) {
++		dev_err(this->dev, "failed to request slave channel\n");
++		return -ENODEV;
++	}
++
++	return 0;
++}
++
++static void qcom_nandc_unalloc(struct qcom_nandc_data *this)
++{
++	dma_release_channel(this->chan);
++}
++
++static int qcom_nandc_init(struct qcom_nandc_data *this)
++{
++	struct mtd_info *mtd = &this->mtd;
++	struct nand_chip *chip = &this->chip;
++	struct device_node *np = this->dev->of_node;
++	struct mtd_part_parser_data ppdata = { .of_node = np };
++	int r;
++
++	mtd->priv = chip;
++	mtd->name = "qcom-nandc";
++	mtd->owner = THIS_MODULE;
++
++	chip->priv = this;
++
++	chip->cmdfunc		= qcom_nandc_command;
++	chip->select_chip	= qcom_nandc_select_chip;
++	chip->read_byte		= qcom_nandc_read_byte;
++	chip->read_buf		= qcom_nandc_read_buf;
++	chip->write_buf		= qcom_nandc_write_buf;
++
++	chip->options |= NAND_NO_SUBPAGE_WRITE | NAND_USE_BOUNCE_BUFFER;
++	if (this->bus_width == 16)
++		chip->options |= NAND_BUSWIDTH_16;
++
++	chip->bbt_options = NAND_BBT_ACCESS_BBM_RAW;
++	if (of_get_nand_on_flash_bbt(np))
++		chip->bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
++
++	qcom_nandc_pre_init(this);
++
++	r = nand_scan_ident(mtd, 1, NULL);
++	if (r)
++		return r;
++
++	r = qcom_nandc_ecc_init(this);
++	if (r)
++		return r;
++
++	qcom_nandc_hw_post_init(this);
++
++	r = nand_scan_tail(mtd);
++	if (r)
++		return r;
++
++	return mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
++}
++
++static int qcom_nandc_parse_dt(struct platform_device *pdev)
++{
++	struct qcom_nandc_data *this = platform_get_drvdata(pdev);
++	struct device_node *np = this->dev->of_node;
++	int r;
++
++	this->ecc_strength = of_get_nand_ecc_strength(np);
++	if (this->ecc_strength < 0) {
++		dev_warn(this->dev,
++			"incorrect ecc strength, setting to 4 bits/step\n");
++		this->ecc_strength = 4;
++	}
++
++	this->bus_width = of_get_nand_bus_width(np);
++	if (this->bus_width < 0) {
++		dev_warn(this->dev, "incorrect bus width, setting to 8\n");
++		this->bus_width = 8;
++	}
++
++	r = of_property_read_u32(np, "qcom,cmd-crci", &this->cmd_crci);
++	if (r) {
++		dev_err(this->dev, "command CRCI unspecified\n");
++		return r;
++	}
++
++	r = of_property_read_u32(np, "qcom,data-crci", &this->data_crci);
++	if (r) {
++		dev_err(this->dev, "data CRCI unspecified\n");
++		return r;
++	}
++
++	return 0;
++}
++
++static int qcom_nandc_probe(struct platform_device *pdev)
++{
++	struct qcom_nandc_data *this;
++	const struct of_device_id *match;
++	int r;
++
++	this = devm_kzalloc(&pdev->dev, sizeof(*this), GFP_KERNEL);
++	if (!this)
++		return -ENOMEM;
++
++	platform_set_drvdata(pdev, this);
++
++	this->pdev = pdev;
++	this->dev  = &pdev->dev;
++
++	match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev);
++	if (!match) {
++		dev_err(&pdev->dev, "failed to match device\n");
++		return -ENODEV;
++	}
++
++	if (!match->data) {
++		dev_err(&pdev->dev, "failed to get device data\n");
++		return -ENODEV;
++	}
++
++	this->ecc_modes = (u32) match->data;
++
++	this->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	this->base = devm_ioremap_resource(&pdev->dev, this->res);
++	if (IS_ERR(this->base))
++		return PTR_ERR(this->base);
++
++	this->core_clk = devm_clk_get(&pdev->dev, "core");
++	if (IS_ERR(this->core_clk))
++		return PTR_ERR(this->core_clk);
++
++	this->aon_clk = devm_clk_get(&pdev->dev, "aon");
++	if (IS_ERR(this->aon_clk))
++		return PTR_ERR(this->aon_clk);
++
++	r = qcom_nandc_parse_dt(pdev);
++	if (r)
++		return r;
++
++	r = qcom_nandc_alloc(this);
++	if (r)
++		return r;
++
++	r = clk_prepare_enable(this->core_clk);
++	if (r)
++		goto err_core_clk;
++
++	r = clk_prepare_enable(this->aon_clk);
++	if (r)
++		goto err_aon_clk;
++
++	r = qcom_nandc_init(this);
++	if (r)
++		goto err_init;
++
++	return 0;
++
++err_init:
++	clk_disable_unprepare(this->aon_clk);
++err_aon_clk:
++	clk_disable_unprepare(this->core_clk);
++err_core_clk:
++	qcom_nandc_unalloc(this);
++
++	return r;
++}
++
++static int qcom_nandc_remove(struct platform_device *pdev)
++{
++	struct qcom_nandc_data *this = platform_get_drvdata(pdev);
++
++	qcom_nandc_unalloc(this);
++
++	clk_disable_unprepare(this->aon_clk);
++	clk_disable_unprepare(this->core_clk);
++
++	return 0;
++}
++
++#define EBI2_NANDC_ECC_MODES	(ECC_RS_4BIT | ECC_BCH_8BIT)
++
++/*
++ * data will hold a struct pointer containing more differences once we support
++ * more IPs
++ */
++static const struct of_device_id qcom_nandc_of_match[] = {
++	{	.compatible = "qcom,ebi2-nandc",
++		.data = (void *) EBI2_NANDC_ECC_MODES,
++	},
++	{}
++};
++MODULE_DEVICE_TABLE(of, qcom_nandc_of_match);
++
++static struct platform_driver qcom_nandc_driver = {
++	.driver = {
++		.name = "qcom-nandc",
++		.of_match_table = qcom_nandc_of_match,
++	},
++	.probe   = qcom_nandc_probe,
++	.remove  = qcom_nandc_remove,
++};
++module_platform_driver(qcom_nandc_driver);
++
++MODULE_AUTHOR("Archit Taneja <architt at codeaurora.org>");
++MODULE_DESCRIPTION("Qualcomm NAND Controller driver");
++MODULE_LICENSE("GPL v2");
+--- a/drivers/mtd/nand/Makefile
++++ b/drivers/mtd/nand/Makefile
+@@ -52,5 +52,6 @@ obj-$(CONFIG_MTD_NAND_XWAY)		+= xway_nan
+ obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH)	+= bcm47xxnflash/
+ obj-$(CONFIG_MTD_NAND_SUNXI)		+= sunxi_nand.o
+ obj-$(CONFIG_MTD_NAND_HISI504)	        += hisi504_nand.o
++obj-$(CONFIG_MTD_NAND_QCOM)	        += qcom_nandc.o
+ 
+ nand-objs := nand_base.o nand_bbt.o nand_timings.o
diff --git a/target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch b/target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
new file mode 100644
index 0000000..6530eb1
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
@@ -0,0 +1,82 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,3/5] dt/bindings: qcom_nandc: Add DT bindings
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927141
+Message-Id: <1438578498-32254-4-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>, devicetree at vger.kernel.org
+Date: Mon,  3 Aug 2015 10:38:16 +0530
+
+Add DT bindings document for the Qualcomm NAND controller driver.
+
+Cc: devicetree at vger.kernel.org
+
+v3:
+- Don't use '0x' when specifying nand controller address space
+- Add optional property for on-flash bbt usage
+
+Acked-by: Andy Gross <agross at codeaurora.org>
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+.../devicetree/bindings/mtd/qcom_nandc.txt         | 49 ++++++++++++++++++++++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/mtd/qcom_nandc.txt
+@@ -0,0 +1,49 @@
++* Qualcomm NAND controller
++
++Required properties:
++- compatible:		should be "qcom,ebi2-nand" for IPQ806x
++- reg:			MMIO address range
++- clocks:		must contain core clock and always on clock
++- clock-names:		must contain "core" for the core clock and "aon" for the
++			always on clock
++- dmas:			DMA specifier, consisting of a phandle to the ADM DMA
++			controller node and the channel number to be used for
++			NAND. Refer to dma.txt and qcom_adm.txt for more details
++- dma-names:		must be "rxtx"
++- qcom,cmd-crci:	must contain the ADM command type CRCI block instance
++			number specified for the NAND controller on the given
++			platform
++- qcom,data-crci:	must contain the ADM data type CRCI block instance
++			number specified for the NAND controller on the given
++			platform
++
++Optional properties:
++- nand-bus-width:	bus width. Must be 8 or 16. If not present, 8 is chosen
++			as default
++
++- nand-ecc-strength:	number of bits to correct per ECC step. Must be 4 or 8
++			bits. If not present, 4 is chosen as default
++- nand-on-flash-bbt:	Create/use on-flash bad block table
++
++The device tree may optionally contain sub-nodes describing partitions of the
++address space. See partition.txt for more detail.
++
++Example:
++
++nand at 1ac00000 {
++	compatible = "qcom,ebi2-nandc";
++	reg = <0x1ac00000 0x800>;
++
++	clocks = <&gcc EBI2_CLK>,
++		 <&gcc EBI2_AON_CLK>;
++	clock-names = "core", "aon";
++
++	dmas = <&adm_dma 3>;
++	dma-names = "rxtx";
++	qcom,cmd-crci = <15>;
++	qcom,data-crci = <3>;
++
++	partition at 0 {
++	...
++	};
++};
diff --git a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
new file mode 100644
index 0000000..27eae8f
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -0,0 +1,50 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,4/5] arm: qcom: dts: Add NAND controller node for ipq806x
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927121
+Message-Id: <1438578498-32254-5-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>, devicetree at vger.kernel.org
+Date: Mon,  3 Aug 2015 10:38:17 +0530
+
+The nand controller in IPQ806x is of the 'EBI2 type'. Use the corresponding
+compatible string.
+
+Cc: devicetree at vger.kernel.org
+
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -615,5 +615,21 @@
+ 
+ 			status = "disabled";
+ 		};
++
++		nand at 1ac00000 {
++			compatible = "qcom,ebi2-nandc";
++			reg = <0x1ac00000 0x800>;
++
++			clocks = <&gcc EBI2_CLK>,
++				 <&gcc EBI2_AON_CLK>;
++			clock-names = "core", "aon";
++
++			dmas = <&adm_dma 3>;
++			dma-names = "rxtx";
++			qcom,cmd-crci = <15>;
++			qcom,data-crci = <3>;
++
++			status = "disabled";
++		};
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch b/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
new file mode 100644
index 0000000..2231d2d
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -0,0 +1,76 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3,5/5] arm: qcom: dts: Enable NAND node on IPQ8064 AP148 platform
+From: Archit Taneja <architt at codeaurora.org>
+X-Patchwork-Id: 6927091
+Message-Id: <1438578498-32254-6-git-send-email-architt at codeaurora.org>
+To: linux-mtd at lists.infradead.org, dehrenberg at google.com,
+	cernekee at gmail.com, computersforpeace at gmail.com
+Cc: linux-arm-msm at vger.kernel.org, agross at codeaurora.org,
+	sboyd at codeaurora.org, linux-kernel at vger.kernel.org,
+	Archit Taneja <architt at codeaurora.org>, devicetree at vger.kernel.org
+Date: Mon,  3 Aug 2015 10:38:18 +0530
+
+Enable the NAND controller node on the AP148 platform. Provide pinmux
+information.
+
+Cc: devicetree at vger.kernel.org
+
+Signed-off-by: Archit Taneja <architt at codeaurora.org>
+
+---
+arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -61,6 +61,28 @@
+ 					bias-none;
+ 				};
+ 			};
++			nand_pins: nand_pins {
++				mux {
++					pins = "gpio34", "gpio35", "gpio36",
++					       "gpio37", "gpio38", "gpio39",
++					       "gpio40", "gpio41", "gpio42",
++					       "gpio43", "gpio44", "gpio45",
++					       "gpio46", "gpio47";
++					function = "nand";
++					drive-strength = <10>;
++					bias-disable;
++				};
++				pullups {
++					pins = "gpio39";
++					bias-pull-up;
++				};
++				hold {
++					pins = "gpio40", "gpio41", "gpio42",
++					       "gpio43", "gpio44", "gpio45",
++					       "gpio46", "gpio47";
++					bias-bus-hold;
++				};
++			};
+ 		};
+ 
+ 		gsbi at 16300000 {
+@@ -150,5 +172,19 @@
+ 			pinctrl-0 = <&pcie1_pins>;
+ 			pinctrl-names = "default";
+ 		};
++
++		nand at 1ac00000 {
++			status = "ok";
++
++			pinctrl-0 = <&nand_pins>;
++			pinctrl-names = "default";
++
++			nand-ecc-strength = <4>;
++			nand-bus-width = <8>;
++		};
+ 	};
+ };
++
++&adm_dma {
++	status = "ok";
++};
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 1af0660..c1e267a 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -22,8 +22,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  	};
  
  	chosen {
-@@ -61,6 +62,15 @@
- 					bias-none;
+@@ -83,6 +84,15 @@
+ 					bias-bus-hold;
  				};
  			};
 +
@@ -38,9 +38,9 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -150,5 +160,33 @@
- 			pinctrl-0 = <&pcie1_pins>;
- 			pinctrl-names = "default";
+@@ -182,6 +192,34 @@
+ 			nand-ecc-strength = <4>;
+ 			nand-bus-width = <8>;
  		};
 +
 +		mdio0: mdio {
@@ -72,6 +72,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		};
  	};
  };
+ 
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 @@ -16,6 +16,7 @@
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index c8dafab..4a43ae4 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -71,6 +71,16 @@
+@@ -93,6 +93,16 @@
  					bias-disable;
  				};
  			};
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -188,5 +198,26 @@
+@@ -220,6 +230,27 @@
  				reg = <4>;
  			};
  		};
@@ -56,6 +56,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		};
  	};
  };
+ 
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 @@ -75,6 +75,14 @@
@@ -116,7 +117,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -615,5 +615,91 @@
+@@ -631,5 +631,91 @@
  
  			status = "disabled";
  		};
-- 
2.1.4

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Thu Aug  6 22:28:42 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Thu,  6 Aug 2015 19:28:42 -0700
Subject: [OpenWrt-Devel] [PATCH 3/3] ipq806x: enable NAND flash support in
	the kernel
In-Reply-To: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
References: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1438914522-24637-4-git-send-email-mathieu@codeaurora.org>

Previous patch set backported the recently posted NAND flash driver to
3.18 and 4.1 kernel. This patch now enables it in the kernel config.

There is no change to the partition layout and init yet. But the NAND
flash can be seen in the mtd list on an AP148:

root at OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 10000000 00020000 "qcom-nandc"
...

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/Makefile    |  2 +-
 target/linux/ipq806x/config-3.18 | 21 ++++++++++++++++++++-
 target/linux/ipq806x/config-4.1  | 19 ++++++++++++++++++-
 3 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index b6ddfe2..45f83dd 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=ipq806x
 BOARDNAME:=Qualcomm Atheros IPQ806X
-FEATURES:=squashfs
+FEATURES:=squashfs nand ubifs
 CPU_TYPE:=cortex-a7
 MAINTAINER:=John Crispin <blogic at openwrt.org>
 
diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index feedfd9..2a837f5 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -104,6 +104,8 @@ CONFIG_CRC16=y
 # CONFIG_CRC32_SARWATE is not set
 CONFIG_CRC32_SLICEBY8=y
 CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
 # CONFIG_CRYPTO_SHA1_ARM_NEON is not set
 # CONFIG_CRYPTO_SHA512_ARM_NEON is not set
 CONFIG_CRYPTO_XZ=y
@@ -251,10 +253,21 @@ CONFIG_MSM_IOMMU=y
 CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
 CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_IMPA7 is not set
+CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_M25P80=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_QCOM=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_BLOCK is not set
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
@@ -327,7 +340,7 @@ CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_PTP_1588_CLOCK=y
-# CONFIG_QCOM_ADM is not set
+CONFIG_QCOM_ADM=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
@@ -395,6 +408,11 @@ CONFIG_THERMAL_OF=y
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TIMER_STATS=y
 CONFIG_TREE_PREEMPT_RCU=y
+CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_XZ=y
+CONFIG_UBIFS_FS_ZLIB=y
 CONFIG_UEVENT_HELPER_PATH=""
 CONFIG_UID16=y
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
@@ -416,5 +434,6 @@ CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
 CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index 0262e7a..f711dd5 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -111,6 +111,8 @@ CONFIG_CRC16=y
 # CONFIG_CRC32_SARWATE is not set
 CONFIG_CRC32_SLICEBY8=y
 CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_XZ=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BUGVERBOSE=y
@@ -263,9 +265,18 @@ CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_M25P80=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_QCOM=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_BLOCK is not set
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
@@ -341,7 +352,7 @@ CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_PTP_1588_CLOCK=y
-# CONFIG_QCOM_ADM is not set
+CONFIG_QCOM_ADM=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
@@ -406,6 +417,11 @@ CONFIG_THERMAL_OF=y
 # CONFIG_THUMB2_KERNEL is not set
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TIMER_STATS=y
+CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_XZ=y
+CONFIG_UBIFS_FS_ZLIB=y
 CONFIG_UEVENT_HELPER_PATH=""
 CONFIG_UID16=y
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
@@ -427,5 +443,6 @@ CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
 CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZONE_DMA_FLAG=0
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Thu Aug  6 23:15:54 2015
From: kerry9842 at gmail.com (John kerry)
Date: Fri, 7 Aug 2015 11:15:54 +0800
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
Message-ID: <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>

Hi,


Could anyone please help me on this to configure the wireless in such a way
that when we connect to wireless WAN the LAN SSID should not change.


Thanks,


On Thu, Aug 6, 2015 at 9:24 PM, John kerry <kerry9842 at gmail.com> wrote:

> Hi,
>
> I have configured wireless as below:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *config wifi-device 'wifi0'        option type 'qcawifi'        option
> channel 'auto'        option macaddr '00:03:7f:42:06:61'        option
> hwmode '11ng'        option txpower '19'        option htmode 'HT20'config
> wifi-iface        option device 'wifi0'        option network 'lan'
> option mode 'ap'        option encryption 'psk2'        option ssid
> 'Test_ap_1'        option key **'Test_ap_1'*
>
>
>
> *It works fine with WPA2 key but when i try to connect another router this
> will become as client and SSID will change to that router SSID as i
> mentioned before also.*
>
>
> *As i understand we can create one more to avoid this problem as explained
> in previous mail.*
>
> *Basically i need that when i connect to wireless WAN, the LAN SSID should
> not change. I am using AR9344. Can i use below script for my requirement.*
>
> config wifi-device 'radio0'
> >>                 option type 'mac80211'
> >>                 option channel '11'
> >>                 option hwmode '11g'
> >>                 option path 'platform/ar933x_wmac'
> >>                 option htmode 'HT20'
> >>                 option country 'US'
> >>                 option txpower '20'
> >>
> >>         config wifi-iface 'ap1'
> >>                 option device 'radio0'
> >>                 option mode 'ap'
> >>                 option wds '1'
> >>                 option ssid 'my AP'
> >>                 option network 'lan'
> >>
> >>         config wifi-iface 'mesh1'
> >>                 option device 'radio0'
> >>                 option mode 'mesh'
> >>                 option mesh_id 'my mesh'
> >>                 option network 'lan'
>
>
> Thanks & Regards,
>
> On Wed, Aug 5, 2015 at 7:00 AM, Roman Yeryomin <leroi.lists at gmail.com>
> wrote:
>
>> On 4 August 2015 at 23:24, Joshua Judson Rosen <jrosen at harvestai.com>
>> wrote:
>> > On 2015-08-04 14:14, Roman Yeryomin wrote:
>> >> On 4 August 2015 at 17:58, Joshua Judson Rosen <jrosen at harvestai.com>
>> wrote:
>> >>> On 2015-08-04 02:26, David Lang wrote:
>> >>>> A given radio can be either an AP or a client, but not both at once.
>> >>>>
>> >>>> so if you use a radio to connect to another AP, you are making it a
>> client, and
>> >>>> in client mode all it can do is connect to that other AP as shows up
>> as the SSID
>> >>>> of that other AP.
>> >>>>
>> >>>> you can do this with one radio, while using the other radio
>> (assuming you have
>> >>>> two) to act as an AP for local clients.
>> >>>
>> >>>
>> >>> This is not necessarily true: with at least some hardware/drivers,
>> it's
>> >>> possible to create multiple virtual interfaces on top of a single
>> radio--
>> >>> and separate virtual interfaces can in fact operate in different modes
>> >>> (e.g.: one in STA mode, two in AP mode, one in mesh mode...).
>> >>>
>> >>> Assuming that your hardware/driver is capable of supporting multiple
>> >>> virtual interfaces on top of the single physical radio,
>> >>> you can create these interfaces by adding "wifi-iface" stanzas
>> >>> in /etc/config/wireless, e.g:
>> >>>
>> >>>         config wifi-device 'radio0'
>> >>>                 option type 'mac80211'
>> >>>                 option channel '11'
>> >>>                 option hwmode '11g'
>> >>>                 option path 'platform/ar933x_wmac'
>> >>>                 option htmode 'HT20'
>> >>>                 option country 'US'
>> >>>                 option txpower '20'
>> >>>
>> >>>         config wifi-iface 'ap1'
>> >>>                 option device 'radio0'
>> >>>                 option mode 'ap'
>> >>>                 option wds '1'
>> >>>                 option ssid 'my AP'
>> >>>                 option network 'lan'
>> >>>
>> >>>         config wifi-iface 'mesh1'
>> >>>                 option device 'radio0'
>> >>>                 option mode 'mesh'
>> >>>                 option mesh_id 'my mesh'
>> >>>                 option network 'lan'
>> >>>
>> >>>
>> >>> That creates two virtual interfaces using the same physical radio,
>> >>> and bridges them together onto the OpenWrt "lan network"
>> >>> (which is itself defined in /etc/config/network).
>> >>>
>> >>>
>> >>> I believe you could also have an interface with "mode 'sta'", but note
>> >>> that it would also need to use the same channel as the other
>> interfaces--
>> >>> which means that the external AP to which you connect it would also
>> >>> need to use that same channel (11, in the example above).
>> >>> That's where having multiple *radios* helps: you can run them on
>> >>> different frequencies (either completely different bands [2.4 GHz vs.
>> 5 GHz],
>> >>> or on different channels within the same band [e.g. 2.427 GHz =
>> channel 4
>> >>> vs. 2.472 GHz = channel 13]) to increase efficiency by multiplexing
>> >>> less data over a single radio, or to increase compatibility with other
>> >>> APs outside of your control that you might want to connect to.
>> >>>
>> >>> Also note that, if you want to bridge a STA interface onto anything
>> else,
>> >>> it'll need to be in "WDS" mode _and_ the the AP to which it's
>> connecting
>> >>> will also need to be in "WDS" mode (note the "option wds '1'",
>> >>> in my example above), because the standard "3-address mode" of Wi-Fi
>> >>> isn't bridgeable (and note that WDS "4-address mode" is bridgeable,
>> >>> but not standardised across different platforms--so you're probably
>> >>> OK so long as all of your equipment is running Linux and using
>> >>> the same Wi-Fi driver, but don't expect to bridge a STA interface
>> >>> that's connected non-Linux Wi-Fi router).
>> >>>
>> >>> At least, I've seen this work with Atheros chips. There are some
>> >>> notes in the wiki about how Broadcom chips have their own, different
>> >>> solution implemented in hardware; and about how some drivers
>> >>> don't support this stuff at all....
>> >>
>> >> Actually 3-address mode bridging is possible with the help of relayd
>> >
>> > That's not actually "3-address mode bridging", though--
>> > it's relaying (done entirely through a userspace daemon,
>> > which AFAICT actually relays only IPv4, ARP, and DHCP packets).
>>
>> OK, yes technically it's not bridging :)
>>
>> >> and it even works quite good.
>> >> But there is an issue (also mentioned in a parallel thread): when
>> >> client interface cannot connect then AP interface doesn't come up
>> >> also. Which may not be a problem unless you want to bridge ethernet
>> >> there also.
>> >> On the other hand you may not be able to switch the main AP into
>> >> 4-address mode so relayd is a way out.
>> >
>> > It may be a solution.
>> >
>> > When I tried it a few months back (in Barrier Breaker),
>> > relayd wasn't really working for me....
>> >
>> > I know that's a terrible (non-)description; I don't specifically
>> > remember what seemed to be going wrong, except that there was
>> > a lot of traffic not reliably getting through to where it was supposed
>> to,
>> > and that it was confusing, and that I was able to slightly improve
>> > the situation by fiddling with some of the options that the init-script
>> > passed to relayd (IIRC, I had some success using "-I" on only one
>> interface
>> > and "-i" on the other), but I didn't have time to dig in and actually
>> > understand what wasn't working--just switching to 4-address mode and
>> having
>> > OpenWrt set up a kernel-level bridge w/ brctl was a more expedient
>> > path for me to get something working reliably at the time.
>> >
>> > Actually, if anyone can offer guesses as to what my issues
>> > with relayd might have actually been, I'd be glad to hear them :)
>> >
>> > I'm not specifically aware of a reason why IPv4+ARP+DHCP relaying
>> > should have been insufficient for what I was doing (I wasn't
>> > running any weird non-IP protocols...).
>> >
>> > Maybe someone can point me to a basic explanation of what
>> > sort of "ARP cache and host route management" the "-I" option
>> > is actually doing--and why I might need to disable it on one
>> > of my interfaces?
>> >
>>
>> I was using trunk around March-April this year and didn't have any
>> problems. So I would suggest just trying newer version.
>>
>>
>> Regards,
>> Roman
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150807/5d8d5b84/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From weedy2887 at gmail.com  Thu Aug  6 23:31:00 2015
From: weedy2887 at gmail.com (Weedy)
Date: Thu, 6 Aug 2015 23:31:00 -0400
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
Message-ID: <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>

On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
>
> Hi,
>
>
> Could anyone please help me on this to configure the wireless in such a
way that when we connect to wireless WAN the LAN SSID should not change.
>
>
> Thanks,

You need 2 physical radios.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150806/869e3a80/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Thu Aug  6 23:35:44 2015
From: kerry9842 at gmail.com (John kerry)
Date: Fri, 7 Aug 2015 11:35:44 +0800
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
Message-ID: <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>

Hi,


I have one and i configured as below:

config wifi-device 'wifi0'
        option type 'qcawifi'
        option channel 'auto'
        option macaddr '00:26:75:bd:37:24'
        option hwmode '11ng'
        option txpower '16'
        option htmode 'HT20'

config wifi-iface
        option device 'wifi0'
        option network 'lan'
        option mode 'ap'
        option ssid 'Test_Ap'
        option encryption 'psk2'
        option key 'Test_AP'


We can configure one radio only to work like that.
Something like below:

config wifi-device 'radio0'
>>                 option type 'mac80211'
>>                 option channel '11'
>>                 option hwmode '11g'
>>                 option path 'platform/ar933x_wmac'
>>                 option htmode 'HT20'
>>                 option country 'US'
>>                 option txpower '20'
>>
>>         config wifi-iface 'ap1'
>>                 option device 'radio0'
>>                 option mode 'ap'
>>                 option wds '1'
>>                 option ssid 'my AP'
>>                 option network 'lan'
>>
>>         config wifi-iface 'mesh1'
>>                 option device 'radio0'
>>                 option mode 'mesh'
>>                 option mesh_id 'my mesh'
>>                 option network 'lan'



On Fri, Aug 7, 2015 at 11:31 AM, Weedy <weedy2887 at gmail.com> wrote:

> On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
> >
> > Hi,
> >
> >
> > Could anyone please help me on this to configure the wireless in such a
> way that when we connect to wireless WAN the LAN SSID should not change.
> >
> >
> > Thanks,
>
> You need 2 physical radios.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150807/cca968a4/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Fri Aug  7 00:22:22 2015
From: kerry9842 at gmail.com (John kerry)
Date: Fri, 7 Aug 2015 12:22:22 +0800
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFq19A_ra_X6Q3--heyF34C5diCYgLE2q98pT-QDFC6uA@mail.gmail.com>
 <alpine.DEB.2.02.1508021539490.19555@nftneq.ynat.uz>
 <CAGUNxBEqSAk5EH+PpnkWnWABdq29i7h=56JRp=jm656zsuJkVA@mail.gmail.com>
 <alpine.DEB.2.02.1508021941090.19555@nftneq.ynat.uz>
 <CAGUNxBHjqjyybR+Y=yLj3ryy_E1MzrOMJ_86aByN4PdQYqRsJQ@mail.gmail.com>
 <CAGUNxBFpK-PRpQTU2kKEOk6U4x6RykWix7n8tVLjWyy6ss_iEw@mail.gmail.com>
 <alpine.DEB.2.02.1508032055190.2262@nftneq.ynat.uz>
 <CAGUNxBGHCv7A-8ffm1xMmoxSWtu6pzX96=wbHQD9mNh_-NqKGw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
Message-ID: <CAGUNxBHXX7iSydQZ9JZ0anYjjhkuQXXzk_ChNg4Q8ji6DFy6fg@mail.gmail.com>

Hi,

I have configured wireless file as below:

config wifi-device 'wifi0'
        option type 'qcawifi'
        option channel 'auto'
        option macaddr '00:26:75:bd:37:24'
        option hwmode '11ng'
        option txpower '16'
        option htmode 'HT20'

config wifi-iface
        option device 'wifi0'
        option network 'lan'
        option mode 'ap'
        option ssid 'Test_AP'
        option encryption 'psk2'
        option key 'Test_AP'

config wifi-iface 'mesh1'
        option device 'wifi0'
        option mode 'mesh'
        option mesh_id 'my mesh'
        option network 'lan'

[image: Inline image 1]

[image: Inline image 4]

Its created one more but still facing same problem.

Could anyone guide how i can do that.

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150807/c851b1ce/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 18178 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150807/c851b1ce/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 36431 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150807/c851b1ce/attachment-0001.png>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Fri Aug  7 01:50:20 2015
From: david at lang.hm (David Lang)
Date: Thu, 6 Aug 2015 22:50:20 -0700 (PDT)
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>

You cannot use both radios on the same channel, or even the same band.

One radio will only work on channels 1-11 and the other will only work on 
channels 36+

pick which band you are going to use to connect to the remote AP and which you 
are going to use to have your clients connect to it.

David Lang

On Fri, 7 Aug 2015, John kerry wrote:

> Hi,
>
>
> I have one and i configured as below:
>
> config wifi-device 'wifi0'
>        option type 'qcawifi'
>        option channel 'auto'
>        option macaddr '00:26:75:bd:37:24'
>        option hwmode '11ng'
>        option txpower '16'
>        option htmode 'HT20'
>
> config wifi-iface
>        option device 'wifi0'
>        option network 'lan'
>        option mode 'ap'
>        option ssid 'Test_Ap'
>        option encryption 'psk2'
>        option key 'Test_AP'
>
>
> We can configure one radio only to work like that.
> Something like below:
>
> config wifi-device 'radio0'
>>>                 option type 'mac80211'
>>>                 option channel '11'
>>>                 option hwmode '11g'
>>>                 option path 'platform/ar933x_wmac'
>>>                 option htmode 'HT20'
>>>                 option country 'US'
>>>                 option txpower '20'
>>>
>>>         config wifi-iface 'ap1'
>>>                 option device 'radio0'
>>>                 option mode 'ap'
>>>                 option wds '1'
>>>                 option ssid 'my AP'
>>>                 option network 'lan'
>>>
>>>         config wifi-iface 'mesh1'
>>>                 option device 'radio0'
>>>                 option mode 'mesh'
>>>                 option mesh_id 'my mesh'
>>>                 option network 'lan'
>
>
>
> On Fri, Aug 7, 2015 at 11:31 AM, Weedy <weedy2887 at gmail.com> wrote:
>
>> On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
>>>
>>> Hi,
>>>
>>>
>>> Could anyone please help me on this to configure the wireless in such a
>> way that when we connect to wireless WAN the LAN SSID should not change.
>>>
>>>
>>> Thanks,
>>
>> You need 2 physical radios.
>>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sami at olmari.fi  Fri Aug  7 03:57:53 2015
From: sami at olmari.fi (Sami Olmari)
Date: Fri, 7 Aug 2015 10:57:53 +0300
Subject: [OpenWrt-Devel] Separate Default SSID for 2.4GHz and 5GHz
In-Reply-To: <CAHb30NpLnaaDo-XtCjRMHZL562uEKoqzy8WSQquDcQPqpyymPA@mail.gmail.com>
References: <CAHb30NpLnaaDo-XtCjRMHZL562uEKoqzy8WSQquDcQPqpyymPA@mail.gmail.com>
Message-ID: <CAENOc+zrfK_7SVqxomzewpmby07PCizgoigWuphJAoFrbBp9xA@mail.gmail.com>

In openwrt you are free to configure each and every radio as own unit, so
use whatever SSID you see fit for each radio. This is default basic OpenWrt
stuff :)

 Sami Olmati

On Thu, Aug 6, 2015 at 6:59 PM, Afkar Rafique <afkar.ec at gmail.com> wrote:

> Hi Everyone,
>
> I am working on AR93XX openWrt project. I have to configure the wifi0 as
> 2.4GHz and 5Ghz as per the selection of user. Mainly I have to add
> selection in the GUI to switch between 2.4GHz and 5GHz. I have to keep two
> separate default SSID for 2.4GHz and 5GHz.
>
> Could anyone can help me that how I can keep two separate configuration
> and how I can handle this in software.  I mean to say how I can thin into
> GUI and can handle backend.
>
>
> Thanks.
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150807/c70f0a47/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Fri Aug  7 05:11:00 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Fri, 7 Aug 2015 11:11:00 +0200
Subject: [OpenWrt-Devel] [PATCH 0/3] ipq806x: add NAND flash support
In-Reply-To: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
References: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <55C47624.9030208@openwrt.org>

On 2015-08-07 04:28, Mathieu Olivari wrote:
> This patch serie adds support for the integrated NAND flash controller
> available on AP148. Most of the patches are backported from LKML, with
> minor modifications.
> 
> This is kernel level support & enablement for now. Support for proper
> MTD partitioning will come later and will be necessary to boot from
> it.
Do you plan on porting the smem stuff for partitioning that QSDK uses,
or do are you going to add partitions to the device tree file?
Unless there's a good reason to avoid it, I'm leaning towards the
latter, to give our kernel more control over what's going on.
For example, I'd like to call the partition with the kernel/fs 'ubi'
instead of 'rootfs', since rootfs is already used to auto-select the
root filesystem partition for auto-mounting.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Fri Aug  7 07:25:09 2015
From: linus.luessing at c0d3.blue (Linus =?utf-8?Q?L=C3=BCssing?=)
Date: Fri, 7 Aug 2015 13:25:09 +0200
Subject: [OpenWrt-Devel] [PATCHv2 netifd 2/3] bridge: Allow setting
 multicast_to_unicast option
In-Reply-To: <55C3CCEE.8060802@openwrt.org>
References: <1438729208-3556-1-git-send-email-linus.luessing@c0d3.blue>
 <1438729208-3556-3-git-send-email-linus.luessing@c0d3.blue>
 <55C1F5B4.10007@openwrt.org> <20150806201012.GC3046@odroid>
 <55C3CCEE.8060802@openwrt.org>
Message-ID: <20150807112509.GA2893@odroid>

On Thu, Aug 06, 2015 at 11:09:02PM +0200, Felix Fietkau wrote:
> On 2015-08-06 22:10, Linus L?ssing wrote:
> > On Wed, Aug 05, 2015 at 01:38:28PM +0200, Felix Fietkau wrote:
> >> On 2015-08-05 01:00, Linus L?ssing wrote:
> >> > With this patch the multicast_to_unicast feature can be disabled for all
> >> > wireless interfaces via an according option on the uci bridge interface.
> >> > 
> >> > This patch also exports the setting information to wireless handler
> >> > scripts. The hostapd script will need that information to determine
> >> > whether to enable or disable ap-isolation, for instance.
> >> > 
> >> > Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
> >> I think it would be better to store these flags in the bridge config
> >> instead of the generic device config, and either add a blob_buf argument
> >> in struct device_hotplug_ops -> prepare, or add a new callback get_info,
> >> which adds the bridge info for use in the wireless json.
> > 
> > These would then be options per bridge, but not per bridge port,
> > wouldn't they?
> Right.
> 
> > For the multicast_to_unicast feature, okay (currently this patch
> > only allows setting it "globally" for a bridge but not on a bridge
> > port basis - though I was thinking about maybe making it bridge
> > port specific once someone needs that). For the multicast_router
> > option I'd need that on a bridge port basis.
> OK, then leave it as device options for now until we have a better way
> of specifiying bridge port settings. Same for multicast_to_unicast.

Ok, thanks :). (we want to fix and use bridge snooping +
multicast-to-unicast here as soon as possible so I'm quite fond of
simple solutions for now :) )

> 
> >> I would like to avoid polluting the generic device options with bridge
> >> specific stuff.
> >> 
> >> This patch should probably be merged with the previous one afterwards,
> >> since the first one without any other changes will cause regressions.
> > 
> > Regressions, where/why? If this patch were ommitted from this
> > patchset then no harm should be done (unless I'm missing
> > something?).
> The regression is: patch 1 enables hairpin mode for wireless interfaces,
> with the assumption that the wireless script enables isolate mode for
> multicast-to-unicast enable configurations.
> The wireless script can only do that if patch 2 is applies, because that
> one passes the required options.

Not passing the multicast_to_unicast option from netifd to
hostapd.sh is not a regression. Actually even with patch 2 there
are cases where no multicast_to_unicast json option is passed -
that's when no multicast_to_unicast option was set in uci.

With netifd patch 1, without netifd patch 2 and with openwrt patch
1 things will work fine without a regression because
multicast_to_unicast is then empty and hostapd.sh will assume the
default which is that multicast_to_unicast was enabled.


However, netifd patch 1 without openwrt patch 1 is a regression,
yes (which is independant of netifd patch 2). Which I couldn't do
with a single patch as it's in two packages. But I like your
suggestion for netifd patch 1 which will also get rid of an
"intermediate regression" :). So with that change I think I can
leave netifd patch 2 and netifd 3 as is, without any regressions.

Cheers, Linus
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jogo at openwrt.org  Fri Aug  7 09:38:34 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 7 Aug 2015 15:38:34 +0200
Subject: [OpenWrt-Devel] [PATCH 1/3] ipq806x: Add ADM support
In-Reply-To: <1438914522-24637-2-git-send-email-mathieu@codeaurora.org>
References: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
 <1438914522-24637-2-git-send-email-mathieu@codeaurora.org>
Message-ID: <CAOiHx=nnoS0SOvM+xYrG9mZPGFN+u59HVzqCK4_VaXp_yid=-Q@mail.gmail.com>

Hi,

On Fri, Aug 7, 2015 at 4:28 AM, Mathieu Olivari <mathieu at codeaurora.org> wrote:
> These are cherry-picked & backported from LKML:
> *https://lkml.org/lkml/2015/3/17/19
>
> They are enabled on both 3.18 and 4.1 kernel. Patches 150 to 154 are
> applying changes merged since 3.18; they enable mechanisms used by the
> ADM driver.
>
> ADM engine is used by the NAND controller, so it is necessary to
> bring-up NAND flash support.
>
> Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
> ---

(snip)

> diff --git a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
> new file mode 100644
> index 0000000..64b0022
> --- /dev/null
> +++ b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
> @@ -0,0 +1,54 @@
> +From 1fb18acab2d71e7e4efd9c10492edb1baf84dcc0 Mon Sep 17 00:00:00 2001
> +From: Andy Gross <agross at codeaurora.org>
> +Date: Wed, 20 May 2015 15:41:07 +0530
> +Subject: [PATCH] ARM: DT: ipq8064: Add ADM device node
> +
> +This patch adds support for the ADM DMA on the IPQ8064 SOC
> +
> +Signed-off-by: Andy Gross <agross at codeaurora.org>
> +---
> + arch/arm/boot/dts/qcom-ipq8064-ap148.dts |  4 ++++
> + arch/arm/boot/dts/qcom-ipq8064.dtsi      | 21 +++++++++++++++++++++
> + 2 files changed, 25 insertions(+)
> +
> +--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> ++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> +@@ -90,6 +90,10 @@
> +
> +                               cs-gpios = <&qcom_pinmux 20 0>;
> +
> ++                              dmas = <&adm_dma 6>,
> ++                                      <&adm_dma 5>;
> ++                              dma-names = "rx", "tx";
> ++

This breaks spi flash access, and accesses to mtd partitions produce
oopses and hang the system. Removing the dma-properties "fixes" it
again. Interestingly the errors are different on 3.18 and 4.1. Also I
wonder if these were really intended to be added to ap148.dts instead
of ipq8064 dtsi - and if so, if the dma-controller should have been
set to "ok" in the .dts as well.


Jonas


3.18:
root at OpenWrt:/# dd if=/dev/mtd4 of=/dev/null
[   37.896768] adm-dma-engine 18300000.dma: invalid crci value
[   37.896820] Unable to handle kernel NULL pointer dereference at
virtual address 00000002
[   37.901146] pgd = c0204000
[   37.909579] [00000002] *pgd=00000000
[   37.915469] Internal error: Oops: 817 [#1] PREEMPT SMP ARM
[   37.915638] Modules linked in: pppoe ppp_async iptable_nat pppox
ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT
ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark
xt_mac xt_limit xt_id xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
xt_LOG xt_CT slhc nf_reject_ipv4 nf_nat_masquerade_ipv4 nf_nat_ftp
nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache
nf_conntrack_ftp nf_conntrack iptable_raw iptable_mangle
iptable_filter ip_tables crc_ccitt ledtrig_usbdev ip6t_REJECT
nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_raw ip6table_mangle
ip6table_filter ip6_tables x_tables ipv6 leds_gpio xhci_plat_hcd
xhci_pci xhci_hcd dwc3 dwc3_qcom ohci_platform ohci_hcd phy_qcom_dwc3
ahci ehci_platform ehci_hcd sd_mod ahci_platform libahci_platform
libahci libata scsi_mod gpio_button_hotplug usbcore nls_base
usb_common
[   37.996970] CPU: 0 PID: 33 Comm: spi32766 Not tainted 3.18.19 #2
[   37.997238] task: dc52c000 ti: dc526000 task.ti: dc526000
[   38.003323] PC is at spi_qup_transfer_one+0x658/0xbf8
[   38.008614] LR is at adm_prep_slave_sg+0x11c/0x598
[   38.013644] pc : [<c04385bc>]    lr : [<c03cb6e4>]    psr: 60000013
[   38.013644] sp : dc527e40  ip : 00000003  fp : 00000000
[   38.018339] r10: dc527e88  r9 : 00000000  r8 : 00000000
[   38.029702] r7 : 00000200  r6 : 00000200  r5 : dc725e1c  r4 : dd57ddd8
[   38.034910] r3 : ffffffea  r2 : dd57de8c  r1 : c04376d4  r0 : ffffffea
[   38.041509] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment kernel
[   38.048021] Control: 10c5787d  Table: 5e2d006a  DAC: 00000015
[   38.055222] Process spi32766 (pid: 33, stack limit = 0xdc526238)
[   38.061127] Stack: (0xdc527e40 to 0xdc528000)
[   38.067202] 7e40: 00000000 00000000 dc527e84 c04376d4 00000000
5e713600 00000000 00000000
[   38.071460] 7e60: 00000000 dd57ddec dc725c90 00000000 000014a0
00000000 01b11f84 c0b1d500
[   38.079619] 7e80: dc52c000 00000000 00000002 00000000 00000200
5e713600 dd4d2aa0 40000013
[   38.087778] 7ea0: dc526038 c02118a8 c05de384 dc725e1c dc725db0
dd57dc00 00000000 c0b326fc
[   38.095939] 7ec0: 00000000 00001f40 dd57dd94 c043652c 00000001
00000000 dc527eec dd57dd7c
[   38.104100] 7ee0: dd57dd6c dc725db0 dd57dc00 dc526038 00000000
00000001 dc526038 c0436c70
[   38.112259] 7f00: c0b1d500 c0b1d500 c0b2a208 dc526038 00000001
dd57dd6c dd57dd54 c0b7eec8
[   38.120417] 7f20: dc526000 dc526038 00000000 00000001 dc526038
c023c98c dd57dd58 c0b7eec8
[   38.128577] 7f40: 00000000 dc517680 00000000 dd57dd54 c023c8ac
00000000 00000000 00000000
[   38.136740] 7f60: 00000000 c023c8a8 17587f16 00000000 deff7575
dd57dd54 00000000 00000000
[   38.144897] 7f80: dc527f80 dc527f80 00000000 00000000 dc527f90
dc527f90 dc527fac dc517680
[   38.153057] 7fa0: c023c7bc 00000000 00000000 c0208e20 00000000
00000000 00000000 00000000
[   38.161216] 7fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[   38.169377] 7fe0: 00000000 00000000 00000000 00000000 00000013
00000000 1f77f542 aeaef472
[   38.177548] [<c04385bc>] (spi_qup_transfer_one) from [<c043652c>]
(spi_transfer_one_message+0x74/0x1d0)
[   38.185702] [<c043652c>] (spi_transfer_one_message) from
[<c0436c70>] (spi_pump_messages+0x3d4/0x3f0)
[   38.194907] [<c0436c70>] (spi_pump_messages) from [<c023c98c>]
(kthread_worker_fn+0xe0/0x174)
[   38.204279] [<c023c98c>] (kthread_worker_fn) from [<c023c8a8>]
(kthread+0xec/0xf0)
[   38.212783] [<c023c8a8>] (kthread) from [<c0208e20>]
(ret_from_fork+0x14/0x34)
[   38.220245] Code: e3300000 1afffffa e59d100c e1a00003 (e5834018)
[   38.228498] ---[ end trace 17614169e0a75860 ]---

4.1:
root at OpenWrt:/# dd if=/dev/mtd4 of=/dev/null
[   29.476222] adm-dma-engine 18300000.dma: invalid burst value: 0
[   29.476302] Unable to handle kernel paging request at virtual
address fffffffe
[   29.481127] pgd = dc274000
[   29.488239] [fffffffe] *pgd=5fffd821, *pte=00000000, *ppte=00000000
[   29.496921] Internal error: Oops: 817 [#1] PREEMPT SMP ARM
[   29.497272] Modules linked in: pppoe ppp_async iptable_nat pppox
ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT
ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark
xt_mac xt_limit xt_id xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT
xt_LOG xt_CT slhc nf_reject_ipv4 nf_nat_redirect
nf_nat_masquerade_ipv4 nf_nat_ftp nf_nat nf_log_ipv4 nf_defrag_ipv6
nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack_ftp nf_conntrack
iptable_raw iptable_mangle iptable_filter ip_tables crc_ccitt
ledtrig_usbdev ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common
ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables ipv6
leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom ohci_platform
ohci_hcd ahci ehci_platform ehci_hcd sd_mod ahci_platform
libahci_platform libahci libata scsi_mod gpio_button_hotplug usbcore
nls_base usb_common
[   29.578778] CPU: 0 PID: 629 Comm: dd Not tainted 4.1.4 #2
[   29.579039] Hardware name: Qualcomm (Flattened Device Tree)
[   29.584425] task: dc70c440 ti: dc720000 task.ti: dc720000
[   29.589816] PC is at spi_qup_prep_sg+0x58/0x7c
[   29.595373] LR is at adm_prep_slave_sg+0xe4/0x598
[   29.599704] pc : [<c044a75c>]    lr : [<c03d9cd0>]    psr: a0000013
[   29.599704] sp : dc721c60  ip : 00000003  fp : dc44ba1c
[   29.604484] r10: dc44b800  r9 : 00000000  r8 : 00000001
[   29.615759] r7 : dc44ba7c  r6 : 00000021  r5 : c044a8c8  r4 : dc44ba68
[   29.620972] r3 : dc8ba304  r2 : ffffffea  r1 : c05c4110  r0 : ffffffea
[   29.627573] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   29.634078] Control: 10c5787d  Table: 5e27406a  DAC: 00000015
[   29.641282] Process dd (pid: 629, stack limit = 0xdc720210)
[   29.647011] Stack: (0xdc721c60 to 0xdc722000)
[   29.652396] 1c60: 00000021 00000000 00000000 dc721d78 dc44ba68
c044b6ec c044b410 dc721d78
[   29.656915] 1c80: dc721d48 dc44b800 dc44ba2c c0b59ea8 00000000
00001f40 dc44ba1c c04490d0
[   29.665074] 1ca0: 00000000 00000000 00000200 dc721d14 dc44b800
dc721d48 dc44ba2c dd4bde10
[   29.673234] 1cc0: dd4bde10 00000001 00000002 c0449914 00000200
00000002 00000001 00000000
[   29.681393] 1ce0: dc721cf4 dc721d48 00000000 c044a510 dc44b800
00000000 dc44ba08 dc44b9a8
[   29.689553] 1d00: dc44ba04 c0449a6c ddfc7f00 60000013 00000000
00000000 dc721d18 dc721d18
[   29.697714] 1d20: 000200da dc44bc14 dc721d48 00000000 dc4ec200
dc0bd200 00270000 dc721f80
[   29.705872] 1d40: dc4f1800 c042d140 dc721dac dc721de8 dc4ec200
00000000 c04487ac dc721d10
[   29.714034] 1d60: 00000205 00000000 ffffff8d dc721d6c dc721d6c
00000000 dc44bf18 00000000
[   29.722192] 1d80: 00000005 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[   29.730352] 1da0: 00000000 00000802 02faf080 dc721de8 dc721d48
00000000 dc0bd200 00000200
[   29.738512] 1dc0: 00000000 00000000 00000000 00000000 00000000
dc6bbf00 00000001 00000001
[   29.746672] 1de0: 00000810 02faf080 dc721d48 dc721dac dd0ff160
00270000 00000000 dc44bc14
[   29.754830] 1e00: 00000000 00000000 00000200 c0436908 00000200
dc721ea8 dc0bd200 00000000
[   29.762991] 1e20: dc721ef0 00270000 00000000 dc4f1800 00000000
c0417c70 00000200 dc721ea8
[   29.771151] 1e40: dc0bd200 00000000 00000001 00040000 00000000
00040000 00000000 dc4f1800
[   29.779311] 1e60: b6f19220 c04156dc 00000200 dc721ea8 dc0bd200
00000000 dc6bb540 00000000
[   29.787470] 1e80: dc0bd200 dc720000 00000200 c0419188 00000200
dc721ea8 dc0bd200 00060000
[   29.795631] 1ea0: dc07a790 dc6bb540 00000000 00000200 dcc18910
dd0ff110 dc585340 0000081f
[   29.803790] 1ec0: dc70c440 dc721f74 00000001 dd416000 ffffff9c
dc59d6c0 b6f19220 dc59d6c0
[   29.811950] 1ee0: dc59d6c0 00000200 b6f19220 00000000 00000000
c02c4b48 d78817d5 00000004
[   29.820109] 1f00: dd416015 b6f175a0 00000000 dd002000 dc586028
dd115088 00000000 00000020
[   29.828269] 1f20: dc0b48c8 c02d8b28 00000001 00000001 dc721f44
dd401b80 dc59d6c0 b6f19220
[   29.836429] 1f40: dc59d6c0 b6f19220 dc721f80 dc59d6c0 00000200
c02c5254 dc0b48c8 00000020
[   29.844588] 1f60: 00000001 00000000 00000000 dc59d6c0 dc59d6c0
00000200 b6f19220 c02c5aa4
[   29.852747] 1f80: 00000000 00000000 dc59d780 00000000 00000000
00000006 00000003 c0209d04
[   29.860907] 1fa0: dc720000 c0209b80 00000000 00000000 00000000
b6f19220 00000200 00000000
[   29.869067] 1fc0: 00000000 00000000 00000006 00000003 b6f19220
b6f19220 00000000 00000000
[   29.877226] 1fe0: bec65d18 bec65d04 b6ef0f14 b6ef3e8c 60000010
00000000 00000000 00000000
[   29.885401] [<c044a75c>] (spi_qup_prep_sg) from [<c044b6ec>]
(spi_qup_transfer_one+0x2dc/0x568)
[   29.893552] [<c044b6ec>] (spi_qup_transfer_one) from [<c04490d0>]
(spi_transfer_one_message+0x74/0x1f4)
[   29.902060] [<c04490d0>] (spi_transfer_one_message) from
[<c0449914>] (__spi_pump_messages+0x4c0/0x4d0)
[   29.911432] [<c0449914>] (__spi_pump_messages) from [<c0449a6c>]
(__spi_sync+0x13c/0x15c)
[   29.920810] [<c0449a6c>] (__spi_sync) from [<c042d140>]
(m25p80_read+0xec/0x114)
[   29.929146] [<c042d140>] (m25p80_read) from [<c0436908>]
(spi_nor_read+0x58/0x74)
[   29.936611] [<c0436908>] (spi_nor_read) from [<c0417c70>]
(part_read+0x48/0x80)
[   29.943985] [<c0417c70>] (part_read) from [<c04156dc>] (mtd_read+0x70/0xac)
[   29.951104] [<c04156dc>] (mtd_read) from [<c0419188>]
(mtdchar_read+0x11c/0x1d8)
[   29.958048] [<c0419188>] (mtdchar_read) from [<c02c4b48>]
(__vfs_read+0x20/0xcc)
[   29.965687] [<c02c4b48>] (__vfs_read) from [<c02c5254>] (vfs_read+0x7c/0x104)
[   29.973064] [<c02c5254>] (vfs_read) from [<c02c5aa4>] (SyS_read+0x40/0x80)
[   29.980094] [<c02c5aa4>] (SyS_read) from [<c0209b80>]
(ret_fast_syscall+0x0/0x3c)
[   29.986866] Code: e59ec060 e12fff3c e2502000 0a000005 (e5825014)
[   29.994658] ---[ end trace 689fb5b87e0515de ]---
Segmentation fault
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Fri Aug  7 10:14:35 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Fri, 7 Aug 2015 17:14:35 +0300
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
In-Reply-To: <CA+U=DspR42pDEe+aqZgoNgbuKCLjHaWfH=RBXyziUmrdxHD6Fg@mail.gmail.com>
References: <55C08938.6030507@inf.h-brs.de>
 <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>
 <CA+U=Dsony4dUX2zK3cM07v7v=saskAcW8qh8GswZBRcrXDVKfg@mail.gmail.com>
 <55C20742.6000607@inf.h-brs.de>
 <CA+U=DspR42pDEe+aqZgoNgbuKCLjHaWfH=RBXyziUmrdxHD6Fg@mail.gmail.com>
Message-ID: <CA+U=Dsp02P33TROP7PUosOwZ2BqwgCuH4wZbd1TZNC9=YE_5dA@mail.gmail.com>

@Florian
So, I took some time today to patch a bit of support for OVS to compile on
OpenWRT with kernel 4.1

Can you pull this from my fork and test it out a bit ?
Branch is here: https://github.com/commodo/packages/tree/ovs-kernel-4.1
Commit is this one:
https://github.com/commodo/packages/commit/de519aac8c751cd8744d839efd071cdf02891db1

If you need a tarball, send me a message and I can prepare one, or maybe
Github has a download zip/tar button per branches somewhere not sure.

Anyway, I'd appreciate if you took the time to test it out a bit.
I'm a bit swamped and don't have time to do proper testing ; to be honest I
just made it build, and I haven't managed to get hold of a device with
which to actually test it.
If all is good I'll add a PR into the official OpenWRT packages.

Thanks

On Wed, Aug 5, 2015 at 5:18 PM, Alexandru Ardelean <ardeleanalex at gmail.com>
wrote:

> I will admit I only tested with x86.
> I ASSumed that it's on kernel 4.1.
>
> Will check again and try to spin up a patch for kernel 4.1.
>
> On Wed, Aug 5, 2015 at 3:53 PM, Florian Siebertz <
> florian.siebertz at inf.h-brs.de> wrote:
>
>> Thank you for your work, i really appreciate it.
>> Now the package is back, but at compilation it fails when
>> checking against the kernel version:
>>
>> (cd
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/./;
>> if [ -x ./configure ]; then find
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>> -name config.guess | xargs -r chmod u+w; find
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>> -name config.guess | xargs -r -n1 cp --remove-destination
>> /home/administrator/openwrt/scripts/config.guess; find
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>> -name config.sub | xargs -r chmod u+w; find
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>> -name config.sub | xargs -r -n1 cp --remove-destination
>> /home/administrator/openwrt/scripts/config.sub;
>> AR="mips-openwrt-linux-musl-gcc-ar" AS="mips-openwrt-linux-musl-gcc -c -Os
>> -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves
>> -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Wformat !
>>  -Werror=fo
>> rmat-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now
>> -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99"
>> LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm"
>> CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc"
>> CXX="mips-openwrt-linux-musl-g++"
>> RANLIB="mips-openwrt-linux-musl-gcc-ranlib"
>> STRIP=mips-openwrt-linux-musl-strip OBJCOPY=mips-openwrt-linux-musl-objcopy
>> OBJDUMP=mips-openwrt-linux-musl-objdump SIZE=mips-openwrt-linux-musl-size
>> CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc
>> -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable
>> -msoft-float -Wformat -Werror=format-security -fstack-protector
>> -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -mno-mips16
>> -mno-interlink-mips16 -flto -std=gnu99 " CXXFLAGS="-Os -pipe
>> -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts
>> -Wno-error=unused-but-set-variable -msoft-float -Wformat
>> -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1!
>>   -Wl,-z,no
>> w -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99 "
>> CPPFLAGS="-I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/include
>> -I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/include
>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/include
>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/fortify
>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include
>> "
>> LDFLAGS="-L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/lib
>> -L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/lib
>> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/lib
>> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/lib
>> -znow -zrelro "   ./configure --target=mips-openwrt-linux
>> --host=mips-openwrt-linux --build!
>>  =x86_64-li
>> nux-gnu --program-prefix="" --program-suffix="" --prefix=/usr
>> --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
>> --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share
>> --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls
>>  _python_sysroot="/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10"
>> _python_prefix="/usr" _python_exec_prefix="/usr"
>> --with-linux=/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
>> --with-rundir=/var/run --enable-ndebug --disable-ssl --enable-shared ; fi; )
>>
>> [...] (a bunch of checks)
>>
>> checking for kernel version... 4.1.3
>> configure: error: Linux kernel in
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
>> is version 4.1.3, but version newer than 4.0.x is not supported (please
>> refer to the FAQ for advice)
>> make[3]: ***
>> [/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/.configured_yyyyyyyy]
>> Error 1
>> make[3]: Leaving directory
>> `/home/administrator/openwrt/feeds/packages/net/openvswitch'
>> make[2]: *** [package/feeds/packages/openvswitch/compile] Error 2
>> make[2]: Leaving directory `/home/administrator/openwrt'
>> make[1]: ***
>> [/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile]
>> Error 2
>> make[1]: Leaving directory `/home/administrator/openwrt'
>> make: *** [world] Error 2
>>
>>
>>
>> Am 04.08.2015 um 16:08 schrieb Alexandru Ardelean:
>> > Took some 20-30 minutes to upgrade OVS and test it (with kernel 4.1).
>> > Seems to work fine so far.
>> >
>> > Please monitor this PR; after it's merged it should appear.
>> >
>> > On Tue, Aug 4, 2015 at 1:37 PM, Alexandru Ardelean <
>> ardeleanalex at gmail.com>
>> > wrote:
>> >
>> >> Well, OpenVSwitch is a bit behind on kernel support.
>> >> It's at 3.18 currently.
>> >> OpenWRT is at 4.1
>> >>
>> >> We'd need to do an upgrade of OVS to get it up to speed.
>> >>
>> >>
>> >>
>> >>
>> >> On Tue, Aug 4, 2015 at 12:43 PM, Florian Siebertz <
>> >> florian.siebertz at inf.h-brs.de> wrote:
>> >>
>> >>> Hi,
>> >>>
>> >>> i noticed that the openvswitch package is not available in trunk at
>> the
>> >>> moment. It is not in the precompiled snapshots, neither can it be
>> >>> choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
>> >>> [update|install] -a).
>> >>>
>> >>> Does anyone know why and when it will be back?
>> >>>
>> >>> Thanks!
>> >>>
>> >>> Florian Siebertz
>> >>> _______________________________________________
>> >>> openwrt-devel mailing list
>> >>> openwrt-devel at lists.openwrt.org
>> >>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>> >>>
>> >>
>> >>
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150807/5d55e8a5/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From lynxis at fe80.eu  Fri Aug  7 11:40:03 2015
From: lynxis at fe80.eu (Alexander Couzens)
Date: Fri,  7 Aug 2015 17:40:03 +0200
Subject: [OpenWrt-Devel] [PATCH v2] busybox: lock: implement -n "Fail rather
	than wait"
In-Reply-To: <55C3CAFC.6070002@openwrt.org>
References: <55C3CAFC.6070002@openwrt.org>
Message-ID: <1438962003-7033-1-git-send-email-lynxis@fe80.eu>

lock -n is similiar to flock -n. If the lock was already taken,
fail with exit code = 1 and write error message to stderr.

example:
if ! lock -n /tmp/foo ; then
	echo lock exits.
else
	echo lock was free. But is locked now.
fi
> lock was free. But is locked now.
> lock exists.

v1: implement feature
v2: rename variable failinsteadwait into try_lock
    extend description of -n
    run make package/utils/busybox/refresh

Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 package/utils/busybox/patches/220-add_lock_util.patch | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
index f42edcb..c261a9e 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -1,6 +1,6 @@
 --- a/include/applets.src.h
 +++ b/include/applets.src.h
-@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, 
+@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
  IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
@@ -35,7 +35,7 @@
  lib-$(CONFIG_MICROCOM)    += microcom.o
 --- /dev/null
 +++ b/miscutils/lock.c
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,145 @@
 +/*
 + * Copyright (C) 2006 Felix Fietkau <nbd at openwrt.org>
 + *
@@ -56,6 +56,7 @@
 +static int unlock = 0;
 +static int shared = 0;
 +static int waitonly = 0;
++static int try_lock = 0;
 +static int fd;
 +static char *file;
 +
@@ -65,6 +66,7 @@
 +	                "	-s	Use shared locking\n"
 +	                "	-u	Unlock\n"
 +	                "	-w	Wait for the lock to become free, don't acquire lock\n"
++			"	-n	Don't wait for the lock to become free. Fail with exit code\n"
 +					"\n", name);
 +	exit(1);
 +}
@@ -95,6 +97,8 @@
 +static int do_lock(void)
 +{
 +	int pid;
++	int ret;
++	int flags;
 +	char pidstr[8];
 +
 +	if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) {
@@ -104,7 +108,10 @@
 +		}
 +	}
 +
-+	if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) {
++	flags = shared ? LOCK_SH : LOCK_EX;
++	flags |= try_lock ? LOCK_NB : 0;
++
++	if ((ret = flock(fd, flags)) < 0) {
 +		fprintf(stderr, "Can't lock %s\n", file);
 +		return 1;
 +	}
@@ -156,6 +163,9 @@
 +				case 'u':
 +					unlock = 1;
 +					break;
++				case 'n':
++					try_lock = 1;
++					break;
 +			}
 +		}
 +		c--;
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug  7 12:19:11 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 7 Aug 2015 18:19:11 +0200
Subject: [OpenWrt-Devel] [PATCH v2] busybox: lock: implement -n "Fail
 rather than wait"
In-Reply-To: <1438962003-7033-1-git-send-email-lynxis@fe80.eu>
References: <55C3CAFC.6070002@openwrt.org>
 <1438962003-7033-1-git-send-email-lynxis@fe80.eu>
Message-ID: <CAOiHx==jSOqV_ZK7P8Ow053K63ptVPmpKnaZH_OQwB=Prr2opQ@mail.gmail.com>

On Fri, Aug 7, 2015 at 5:40 PM, Alexander Couzens <lynxis at fe80.eu> wrote:
> lock -n is similiar to flock -n. If the lock was already taken,
> fail with exit code = 1 and write error message to stderr.
>
> example:
> if ! lock -n /tmp/foo ; then
>         echo lock exits.
> else
>         echo lock was free. But is locked now.
> fi
>> lock was free. But is locked now.
>> lock exists.
>
> v1: implement feature
> v2: rename variable failinsteadwait into try_lock
>     extend description of -n
>     run make package/utils/busybox/refresh
>
> Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
> ---
>  package/utils/busybox/patches/220-add_lock_util.patch | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
> index f42edcb..c261a9e 100644
> --- a/package/utils/busybox/patches/220-add_lock_util.patch
> +++ b/package/utils/busybox/patches/220-add_lock_util.patch
> @@ -1,6 +1,6 @@
>  --- a/include/applets.src.h
>  +++ b/include/applets.src.h
> -@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
> +@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
>   IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
>   IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
>   IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
> @@ -35,7 +35,7 @@
>   lib-$(CONFIG_MICROCOM)    += microcom.o
>  --- /dev/null
>  +++ b/miscutils/lock.c
> -@@ -0,0 +1,135 @@
> +@@ -0,0 +1,145 @@
>  +/*
>  + * Copyright (C) 2006 Felix Fietkau <nbd at openwrt.org>
>  + *
> @@ -56,6 +56,7 @@
>  +static int unlock = 0;
>  +static int shared = 0;
>  +static int waitonly = 0;
> ++static int try_lock = 0;
>  +static int fd;
>  +static char *file;
>  +
> @@ -65,6 +66,7 @@
>  +                      "       -s      Use shared locking\n"
>  +                      "       -u      Unlock\n"
>  +                      "       -w      Wait for the lock to become free, don't acquire lock\n"
> ++                      "       -n      Don't wait for the lock to become free. Fail with exit code\n"
>  +                                      "\n", name);
>  +      exit(1);
>  +}
> @@ -95,6 +97,8 @@
>  +static int do_lock(void)
>  +{
>  +      int pid;
> ++      int ret;
> ++      int flags;
>  +      char pidstr[8];
>  +
>  +      if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) {
> @@ -104,7 +108,10 @@
>  +              }
>  +      }
>  +
> -+      if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) {
> ++      flags = shared ? LOCK_SH : LOCK_EX;
> ++      flags |= try_lock ? LOCK_NB : 0;
> ++
> ++      if ((ret = flock(fd, flags)) < 0) {
>  +              fprintf(stderr, "Can't lock %s\n", file);
>  +              return 1;

You don't use the value of ret, did you intend to print it? Else it is
unneeded and can be dropped.

>  +      }
> @@ -156,6 +163,9 @@
>  +                              case 'u':
>  +                                      unlock = 1;
>  +                                      break;
> ++                              case 'n':
> ++                                      try_lock = 1;
> ++                                      break;
>  +                      }
>  +              }
>  +              c--;

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


From mathieu at codeaurora.org  Fri Aug  7 12:50:36 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Fri, 7 Aug 2015 09:50:36 -0700
Subject: [OpenWrt-Devel] [PATCH 0/3] ipq806x: add NAND flash support
In-Reply-To: <55C47624.9030208@openwrt.org>
References: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
 <55C47624.9030208@openwrt.org>
Message-ID: <011301d0d131$2f6cda50$8e468ef0$@codeaurora.org>

Actually, I was asking myself the same questions yesterday. I was leaning
towards dts for the reasons you mention below as well; the problem is on ref
designs, there is no "standard" layout. The flash layout changes with time
(an AP148 with an old boot binary blob will have a different layout than the
same AP148 with a new boot image), sometimes with a certain application
(some boots will have an SMEM with 2 kernels & 2 rootfs for dual
partitioning). For this reason, and on ref designs, it'd be easier to have
one dts and the kernel adapting at run-time, than multiplying the dts files
and having to pick the right one based on your current SMEM content.

I would agree that it's the exception though; on most retail routers, you
would have one SMEM per SKU, i.e. one layout per dts.

I'm thinking the most flexible way would probably to have the opportunity in
dts to select between "dynamic" smem partitioning, or regular "fixed"
partitioning. Not sure if something like this has ever been done in the
past; but we could explore it.

Thanks,
Mathieu

-----Original Message-----
From: Felix Fietkau [mailto:nbd at openwrt.org] 
Sent: Friday, August 07, 2015 2:11 AM
To: Mathieu Olivari; jogo at openwrt.org
Cc: openwrt-devel at lists.openwrt.org
Subject: Re: [PATCH 0/3] ipq806x: add NAND flash support

On 2015-08-07 04:28, Mathieu Olivari wrote:
> This patch serie adds support for the integrated NAND flash controller 
> available on AP148. Most of the patches are backported from LKML, with 
> minor modifications.
> 
> This is kernel level support & enablement for now. Support for proper 
> MTD partitioning will come later and will be necessary to boot from 
> it.
Do you plan on porting the smem stuff for partitioning that QSDK uses, or do
are you going to add partitions to the device tree file?
Unless there's a good reason to avoid it, I'm leaning towards the latter, to
give our kernel more control over what's going on.
For example, I'd like to call the partition with the kernel/fs 'ubi'
instead of 'rootfs', since rootfs is already used to auto-select the root
filesystem partition for auto-mounting.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Fri Aug  7 12:56:08 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Fri,  7 Aug 2015 18:56:08 +0200
Subject: [OpenWrt-Devel] [PATCH] base-files: default_postinst: propagate the
	real postinst return code
Message-ID: <7d6c9c678382c10891c5ebd0013070f41d2cf1a0.1438966568.git.mschiffer@universe-factory.net>

Using the postinst script for sanity checks and expecting opkg to fail
if the postinst didn't return 0 was possible in Barrier Breaker, propagate
the real postinst return code through default_postinst to restore this
behaviour.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/base-files/files/lib/functions.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 8d045fa..2f78d67 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -174,7 +174,8 @@ default_prerm() {
 }
 
 default_postinst() {
-	local pkgname rusers
+	local pkgname rusers ret
+	ret=0
 	pkgname=$(basename ${1%.*})
 	rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.control)
 	[ -n "$rusers" ] && {
@@ -215,7 +216,10 @@ default_postinst() {
 		done
 	}
 
-	[ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg )
+	if [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ]; then
+		( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg )
+		ret=$?
+	fi
 	[ -n "${IPKG_INSTROOT}" ] || rm -f /tmp/luci-indexcache 2>/dev/null
 
 	[ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.list | grep "^/etc/init.d/"`; do
@@ -225,7 +229,7 @@ default_postinst() {
 			$i start
 		}
 	done
-	return 0
+	return $ret
 }
 
 include() {
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Fri Aug  7 14:09:14 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Fri, 7 Aug 2015 20:09:14 +0200
Subject: [OpenWrt-Devel] [PATCH 0/3] ipq806x: add NAND flash support
In-Reply-To: <011301d0d131$2f6cda50$8e468ef0$@codeaurora.org>
References: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
 <55C47624.9030208@openwrt.org>
 <011301d0d131$2f6cda50$8e468ef0$@codeaurora.org>
Message-ID: <55C4F44A.2010203@openwrt.org>

On 2015-08-07 18:50, Mathieu Olivari wrote:
> Actually, I was asking myself the same questions yesterday. I was leaning
> towards dts for the reasons you mention below as well; the problem is on ref
> designs, there is no "standard" layout. The flash layout changes with time
> (an AP148 with an old boot binary blob will have a different layout than the
> same AP148 with a new boot image), sometimes with a certain application
> (some boots will have an SMEM with 2 kernels & 2 rootfs for dual
> partitioning). For this reason, and on ref designs, it'd be easier to have
> one dts and the kernel adapting at run-time, than multiplying the dts files
> and having to pick the right one based on your current SMEM content.
> 
> I would agree that it's the exception though; on most retail routers, you
> would have one SMEM per SKU, i.e. one layout per dts.
> 
> I'm thinking the most flexible way would probably to have the opportunity in
> dts to select between "dynamic" smem partitioning, or regular "fixed"
> partitioning. Not sure if something like this has ever been done in the
> past; but we could explore it.
The bcm53xx target in OpenWrt works like that. The mtd driver specifies
two partition parsers, first ofpart, then a custom one.
If ofpart fails to find any partitions, the custom one gets to specify
the layout. We could probably make use of something like that for ipq as
well.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From a.seppala at gmail.com  Fri Aug  7 14:50:03 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Fri,  7 Aug 2015 18:50:03 +0000
Subject: [OpenWrt-Devel] [PATCH 0/2] uqmi: Improve ipv6 connectivity
Message-ID: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>

Here is a set of two patches which improve uqmi when connecting to ipv6 
enabled networks.

The first patch adds the capability to select the ip-family that is used 
when connecting (ipv4 or ipv6). The second patch can be used to output 
the obtained ip information from connected networks.

With proper configuration these patches can be utilized to establish a 
working dual-stack connection with a qmi device and then configure 
system ip-information accordingly.

Antti Sepp?l? (2):
  uqmi: Add IP family selection command-line switch
  uqmi: Add get-current-settings command-line switch

 commands-wds.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 commands-wds.h |   6 ++-
 2 files changed, 155 insertions(+), 1 deletion(-)

-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Fri Aug  7 14:50:04 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Fri,  7 Aug 2015 18:50:04 +0000
Subject: [OpenWrt-Devel] [PATCH 1/2] uqmi: Add IP family selection
	command-line switch
In-Reply-To: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>
References: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1438973405-25757-2-git-send-email-a.seppala@gmail.com>

This patch adds support for (optionally) specifying ip family via a 
command- line switch. The switch sends respective "Set IP Family" WDS 
message to qmi-device before actually connecting.

Using this switch allows connecting to ipv6 enabled networks or networks 
with dual-stack support with the appropriate hardware (dongle and FW 
with ipv6 support) and configuration (AT+CGDCONT reporting ipv6 or 
ipv4v6 capability).

Help text:
  --ip-family <family>:    Set ip-family for the connection (ipv4, ipv6, unspecified)

Usage example for ipv6:
  uqmi -d /dev/cdc-wdm0 --set-client-id wds,<cid> --start-network <apn> --ip-family ipv6

Dual-stack usage example:
  uqmi -d /dev/cdc-wdm0 --get-client-id wds
  uqmi -d /dev/cdc-wdm0 --set-client-id wds,<cid-1> --start-network <apn> --ip-family ipv4
  uqmi -d /dev/cdc-wdm0 --get-client-id wds
  uqmi -d /dev/cdc-wdm0 --set-client-id wds,<cid-2> --start-network <apn> --ip-family ipv6

Signed-off-by: Antti Sepp?l? <a.seppala at gmail.com>
Tested-by: Matti Laakso <malaakso at elisanet.fi>
---
 commands-wds.c | 28 ++++++++++++++++++++++++++++
 commands-wds.h |  2 ++
 2 files changed, 30 insertions(+)

diff --git a/commands-wds.c b/commands-wds.c
index aa57d03..fdf9003 100644
--- a/commands-wds.c
+++ b/commands-wds.c
@@ -170,3 +170,31 @@ cmd_wds_reset_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_m
 	qmi_set_wds_reset_request(msg);
 	return QMI_CMD_REQUEST;
 }
+
+#define cmd_wds_set_ip_family_cb no_cb
+static enum qmi_cmd_result
+cmd_wds_set_ip_family_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+	struct qmi_wds_set_ip_family_request ipf_req;
+	const struct ip_modes {
+		const char *name;
+		const QmiWdsIpFamily mode;
+	} modes[] = {
+		{ "ipv4", QMI_WDS_IP_FAMILY_IPV4 },
+		{ "ipv6", QMI_WDS_IP_FAMILY_IPV6 },
+		{ "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED },
+	};
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(modes); i++) {
+		if (strcasecmp(modes[i].name, arg) != 0)
+			continue;
+
+		qmi_set(&ipf_req, preference, modes[i].mode);
+		qmi_set_wds_set_ip_family_request(msg, &ipf_req);
+		return QMI_CMD_REQUEST;
+	}
+
+	uqmi_add_error("Invalid value (valid: ipv4, ipv6, unspecified)");
+	return QMI_CMD_EXIT;
+}
diff --git a/commands-wds.h b/commands-wds.h
index 19e6406..8ddfb1e 100644
--- a/commands-wds.h
+++ b/commands-wds.h
@@ -24,6 +24,7 @@
 	__uqmi_command(wds_set_auth, auth-type, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_username, username, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_password, password, required, CMD_TYPE_OPTION), \
+	__uqmi_command(wds_set_ip_family, ip-family, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_autoconnect, autoconnect, no, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_stop_network, stop-network, required, QMI_SERVICE_WDS), \
 	__uqmi_command(wds_get_packet_service_status, get-data-status, no, QMI_SERVICE_WDS), \
@@ -36,6 +37,7 @@
 		"    --auth-type pap|chap|both|none: Use network authentication type\n" \
 		"    --username <name>:              Use network username\n" \
 		"    --password <password>:          Use network password\n" \
+		"    --ip-family <family>:           Use ip-family for the connection (ipv4, ipv6, unspecified)\n" \
 		"    --autoconnect:                  Enable automatic connect/reconnect\n" \
 		"  --stop-network <pdh>:             Stop network connection (use with option below)\n" \
 		"    --autoconnect:                  Disable automatic connect/reconnect\n" \
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Fri Aug  7 14:50:05 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Fri,  7 Aug 2015 18:50:05 +0000
Subject: [OpenWrt-Devel] [PATCH 2/2] uqmi: Add get-current-settings
	command-line switch
In-Reply-To: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>
References: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1438973405-25757-3-git-send-email-a.seppala@gmail.com>

Adding --get-current-settings switch which can be used to query 
ip-settings among some other useful data obtained from remote end when 
connected.

This is mainly useful with modems which do not provide a dhcp server for 
nameserver or ip-information (especially in ipv6 networks).

Signed-off-by: Antti Sepp?l? <a.seppala at gmail.com>
Tested-by: Matti Laakso <malaakso at elisanet.fi>
---
 commands-wds.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 commands-wds.h |   4 +-
 2 files changed, 126 insertions(+), 2 deletions(-)

diff --git a/commands-wds.c b/commands-wds.c
index fdf9003..19b3b40 100644
--- a/commands-wds.c
+++ b/commands-wds.c
@@ -20,6 +20,7 @@
  */
 
 #include <stdlib.h>
+#include <arpa/inet.h>
 
 #include "qmi-message.h"
 
@@ -185,7 +186,6 @@ cmd_wds_set_ip_family_prepare(struct qmi_dev *qmi, struct qmi_request *req, stru
 		{ "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED },
 	};
 	int i;
-
 	for (i = 0; i < ARRAY_SIZE(modes); i++) {
 		if (strcasecmp(modes[i].name, arg) != 0)
 			continue;
@@ -198,3 +198,125 @@ cmd_wds_set_ip_family_prepare(struct qmi_dev *qmi, struct qmi_request *req, stru
 	uqmi_add_error("Invalid value (valid: ipv4, ipv6, unspecified)");
 	return QMI_CMD_EXIT;
 }
+
+static void wds_to_ipv4(const char *name, const uint32_t addr)
+{
+	struct in_addr ip_addr;
+	char buf[INET_ADDRSTRLEN];
+
+	ip_addr.s_addr = htonl(addr);
+	blobmsg_add_string(&status, name, inet_ntop(AF_INET, &ip_addr, buf, sizeof(buf)));
+}
+
+static void wds_to_ipv6(const char *name, const uint16_t *addr)
+{
+	int i;
+	struct in6_addr ip_addr;
+	char buf[INET6_ADDRSTRLEN];
+
+	for (i = 0; i < ARRAY_SIZE(ip_addr.s6_addr16); i++) {
+		ip_addr.s6_addr16[i] = htons(addr[i]);
+	}
+
+	blobmsg_add_string(&status, name, inet_ntop(AF_INET6, &ip_addr, buf, sizeof(buf)));
+}
+
+static void
+cmd_wds_get_current_settings_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
+{
+	void *v4, *v6, *d, *t;
+	struct qmi_wds_get_current_settings_response res;
+	const char *pdptypes[] = {
+		[QMI_WDS_PDP_TYPE_IPV4] = "ipv4",
+		[QMI_WDS_PDP_TYPE_PPP] = "ppp",
+		[QMI_WDS_PDP_TYPE_IPV6] = "ipv6",
+		[QMI_WDS_PDP_TYPE_IPV4_OR_IPV6] = "ipv4-or-ipv6",
+	};
+	const struct ip_modes {
+		const char *name;
+		const QmiWdsIpFamily mode;
+	} modes[] = {
+		{ "ipv4", QMI_WDS_IP_FAMILY_IPV4 },
+		{ "ipv6", QMI_WDS_IP_FAMILY_IPV6 },
+		{ "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED },
+	};
+	int i;
+
+	qmi_parse_wds_get_current_settings_response(msg, &res);
+
+	t = blobmsg_open_table(&status, NULL);
+
+	if (res.set.pdp_type && res.data.pdp_type < ARRAY_SIZE(pdptypes))
+		blobmsg_add_string(&status, "pdp-type", pdptypes[res.data.pdp_type]);
+
+	if (res.set.ip_family) {
+		for (i = 0; i < ARRAY_SIZE(modes); i++) {
+			if (modes[i].mode != res.data.ip_family)
+				continue;
+			blobmsg_add_string(&status, "ip-family", modes[i].name);
+			break;
+		}
+	}
+
+	if (res.set.mtu)
+		blobmsg_add_u32(&status, "mtu", res.data.mtu);
+
+	/* IPV4 */
+	v4 = blobmsg_open_table(&status, "ipv4");
+
+	if (res.set.ipv4_address)
+		wds_to_ipv4("ip", res.data.ipv4_address);
+	if (res.set.primary_ipv4_dns_address)
+		wds_to_ipv4("dns1", res.data.primary_ipv4_dns_address);
+	if (res.set.secondary_ipv4_dns_address)
+		wds_to_ipv4("dns2", res.data.secondary_ipv4_dns_address);
+	if (res.set.ipv4_gateway_address)
+		wds_to_ipv4("gateway", res.data.ipv4_gateway_address);
+	if (res.set.ipv4_gateway_subnet_mask)
+		wds_to_ipv4("subnet", res.data.ipv4_gateway_subnet_mask);
+	blobmsg_close_table(&status, v4);
+
+	/* IPV6 */
+	v6 = blobmsg_open_table(&status, "ipv6");
+
+	if (res.set.ipv6_address) {
+		wds_to_ipv6("ip", res.data.ipv6_address.address);
+		blobmsg_add_u32(&status, "ip-prefix-length", res.data.ipv6_address.prefix_length);
+	}
+	if (res.set.ipv6_gateway_address) {
+		wds_to_ipv6("gateway", res.data.ipv6_gateway_address.address);
+		blobmsg_add_u32(&status, "gw-prefix-length", res.data.ipv6_gateway_address.prefix_length);
+	}
+	if (res.set.ipv6_primary_dns_address)
+		wds_to_ipv6("dns1", res.data.ipv6_primary_dns_address);
+	if (res.set.ipv6_secondary_dns_address)
+		wds_to_ipv6("dns2", res.data.ipv6_secondary_dns_address);
+
+	blobmsg_close_table(&status, v6);
+
+	d = blobmsg_open_table(&status, "domain-names");
+	for (i = 0; i < res.data.domain_name_list_n; i++) {
+		blobmsg_add_string(&status, NULL, res.data.domain_name_list[i]);
+	}
+	blobmsg_close_table(&status, d);
+
+	blobmsg_close_table(&status, t);
+}
+
+static enum qmi_cmd_result
+cmd_wds_get_current_settings_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+	struct qmi_wds_get_current_settings_request gcs_req;
+	memset(&gcs_req, '\0', sizeof(struct qmi_wds_get_current_settings_request));
+	qmi_set(&gcs_req, requested_settings,
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_PDP_TYPE |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_DNS_ADDRESS |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_GRANTED_QOS |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_IP_ADDRESS |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_GATEWAY_INFO |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_MTU |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_DOMAIN_NAME_LIST |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_IP_FAMILY);
+	qmi_set_wds_get_current_settings_request(msg, &gcs_req);
+	return QMI_CMD_REQUEST;
+}
diff --git a/commands-wds.h b/commands-wds.h
index 8ddfb1e..8cb7289 100644
--- a/commands-wds.h
+++ b/commands-wds.h
@@ -29,7 +29,8 @@
 	__uqmi_command(wds_stop_network, stop-network, required, QMI_SERVICE_WDS), \
 	__uqmi_command(wds_get_packet_service_status, get-data-status, no, QMI_SERVICE_WDS), \
 	__uqmi_command(wds_set_autoconnect_setting, set-autoconnect, required, QMI_SERVICE_WDS), \
-	__uqmi_command(wds_reset, reset-wds, no, QMI_SERVICE_WDS) \
+	__uqmi_command(wds_reset, reset-wds, no, QMI_SERVICE_WDS), \
+	__uqmi_command(wds_get_current_settings, get-current-settings, no, QMI_SERVICE_WDS) \
 
 
 #define wds_helptext \
@@ -43,4 +44,5 @@
 		"    --autoconnect:                  Disable automatic connect/reconnect\n" \
 		"  --get-data-status:                Get current data access status\n" \
 		"  --set-autoconnect <val>:          Get current data access status (disabled, enabled, paused)\n" \
+		"  --get-current-settings:           Get current connection settings\n" \
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From zajec5 at gmail.com  Fri Aug  7 19:40:25 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Sat, 8 Aug 2015 01:40:25 +0200
Subject: [OpenWrt-Devel] [PATCH v2] busybox: lock: implement -n "Fail
 rather than wait"
In-Reply-To: <1438962003-7033-1-git-send-email-lynxis@fe80.eu>
References: <55C3CAFC.6070002@openwrt.org>
 <1438962003-7033-1-git-send-email-lynxis@fe80.eu>
Message-ID: <CACna6rw4-hq1y+221S91WEbpuwvqKjS=pPMA5G1a=z7DCgoK=Q@mail.gmail.com>

On 7 August 2015 at 17:40, Alexander Couzens <lynxis at fe80.eu> wrote:
> lock -n is similiar to flock -n. If the lock was already taken,
> fail with exit code = 1 and write error message to stderr.
>
> example:
> if ! lock -n /tmp/foo ; then
>         echo lock exits.
> else
>         echo lock was free. But is locked now.
> fi
>> lock was free. But is locked now.
>> lock exists.
>
> v1: implement feature
> v2: rename variable failinsteadwait into try_lock
>     extend description of -n
>     run make package/utils/busybox/refresh

Having patch history in repository log isn't really helpful, so you
may put it in comments part of the patch.


> Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
> ---

Like here.

>  package/utils/busybox/patches/220-add_lock_util.patch | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From karlp at tweak.net.au  Fri Aug  7 21:03:43 2015
From: karlp at tweak.net.au (Karl Palsson)
Date: Sat, 08 Aug 2015 01:03:43 -0000
Subject: [OpenWrt-Devel] [PATCH] [SIGNED-OFF] Add WeIO board
 (http://we-io.net) profile. This patch adds support for WeIO board,
 which is based on Carambola2 board from 8Devices.
In-Reply-To: <1438797376-9669-1-git-send-email-drasko.draskovic@gmail.com>
References: <1438797376-9669-1-git-send-email-drasko.draskovic@gmail.com>
Message-ID: <20150808005753-31735-92674-mailpile@palmtree-beeroclock-net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Comments inline...

Drasko DRASKOVIC <drasko.draskovic at gmail.com> wrote:
> Signed-off-by: Drasko DRASKOVIC <drasko.draskovic at gmail.com>
> ---


Might just be my mail client, but might be yours, did you change
anything to send this? you seem to have lost all the commit message up
into the subject?


>  target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
>  .../ar71xx/base-files/lib/upgrade/platform.sh      |   3 +-
>  target/linux/ar71xx/config-4.1                     |   1 +
>  .../linux/ar71xx/files/arch/mips/ath79/mach-weio.c | 146 +++++++++++++++++++++
>  target/linux/ar71xx/generic/profiles/weio.mk       |  17 +++
>  target/linux/ar71xx/image/Makefile                 |   8 ++
>  .../700-MIPS-ath79-openwrt-machines.patch          |  21 ++-
>  7 files changed, 193 insertions(+), 6 deletions(-)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
>  create mode 100644 target/linux/ar71xx/generic/profiles/weio.mk
> 
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 256bd10..80af14b 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -823,6 +823,9 @@ ar71xx_board_detect() {
>  	*"UniFi AP Pro")
>  		name="uap-pro"
>  		;;
> + 	*"WeIO")
> +		name="weio"
> +		;;       
>  	*WHR-G301N)
>  		name="whr-g301n"
>  		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index 76d8c5b..57df672 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -250,7 +250,8 @@ platform_check_image() {
>  	nbg460n_550n_550nh | \
>  	unifi | \
>  	unifi-outdoor | \
> -	carambola2 )
> +	carambola2 | \
> +	weio )
>  		[ "$magic" != "2705" ] && {
>  			echo "Invalid image type."
>  			return 1
> diff --git a/target/linux/ar71xx/config-4.1
> b/target/linux/ar71xx/config-4.1
> index 1e31a01..0f80804 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -137,6 +137,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y
>  CONFIG_ATH79_MACH_TUBE2H=y
>  CONFIG_ATH79_MACH_UBNT=y
>  CONFIG_ATH79_MACH_UBNT_XM=y
> +CONFIG_ATH79_MACH_WEIO=y
>  CONFIG_ATH79_MACH_WHR_HP_G300N=y
>  CONFIG_ATH79_MACH_WLAE_AG300N=y
>  CONFIG_ATH79_MACH_WLR8100=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
> new file mode 100644
> index 0000000..5c707ec
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
> @@ -0,0 +1,146 @@
> +/**
> + * WEIO Web Of Things Platform
> + *
> + * Copyright (C) 2013 Drasko DRASKOVIC and Uros PETREVSKI
> + *
> + *              ##      ## ######## ####  #######  
> + *              ##  ##  ## ##        ##  ##     ## 
> + *              ##  ##  ## ##        ##  ##     ## 
> + *              ##  ##  ## ######    ##  ##     ## 
> + *              ##  ##  ## ##        ##  ##     ## 
> + *              ##  ##  ## ##        ##  ##     ## 
> + *               ###  ###  ######## ####  #######
> + *
> + *                   Web Of Things Platform
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
> + *
> + * Authors : 
> + * Drasko DRASKOVIC <drasko.draskovic at gmail.com>
> + * Uros PETREVSKI <uros at nodesign.net>
> + */
> +
> +#include <asm/mach-ath79/ath79.h>
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-spi.h"
> +#include "dev-usb.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +#include "linux/i2c-gpio.h"
> +#include "linux/platform_device.h"
> +
> +#define WEIO_GPIO_LED_STA		1
> +#define WEIO_GPIO_LED_AP		16
> +//#define WEIO_GPIO_LED_ETH0	13

It's good that you've removed the commented out ethernet code in the
other part of this file, so why is this still left here?

> +
> +#define WEIO_GPIO_BTN_AP	    20
> +#define WEIO_GPIO_BTN_RESET		23
> +
> +#define WEIO_KEYS_POLL_INTERVAL		20	/* msecs */
> +#define WEIO_KEYS_DEBOUNCE_INTERVAL	(3 * WEIO_KEYS_POLL_INTERVAL)
> +
> +#define WEIO_MAC0_OFFSET			0x0000
> +#define WEIO_MAC1_OFFSET			0x0006
> +#define WEIO_CALDATA_OFFSET		    0x1000
> +#define WEIO_WMAC_MAC_OFFSET		0x1002
> +
> +static struct gpio_led weio_leds_gpio[] __initdata = {
> +	{
> +		.name		= "weio:green:sta",
> +		.gpio		= WEIO_GPIO_LED_STA,
> +		.active_low	= 1,
> +        .default_state = LEDS_GPIO_DEFSTATE_ON,
> +	}, {
> +		.name		= "weio:green:ap",
> +		.gpio		= WEIO_GPIO_LED_AP,
> +		.active_low	= 1,
> +        .default_state = LEDS_GPIO_DEFSTATE_ON,
> +	}
> +};
> +
> +static struct gpio_keys_button weio_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "ap button",
> +		.type		= EV_KEY,
> +		.code		= BTN_0,
> +		.debounce_interval = WEIO_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= WEIO_GPIO_BTN_AP,
> +		.active_low	= 1,
> +	},
> +	{
> +		.desc		= "soft-reset button",
> +		.type		= EV_KEY,
> +		.code		= BTN_1,
> +		.debounce_interval = WEIO_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= WEIO_GPIO_BTN_RESET,
> +		.active_low	= 1,
> +	}
> +};
> +
> +static struct i2c_gpio_platform_data weio_i2c_gpio_data = {
> +	.sda_pin        = 18,
> +	.scl_pin        = 19,
> +};
> +
> +static struct platform_device weio_i2c_gpio = {
> +	.name           = "i2c-gpio",
> +	.id             = 0,
> +	.dev     = {
> +		.platform_data  = &weio_i2c_gpio_data,
> +	},
> +};
> +
> +static struct platform_device *weio_devices[] __initdata = {
> +        &weio_i2c_gpio
> +};
> +
> +static void __init weio_common_setup(void)
> +{
> +	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
> +
> +	ath79_register_m25p80(NULL);
> +	ath79_register_wmac(art + WEIO_CALDATA_OFFSET,
> +			    art + WEIO_WMAC_MAC_OFFSET);
> +}

It looks like the whitespace in those structs is all of mixed style?

> +
> +static void __init weio_setup(void)
> +{
> +	weio_common_setup();
> +
> +    
> +	ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
> +				AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
> +				AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
> +				AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
> +                AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
> +
> +    platform_add_devices(weio_devices, ARRAY_SIZE(weio_devices));
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(weio_leds_gpio),
> +				 weio_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, WEIO_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(weio_gpio_keys),
> +					weio_gpio_keys);
> +	ath79_register_usb();
> +}

Is there whitespace mixing here too? platform_add_... looks to be
different at least.

> +
> +MIPS_MACHINE(ATH79_MACH_WEIO, "WEIO", "WeIO board from Drasko DRASKOVIC and Uros PETREVSKI",
> +		weio_setup);
> diff --git a/target/linux/ar71xx/generic/profiles/weio.mk
> b/target/linux/ar71xx/generic/profiles/weio.mk
> new file mode 100644
> index 0000000..227cec9
> --- /dev/null
> +++ b/target/linux/ar71xx/generic/profiles/weio.mk
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2013 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/WEIO
> +        NAME:=WeIO
> +        PACKAGES:=kmod-usb-core kmod-usb2
> +endef
> +
> +define Profile/WEIO/Description
> +        Package set optimized for the WeIO board.
> +endef
> +
> +$(eval $(call Profile,WEIO))
> diff --git a/target/linux/ar71xx/image/Makefile
> b/target/linux/ar71xx/image/Makefile
> index e894d78..d750745 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -180,6 +180,14 @@ define Device/carambola2
>  endef
>  TARGET_DEVICES += carambola2
>  
> +define Device/weio
> +  BOARDNAME = WEIO
> +  IMAGE_SIZE = 16000k
> +  CONSOLE = ttyATH0,115200
> +  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
> +endef
> +TARGET_DEVICES += weio
> +
>  define Device/wndr3700
>    BOARDNAME = WNDR3700
>    NETGEAR_KERNEL_MAGIC = 0x33373030
> diff --git
> a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> index 02ebd1b..fa9fd0ad 100644
> --- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> +++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> @@ -1,6 +1,6 @@
>  --- a/arch/mips/ath79/machtypes.h
>  +++ b/arch/mips/ath79/machtypes.h
> -@@ -16,24 +16,207 @@
> +@@ -16,24 +16,208 @@
>   
>   enum ath79_mach_type {
>   	ATH79_MACH_GENERIC = 0,
> @@ -176,6 +176,7 @@
>   	ATH79_MACH_UBNT_UNIFI_OUTDOOR,	/* Ubiquiti UnifiAP Outdoor */
>  +	ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
>   	ATH79_MACH_UBNT_XM,		/* Ubiquiti Networks XM board rev 1.0 */
> ++	ATH79_MACH_WEIO,		    /* WeIO board */
>  +	ATH79_MACH_WHR_G301N,		/* Buffalo WHR-G301N */
>  +	ATH79_MACH_WHR_HP_G300N,	/* Buffalo WHR-HP-G300N */
>  +	ATH79_MACH_WHR_HP_GN,		/* Buffalo WHR-HP-GN */
> @@ -1437,7 +1438,7 @@
>   
>   config ATH79_MACH_UBNT_XM
>   	bool "Ubiquiti Networks XM/UniFi boards"
> -@@ -83,6 +1212,97 @@ config ATH79_MACH_UBNT_XM
> +@@ -83,6 +1212,106 @@ config ATH79_MACH_UBNT_XM
>   	  Say 'Y' here if you want your kernel to support the
>   	  Ubiquiti Networks XM (rev 1.0) board.
>   
> @@ -1511,6 +1512,15 @@
>  +	select ATH79_DEV_USB
>  +	select ATH79_DEV_WMAC
>  +
> ++config ATH79_MACH_WEIO
> ++	bool "WeIO board"
> ++	select SOC_AR933X
> ++	select ATH79_DEV_GPIO_BUTTONS
> ++	select ATH79_DEV_LEDS_GPIO
> ++	select ATH79_DEV_M25P80
> ++	select ATH79_DEV_USB
> ++	select ATH79_DEV_WMAC
> ++
>  +config ATH79_MACH_BHU_BXU2000N2_A
>  +	bool "BHU BXU2000n-2 rev. A support"
>  +	select SOC_AR934X
> @@ -1535,7 +1545,7 @@
>   endmenu
>   
>   config SOC_AR71XX
> -@@ -134,7 +1354,10 @@ config ATH79_DEV_DSA
> +@@ -134,7 +1363,10 @@ config ATH79_DEV_DSA
>   config ATH79_DEV_ETH
>   	def_bool n
>   
> @@ -1547,7 +1557,7 @@
>   	def_bool n
>   
>   config ATH79_DEV_GPIO_BUTTONS
> -@@ -164,6 +1387,11 @@ config ATH79_PCI_ATH9K_FIXUP
> +@@ -164,6 +1396,11 @@ config ATH79_PCI_ATH9K_FIXUP
>   	def_bool n
>   
>   config ATH79_ROUTERBOOT
> @@ -1561,7 +1571,7 @@
>   endif
>  --- a/arch/mips/ath79/Makefile
>  +++ b/arch/mips/ath79/Makefile
> -@@ -38,9 +38,133 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
> +@@ -38,9 +38,134 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
>   #
>   # Machines
>   #
> @@ -1670,6 +1680,7 @@
>  +obj-$(CONFIG_ATH79_MACH_TUBE2H)		+= mach-tube2h.o
>  +obj-$(CONFIG_ATH79_MACH_UBNT)		+= mach-ubnt.o
>   obj-$(CONFIG_ATH79_MACH_UBNT_XM)	+= mach-ubnt-xm.o
> ++obj-$(CONFIG_ATH79_MACH_WEIO)		+= mach-weio.o
>  +obj-$(CONFIG_ATH79_MACH_WHR_HP_G300N)	+= mach-whr-hp-g300n.o
>  +obj-$(CONFIG_ATH79_MACH_WLAE_AG300N)	+= mach-wlae-ag300n.o
>  +obj-$(CONFIG_ATH79_MACH_WLR8100)	+= mach-wlr8100.o
> -- 
> 2.1.4
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Cheers,
Karl P

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

iQIcBAEBAgAGBQJVxVVwAAoJEBmotQ/U1cr2qyoP/07Rq+xeEere5w8zJqwYP9Lo
X5nQPTZ8yflLWihWmi0D5N9ty+JnzcnurAjBYZkeASXCf9JUni0aV8O3cvWjvTNr
kOPG+ImBqPie9Fb3PhKtInifRY/PK1AJtnafIVuE7PftGBdCeJVNRTxSOQAWzZ0l
/y1LJW7pFs5bTnbLh2W+U4mNATpaN1zQDkRxjY+0YWnQ9srGZhbNxF95dqpEFl3H
1aM9nrBg9/HO6yZIhq7Q2Bq2QKzTF96+nxoSuL6dT5hdQxK4URFF5rl140cxMctN
eYSBPSilWcy2znEE/JK5RzVmTnDRofiWZWKjN5tK85EAY/dy7c1tF+JrBpKFS/Np
HWQ+6ig/ADllh50nJAT6qsWNC28Ol5tsrSGrA9Hzdpa3aliyI2cel3UjhnWtl7mh
dmtXkP4L9b7hExnxU8djfs6wuFl7VtAqpFVmtRZKn5o3zzs4q1KaTqGxFbfOVI1W
+UhWCuCWltAg84DI5RZD0kVr+bk42Bj82oTDGXe6pBxTw29h5dibGB1a95ofeFHh
UJkouob7isSRN5q/9CaCnyRwz6KKC+1G4LYxpdsbWCF6AfU8zwExYIJZImzj+7w+
DG6qXEUGU/9WrCycsafH2ZhSb0J4U3G2rsfGdw7PNyfmdcgWL+y/TXQIhQfKWZK4
yYND9S+HZQUYtosyoW8i
=0NsU
-----END PGP SIGNATURE-----
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From karlp at tweak.net.au  Fri Aug  7 21:14:17 2015
From: karlp at tweak.net.au (Karl Palsson)
Date: Sat, 08 Aug 2015 01:14:17 -0000
Subject: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl
 commands (from Silicon Labs)
In-Reply-To: <313D826A9A24468BB60A7181383A1C2F@fortmeadow.com>
References: <313D826A9A24468BB60A7181383A1C2F@fortmeadow.com>
Message-ID: <20150808010706-31735-90435-mailpile@palmtree-beeroclock-net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Ted Hess" <thess at kitschensync.net> wrote:
> After a bit more research - This is what I know:
> 
> The upstream cp210x driver is not completely up-to-date with the driver
> silabs maintains on
> their site. In their own words: "... unfortunately GPIO is not something
> that has been
> committed to the Linux kernel yet for community maintenance. We leave
> the drivers on our
> website, even though they are a bit behind the curve of the maintained
> kernels, to
> demonstrate how to do this quickly using an ioctl() call."
> 
> I also noted that the patch I submitted is not up-to-date with their
> latest devices which are
> supported in their driver - whoops.
> 
> I could try to submit this upstream even if it was snatched from their
> driver. Is this OK?

There 's two people working on this on the linux-usb mailing list "right
now"  (I'm on apalling internet right now, so I can't find links for you
to the archives)  The ioctl approach has been totally vetoed, any ioctl
for gpios on this chips will never merge upstream, the silabs driver is
for people who don't care about those sorts of things.  gpios for ftdi
is also landing, and it's finally being accepted that all of these
things are actually, you know, important, so it's finally getting there,
but the ioctl approach is out.  I wouldn't personally be a fan of
openwrt putting in ioctls even for "just for now" as it's something you
can maintain in your own tree if you really need this sort of
functionality.

> 
> There is a small relay controller package (crelay) that I am going to
> submit to the packages
> repo it this patch gets accepted. It uses the cp210x ioctl interface.

What's happening is it's getting the whole gpiolib interface.  so this
app will only ever work with people using the vendor driver.... _if_ you
need to do it in the kernel.  You can always use libusb to make the same
control requests if you like, and if you're only poking a relay, I'd
imagine it's more than sufficient.  (of course depending on what you
want to be doing at the same time and all that)

Cheers,
Karl P

> 
> -----Original Message----- 
> From: Felix Fietkau
> Sent: Monday, August 03, 2015 2:33 PM
> To: Ted Hess ; OpenWrt developers
> Subject: Re: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl
> commands (from Silicon Labs)
> 
> On 2015-08-03 20:17, Ted Hess wrote:
> > It would probably make sense to do it that way however, there are apps which already use the ioctl interface on this device and 
> > this
> > code came directly from the the manufacturer's linux driver.
> >
> > I'm not sure how to add general GPIO support for a specific USB device? Things to research...
> Did the manufacturer submit this upstream already, or is somebody else
> (maybe you) going to do so?
> 
> - Felix 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

- -- 
Sent using Mailpile, Free Software from www.mailpile.is

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

iQIcBAEBAgAGBQJVxVfqAAoJEBmotQ/U1cr2SWUP/jpwCwpCoTwidPoR3PbHOy8W
xjDuV1yseAV9HDrFjiCgLC0sOXfoaRWHJrGV7lvADLvYMNJb4nfGzShCzMPqJb3K
xvD1snvZu/mFCFVzuxv8OYImMzdfPw6zVpRjjgwrpnytCejfc6wqADopL418XFSZ
PFgN5n9sxDgrM1BkPEvMJoBB58IrN1w2M/zDq+IWN4uJgEfdSosjiP++sRngB8dA
YAcmqhg1RBbv6tilr8jcXaKlgIc+iriEN2sGpe8cVjkhefkyO5MtNVbo9yFxco7n
nNdcjh1hhf+DoUmrO7YImjmIFVO1UU37yKbg3tMFg4XWh55O/BEkk0Q6+ljfzeZz
nj+mW3rARjYXDNX8AKYFTS3TdlA/4rphtQ/ReleeK77SzZIwlKEr+RLES8q/2Lde
sf8TEP/EpXXgwfhJFeVnpP10p/2DS8khOWb80enPBfM6+N6c+/+LDijj/1UHpi2k
Zoin3Kcwa/vuMRWHill0me3bvBbiK2ZJY+sQCt+VMKisH42CJpDYi7CY5FG9W4aD
oR2Nf4jAPiA/VB4+KNzeoO5CoBGBLDqZPeiYfsZfB5g/OuvNHzbG/on7fyNZTR+Z
q/e5iMXmRYqCT0VmK/AqVdZgyBSkHg/knLvwbC8U1onudYDMz88BrBlRpTztVagr
i5qDhzH6yhRiPZSIo9VM
=2eLL
-----END PGP SIGNATURE-----
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From thess at kitschensync.net  Fri Aug  7 21:53:12 2015
From: thess at kitschensync.net (Ted Hess)
Date: Fri, 7 Aug 2015 21:53:12 -0400
Subject: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl
	commands (from Silicon Labs)
In-Reply-To: <20150808010706-31735-90435-mailpile@palmtree-beeroclock-net>
References: <313D826A9A24468BB60A7181383A1C2F@fortmeadow.com>
 <20150808010706-31735-90435-mailpile@palmtree-beeroclock-net>
Message-ID: <41326B7C4B0A461DAD87BF9F5EDDC115@fortmeadow.com>

Thanks for the info and explanation. No need for the pointers.

I'd already decided on dropping this request 'cause it did seem a bit hacky and was looking at a better solution. Your suggestion to 
take a look at libusb seems like a good thing to do for this app.

/ted

-----Original Message----- 
From: Karl Palsson
Sent: Friday, August 07, 2015 9:14 PM
To: Ted Hess
Cc: Felix Fietkau ; OpenWrt developers
Subject: Re: Re: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl commands (from Silicon Labs)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Ted Hess" <thess at kitschensync.net> wrote:
> After a bit more research - This is what I know:
>
> The upstream cp210x driver is not completely up-to-date with the driver
> silabs maintains on
> their site. In their own words: "... unfortunately GPIO is not something
> that has been
> committed to the Linux kernel yet for community maintenance. We leave
> the drivers on our
> website, even though they are a bit behind the curve of the maintained
> kernels, to
> demonstrate how to do this quickly using an ioctl() call."
>
> I also noted that the patch I submitted is not up-to-date with their
> latest devices which are
> supported in their driver - whoops.
>
> I could try to submit this upstream even if it was snatched from their
> driver. Is this OK?

There 's two people working on this on the linux-usb mailing list "right
now"  (I'm on apalling internet right now, so I can't find links for you
to the archives)  The ioctl approach has been totally vetoed, any ioctl
for gpios on this chips will never merge upstream, the silabs driver is
for people who don't care about those sorts of things.  gpios for ftdi
is also landing, and it's finally being accepted that all of these
things are actually, you know, important, so it's finally getting there,
but the ioctl approach is out.  I wouldn't personally be a fan of
openwrt putting in ioctls even for "just for now" as it's something you
can maintain in your own tree if you really need this sort of
functionality.

>
> There is a small relay controller package (crelay) that I am going to
> submit to the packages
> repo it this patch gets accepted. It uses the cp210x ioctl interface.

What's happening is it's getting the whole gpiolib interface.  so this
app will only ever work with people using the vendor driver.... _if_ you
need to do it in the kernel.  You can always use libusb to make the same
control requests if you like, and if you're only poking a relay, I'd
imagine it's more than sufficient.  (of course depending on what you
want to be doing at the same time and all that)

Cheers,
Karl P

>
> -----Original Message----- 
> From: Felix Fietkau
> Sent: Monday, August 03, 2015 2:33 PM
> To: Ted Hess ; OpenWrt developers
> Subject: Re: [OpenWrt-Devel] [PATCH] [kernel] cp201x: Add GPIO ioctl
> commands (from Silicon Labs)
>
> On 2015-08-03 20:17, Ted Hess wrote:
> > It would probably make sense to do it that way however, there are apps which already use the ioctl interface on this device and
> > this
> > code came directly from the the manufacturer's linux driver.
> >
> > I'm not sure how to add general GPIO support for a specific USB device? Things to research...
> Did the manufacturer submit this upstream already, or is somebody else
> (maybe you) going to do so?
>
> - Felix
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

- -- 
Sent using Mailpile, Free Software from www.mailpile.is

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

iQIcBAEBAgAGBQJVxVfqAAoJEBmotQ/U1cr2SWUP/jpwCwpCoTwidPoR3PbHOy8W
xjDuV1yseAV9HDrFjiCgLC0sOXfoaRWHJrGV7lvADLvYMNJb4nfGzShCzMPqJb3K
xvD1snvZu/mFCFVzuxv8OYImMzdfPw6zVpRjjgwrpnytCejfc6wqADopL418XFSZ
PFgN5n9sxDgrM1BkPEvMJoBB58IrN1w2M/zDq+IWN4uJgEfdSosjiP++sRngB8dA
YAcmqhg1RBbv6tilr8jcXaKlgIc+iriEN2sGpe8cVjkhefkyO5MtNVbo9yFxco7n
nNdcjh1hhf+DoUmrO7YImjmIFVO1UU37yKbg3tMFg4XWh55O/BEkk0Q6+ljfzeZz
nj+mW3rARjYXDNX8AKYFTS3TdlA/4rphtQ/ReleeK77SzZIwlKEr+RLES8q/2Lde
sf8TEP/EpXXgwfhJFeVnpP10p/2DS8khOWb80enPBfM6+N6c+/+LDijj/1UHpi2k
Zoin3Kcwa/vuMRWHill0me3bvBbiK2ZJY+sQCt+VMKisH42CJpDYi7CY5FG9W4aD
oR2Nf4jAPiA/VB4+KNzeoO5CoBGBLDqZPeiYfsZfB5g/OuvNHzbG/on7fyNZTR+Z
q/e5iMXmRYqCT0VmK/AqVdZgyBSkHg/knLvwbC8U1onudYDMz88BrBlRpTztVagr
i5qDhzH6yhRiPZSIo9VM
=2eLL
-----END PGP SIGNATURE----- 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From a.seppala at gmail.com  Sat Aug  8 03:44:36 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Sat,  8 Aug 2015 07:44:36 +0000
Subject: [OpenWrt-Devel] [PATCH v2 0/2] uqmi: Improve ipv6 connectivity
In-Reply-To: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>
References: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1439019879-9045-1-git-send-email-a.seppala@gmail.com>

v2: Resending the series because of a small mistake in whitespace 
handling in the second patch.


Here is a set of two patches which improve uqmi when connecting to ipv6
enabled networks.

The first patch adds the capability to select the ip-family that is used
when connecting (ipv4 or ipv6). The second patch can be used to output
the obtained ip information from connected networks.

With proper configuration these patches can be utilized to establish a
working dual-stack connection with a qmi device and then configure
system ip-information accordingly.

Antti Sepp?l? (2):
  uqmi: Add IP family selection command-line switch
  uqmi: Add get-current-settings command-line switch

 commands-wds.c | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 commands-wds.h |   6 ++-
 2 files changed, 156 insertions(+), 1 deletion(-)

-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Sat Aug  8 03:44:37 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Sat,  8 Aug 2015 07:44:37 +0000
Subject: [OpenWrt-Devel] [PATCH v2 1/2] uqmi: Add IP family selection
	command-line switch
In-Reply-To: <1439019879-9045-1-git-send-email-a.seppala@gmail.com>
References: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>
 <1439019879-9045-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1439019879-9045-2-git-send-email-a.seppala@gmail.com>

This patch adds support for (optionally) specifying ip family via a 
command- line switch. The switch sends respective "Set IP Family" WDS 
message to qmi-device before actually connecting.

Using this switch allows connecting to ipv6 enabled networks or networks 
with dual-stack support with the appropriate hardware (dongle and FW 
with ipv6 support) and configuration (AT+CGDCONT reporting ipv6 or 
ipv4v6 capability).

Help text:
  --ip-family <family>:    Set ip-family for the connection (ipv4, ipv6, unspecified)

Usage example for ipv6:
  uqmi -d /dev/cdc-wdm0 --set-client-id wds,<cid> --start-network <apn> --ip-family ipv6

Dual-stack usage example:
  uqmi -d /dev/cdc-wdm0 --get-client-id wds
  uqmi -d /dev/cdc-wdm0 --set-client-id wds,<cid-1> --start-network <apn> --ip-family ipv4
  uqmi -d /dev/cdc-wdm0 --get-client-id wds
  uqmi -d /dev/cdc-wdm0 --set-client-id wds,<cid-2> --start-network <apn> --ip-family ipv6

Signed-off-by: Antti Sepp?l? <a.seppala at gmail.com>
Tested-by: Matti Laakso <malaakso at elisanet.fi>
---

Notes:
    v2: No changes

 commands-wds.c | 28 ++++++++++++++++++++++++++++
 commands-wds.h |  2 ++
 2 files changed, 30 insertions(+)

diff --git a/commands-wds.c b/commands-wds.c
index aa57d03..fdf9003 100644
--- a/commands-wds.c
+++ b/commands-wds.c
@@ -170,3 +170,31 @@ cmd_wds_reset_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_m
 	qmi_set_wds_reset_request(msg);
 	return QMI_CMD_REQUEST;
 }
+
+#define cmd_wds_set_ip_family_cb no_cb
+static enum qmi_cmd_result
+cmd_wds_set_ip_family_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+	struct qmi_wds_set_ip_family_request ipf_req;
+	const struct ip_modes {
+		const char *name;
+		const QmiWdsIpFamily mode;
+	} modes[] = {
+		{ "ipv4", QMI_WDS_IP_FAMILY_IPV4 },
+		{ "ipv6", QMI_WDS_IP_FAMILY_IPV6 },
+		{ "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED },
+	};
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(modes); i++) {
+		if (strcasecmp(modes[i].name, arg) != 0)
+			continue;
+
+		qmi_set(&ipf_req, preference, modes[i].mode);
+		qmi_set_wds_set_ip_family_request(msg, &ipf_req);
+		return QMI_CMD_REQUEST;
+	}
+
+	uqmi_add_error("Invalid value (valid: ipv4, ipv6, unspecified)");
+	return QMI_CMD_EXIT;
+}
diff --git a/commands-wds.h b/commands-wds.h
index 19e6406..8ddfb1e 100644
--- a/commands-wds.h
+++ b/commands-wds.h
@@ -24,6 +24,7 @@
 	__uqmi_command(wds_set_auth, auth-type, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_username, username, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_password, password, required, CMD_TYPE_OPTION), \
+	__uqmi_command(wds_set_ip_family, ip-family, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_autoconnect, autoconnect, no, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_stop_network, stop-network, required, QMI_SERVICE_WDS), \
 	__uqmi_command(wds_get_packet_service_status, get-data-status, no, QMI_SERVICE_WDS), \
@@ -36,6 +37,7 @@
 		"    --auth-type pap|chap|both|none: Use network authentication type\n" \
 		"    --username <name>:              Use network username\n" \
 		"    --password <password>:          Use network password\n" \
+		"    --ip-family <family>:           Use ip-family for the connection (ipv4, ipv6, unspecified)\n" \
 		"    --autoconnect:                  Enable automatic connect/reconnect\n" \
 		"  --stop-network <pdh>:             Stop network connection (use with option below)\n" \
 		"    --autoconnect:                  Disable automatic connect/reconnect\n" \
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Sat Aug  8 03:44:38 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Sat,  8 Aug 2015 07:44:38 +0000
Subject: [OpenWrt-Devel] [PATCH v2 2/2] uqmi: Add get-current-settings
	command-line switch
In-Reply-To: <1439019879-9045-1-git-send-email-a.seppala@gmail.com>
References: <1438973405-25757-1-git-send-email-a.seppala@gmail.com>
 <1439019879-9045-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1439019879-9045-3-git-send-email-a.seppala@gmail.com>

Adding --get-current-settings switch which can be used to query 
ip-settings among some other useful data obtained from remote end when 
connected.

This is mainly useful with modems which do not provide a dhcp server for 
nameserver or ip-information (especially in ipv6 networks).

Signed-off-by: Antti Sepp?l? <a.seppala at gmail.com>
Tested-by: Matti Laakso <malaakso at elisanet.fi>
---

Notes:
    v2: Remove unintended whitespace formatting

 commands-wds.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 commands-wds.h |   4 +-
 2 files changed, 126 insertions(+), 1 deletion(-)

diff --git a/commands-wds.c b/commands-wds.c
index fdf9003..fabb5f4 100644
--- a/commands-wds.c
+++ b/commands-wds.c
@@ -20,6 +20,7 @@
  */
 
 #include <stdlib.h>
+#include <arpa/inet.h>
 
 #include "qmi-message.h"
 
@@ -198,3 +199,125 @@ cmd_wds_set_ip_family_prepare(struct qmi_dev *qmi, struct qmi_request *req, stru
 	uqmi_add_error("Invalid value (valid: ipv4, ipv6, unspecified)");
 	return QMI_CMD_EXIT;
 }
+
+static void wds_to_ipv4(const char *name, const uint32_t addr)
+{
+	struct in_addr ip_addr;
+	char buf[INET_ADDRSTRLEN];
+
+	ip_addr.s_addr = htonl(addr);
+	blobmsg_add_string(&status, name, inet_ntop(AF_INET, &ip_addr, buf, sizeof(buf)));
+}
+
+static void wds_to_ipv6(const char *name, const uint16_t *addr)
+{
+	int i;
+	struct in6_addr ip_addr;
+	char buf[INET6_ADDRSTRLEN];
+
+	for (i = 0; i < ARRAY_SIZE(ip_addr.s6_addr16); i++) {
+		ip_addr.s6_addr16[i] = htons(addr[i]);
+	}
+
+	blobmsg_add_string(&status, name, inet_ntop(AF_INET6, &ip_addr, buf, sizeof(buf)));
+}
+
+static void
+cmd_wds_get_current_settings_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
+{
+	void *v4, *v6, *d, *t;
+	struct qmi_wds_get_current_settings_response res;
+	const char *pdptypes[] = {
+		[QMI_WDS_PDP_TYPE_IPV4] = "ipv4",
+		[QMI_WDS_PDP_TYPE_PPP] = "ppp",
+		[QMI_WDS_PDP_TYPE_IPV6] = "ipv6",
+		[QMI_WDS_PDP_TYPE_IPV4_OR_IPV6] = "ipv4-or-ipv6",
+	};
+	const struct ip_modes {
+		const char *name;
+		const QmiWdsIpFamily mode;
+	} modes[] = {
+		{ "ipv4", QMI_WDS_IP_FAMILY_IPV4 },
+		{ "ipv6", QMI_WDS_IP_FAMILY_IPV6 },
+		{ "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED },
+	};
+	int i;
+
+	qmi_parse_wds_get_current_settings_response(msg, &res);
+
+	t = blobmsg_open_table(&status, NULL);
+
+	if (res.set.pdp_type && res.data.pdp_type < ARRAY_SIZE(pdptypes))
+		blobmsg_add_string(&status, "pdp-type", pdptypes[res.data.pdp_type]);
+
+	if (res.set.ip_family) {
+		for (i = 0; i < ARRAY_SIZE(modes); i++) {
+			if (modes[i].mode != res.data.ip_family)
+				continue;
+			blobmsg_add_string(&status, "ip-family", modes[i].name);
+			break;
+		}
+	}
+
+	if (res.set.mtu)
+		blobmsg_add_u32(&status, "mtu", res.data.mtu);
+
+	/* IPV4 */
+	v4 = blobmsg_open_table(&status, "ipv4");
+
+	if (res.set.ipv4_address)
+		wds_to_ipv4("ip", res.data.ipv4_address);
+	if (res.set.primary_ipv4_dns_address)
+		wds_to_ipv4("dns1", res.data.primary_ipv4_dns_address);
+	if (res.set.secondary_ipv4_dns_address)
+		wds_to_ipv4("dns2", res.data.secondary_ipv4_dns_address);
+	if (res.set.ipv4_gateway_address)
+		wds_to_ipv4("gateway", res.data.ipv4_gateway_address);
+	if (res.set.ipv4_gateway_subnet_mask)
+		wds_to_ipv4("subnet", res.data.ipv4_gateway_subnet_mask);
+	blobmsg_close_table(&status, v4);
+
+	/* IPV6 */
+	v6 = blobmsg_open_table(&status, "ipv6");
+
+	if (res.set.ipv6_address) {
+		wds_to_ipv6("ip", res.data.ipv6_address.address);
+		blobmsg_add_u32(&status, "ip-prefix-length", res.data.ipv6_address.prefix_length);
+	}
+	if (res.set.ipv6_gateway_address) {
+		wds_to_ipv6("gateway", res.data.ipv6_gateway_address.address);
+		blobmsg_add_u32(&status, "gw-prefix-length", res.data.ipv6_gateway_address.prefix_length);
+	}
+	if (res.set.ipv6_primary_dns_address)
+		wds_to_ipv6("dns1", res.data.ipv6_primary_dns_address);
+	if (res.set.ipv6_secondary_dns_address)
+		wds_to_ipv6("dns2", res.data.ipv6_secondary_dns_address);
+
+	blobmsg_close_table(&status, v6);
+
+	d = blobmsg_open_table(&status, "domain-names");
+	for (i = 0; i < res.data.domain_name_list_n; i++) {
+		blobmsg_add_string(&status, NULL, res.data.domain_name_list[i]);
+	}
+	blobmsg_close_table(&status, d);
+
+	blobmsg_close_table(&status, t);
+}
+
+static enum qmi_cmd_result
+cmd_wds_get_current_settings_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+	struct qmi_wds_get_current_settings_request gcs_req;
+	memset(&gcs_req, '\0', sizeof(struct qmi_wds_get_current_settings_request));
+	qmi_set(&gcs_req, requested_settings,
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_PDP_TYPE |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_DNS_ADDRESS |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_GRANTED_QOS |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_IP_ADDRESS |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_GATEWAY_INFO |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_MTU |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_DOMAIN_NAME_LIST |
+		QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_IP_FAMILY);
+	qmi_set_wds_get_current_settings_request(msg, &gcs_req);
+	return QMI_CMD_REQUEST;
+}
diff --git a/commands-wds.h b/commands-wds.h
index 8ddfb1e..8cb7289 100644
--- a/commands-wds.h
+++ b/commands-wds.h
@@ -29,7 +29,8 @@
 	__uqmi_command(wds_stop_network, stop-network, required, QMI_SERVICE_WDS), \
 	__uqmi_command(wds_get_packet_service_status, get-data-status, no, QMI_SERVICE_WDS), \
 	__uqmi_command(wds_set_autoconnect_setting, set-autoconnect, required, QMI_SERVICE_WDS), \
-	__uqmi_command(wds_reset, reset-wds, no, QMI_SERVICE_WDS) \
+	__uqmi_command(wds_reset, reset-wds, no, QMI_SERVICE_WDS), \
+	__uqmi_command(wds_get_current_settings, get-current-settings, no, QMI_SERVICE_WDS) \
 
 
 #define wds_helptext \
@@ -43,4 +44,5 @@
 		"    --autoconnect:                  Disable automatic connect/reconnect\n" \
 		"  --get-data-status:                Get current data access status\n" \
 		"  --set-autoconnect <val>:          Get current data access status (disabled, enabled, paused)\n" \
+		"  --get-current-settings:           Get current connection settings\n" \
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kaloz at openwrt.org  Sat Aug  8 05:12:04 2015
From: kaloz at openwrt.org (Imre Kaloz)
Date: Sat, 08 Aug 2015 11:12:04 +0200
Subject: [OpenWrt-Devel] [PATCH 0/3] ipq806x: add NAND flash support
In-Reply-To: <55C4F44A.2010203@openwrt.org>
References: <1438914522-24637-1-git-send-email-mathieu@codeaurora.org>
 <55C47624.9030208@openwrt.org>
 <011301d0d131$2f6cda50$8e468ef0$@codeaurora.org>
 <55C4F44A.2010203@openwrt.org>
Message-ID: <op.x21k6ex02s3iss@ecaz>

On Fri, 07 Aug 2015 20:09:14 +0200, Felix Fietkau <nbd at openwrt.org> wrote:

> On 2015-08-07 18:50, Mathieu Olivari wrote:
>> Actually, I was asking myself the same questions yesterday. I was  
>> leaning
>> towards dts for the reasons you mention below as well; the problem is  
>> on ref
>> designs, there is no "standard" layout. The flash layout changes with  
>> time
>> (an AP148 with an old boot binary blob will have a different layout  
>> than the
>> same AP148 with a new boot image), sometimes with a certain application
>> (some boots will have an SMEM with 2 kernels & 2 rootfs for dual
>> partitioning). For this reason, and on ref designs, it'd be easier to  
>> have
>> one dts and the kernel adapting at run-time, than multiplying the dts  
>> files
>> and having to pick the right one based on your current SMEM content.

Well, there's no reason to try to support old versions or nonstandard  
designs upstream. You just have to pick the one you consider upstream  
version. For what you are looking for, you might want to take a look at  
device tree overlays.

>> I would agree that it's the exception though; on most retail routers,  
>> you
>> would have one SMEM per SKU, i.e. one layout per dts.
>>
>> I'm thinking the most flexible way would probably to have the  
>> opportunity in
>> dts to select between "dynamic" smem partitioning, or regular "fixed"
>> partitioning. Not sure if something like this has ever been done in the
>> past; but we could explore it.
> The bcm53xx target in OpenWrt works like that. The mtd driver specifies
> two partition parsers, first ofpart, then a custom one.
> If ofpart fails to find any partitions, the custom one gets to specify
> the layout. We could probably make use of something like that for ipq as
> well.

Agreed, but I'm afraid 3rd party vendors will miss-use that as usual.


Imre
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jernej at kos.mx  Sat Aug  8 08:22:26 2015
From: jernej at kos.mx (Jernej Kos)
Date: Sat,  8 Aug 2015 14:22:26 +0200
Subject: [OpenWrt-Devel] [PATCH] iwinfo: report additional data for stations
Message-ID: <1439036546-28882-1-git-send-email-jernej@kos.mx>

Signed-off-by: Jernej Kos <jernej at kos.mx>
---
 include/iwinfo.h | 11 +++++++++++
 iwinfo_nl80211.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/include/iwinfo.h b/include/iwinfo.h
index 57a88e2..1f58ef8 100644
--- a/include/iwinfo.h
+++ b/include/iwinfo.h
@@ -82,6 +82,17 @@ struct iwinfo_assoclist_entry {
 	uint32_t tx_packets;
 	struct iwinfo_rate_entry rx_rate;
 	struct iwinfo_rate_entry tx_rate;
+	uint32_t rx_bytes;
+	uint32_t tx_bytes;
+	uint32_t tx_retries;
+	uint32_t tx_failed;
+	uint64_t t_offset;
+	uint8_t is_authorized:1;
+	uint8_t is_authenticated:1;
+	uint8_t is_preamble_short:1;
+	uint8_t is_wme:1;
+	uint8_t is_mfp:1;
+	uint8_t is_tdls:1;
 };
 
 struct iwinfo_txpwrlist_entry {
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 2562492..99047b1 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -29,6 +29,8 @@
 
 #define min(x, y) ((x) < (y)) ? (x) : (y)
 
+#define BIT(x) (1ULL<<(x))
+
 static struct nl80211_state *nls = NULL;
 
 static void nl80211_close(void)
@@ -1577,6 +1579,7 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg)
 	struct nlattr **attr = nl80211_parse(msg);
 	struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1];
 	struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1];
+	struct nl80211_sta_flag_update *sta_flags;
 
 	static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = {
 		[NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32    },
@@ -1585,6 +1588,13 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg)
 		[NL80211_STA_INFO_RX_BITRATE]    = { .type = NLA_NESTED },
 		[NL80211_STA_INFO_TX_BITRATE]    = { .type = NLA_NESTED },
 		[NL80211_STA_INFO_SIGNAL]        = { .type = NLA_U8     },
+		[NL80211_STA_INFO_RX_BYTES]      = { .type = NLA_U32    },
+		[NL80211_STA_INFO_TX_BYTES]      = { .type = NLA_U32    },
+		[NL80211_STA_INFO_TX_RETRIES]    = { .type = NLA_U32    },
+		[NL80211_STA_INFO_TX_FAILED]     = { .type = NLA_U32    },
+		[NL80211_STA_INFO_T_OFFSET]      = { .type = NLA_U64    },
+		[NL80211_STA_INFO_STA_FLAGS] =
+			{ .minlen = sizeof(struct nl80211_sta_flag_update) },
 	};
 
 	static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
@@ -1652,6 +1662,52 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg)
 			if (rinfo[NL80211_RATE_INFO_SHORT_GI])
 				e->tx_rate.is_short_gi = 1;
 		}
+
+		if (sinfo[NL80211_STA_INFO_RX_BYTES])
+			e->rx_bytes = nla_get_u32(sinfo[NL80211_STA_INFO_RX_BYTES]);
+
+		if (sinfo[NL80211_STA_INFO_TX_BYTES])
+			e->tx_bytes = nla_get_u32(sinfo[NL80211_STA_INFO_TX_BYTES]);
+
+		if (sinfo[NL80211_STA_INFO_TX_RETRIES])
+			e->tx_retries = nla_get_u32(sinfo[NL80211_STA_INFO_TX_RETRIES]);
+
+		if (sinfo[NL80211_STA_INFO_TX_FAILED])
+			e->tx_failed = nla_get_u32(sinfo[NL80211_STA_INFO_TX_FAILED]);
+
+		if (sinfo[NL80211_STA_INFO_T_OFFSET])
+			e->t_offset = nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]);
+
+		/* Station flags */
+		if (sinfo[NL80211_STA_INFO_STA_FLAGS])
+		{
+			sta_flags = (struct nl80211_sta_flag_update *)
+				nla_data(sinfo[NL80211_STA_INFO_STA_FLAGS]);
+
+			if (sta_flags->mask & BIT(NL80211_STA_FLAG_AUTHORIZED) &&
+			    sta_flags->set & BIT(NL80211_STA_FLAG_AUTHORIZED))
+				e->is_authorized = 1;
+
+			if (sta_flags->mask & BIT(NL80211_STA_FLAG_AUTHENTICATED) &&
+			    sta_flags->set & BIT(NL80211_STA_FLAG_AUTHENTICATED))
+				e->is_authenticated = 1;
+
+			if (sta_flags->mask & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) &&
+			    sta_flags->set & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE))
+				e->is_preamble_short = 1;
+
+			if (sta_flags->mask & BIT(NL80211_STA_FLAG_WME) &&
+			    sta_flags->set & BIT(NL80211_STA_FLAG_WME))
+				e->is_wme = 1;
+
+			if (sta_flags->mask & BIT(NL80211_STA_FLAG_MFP) &&
+			    sta_flags->set & BIT(NL80211_STA_FLAG_MFP))
+				e->is_mfp = 1;
+
+			if (sta_flags->mask & BIT(NL80211_STA_FLAG_TDLS_PEER) &&
+			    sta_flags->set & BIT(NL80211_STA_FLAG_TDLS_PEER))
+				e->is_tdls = 1;
+		}
 	}
 
 	e->noise = 0; /* filled in by caller */
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Sat Aug  8 08:26:33 2015
From: kerry9842 at gmail.com (John kerry)
Date: Sat, 8 Aug 2015 20:26:33 +0800
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
Message-ID: <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>

Hi,

I have to keep 2 default settings for wireless, i means to say i have to
configure default settings for 2.4GHz and 5GHz.

How i can configure wireless files. mainly i will add switch button in the
GUI to switch over 2.4GHz and 5GHz.

How i can control this in backend, how i can add file which handle this and
configure 2 separate default settings for 2.4GHz and 5GHz.

Thanks,

On Fri, Aug 7, 2015 at 1:50 PM, David Lang <david at lang.hm> wrote:

> You cannot use both radios on the same channel, or even the same band.
>
> One radio will only work on channels 1-11 and the other will only work on
> channels 36+
>
> pick which band you are going to use to connect to the remote AP and which
> you are going to use to have your clients connect to it.
>
> David Lang
>
>
> On Fri, 7 Aug 2015, John kerry wrote:
>
> Hi,
>>
>>
>> I have one and i configured as below:
>>
>> config wifi-device 'wifi0'
>>        option type 'qcawifi'
>>        option channel 'auto'
>>        option macaddr '00:26:75:bd:37:24'
>>        option hwmode '11ng'
>>        option txpower '16'
>>        option htmode 'HT20'
>>
>> config wifi-iface
>>        option device 'wifi0'
>>        option network 'lan'
>>        option mode 'ap'
>>        option ssid 'Test_Ap'
>>        option encryption 'psk2'
>>        option key 'Test_AP'
>>
>>
>> We can configure one radio only to work like that.
>> Something like below:
>>
>> config wifi-device 'radio0'
>>
>>>                 option type 'mac80211'
>>>>                 option channel '11'
>>>>                 option hwmode '11g'
>>>>                 option path 'platform/ar933x_wmac'
>>>>                 option htmode 'HT20'
>>>>                 option country 'US'
>>>>                 option txpower '20'
>>>>
>>>>         config wifi-iface 'ap1'
>>>>                 option device 'radio0'
>>>>                 option mode 'ap'
>>>>                 option wds '1'
>>>>                 option ssid 'my AP'
>>>>                 option network 'lan'
>>>>
>>>>         config wifi-iface 'mesh1'
>>>>                 option device 'radio0'
>>>>                 option mode 'mesh'
>>>>                 option mesh_id 'my mesh'
>>>>                 option network 'lan'
>>>>
>>>
>>
>>
>> On Fri, Aug 7, 2015 at 11:31 AM, Weedy <weedy2887 at gmail.com> wrote:
>>
>> On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>>
>>>> Could anyone please help me on this to configure the wireless in such a
>>>>
>>> way that when we connect to wireless WAN the LAN SSID should not change.
>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>
>>> You need 2 physical radios.
>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150808/7c07be93/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From sscapi at gmail.com  Sat Aug  8 09:39:33 2015
From: sscapi at gmail.com (Sylwester Petela)
Date: Sat, 8 Aug 2015 15:39:33 +0200
Subject: [OpenWrt-Devel] [PATCH v3] lantiq: get more status information
 from xDSL
In-Reply-To: <CALPCC5y35hb2sN1EBgJKS8MOg7AW_hFA7bW8FTp4NRpUCLzHtQ@mail.gmail.com>
References: <1438839704-7187-1-git-send-email-Eckert.Florian@googlemail.com>
 <55C3099B.20807@gmail.com>
 <CALPCC5wd1x65PxN9FhKs1gDGhzgUCpTqmdevCPHbtQz80k16kw@mail.gmail.com>
 <CAJSWe5ZaLfNh2Jd08fJsn0=xWCFqZXYBQ+p7j-Bm-UkGqwOsoA@mail.gmail.com>
 <CALPCC5y35hb2sN1EBgJKS8MOg7AW_hFA7bW8FTp4NRpUCLzHtQ@mail.gmail.com>
Message-ID: <55C60695.1080304@gmail.com>

An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150808/baad4a4d/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Sat Aug  8 12:04:29 2015
From: kerry9842 at gmail.com (John kerry)
Date: Sun, 9 Aug 2015 00:04:29 +0800
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAFE24U2LCSMT7eS5ON5Gs81vTuPbaNa4szOWO9AQgKq2fJR0ug@mail.gmail.com>
 <CAGUNxBGRiY+BoB4W_zG=b6Woa3gsvhPBMSesk96Df0c-2OR1-Q@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
Message-ID: <CAGUNxBHJkNXMi3vCWpH4e_wGSBDUxYAWLRhC2breWKjHopis7Q@mail.gmail.com>

Hi,

Could anyone Please guide me how i can create 2 separate default settings
for 2.4GHz and 5GHz.

Thanks,

On Sat, Aug 8, 2015 at 8:26 PM, John kerry <kerry9842 at gmail.com> wrote:

> Hi,
>
> I have to keep 2 default settings for wireless, i means to say i have to
> configure default settings for 2.4GHz and 5GHz.
>
> How i can configure wireless files. mainly i will add switch button in the
> GUI to switch over 2.4GHz and 5GHz.
>
> How i can control this in backend, how i can add file which handle this
> and configure 2 separate default settings for 2.4GHz and 5GHz.
>
> Thanks,
>
> On Fri, Aug 7, 2015 at 1:50 PM, David Lang <david at lang.hm> wrote:
>
>> You cannot use both radios on the same channel, or even the same band.
>>
>> One radio will only work on channels 1-11 and the other will only work on
>> channels 36+
>>
>> pick which band you are going to use to connect to the remote AP and
>> which you are going to use to have your clients connect to it.
>>
>> David Lang
>>
>>
>> On Fri, 7 Aug 2015, John kerry wrote:
>>
>> Hi,
>>>
>>>
>>> I have one and i configured as below:
>>>
>>> config wifi-device 'wifi0'
>>>        option type 'qcawifi'
>>>        option channel 'auto'
>>>        option macaddr '00:26:75:bd:37:24'
>>>        option hwmode '11ng'
>>>        option txpower '16'
>>>        option htmode 'HT20'
>>>
>>> config wifi-iface
>>>        option device 'wifi0'
>>>        option network 'lan'
>>>        option mode 'ap'
>>>        option ssid 'Test_Ap'
>>>        option encryption 'psk2'
>>>        option key 'Test_AP'
>>>
>>>
>>> We can configure one radio only to work like that.
>>> Something like below:
>>>
>>> config wifi-device 'radio0'
>>>
>>>>                 option type 'mac80211'
>>>>>                 option channel '11'
>>>>>                 option hwmode '11g'
>>>>>                 option path 'platform/ar933x_wmac'
>>>>>                 option htmode 'HT20'
>>>>>                 option country 'US'
>>>>>                 option txpower '20'
>>>>>
>>>>>         config wifi-iface 'ap1'
>>>>>                 option device 'radio0'
>>>>>                 option mode 'ap'
>>>>>                 option wds '1'
>>>>>                 option ssid 'my AP'
>>>>>                 option network 'lan'
>>>>>
>>>>>         config wifi-iface 'mesh1'
>>>>>                 option device 'radio0'
>>>>>                 option mode 'mesh'
>>>>>                 option mesh_id 'my mesh'
>>>>>                 option network 'lan'
>>>>>
>>>>
>>>
>>>
>>> On Fri, Aug 7, 2015 at 11:31 AM, Weedy <weedy2887 at gmail.com> wrote:
>>>
>>> On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>> Could anyone please help me on this to configure the wireless in such a
>>>>>
>>>> way that when we connect to wireless WAN the LAN SSID should not change.
>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>
>>>> You need 2 physical radios.
>>>>
>>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150809/cd8cf91d/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Sat Aug  8 19:02:05 2015
From: david at lang.hm (David Lang)
Date: Sat, 8 Aug 2015 16:02:05 -0700 (PDT)
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBHJkNXMi3vCWpH4e_wGSBDUxYAWLRhC2breWKjHopis7Q@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
 <CAGUNxBHJkNXMi3vCWpH4e_wGSBDUxYAWLRhC2breWKjHopis7Q@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508081600110.2141@nftneq.ynat.uz>

you have two radio settings in /etc/config/wireless, one is for 2.4GHz, one is 
for 5GHz

set each of them the way you want them to be (one as a client to the remote AP, 
the other as a different SSID for your local users to connect to), then add this 
file to your build process the way you did /etc/config/networks (under files/)

David Lang

On Sun, 9 Aug 2015, John kerry wrote:

> Hi,
>
> Could anyone Please guide me how i can create 2 separate default settings
> for 2.4GHz and 5GHz.
>
> Thanks,
>
> On Sat, Aug 8, 2015 at 8:26 PM, John kerry <kerry9842 at gmail.com> wrote:
>
>> Hi,
>>
>> I have to keep 2 default settings for wireless, i means to say i have to
>> configure default settings for 2.4GHz and 5GHz.
>>
>> How i can configure wireless files. mainly i will add switch button in the
>> GUI to switch over 2.4GHz and 5GHz.
>>
>> How i can control this in backend, how i can add file which handle this
>> and configure 2 separate default settings for 2.4GHz and 5GHz.
>>
>> Thanks,
>>
>> On Fri, Aug 7, 2015 at 1:50 PM, David Lang <david at lang.hm> wrote:
>>
>>> You cannot use both radios on the same channel, or even the same band.
>>>
>>> One radio will only work on channels 1-11 and the other will only work on
>>> channels 36+
>>>
>>> pick which band you are going to use to connect to the remote AP and
>>> which you are going to use to have your clients connect to it.
>>>
>>> David Lang
>>>
>>>
>>> On Fri, 7 Aug 2015, John kerry wrote:
>>>
>>> Hi,
>>>>
>>>>
>>>> I have one and i configured as below:
>>>>
>>>> config wifi-device 'wifi0'
>>>>        option type 'qcawifi'
>>>>        option channel 'auto'
>>>>        option macaddr '00:26:75:bd:37:24'
>>>>        option hwmode '11ng'
>>>>        option txpower '16'
>>>>        option htmode 'HT20'
>>>>
>>>> config wifi-iface
>>>>        option device 'wifi0'
>>>>        option network 'lan'
>>>>        option mode 'ap'
>>>>        option ssid 'Test_Ap'
>>>>        option encryption 'psk2'
>>>>        option key 'Test_AP'
>>>>
>>>>
>>>> We can configure one radio only to work like that.
>>>> Something like below:
>>>>
>>>> config wifi-device 'radio0'
>>>>
>>>>>                 option type 'mac80211'
>>>>>>                 option channel '11'
>>>>>>                 option hwmode '11g'
>>>>>>                 option path 'platform/ar933x_wmac'
>>>>>>                 option htmode 'HT20'
>>>>>>                 option country 'US'
>>>>>>                 option txpower '20'
>>>>>>
>>>>>>         config wifi-iface 'ap1'
>>>>>>                 option device 'radio0'
>>>>>>                 option mode 'ap'
>>>>>>                 option wds '1'
>>>>>>                 option ssid 'my AP'
>>>>>>                 option network 'lan'
>>>>>>
>>>>>>         config wifi-iface 'mesh1'
>>>>>>                 option device 'radio0'
>>>>>>                 option mode 'mesh'
>>>>>>                 option mesh_id 'my mesh'
>>>>>>                 option network 'lan'
>>>>>>
>>>>>
>>>>
>>>>
>>>> On Fri, Aug 7, 2015 at 11:31 AM, Weedy <weedy2887 at gmail.com> wrote:
>>>>
>>>> On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>
>>>>>> Could anyone please help me on this to configure the wireless in such a
>>>>>>
>>>>> way that when we connect to wireless WAN the LAN SSID should not change.
>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>
>>>>> You need 2 physical radios.
>>>>>
>>>>>
>>>>
>>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From david at lang.hm  Sat Aug  8 19:02:49 2015
From: david at lang.hm (David Lang)
Date: Sat, 8 Aug 2015 16:02:49 -0700 (PDT)
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>

On Sat, 8 Aug 2015, John kerry wrote:

> Hi,
>
> I have to keep 2 default settings for wireless, i means to say i have to
> configure default settings for 2.4GHz and 5GHz.
>
> How i can configure wireless files. mainly i will add switch button in the
> GUI to switch over 2.4GHz and 5GHz.
>
> How i can control this in backend, how i can add file which handle this and
> configure 2 separate default settings for 2.4GHz and 5GHz.

It's not clear what you are asking to do. Please explain in more detail.

David Lang

> Thanks,
>
> On Fri, Aug 7, 2015 at 1:50 PM, David Lang <david at lang.hm> wrote:
>
>> You cannot use both radios on the same channel, or even the same band.
>>
>> One radio will only work on channels 1-11 and the other will only work on
>> channels 36+
>>
>> pick which band you are going to use to connect to the remote AP and which
>> you are going to use to have your clients connect to it.
>>
>> David Lang
>>
>>
>> On Fri, 7 Aug 2015, John kerry wrote:
>>
>> Hi,
>>>
>>>
>>> I have one and i configured as below:
>>>
>>> config wifi-device 'wifi0'
>>>        option type 'qcawifi'
>>>        option channel 'auto'
>>>        option macaddr '00:26:75:bd:37:24'
>>>        option hwmode '11ng'
>>>        option txpower '16'
>>>        option htmode 'HT20'
>>>
>>> config wifi-iface
>>>        option device 'wifi0'
>>>        option network 'lan'
>>>        option mode 'ap'
>>>        option ssid 'Test_Ap'
>>>        option encryption 'psk2'
>>>        option key 'Test_AP'
>>>
>>>
>>> We can configure one radio only to work like that.
>>> Something like below:
>>>
>>> config wifi-device 'radio0'
>>>
>>>>                 option type 'mac80211'
>>>>>                 option channel '11'
>>>>>                 option hwmode '11g'
>>>>>                 option path 'platform/ar933x_wmac'
>>>>>                 option htmode 'HT20'
>>>>>                 option country 'US'
>>>>>                 option txpower '20'
>>>>>
>>>>>         config wifi-iface 'ap1'
>>>>>                 option device 'radio0'
>>>>>                 option mode 'ap'
>>>>>                 option wds '1'
>>>>>                 option ssid 'my AP'
>>>>>                 option network 'lan'
>>>>>
>>>>>         config wifi-iface 'mesh1'
>>>>>                 option device 'radio0'
>>>>>                 option mode 'mesh'
>>>>>                 option mesh_id 'my mesh'
>>>>>                 option network 'lan'
>>>>>
>>>>
>>>
>>>
>>> On Fri, Aug 7, 2015 at 11:31 AM, Weedy <weedy2887 at gmail.com> wrote:
>>>
>>> On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>> Could anyone please help me on this to configure the wireless in such a
>>>>>
>>>> way that when we connect to wireless WAN the LAN SSID should not change.
>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>
>>>> You need 2 physical radios.
>>>>
>>>>
>>>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sat Aug  8 23:50:43 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sat, 8 Aug 2015 23:50:43 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [buildroot] Fix for liblzma breaks
	redhat-like systems
Message-ID: <20150810153021.796FC23A1534@danielcent.thecshore.com>

On RedHat/Fedora and derivatives we must use the system liblzma
from xz-devel because the liblzma in tools/xz breaks these
systems due to system tools (which use liblzma) having
missing symbols when staging_dir/host/lib has liblzma
(because buildroot puts staging_dir/host/lib first in
library load path and therefore all binaries not just
buildroot's binaries use liblzma from staging_dir/host/lib, at
least while building OpenWrt).

Closes: 20134
Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 include/host.mk          |  7 ++++++-
 include/prereq-build.mk  |  7 +++++++
 tools/Makefile           | 11 ++++++++---
 tools/squashfs4/Makefile |  2 +-
 4 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/include/host.mk b/include/host.mk
index ec3ae27..fc55b63 100644
--- a/include/host.mk
+++ b/include/host.mk
@@ -45,7 +45,12 @@ $(TMP_DIR)/.host.mk: $(TOPDIR)/include/host.mk
 			echo "FIND_L=find -L \$$(1)" >> $@; \
 		else \
 			echo "FIND_L=find \$$(1) -follow" >> $@; \
-		fi \
+		fi ; \
+		[ -r /etc/os-release ] && \
+			eval "$$(cat /etc/os-release)" && \
+				echo "$$ID_LIKE" | grep -qE '(rhel|fedora)' && \
+					[ "$$VERSION_ID" -ge 7 ] && \
+						echo "USE_HOST_LZMA:=1" >> $@ \
 	) >/dev/null 2>/dev/null
 
 endif
diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 211201a..312eabf 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -70,6 +70,13 @@ $(eval $(call TestHostCommand,libssl, \
 	echo 'int main(int argc, char **argv) { SSL_library_init(); return 0; }' | \
 		gcc -include openssl/ssl.h -x c -o $(TMP_DIR)/a.out - -lcrypto -lssl))
 
+ifeq ($(USE_HOST_LZMA),1)
+$(eval $(call TestHostCommand,liblzma, \
+	Please install xz development package.  (Missing liblzma.so or lzma.h), \
+	echo 'int main(int argc, char **argv) { lzma_stream strm = LZMA_STREAM_INIT; lzma_ret ret = lzma_easy_encoder(&strm, 1, LZMA_CHECK_CRC64); if (ret == LZMA_OK) { lzma_end(&strm); return 0; } else { return -1; } }' | \
+		gcc -include lzma.h -x c -o $(TMP_DIR)/a.out - -llzma))
+endif
+
 
 $(eval $(call SetupHostCommand,tar,Please install GNU 'tar', \
 	gtar --version 2>&1 | grep GNU, \
diff --git a/tools/Makefile b/tools/Makefile
index 60041dd..a4bc127 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -27,7 +27,10 @@ tools-$(BUILD_TOOLCHAIN) += gmp mpfr mpc libelf expat
 tools-y += m4 libtool autoconf automake flex bison pkg-config sed mklibs
 tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage
 tools-y += firmware-utils patch-image patch quilt yaffs2 flock padjffs2
-tools-y += mm-macros missing-macros xz cmake scons bc findutils gengetopt patchelf
+tools-y += mm-macros missing-macros cmake scons bc findutils gengetopt patchelf
+ifneq ($(USE_HOST_LZMA),1)
+tools-y += xz
+endif
 tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
 tools-$(CONFIG_powerpc) += upx
 tools-$(CONFIG_TARGET_x86) += qemu
@@ -45,16 +48,18 @@ $(curdir)/flex/compile := $(curdir)/libtool/install
 $(curdir)/pkg-config/compile := $(curdir)/sed/install
 $(curdir)/libtool/compile := $(curdir)/sed/install $(curdir)/m4/install $(curdir)/autoconf/install $(curdir)/automake/install $(curdir)/missing-macros/install
 $(curdir)/squashfs/compile := $(curdir)/lzma-old/install
+ifneq ($(USE_HOST_LZMA),1)
 $(curdir)/squashfs4/compile := $(curdir)/xz/install
+endif
 $(curdir)/quilt/compile := $(curdir)/sed/install $(curdir)/autoconf/install $(curdir)/findutils/install
 $(curdir)/autoconf/compile := $(curdir)/m4/install
-$(curdir)/automake/compile := $(curdir)/m4/install $(curdir)/autoconf/install $(curdir)/pkg-config/install $(curdir)/xz/install
+$(curdir)/automake/compile := $(curdir)/m4/install $(curdir)/autoconf/install $(curdir)/pkg-config/install $(if $(filter 1,$(USE_HOST_LZMA)),,$(curdir)/xz/install)
 $(curdir)/gmp/compile := $(curdir)/libtool/install
 $(curdir)/mpc/compile := $(curdir)/mpfr/install $(curdir)/gmp/install
 $(curdir)/mpfr/compile := $(curdir)/gmp/install
 $(curdir)/ppl/compile := $(curdir)/gmp/install
 $(curdir)/cloog/compile := $(curdir)/ppl/install
-$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/install $(curdir)/xz/install
+$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/install $(if $(filter 1,$(USE_HOST_LZMA)),,$(curdir)/xz/install)
 $(curdir)/mkimage/compile := $(curdir)/sed/install
 $(curdir)/mklibs/compile := $(curdir)/libtool/install
 $(curdir)/qemu/compile := $(curdir)/e2fsprogs/install
diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile
index 50b70fb..2c0ee0d 100644
--- a/tools/squashfs4/Makefile
+++ b/tools/squashfs4/Makefile
@@ -24,7 +24,7 @@ define Host/Compile
 		XZ_SUPPORT=1 \
 		LZMA_XZ_SUPPORT=1 \
 		XATTR_SUPPORT= \
-		LZMA_LIB="$(STAGING_DIR_HOST)/lib/liblzma.a" \
+		$(if $(filter 1,$(USE_HOST_LZMA)),,LZMA_LIB="$(STAGING_DIR_HOST)/lib/liblzma.a") \
 		EXTRA_CFLAGS="-I$(STAGING_DIR_HOST)/include" \
 		mksquashfs unsquashfs
 endef
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.6C58E23A1542@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.40.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.41.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.42.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.43.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.44.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.45.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.46.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.47.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.790B323A154A@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.48.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.49.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.50.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.51.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.52.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.53.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.54.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.55.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.6FA7C23A1543@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.56.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.57.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.58.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.59.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.60.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.61.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.62.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.63.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.8AB4423A1551@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.64.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.65.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.66.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.67.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.68.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.69.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.70.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.71.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.747B723A1549@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.72.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.73.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.74.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.75.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.76.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.77.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.78.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.79.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.81F4523A154F@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.80.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.81.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.82.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.83.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.84.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.85.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.86.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.87.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.8649323A1550@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.88.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.89.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.90.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.91.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.92.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.93.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.94.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.95.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.7D91423A154C@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.96.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.97.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.98.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.99.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.100.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.101.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.102.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.103.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810153008.679E623A1534@danielcent.thecshore.com>

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch


From openwrt at daniel.thecshore.com  Sun Aug  2 01:23:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:23:55 -0400
Subject: [PATCH 1/8] CC PowerCloud CAP324 Image generation
Message-ID: <mailman.104.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 27 +++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 31 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..888c42e 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,30 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index c2ebb8f..4e97def 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1190,6 +1190,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2036,6 +2038,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 01:34:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 01:34:52 -0400
Subject: [PATCH 2/8] CC PowerCloud CAP324 OpenWrt configuration
Message-ID: <mailman.105.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..6ffdd37 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -50,6 +50,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 2aced37..eefc299 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -80,6 +80,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_default "lan_green" "LAN_GREEN" "pcs:green:lan" "1"
+	ucidef_set_led_wlan "wlan0_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan1_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 2893e62..bee5a53 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -325,6 +325,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..25f0451 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -386,6 +386,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..6faf38c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1

From openwrt at daniel.thecshore.com  Sun Aug  2 02:25:40 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:25:40 -0400
Subject: [PATCH 3/8] CC PowerCloud CR3000 Kernel BSP
Message-ID: <mailman.106.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++++
 2 files changed, 212 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index c01ec6e..f42a65d 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
new file mode 100644
index 0000000..06b1fbc
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
@@ -0,0 +1,211 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -906,6 +906,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,161 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "cr3000:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* WAN Fast Ethernet interface */
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++       ath79_switch_data.phy4_mii_en = 1;
++       ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_register_eth(0);
++
++	/* Lan 4-port switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_eth1_data.speed = SPEED_1000;
++	ath79_eth1_data.duplex = DUPLEX_FULL;
++	ath79_register_eth(1);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -43,6 +43,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 02:40:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:40:46 -0400
Subject: [PATCH 4/8] CC PowerCloud CR3000 image generation
Message-ID: <mailman.107.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 888c42e..f7c4866 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -54,3 +54,29 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4e97def..e5398a5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1194,6 +1194,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2041,6 +2043,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 02:59:20 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 02:59:20 -0400
Subject: [PATCH 5/8] CC PowerCloud CR3000 OpenWrt configuration
Message-ID: <mailman.108.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 6ffdd37..f54d6c2 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -59,6 +59,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 eefc299..fc4ed16 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -108,6 +108,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:green:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:green:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:green:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:green:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 bee5a53..2d0eb5b 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -263,6 +263,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 25f0451..f1441c1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -396,6 +396,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 6faf38c..8acb2b1 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;

From openwrt at daniel.thecshore.com  Sun Aug  2 03:30:25 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:30:25 -0400
Subject: [PATCH 6/8] CC PowerCloud CR5000 Kernel BSP
Message-ID: <mailman.109.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f42a65d..e78217b 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
new file mode 100644
index 0000000..f0fc00b
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
@@ -0,0 +1,230 @@
+Index: linux-4.1.3/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
++++ linux-4.1.3/arch/mips/ath79/Kconfig
+@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_EAP7660D
+ 	bool "Senao EAP7660D support"
+ 	select SOC_AR71XX
+Index: linux-4.1.3/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/Makefile
++++ linux-4.1.3/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+Index: linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+===================================================================
+--- /dev/null
++++ linux-4.1.3/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,179 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_WPS		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_MAC1_OFFSET		6
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET;
++	ap94_pci_init(NULL, NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET;
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+Index: linux-4.1.3/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.3.orig/arch/mips/ath79/machtypes.h
++++ linux-4.1.3/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,		/* PowerCloud Systems CR3000 */
++	ATH79_MACH_CR5000,		/* PowerCloud Systems CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */

From openwrt at daniel.thecshore.com  Sun Aug  2 03:42:48 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:42:48 -0400
Subject: [PATCH 7/8] CC PowerCloud CR5000 image generation
Message-ID: <mailman.110.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 26 ++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index f7c4866..65d06e6 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -80,3 +80,29 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e5398a5..93b2428 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1196,6 +1196,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2045,6 +2047,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))

From openwrt at daniel.thecshore.com  Sun Aug  2 03:49:02 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 2 Aug 2015 03:49:02 -0400
Subject: [PATCH 8/8] CC PowerCloud CR5000 OpenWrt configuration
Message-ID: <mailman.111.1593078804.4661.openwrt-devel@lists.openwrt.org>

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index f54d6c2..e7812ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 fc4ed16..2cc6ec8 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -117,6 +117,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 2d0eb5b..eae5541 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index f1441c1..d5edeca 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8acb2b1..bc53040 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug  9 00:12:27 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 9 Aug 2015 00:12:27 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
	Systems devices
Message-ID: <20150810154128.2DE0923A1534@danielcent.thecshore.com>

Sorry, one last time; this series got concatenated into one big email.

Hi all,

I have added suport for three PowerCloud Systems devices based on
the patches posted in 
https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
updated board support in the OpenWrt tree, and some tweaks of my own.

These patches are against trunk.

Daniel Dickinson (8):
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   2 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 11 files changed, 587 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From zajec5 at gmail.com  Sun Aug  9 00:21:59 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Sun, 9 Aug 2015 06:21:59 +0200
Subject: [OpenWrt-Devel] Netgear R7000 tester needed (serial console
	recommended)
Message-ID: <CACna6ryLGnpzL0bqTRG0jQhqofdf6qUC5ZNkKRXbLjGC-uOtxw@mail.gmail.com>

Hi,

I'll copy my testing requests from OpenWrt forum post [0]:

> 2 weeks ago someone on IRC said he has a R7000 with serial console attached and he wants to try OpenWrt. He provided required info and then I added basic R7000 support:
> https://dev.openwrt.org/changeset/46363/
>
> As it often happens, then he disappeared. Image ready to test is available in snapshots, see:
> https://downloads.openwrt.org/snapshots/trunk/bcm53xx/generic/
> You just have to install openwrt-bcm53xx-netgear-r7000-squashfs.chk
>
> After installing it please confirm that it boots & works. Then please tests GPIOs to provide LEDs and buttons mappings:
> http://wiki.openwrt.org/doc/devel/add.new.device#gpios

Serial console is recommended in case something goes wrong and OpenWrt
won't boot. Bricking device totally is quite unlikely.

[0] https://forum.openwrt.org/viewtopic.php?pid=285654#p285654

-- 
Rafa?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Sun Aug  9 00:42:49 2015
From: kerry9842 at gmail.com (John kerry)
Date: Sun, 9 Aug 2015 12:42:49 +0800
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBHBQ-wS0YKb_QGixNXaefGqiCW2=fcFmcAUHA_hA+0UWA@mail.gmail.com>
 <alpine.DEB.2.02.1508032324060.2262@nftneq.ynat.uz>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
Message-ID: <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>

Hi,

Basically i will add one switch in GUI to select either 2.4GHz or 5GHz.

So if i select 2.4GHz the settings should be like below,

*config wifi-device 'wifi0'*













*         option type 'qcawifi'         option channel 'auto'
option macaddr '00:03:7f:42:06:61'         option hwmode '11ng'
option txpower '19'         option htmode 'HT20' config wifi-iface
option device 'wifi0'         option network 'lan'         option mode 'ap'
        option encryption 'psk2'         option ssid 'Test_ap_1'
option key 'Test_ap_1'*

so if i do factory reset it settings.

When i select 5GHz the config load with 5GHz as below:

*config wifi-device 'wifi0'*













*         option type 'qcawifi'         option channel 'auto'
option macaddr '00:03:7f:42:06:61'         option hwmode '11na'
option txpower '23'         option htmode 'HT20' config wifi-iface
option device 'wifi0'         option network 'lan'         option mode 'ap'
        option encryption 'psk2'         option ssid 'Test_ap_1'
option key 'Test_ap_1'*


*So basically how i can condition in wireless config file to load the
config based on the selection.*


*Can i write condition in wireless config file.*



*Thanks,*


On Sun, Aug 9, 2015 at 7:02 AM, David Lang <david at lang.hm> wrote:

> On Sat, 8 Aug 2015, John kerry wrote:
>
> Hi,
>>
>> I have to keep 2 default settings for wireless, i means to say i have to
>> configure default settings for 2.4GHz and 5GHz.
>>
>> How i can configure wireless files. mainly i will add switch button in the
>> GUI to switch over 2.4GHz and 5GHz.
>>
>> How i can control this in backend, how i can add file which handle this
>> and
>> configure 2 separate default settings for 2.4GHz and 5GHz.
>>
>
> It's not clear what you are asking to do. Please explain in more detail.
>
> David Lang
>
>
> Thanks,
>>
>> On Fri, Aug 7, 2015 at 1:50 PM, David Lang <david at lang.hm> wrote:
>>
>> You cannot use both radios on the same channel, or even the same band.
>>>
>>> One radio will only work on channels 1-11 and the other will only work on
>>> channels 36+
>>>
>>> pick which band you are going to use to connect to the remote AP and
>>> which
>>> you are going to use to have your clients connect to it.
>>>
>>> David Lang
>>>
>>>
>>> On Fri, 7 Aug 2015, John kerry wrote:
>>>
>>> Hi,
>>>
>>>>
>>>>
>>>> I have one and i configured as below:
>>>>
>>>> config wifi-device 'wifi0'
>>>>        option type 'qcawifi'
>>>>        option channel 'auto'
>>>>        option macaddr '00:26:75:bd:37:24'
>>>>        option hwmode '11ng'
>>>>        option txpower '16'
>>>>        option htmode 'HT20'
>>>>
>>>> config wifi-iface
>>>>        option device 'wifi0'
>>>>        option network 'lan'
>>>>        option mode 'ap'
>>>>        option ssid 'Test_Ap'
>>>>        option encryption 'psk2'
>>>>        option key 'Test_AP'
>>>>
>>>>
>>>> We can configure one radio only to work like that.
>>>> Something like below:
>>>>
>>>> config wifi-device 'radio0'
>>>>
>>>>                 option type 'mac80211'
>>>>>
>>>>>>                 option channel '11'
>>>>>>                 option hwmode '11g'
>>>>>>                 option path 'platform/ar933x_wmac'
>>>>>>                 option htmode 'HT20'
>>>>>>                 option country 'US'
>>>>>>                 option txpower '20'
>>>>>>
>>>>>>         config wifi-iface 'ap1'
>>>>>>                 option device 'radio0'
>>>>>>                 option mode 'ap'
>>>>>>                 option wds '1'
>>>>>>                 option ssid 'my AP'
>>>>>>                 option network 'lan'
>>>>>>
>>>>>>         config wifi-iface 'mesh1'
>>>>>>                 option device 'radio0'
>>>>>>                 option mode 'mesh'
>>>>>>                 option mesh_id 'my mesh'
>>>>>>                 option network 'lan'
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> On Fri, Aug 7, 2015 at 11:31 AM, Weedy <weedy2887 at gmail.com> wrote:
>>>>
>>>> On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>
>>>>>> Could anyone please help me on this to configure the wireless in such
>>>>>> a
>>>>>>
>>>>>> way that when we connect to wireless WAN the LAN SSID should not
>>>>> change.
>>>>>
>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>>
>>>>> You need 2 physical radios.
>>>>>
>>>>>
>>>>>
>>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150809/87f51b25/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From chengg11 at yahoo.com  Sun Aug  9 03:13:10 2015
From: chengg11 at yahoo.com (Gong Cheng)
Date: Sun,  9 Aug 2015 00:13:10 -0700
Subject: [OpenWrt-Devel] [PATCH] hostapd: Add vlan_file option to netifd.sh
Message-ID: <1439104390-14175-1-git-send-email-chengg11@yahoo.com>

Other VLAN related options are already being processed in netifd.sh
but the vlan_file option is missing. This option allows the mapping
of vlan IDs to network interfaces and will be used in dynamic VLAN
feature for binding stations to interfaces based on VLAN
assignments. The change is done similarly to the wpa_psk_file
option.

Signed-off-by: Gong Cheng <chengg11 at yahoo.com>
---
 package/network/services/hostapd/files/netifd.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index a3ffd93..d90ff9b 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -140,6 +140,7 @@ hostapd_common_add_bss_config() {
 
 	config_add_int dynamic_vlan vlan_naming
 	config_add_string vlan_tagged_interface vlan_bridge
+	config_add_string vlan_file
 
 	config_add_string 'key1:wepkey' 'key2:wepkey' 'key3:wepkey' 'key4:wepkey' 'password:wpakey'
 
@@ -248,7 +249,7 @@ hostapd_set_bss_options() {
 				ownip \
 				eap_reauth_period dynamic_vlan \
 				vlan_naming vlan_tagged_interface \
-				vlan_bridge
+				vlan_bridge vlan_file
 
 			# legacy compatibility
 			[ -n "$auth_server" ] || json_get_var auth_server server
@@ -291,6 +292,10 @@ hostapd_set_bss_options() {
 					append bss_conf "vlan_bridge=$vlan_bridge" "$N"
 				[ -n "$vlan_tagged_interface" ] && \
 					append bss_conf "vlan_tagged_interface=$vlan_tagged_interface" "$N"
+				[ -n "$vlan_file" ] && {
+					[ -e "$vlan_file" ] || touch "$vlan_file"
+					append bss_conf "vlan_file=$vlan_file" "$N"
+				}
 			}
 		;;
 		wep)
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From david at lang.hm  Sun Aug  9 06:45:42 2015
From: david at lang.hm (David Lang)
Date: Sun, 9 Aug 2015 03:45:42 -0700 (PDT)
Subject: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
 client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <55C0D322.6090008@harvestai.com>
 <CACiydb+uF1Om4uZ5pZYF9r-K_Dw41kMwtQ_zfoGmR4LqEVGANw@mail.gmail.com>
 <55C11F77.6050809@harvestai.com>
 <CACiydbLmAQib7SFStgMLJ19f26++uTVZjvvBOyUbpoAgWKdBvg@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>

Well, if you are going to be modifying the GUI and adding a button to chagne 
between two configs, where you store the two configs is going to be up to you.

When the button is clicked, you need to copy the approriate config to 
/etc/config/wireless and run the wifi command to restart wifi with the new 
config (I don't know the exact command to run, do wifi -h and look for a restart 
option). Or, since the other LUCI stuff writes the file and then restarts 
things, you can copy that code (which you will be looking at when you modify it 
to include the new button and related functionality)

the files/ process lets you put whatever files you want in place to then use via 
your change to LUCI.

for details of how to change the LUCI code, you should ask on it's development 
mailing list.

David Lang

On Sun, 9 Aug 2015, John kerry wrote:

> Date: Sun, 9 Aug 2015 12:42:49 +0800
> From: John kerry <kerry9842 at gmail.com>
> To: David Lang <david at lang.hm>
> Cc: Weedy <weedy2887 at gmail.com>,
>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>,
>     Joshua Judson Rosen <jrosen at harvestai.com>
> Subject: Re: [OpenWrt-Devel] "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
>     client/AP interfaces on one radio)
> 
> Hi,
>
> Basically i will add one switch in GUI to select either 2.4GHz or 5GHz.
>
> So if i select 2.4GHz the settings should be like below,
>
> *config wifi-device 'wifi0'*
>
>
>
>
>
>
>
>
>
>
>
>
>
> *         option type 'qcawifi'         option channel 'auto'
> option macaddr '00:03:7f:42:06:61'         option hwmode '11ng'
> option txpower '19'         option htmode 'HT20' config wifi-iface
> option device 'wifi0'         option network 'lan'         option mode 'ap'
>        option encryption 'psk2'         option ssid 'Test_ap_1'
> option key 'Test_ap_1'*
>
> so if i do factory reset it settings.
>
> When i select 5GHz the config load with 5GHz as below:
>
> *config wifi-device 'wifi0'*
>
>
>
>
>
>
>
>
>
>
>
>
>
> *         option type 'qcawifi'         option channel 'auto'
> option macaddr '00:03:7f:42:06:61'         option hwmode '11na'
> option txpower '23'         option htmode 'HT20' config wifi-iface
> option device 'wifi0'         option network 'lan'         option mode 'ap'
>        option encryption 'psk2'         option ssid 'Test_ap_1'
> option key 'Test_ap_1'*
>
>
> *So basically how i can condition in wireless config file to load the
> config based on the selection.*
>
>
> *Can i write condition in wireless config file.*
>
>
>
> *Thanks,*
>
>
> On Sun, Aug 9, 2015 at 7:02 AM, David Lang <david at lang.hm> wrote:
>
>> On Sat, 8 Aug 2015, John kerry wrote:
>>
>> Hi,
>>>
>>> I have to keep 2 default settings for wireless, i means to say i have to
>>> configure default settings for 2.4GHz and 5GHz.
>>>
>>> How i can configure wireless files. mainly i will add switch button in the
>>> GUI to switch over 2.4GHz and 5GHz.
>>>
>>> How i can control this in backend, how i can add file which handle this
>>> and
>>> configure 2 separate default settings for 2.4GHz and 5GHz.
>>>
>>
>> It's not clear what you are asking to do. Please explain in more detail.
>>
>> David Lang
>>
>>
>> Thanks,
>>>
>>> On Fri, Aug 7, 2015 at 1:50 PM, David Lang <david at lang.hm> wrote:
>>>
>>> You cannot use both radios on the same channel, or even the same band.
>>>>
>>>> One radio will only work on channels 1-11 and the other will only work on
>>>> channels 36+
>>>>
>>>> pick which band you are going to use to connect to the remote AP and
>>>> which
>>>> you are going to use to have your clients connect to it.
>>>>
>>>> David Lang
>>>>
>>>>
>>>> On Fri, 7 Aug 2015, John kerry wrote:
>>>>
>>>> Hi,
>>>>
>>>>>
>>>>>
>>>>> I have one and i configured as below:
>>>>>
>>>>> config wifi-device 'wifi0'
>>>>>        option type 'qcawifi'
>>>>>        option channel 'auto'
>>>>>        option macaddr '00:26:75:bd:37:24'
>>>>>        option hwmode '11ng'
>>>>>        option txpower '16'
>>>>>        option htmode 'HT20'
>>>>>
>>>>> config wifi-iface
>>>>>        option device 'wifi0'
>>>>>        option network 'lan'
>>>>>        option mode 'ap'
>>>>>        option ssid 'Test_Ap'
>>>>>        option encryption 'psk2'
>>>>>        option key 'Test_AP'
>>>>>
>>>>>
>>>>> We can configure one radio only to work like that.
>>>>> Something like below:
>>>>>
>>>>> config wifi-device 'radio0'
>>>>>
>>>>>                 option type 'mac80211'
>>>>>>
>>>>>>>                 option channel '11'
>>>>>>>                 option hwmode '11g'
>>>>>>>                 option path 'platform/ar933x_wmac'
>>>>>>>                 option htmode 'HT20'
>>>>>>>                 option country 'US'
>>>>>>>                 option txpower '20'
>>>>>>>
>>>>>>>         config wifi-iface 'ap1'
>>>>>>>                 option device 'radio0'
>>>>>>>                 option mode 'ap'
>>>>>>>                 option wds '1'
>>>>>>>                 option ssid 'my AP'
>>>>>>>                 option network 'lan'
>>>>>>>
>>>>>>>         config wifi-iface 'mesh1'
>>>>>>>                 option device 'radio0'
>>>>>>>                 option mode 'mesh'
>>>>>>>                 option mesh_id 'my mesh'
>>>>>>>                 option network 'lan'
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>> On Fri, Aug 7, 2015 at 11:31 AM, Weedy <weedy2887 at gmail.com> wrote:
>>>>>
>>>>> On 6 Aug 2015 23:15, "John kerry" <kerry9842 at gmail.com> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>
>>>>>>> Could anyone please help me on this to configure the wireless in such
>>>>>>> a
>>>>>>>
>>>>>>> way that when we connect to wireless WAN the LAN SSID should not
>>>>>> change.
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>>
>>>>>> You need 2 physical radios.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From francesco.borromini at inventati.org  Sun Aug  9 16:47:58 2015
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Sun, 09 Aug 2015 22:47:58 +0200
Subject: [OpenWrt-Devel] [PATCH] Ar71xx: Add Minibox v1.0 support
Message-ID: <1439153278.8865.0@smtp.autistici.org>

Hello,

The patch below adds support for the Gainstrong Minibox v1.0 mini 
router into trunk. This is based off the Barrier Breaker based source 
code at http://ooioe.com/miniboxv1/Sourcecode/.

Patch applies cleanly, has been compile-tested on a 15.05 tree (the 
patch below is for the trunk ar17xx target with kernel 4.1). For those 
interested, I can provide the 15.05 patch as well.

Any questions, let me know.

Thank you

Stijn




Index: openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
===================================================================
--- openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/diag.sh
+++ openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
@@ -222,6 +222,9 @@ get_status_led() {
 	qihoo-c301)
 		status_led="qihoo:green:status"
 		;;
+	minibox-v1)
+		status_led="minibox-v1:green:system"
+		;;
 	tew-632brp)
 		status_led="tew-632brp:green:status"
 		;;
@@ -366,7 +369,7 @@ set_state() {
 		status_led_blink_preinit_regular
 		;;
 	done)
-		status_led_on
+		status_led_off
 		case $(ar71xx_board_name) in
 		qihoo-c301)
 			local n=$(fw_printenv activeregion | cut -d = -f 2)
Index: 
openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
===================================================================
--- 
openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ 
openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -419,6 +419,7 @@ ja76pf |\
 mc-mac1200r|\
 mynet-n600 |\
 oolite |\
+minibox-v1 |\
 qihoo-c301 |\
 rb-750 |\
 rb-751 |\
Index: openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
===================================================================
--- openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -119,6 +119,9 @@ tplink_board_detect() {
 	"3C0001"*)
 		model="OOLITE"
 		;;
+	"3C0002"*)
+		model="MINIBOX_V1"
+		;;
 	"070300"*)
 		model="TP-Link TL-WR703N"
 		;;
@@ -320,6 +323,9 @@ ar71xx_board_detect() {
 	*"AC1750DB")
 		name="f9k1115v2"
 		;;
+	*"MiniBox V1.0")
+		name="minibox-v1"
+		;;
 	*"AirGateway")
 		name="airgateway"
 		;;
Index: 
openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
===================================================================
--- 
openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -315,6 +315,7 @@ platform_check_image() {
 	mc-mac1200r | \
 	onion-omega | \
 	oolite | \
+	minibox-v1 |\
 	smart-300 | \
 	tl-mr10u | \
 	tl-mr11u | \
Index: openwrt/trunk/target/linux/ar71xx/config-4.1
===================================================================
--- openwrt.orig/trunk/target/linux/ar71xx/config-4.1
+++ openwrt/trunk/target/linux/ar71xx/config-4.1
@@ -73,6 +73,7 @@ CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_GL_INET=y
 CONFIG_ATH79_MACH_GS_OOLITE=y
+CONFIG_ATH79_MACH_MINIBOX_V1=y
 CONFIG_ATH79_MACH_HIWIFI_HC6361=y
 CONFIG_ATH79_MACH_HORNET_UB=y
 CONFIG_ATH79_MACH_JA76PF=y
Index: 
openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
===================================================================
--- /dev/null
+++ 
openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
@@ -0,0 +1,85 @@
+/*
+ *  Oolite board support
+ *
+ *
+ *  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.
+ */
+
+#include <linux/gpio.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+#include "dev-usb.h"
+
+#define MINIBOX_V1_GPIO_BTN_RESET	11
+
+#define MINIBOX_V1_GPIO_LED_SYSTEM	1
+
+#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
+#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * 
MINIBOX_V1_KEYS_POLL_INTERVAL)
+
+static const char *MINIBOX_V1_part_probes[] = {
+	"tp-link",
+	NULL,
+};
+
+static struct flash_platform_data MINIBOX_V1_flash_data = {
+	.part_probes	= MINIBOX_V1_part_probes,
+};
+
+static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
+	{
+		.name		= "minibox-v1:green:system",
+		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
+		.active_low	= 0,
+	},
+};
+
+static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = {
+	{
+		.desc		= "reset",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
+		.active_low	= 0,
+	},
+};
+
+static void __init MINIBOX_V1_setup(void)
+{
+	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
+				 MINIBOX_V1_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
+					MINIBOX_V1_gpio_keys);
+
+	ath79_register_usb();
+
+	ath79_register_m25p80(&MINIBOX_V1_flash_data);
+	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
+
+	ath79_register_mdio(0, 0x0);
+	ath79_register_eth(1);
+	ath79_register_eth(0);
+
+	ath79_register_wmac(ee, mac);
+}
+
+MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
+	     "MiniBox V1.0", MINIBOX_V1_setup);
Index: openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
===================================================================
--- /dev/null
+++ openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License 
v2.
+# See /LICENSE for more information.
+#
+
+define Profile/MINIBOXV1
+	NAME:=MINIBOX V1.0
+	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
+endef
+
+
+define Profile/MINIBOXV1/Description
+	Package set optimized for the MINIBOX V1.0
+endef
+$(eval $(call Profile,MINIBOXV1))
Index: openwrt/trunk/target/linux/ar71xx/image/Makefile
===================================================================
--- openwrt.orig/trunk/target/linux/ar71xx/image/Makefile
+++ openwrt/trunk/target/linux/ar71xx/image/Makefile
@@ -902,6 +902,15 @@ endef

 TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus

+define Device/minibox-v1
+    $(Device/tplink-16mlzma)
+    BOARDNAME := MINIBOX-V1
+    DEVICE_PROFILE := MINIBOXV1
+    TPLINK_HWID := 0x3C000201
+    CONSOLE := ttyATH0,115200
+endef
+TARGET_DEVICES += minibox-v1
+
 rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst 
squashfs-%,squashfs,$(1)))

 # $(1): rootfs type.
Index: 
openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
===================================================================
--- /dev/null
+++ 
openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
@@ -0,0 +1,39 @@
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -61,6 +61,7 @@ enum ath79_mach_type {
+	ATH79_MACH_ESR1750,		/* EnGenius ESR1750 */
+	ATH79_MACH_GL_INET,		/* GL-CONNECT GL-INET */
+	ATH79_MACH_GS_OOLITE,           /* GS OOLITE V1.0 */
++	ATH79_MACH_MINIBOX_V1,           /* MINIBOX V1.0 */
+	ATH79_MACH_HIWIFI_HC6361,	/* HiWiFi HC6361 */
+	ATH79_MACH_JA76PF,		/* jjPlus JA76PF */
+	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -446,6 +446,16 @@ config ATH79_MACH_GS_OOLITE
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
++config ATH79_MACH_MINIBOX_V1
++       bool "OOLITE BOX V1.0 support"
++       select SOC_AR933X
++       select ARH79_DEV_ETH
++       select ARH79_DEV_GPIO_BUTTONS
++       select ATH79_DEV_LEDS_GPIO
++       select ATH79_DEV_M25P80
++       select ATH79_DEV_USB
++       select ATH79_DEV_WMAC
++
+ config ATH79_MACH_HIWIFI_HC6361
+	bool "HiWiFi HC6361 board support"
+	select SOC_AR933X
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -72,6 +72,7 @@ obj-$(CONFIG_ATH79_MACH_DIR_825_C1)	+= m
+ obj-$(CONFIG_ATH79_MACH_ESR1750)	+= mach-esr1750.o
+ obj-$(CONFIG_ATH79_MACH_GL_INET)	+= mach-gl-inet.o
+ obj-$(CONFIG_ATH79_MACH_GS_OOLITE)	+= mach-gs-oolite.o
++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
+ obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361)	+= mach-hiwifi-hc6361.o
+ obj-$(CONFIG_ATH79_MACH_JA76PF)		+= mach-ja76pf.o
+ obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150809/9743e001/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From francesco.borromini at inventati.org  Sun Aug  9 17:02:31 2015
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Sun, 09 Aug 2015 23:02:31 +0200
Subject: [OpenWrt-Devel] [PATCH] Ar71xx: Add Minibox v1.0 support
In-Reply-To: <1439153278.8865.0@smtp.autistici.org>
References: <1439153278.8865.0@smtp.autistici.org>
Message-ID: <1439154151.9129.0@smtp.autistici.org>

It seems the ML is choking on the full patch and splitting it up 
because it in turn adds a patch into the kernel patches dir, so here's 
the download link for the full patch:

https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-trunk.patch

I think the full patch meets the requirements, if I need to split out, 
let me know.

Stijn

Op zo, 9 aug 2015 om 10:47 , schreef Stijn Segers 
<francesco.borromini at inventati.org>:
> Hello,
> 
> The patch below adds support for the Gainstrong Minibox v1.0 mini 
> router into trunk. This is based off the Barrier Breaker based source 
> code at http://ooioe.com/miniboxv1/Sourcecode/.
> 
> Patch applies cleanly, has been compile-tested on a 15.05 tree (the 
> patch below is for the trunk ar17xx target with kernel 4.1). For 
> those interested, I can provide the 15.05 patch as well.
> 
> Any questions, let me know.
> 
> Thank you
> 
> Stijn
> 
> 
> 
> 
> Index: openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
> ===================================================================
> --- openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/diag.sh
> +++ openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -222,6 +222,9 @@ get_status_led() {
>  	qihoo-c301)
>  		status_led="qihoo:green:status"
>  		;;
> +	minibox-v1)
> +		status_led="minibox-v1:green:system"
> +		;;
>  	tew-632brp)
>  		status_led="tew-632brp:green:status"
>  		;;
> @@ -366,7 +369,7 @@ set_state() {
>  		status_led_blink_preinit_regular
>  		;;
>  	done)
> -		status_led_on
> +		status_led_off
>  		case $(ar71xx_board_name) in
>  		qihoo-c301)
>  			local n=$(fw_printenv activeregion | cut -d = -f 2)
> Index: 
> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> ===================================================================
> --- 
> openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ 
> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -419,6 +419,7 @@ ja76pf |\
>  mc-mac1200r|\
>  mynet-n600 |\
>  oolite |\
> +minibox-v1 |\
>  qihoo-c301 |\
>  rb-750 |\
>  rb-751 |\
> Index: openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
> ===================================================================
> --- openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -119,6 +119,9 @@ tplink_board_detect() {
>  	"3C0001"*)
>  		model="OOLITE"
>  		;;
> +	"3C0002"*)
> +		model="MINIBOX_V1"
> +		;;
>  	"070300"*)
>  		model="TP-Link TL-WR703N"
>  		;;
> @@ -320,6 +323,9 @@ ar71xx_board_detect() {
>  	*"AC1750DB")
>  		name="f9k1115v2"
>  		;;
> +	*"MiniBox V1.0")
> +		name="minibox-v1"
> +		;;
>  	*"AirGateway")
>  		name="airgateway"
>  		;;
> Index: 
> openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> ===================================================================
> --- 
> openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ 
> openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -315,6 +315,7 @@ platform_check_image() {
>  	mc-mac1200r | \
>  	onion-omega | \
>  	oolite | \
> +	minibox-v1 |\
>  	smart-300 | \
>  	tl-mr10u | \
>  	tl-mr11u | \
> Index: openwrt/trunk/target/linux/ar71xx/config-4.1
> ===================================================================
> --- openwrt.orig/trunk/target/linux/ar71xx/config-4.1
> +++ openwrt/trunk/target/linux/ar71xx/config-4.1
> @@ -73,6 +73,7 @@ CONFIG_ATH79_MACH_EW_DORIN=y
>  CONFIG_ATH79_MACH_F9K1115V2=y
>  CONFIG_ATH79_MACH_GL_INET=y
>  CONFIG_ATH79_MACH_GS_OOLITE=y
> +CONFIG_ATH79_MACH_MINIBOX_V1=y
>  CONFIG_ATH79_MACH_HIWIFI_HC6361=y
>  CONFIG_ATH79_MACH_HORNET_UB=y
>  CONFIG_ATH79_MACH_JA76PF=y
> Index: 
> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> ===================================================================
> --- /dev/null
> +++ 
> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> @@ -0,0 +1,85 @@
> +/*
> + *  Oolite board support
> + *
> + *
> + *  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.
> + */
> +
> +#include <linux/gpio.h>
> +
> +#include <asm/mach-ath79/ath79.h>
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +#include "dev-usb.h"
> +
> +#define MINIBOX_V1_GPIO_BTN_RESET	11
> +
> +#define MINIBOX_V1_GPIO_LED_SYSTEM	1
> +
> +#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * 
> MINIBOX_V1_KEYS_POLL_INTERVAL)
> +
> +static const char *MINIBOX_V1_part_probes[] = {
> +	"tp-link",
> +	NULL,
> +};
> +
> +static struct flash_platform_data MINIBOX_V1_flash_data = {
> +	.part_probes	= MINIBOX_V1_part_probes,
> +};
> +
> +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
> +	{
> +		.name		= "minibox-v1:green:system",
> +		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
> +		.active_low	= 0,
> +	},
> +};
> +
> +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "reset",
> +		.type		= EV_KEY,
> +		.code		= KEY_RESTART,
> +		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
> +		.active_low	= 0,
> +	},
> +};
> +
> +static void __init MINIBOX_V1_setup(void)
> +{
> +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
> +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
> +				 MINIBOX_V1_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
> +					MINIBOX_V1_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +	ath79_register_m25p80(&MINIBOX_V1_flash_data);
> +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
> +
> +	ath79_register_mdio(0, 0x0);
> +	ath79_register_eth(1);
> +	ath79_register_eth(0);
> +
> +	ath79_register_wmac(ee, mac);
> +}
> +
> +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
> +	     "MiniBox V1.0", MINIBOX_V1_setup);
> Index: 
> openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> ===================================================================
> --- /dev/null
> +++ openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public 
> License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/MINIBOXV1
> +	NAME:=MINIBOX V1.0
> +	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
> +endef
> +
> +
> +define Profile/MINIBOXV1/Description
> +	Package set optimized for the MINIBOX V1.0
> +endef
> +$(eval $(call Profile,MINIBOXV1))
> Index: openwrt/trunk/target/linux/ar71xx/image/Makefile
> ===================================================================
> --- openwrt.orig/trunk/target/linux/ar71xx/image/Makefile
> +++ openwrt/trunk/target/linux/ar71xx/image/Makefile
> @@ -902,6 +902,15 @@ endef
> 
>  TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus
> 
> +define Device/minibox-v1
> +    $(Device/tplink-16mlzma)
> +    BOARDNAME := MINIBOX-V1
> +    DEVICE_PROFILE := MINIBOXV1
> +    TPLINK_HWID := 0x3C000201
> +    CONSOLE := ttyATH0,115200
> +endef
> +TARGET_DEVICES += minibox-v1
> +
>  rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst 
> squashfs-%,squashfs,$(1)))
> 
>  # $(1): rootfs type.
> Index: 
> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> ===================================================================
> --- /dev/null
> +++ 
> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> @@ -0,0 +1,39 @@
> +--- a/arch/mips/ath79/machtypes.h
> ++++ b/arch/mips/ath79/machtypes.h
> +@@ -61,6 +61,7 @@ enum ath79_mach_type {
> +	ATH79_MACH_ESR1750,		/* EnGenius ESR1750 */
> +	ATH79_MACH_GL_INET,		/* GL-CONNECT GL-INET */
> +	ATH79_MACH_GS_OOLITE,           /* GS OOLITE V1.0 */
> ++	ATH79_MACH_MINIBOX_V1,           /* MINIBOX V1.0 */
> +	ATH79_MACH_HIWIFI_HC6361,	/* HiWiFi HC6361 */
> +	ATH79_MACH_JA76PF,		/* jjPlus JA76PF */
> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
> +--- a/arch/mips/ath79/Kconfig
> ++++ b/arch/mips/ath79/Kconfig
> +@@ -446,6 +446,16 @@ config ATH79_MACH_GS_OOLITE
> +       select ATH79_DEV_USB
> +       select ATH79_DEV_WMAC
> +
> ++config ATH79_MACH_MINIBOX_V1
> ++       bool "OOLITE BOX V1.0 support"
> ++       select SOC_AR933X
> ++       select ARH79_DEV_ETH
> ++       select ARH79_DEV_GPIO_BUTTONS
> ++       select ATH79_DEV_LEDS_GPIO
> ++       select ATH79_DEV_M25P80
> ++       select ATH79_DEV_USB
> ++       select ATH79_DEV_WMAC
> ++
> + config ATH79_MACH_HIWIFI_HC6361
> +	bool "HiWiFi HC6361 board support"
> +	select SOC_AR933X
> +--- a/arch/mips/ath79/Makefile
> ++++ b/arch/mips/ath79/Makefile
> +@@ -72,6 +72,7 @@ obj-$(CONFIG_ATH79_MACH_DIR_825_C1)	+= m
> + obj-$(CONFIG_ATH79_MACH_ESR1750)	+= mach-esr1750.o
> + obj-$(CONFIG_ATH79_MACH_GL_INET)	+= mach-gl-inet.o
> + obj-$(CONFIG_ATH79_MACH_GS_OOLITE)	+= mach-gs-oolite.o
> ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
> + obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361)	+= mach-hiwifi-hc6361.o
> + obj-$(CONFIG_ATH79_MACH_JA76PF)		+= mach-ja76pf.o
> + obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150809/1af8df13/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From francesco.borromini at inventati.org  Sun Aug  9 17:16:29 2015
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Sun, 09 Aug 2015 23:16:29 +0200
Subject: [OpenWrt-Devel] [PATCH] Ar71xx: Add Minibox v1.0 support
Message-ID: <1439154989.9362.0@smtp.autistici.org>

It seems the ML is choking on the full patch and splitting it up 
somehow because it in turn adds a patch into the kernel patches dir, so 
here's a download link:

https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-trunk.patch

I think the full patch meets the requirements, if I need to split out, 
let me know.

Stijn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150809/71d9e251/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jow at openwrt.org  Mon Aug 10 04:36:39 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 10:36:39 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] knxd: Update
Message-ID: <20150810083603.51E7A280893@arrakis.dune.hu>

The knxd package has been rebuilt and was uploaded to the Chaos Calmer
15.05 Release Candicate 3 repository.


VERSION

2015-03-31-2c6c6732a684dffb87b391ea92cccdf07c8385b8-1 =>
  2015-07-19-be1fcfe85cc1dfcc41f791cd9a45c57fe18da6a0-1


CHANGELOG

[Sun, 26 Jul 2015 18:27:01 +0200 805c6e6]

Bump to newest version for CC


CHANGES

 net/knxd/Makefile |   73 ++++++++-------------------------------------
 1 file changed, 12 insertions(+), 61 deletions(-)


REFERENCES

 * https://github.com/openwrt/packages/commit/805c6e69242bc60a2d35793d312121dcc90ad1ea
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 10 04:36:40 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 10:36:40 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] mwan3: Update
Message-ID: <20150810083607.6464628BD95@arrakis.dune.hu>

The mwan3 package has been rebuilt and was uploaded to the Chaos Calmer
15.05 Release Candicate 3 repository.


VERSION

1.6-1 => 1.6-2


CHANGELOG

[Thu, 23 Jul 2015 13:51:04 +0200 75f9788]

Update to version 1.6-2

Fix malformed uci commands. (issue #1502)


CHANGES

 net/mwan3/Makefile             |    2 +-
 net/mwan3/files/usr/sbin/mwan3 |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)


REFERENCES

 * https://github.com/openwrt/packages/commit/75f978879e2b98065d86d4bcb377c0f3e677557d
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 10 05:38:42 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 11:38:42 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] bmx6: Update
Message-ID: <20150810093808.007A928BD66@arrakis.dune.hu>

The bmx6 package has been rebuilt and was uploaded to the Chaos Calmer
15.05 Release Candicate 3 repository.


VERSION

r2015061604-4 => r2015080701-4


CHANGELOG

[Fri, 7 Aug 2015 20:44:02 +0200 c287113]

Update to latest bmx6-master branch (fix rule corruption on the fly)


CHANGES

 bmx6/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


REFERENCES

 * https://github.com/openwrt-routing/packages/commit/c2871131b4bdd69ad9e658d9ddf295757bd09e4b
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 10 05:38:42 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 11:38:42 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] oonf-dlep-proxy: Update
Message-ID: <20150810093811.B30D428BD97@arrakis.dune.hu>

The oonf-dlep-proxy package has been rebuilt and was uploaded to the
Chaos Calmer 15.05 Release Candicate 3 repository.


VERSION

0.9.1-r1-eab3845089bc2410a3c115fb8274572b16a0e47d =>
  0.9.1-r2-eab3845089bc2410a3c115fb8274572b16a0e47d


CHANGELOG

[Thu, 6 Aug 2015 21:43:33 +0200 57658db]

Unified openwrt init files for OONF

[Wed, 5 Aug 2015 13:19:59 +0200 b13b00b]

OONF v0.9.1 for chaos calmer


CHANGES

 oonf-dlep-proxy/Makefile                 |    4 +-
 oonf-dlep-proxy/files/dlep_proxy.hotplug |   11 +-
 oonf-dlep-proxy/files/dlep_proxy.init    |  122 +---------------------
 3 files changed, 6 insertions(+), 131 deletions(-)


REFERENCES

 * https://github.com/openwrt-routing/packages/commit/b13b00b0eca838748dc95309f68091052f9074a2
 * https://github.com/openwrt-routing/packages/commit/57658dbe2ad8d3c16e56116d4376ec4d4e3e654d
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 10 05:38:43 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 11:38:43 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] oonf-dlep-radio: Update
Message-ID: <20150810093821.929D228C0BB@arrakis.dune.hu>

The oonf-dlep-radio package has been rebuilt and was uploaded to the
Chaos Calmer 15.05 Release Candicate 3 repository.


VERSION

0.9.1-r1-eab3845089bc2410a3c115fb8274572b16a0e47d =>
  0.9.1-r2-eab3845089bc2410a3c115fb8274572b16a0e47d


CHANGELOG

[Thu, 6 Aug 2015 21:43:33 +0200 57658db]

Unified openwrt init files for OONF

[Wed, 5 Aug 2015 13:19:59 +0200 b13b00b]

OONF v0.9.1 for chaos calmer


CHANGES

 oonf-dlep-radio/Makefile                 |    4 +-
 oonf-dlep-radio/files/dlep_radio.hotplug |   11 +-
 oonf-dlep-radio/files/dlep_radio.init    |  122 +---------------------
 3 files changed, 6 insertions(+), 131 deletions(-)


REFERENCES

 * https://github.com/openwrt-routing/packages/commit/b13b00b0eca838748dc95309f68091052f9074a2
 * https://github.com/openwrt-routing/packages/commit/57658dbe2ad8d3c16e56116d4376ec4d4e3e654d
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 10 05:38:43 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 11:38:43 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] oonf-init-scripts: Update
Message-ID: <20150810093826.0054D28C0D9@arrakis.dune.hu>

The oonf-init-scripts package has been rebuilt and was uploaded to the
Chaos Calmer 15.05 Release Candicate 3 repository.


VERSION

0.9.1-r2-1 => 0.9.1-r2-1


CHANGELOG

[Thu, 6 Aug 2015 21:43:33 +0200 57658db]

Unified openwrt init files for OONF


CHANGES



REFERENCES

 * https://github.com/openwrt-routing/packages/commit/57658dbe2ad8d3c16e56116d4376ec4d4e3e654d
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 10 05:38:44 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 11:38:44 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] oonf-olsrd2: Update
Message-ID: <20150810093838.2DDAB28C0F5@arrakis.dune.hu>

The oonf-olsrd2 package has been rebuilt and was uploaded to the Chaos
Calmer 15.05 Release Candicate 3 repository.


VERSION

0.9.1-r1-eab3845089bc2410a3c115fb8274572b16a0e47d =>
  0.9.1-r2-eab3845089bc2410a3c115fb8274572b16a0e47d


CHANGELOG

[Thu, 6 Aug 2015 21:43:33 +0200 57658db]

Unified openwrt init files for OONF

[Wed, 5 Aug 2015 13:19:59 +0200 b13b00b]

OONF v0.9.1 for chaos calmer


CHANGES

 oonf-olsrd2/Makefile             |    4 +-
 oonf-olsrd2/files/olsrd2.hotplug |   11 +--
 oonf-olsrd2/files/olsrd2.init    |  122 +-----------------------------
 3 files changed, 6 insertions(+), 131 deletions(-)


REFERENCES

 * https://github.com/openwrt-routing/packages/commit/b13b00b0eca838748dc95309f68091052f9074a2
 * https://github.com/openwrt-routing/packages/commit/57658dbe2ad8d3c16e56116d4376ec4d4e3e654d
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 10 05:38:44 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 11:38:44 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] netperf: Update
Message-ID: <20150810093841.B5FDF28C0FD@arrakis.dune.hu>

The netperf package has been rebuilt and was uploaded to the Chaos
Calmer 15.05 Release Candicate 3 repository.


VERSION

2.6.0-1 => 2.7.0-1


CHANGELOG

[Mon, 3 Aug 2015 18:13:58 +0200 1ee31bd]

Update to v2.7.0

[Mon, 3 Aug 2015 18:13:54 +0200 aa75904]

Adopt the netperf package.


CHANGES

 net/netperf/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


REFERENCES

 * https://github.com/openwrt/packages/commit/aa75904c0b127254efec9467efbde80fbb437f9d
 * https://github.com/openwrt/packages/commit/1ee31bdfd26c53e41199c3d28cadca731d3bd372
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 10 06:04:13 2015
From: jow at openwrt.org (jow at openwrt.org)
Date: Mon, 10 Aug 2015 12:04:13 +0200
Subject: [OpenWrt-Devel] [CC 15.05-rc3] miniupnpd: Update
Message-ID: <20150810100336.7AC3D281570@arrakis.dune.hu>

The miniupnpd package has been rebuilt and was uploaded to the Chaos
Calmer 15.05 Release Candicate 3 repository.


VERSION

1.9.20150609-1 => 1.9.20150609-1


CHANGELOG

[Wed, 15 Jul 2015 08:29:56 +0200 0a514a3]

Shorten OS name to silence SSDP warnings


CHANGES

 miniupnpd/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


REFERENCES

 * https://github.com/miniupnp/miniupnp/issues/133
 * https://github.com/openwrt-routing/packages/commit/0a514a34e7a371df99e7b48d831001130efbdbda
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Mon Aug 10 06:10:14 2015
From: kerry9842 at gmail.com (John kerry)
Date: Mon, 10 Aug 2015 18:10:14 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFZU7Zm6Vgjifbc8t+Q77qbvXjC_APSw8oGqHiAgA5+kA@mail.gmail.com>
 <CAGUNxBFMaPYQLhAWAEnQvPmNnbyrmvQ3szLYWeF1uWi07BJjTg@mail.gmail.com>
 <CAGUNxBF_9q3q3s16_hQWhXD=cKB9sJ=xpUmv1JJXyk2DFNmHhA@mail.gmail.com>
 <CAFE24U0LYa+hbWLB5UaQTB3uO73k5nPCqj689+uAGS-AnV+GHw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
Message-ID: <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>

Firstly i configure wireless config as below:

config wifi-device 'wifi0'
        option type 'qcawifi'
        option macaddr '00:01:11:00:01:00'
        option hwmode '11ng'
        option txpower '17'
        option htmode 'HT20'
        option disabled '0'
        option channel '1'

config wifi-iface
        option device 'wifi0'
        option mode 'ap'
        option ssid 'Testing_ap'
        option network 'lan'
        option encryption 'psk2'
        option key 'Testing_ap'

so its SSID was showing and able to connect any device to it.

Then i scan the device and connect to one of it. While joining the network
i selected Client(WDS) then the wireless config becomes like below:

config wifi-device 'wifi0'
        option type 'qcawifi'
        option macaddr '00:01:11:00:01:00'
        option hwmode '11ng'
        option txpower '17'
        option htmode 'HT20'
        option disabled '0'
        option channel '1'

config wifi-iface
        option network 'wwan'
        option ssid 'D_Link_Router'
        option encryption 'psk2'
        option device 'wifi0'
        option mode 'sta'
        option key 'Dlink_Router'
        option wds '1'

Then  i added one as shown in the video. Now its connected to router also
and this add one also showing so i can connect to this also.

But i am not getting how to keep this in default wireless config.

Because every time we cant add one to configure like this. It should be
like default should be in ap mode so any device we can connect, if its
connected to another router also that SSID still should be visible and able
to connect to this.


On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com> wrote:

> When i try to configure based on video, its shows 2 one as client another
> one as Master but i am not able to enable it . I mean to say wireless
> becomes disable. If i enable it using GUI also its not happening.
>
> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>
>> What happens when you try to follow the video?
>>
>> Based on your comments, i'm guessing that things don't work when you try
>> and configure the second network and have it with a different SSID than the
>> first network that you put in client mode.
>>
>> Is this correct?
>>
>> David Lang
>>
>> On Mon, 10 Aug 2015, John kerry wrote:
>>
>> Yes, When i am connecting to Another router its changed to Client mode.
>>>
>>> Can i configure this in repeater mode like its shows in below link:
>>>
>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150810/e6dcb81c/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Mon Aug 10 06:18:23 2015
From: david at lang.hm (David Lang)
Date: Mon, 10 Aug 2015 03:18:23 -0700 (PDT)
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>

On Mon, 10 Aug 2015, John kerry wrote:

> Date: Mon, 10 Aug 2015 18:10:14 +0800
> From: John kerry <kerry9842 at gmail.com>
> To: Alex Weedy <weedy2887 at gmail.com>,
>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple Wi-Fi
>     client/AP interfaces on one radio)
> 
> Firstly i configure wireless config as below:
>
> config wifi-device 'wifi0'
>        option type 'qcawifi'
>        option macaddr '00:01:11:00:01:00'
>        option hwmode '11ng'
>        option txpower '17'
>        option htmode 'HT20'
>        option disabled '0'
>        option channel '1'
>
> config wifi-iface
>        option device 'wifi0'
>        option mode 'ap'
>        option ssid 'Testing_ap'
>        option network 'lan'
>        option encryption 'psk2'
>        option key 'Testing_ap'
>
> so its SSID was showing and able to connect any device to it.
>
> Then i scan the device and connect to one of it. While joining the network
> i selected Client(WDS) then the wireless config becomes like below:

why don't you try following the steps in the video that you posted.

first connect as a client, then add an additional interface and make the second 
interface the AP for things to connect to.

the order may make a difference.

David Lang

> config wifi-device 'wifi0'
>        option type 'qcawifi'
>        option macaddr '00:01:11:00:01:00'
>        option hwmode '11ng'
>        option txpower '17'
>        option htmode 'HT20'
>        option disabled '0'
>        option channel '1'
>
> config wifi-iface
>        option network 'wwan'
>        option ssid 'D_Link_Router'
>        option encryption 'psk2'
>        option device 'wifi0'
>        option mode 'sta'
>        option key 'Dlink_Router'
>        option wds '1'
>
> Then  i added one as shown in the video. Now its connected to router also
> and this add one also showing so i can connect to this also.
>
> But i am not getting how to keep this in default wireless config.
>
> Because every time we cant add one to configure like this. It should be
> like default should be in ap mode so any device we can connect, if its
> connected to another router also that SSID still should be visible and able
> to connect to this.


>
> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com> wrote:
>
>> When i try to configure based on video, its shows 2 one as client another
>> one as Master but i am not able to enable it . I mean to say wireless
>> becomes disable. If i enable it using GUI also its not happening.
>>
>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>>
>>> What happens when you try to follow the video?
>>>
>>> Based on your comments, i'm guessing that things don't work when you try
>>> and configure the second network and have it with a different SSID than the
>>> first network that you put in client mode.
>>>
>>> Is this correct?
>>>
>>> David Lang
>>>
>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>
>>> Yes, When i am connecting to Another router its changed to Client mode.
>>>>
>>>> Can i configure this in repeater mode like its shows in below link:
>>>>
>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>
>>>
>>
>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Mon Aug 10 06:25:35 2015
From: kerry9842 at gmail.com (John kerry)
Date: Mon, 10 Aug 2015 18:25:35 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAFE24U19h2zCRUXJ+KfZiG_FYgpno_10hPE+7nq7=4oy0pacag@mail.gmail.com>
 <CAGUNxBEaaDYTr5Ltm6xYu4zG8--_D=Pk+79HFBOxhuyVapg5Kg@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
Message-ID: <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>

I followed the same steps and its working too. But this i want in wireless
config file, Because i dont want every time to add using GUI. So When i
connect to another router also, no need to add one more. I mean to say it
should be in default wireless config file.

On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm> wrote:

> On Mon, 10 Aug 2015, John kerry wrote:
>
> Date: Mon, 10 Aug 2015 18:10:14 +0800
>> From: John kerry <kerry9842 at gmail.com>
>> To: Alex Weedy <weedy2887 at gmail.com>,
>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
>> Wi-Fi
>>     client/AP interfaces on one radio)
>>
>> Firstly i configure wireless config as below:
>>
>> config wifi-device 'wifi0'
>>        option type 'qcawifi'
>>        option macaddr '00:01:11:00:01:00'
>>        option hwmode '11ng'
>>        option txpower '17'
>>        option htmode 'HT20'
>>        option disabled '0'
>>        option channel '1'
>>
>> config wifi-iface
>>        option device 'wifi0'
>>        option mode 'ap'
>>        option ssid 'Testing_ap'
>>        option network 'lan'
>>        option encryption 'psk2'
>>        option key 'Testing_ap'
>>
>> so its SSID was showing and able to connect any device to it.
>>
>> Then i scan the device and connect to one of it. While joining the network
>> i selected Client(WDS) then the wireless config becomes like below:
>>
>
> why don't you try following the steps in the video that you posted.
>
> first connect as a client, then add an additional interface and make the
> second interface the AP for things to connect to.
>
> the order may make a difference.
>
> David Lang
>
>
> config wifi-device 'wifi0'
>>        option type 'qcawifi'
>>        option macaddr '00:01:11:00:01:00'
>>        option hwmode '11ng'
>>        option txpower '17'
>>        option htmode 'HT20'
>>        option disabled '0'
>>        option channel '1'
>>
>> config wifi-iface
>>        option network 'wwan'
>>        option ssid 'D_Link_Router'
>>        option encryption 'psk2'
>>        option device 'wifi0'
>>        option mode 'sta'
>>        option key 'Dlink_Router'
>>        option wds '1'
>>
>> Then  i added one as shown in the video. Now its connected to router also
>> and this add one also showing so i can connect to this also.
>>
>> But i am not getting how to keep this in default wireless config.
>>
>> Because every time we cant add one to configure like this. It should be
>> like default should be in ap mode so any device we can connect, if its
>> connected to another router also that SSID still should be visible and
>> able
>> to connect to this.
>>
>
>
>
>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com> wrote:
>>
>> When i try to configure based on video, its shows 2 one as client another
>>> one as Master but i am not able to enable it . I mean to say wireless
>>> becomes disable. If i enable it using GUI also its not happening.
>>>
>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>>>
>>> What happens when you try to follow the video?
>>>>
>>>> Based on your comments, i'm guessing that things don't work when you try
>>>> and configure the second network and have it with a different SSID than
>>>> the
>>>> first network that you put in client mode.
>>>>
>>>> Is this correct?
>>>>
>>>> David Lang
>>>>
>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>
>>>> Yes, When i am connecting to Another router its changed to Client mode.
>>>>
>>>>>
>>>>> Can i configure this in repeater mode like its shows in below link:
>>>>>
>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>
>>>>>
>>>>
>>>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150810/a2e26c7a/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From karlp at tweak.net.au  Mon Aug 10 09:12:11 2015
From: karlp at tweak.net.au (Karl Palsson)
Date: Mon, 10 Aug 2015 13:12:11 -0000
Subject: [OpenWrt-Devel] [PATCH] Ar71xx: Add Minibox v1.0 support
In-Reply-To: <1439153278.8865.0@smtp.autistici.org>
References: <1439153278.8865.0@smtp.autistici.org>
Message-ID: <20150810130740-31735-43528-mailpile@palmtree-beeroclock-net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This has many cases where you have added the board out of order.  The
lists are generally alphabetically sorted, and should be maintained that
way, even though a few boards escaped this.

More comments inline.


Stijn Segers <francesco.borromini at inventati.org> wrote:
> Hello,
> 
> The patch below adds support for the Gainstrong Minibox v1.0 mini 
> router into trunk. This is based off the Barrier Breaker based source 
> code at http://ooioe.com/miniboxv1/Sourcecode/.
> 
> Patch applies cleanly, has been compile-tested on a 15.05 tree (the 
> patch below is for the trunk ar17xx target with kernel 4.1). For those 
> interested, I can provide the 15.05 patch as well.
> 
> Any questions, let me know.
> 
> Thank you
> 
> Stijn
> 
> 
> 
> 
> Index: openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
> ===================================================================
> --- openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/diag.sh
> +++ openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -222,6 +222,9 @@ get_status_led() {
>  	qihoo-c301)
>  		status_led="qihoo:green:status"
>  		;;
> +	minibox-v1)
> +		status_led="minibox-v1:green:system"
> +		;;
>  	tew-632brp)
>  		status_led="tew-632brp:green:status"
>  		;;
> @@ -366,7 +369,7 @@ set_state() {
>  		status_led_blink_preinit_regular
>  		;;
>  	done)
> -		status_led_on
> +		status_led_off

Pretty sure you can't just change this for everyone.  If you have an
active low/active high issue, you should fix that in your board file.

>  		case $(ar71xx_board_name) in
>  		qihoo-c301)
>  			local n=$(fw_printenv activeregion | cut -d = -f 2)
> Index: 
> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> ===================================================================
> --- 
> openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ 
> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -419,6 +419,7 @@ ja76pf |\
>  mc-mac1200r|\
>  mynet-n600 |\
>  oolite |\
> +minibox-v1 |\


I know gainstrong makes the oolite too, but at this point in this file,
that's irrelevant, keep the alphabetical sorting.

>  qihoo-c301 |\
>  rb-750 |\
>  rb-751 |\
> Index: openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
> ===================================================================
> --- openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -119,6 +119,9 @@ tplink_board_detect() {
>  	"3C0001"*)
>  		model="OOLITE"
>  		;;
> +	"3C0002"*)
> +		model="MINIBOX_V1"
> +		;;
>  	"070300"*)
>  		model="TP-Link TL-WR703N"
>  		;;
> @@ -320,6 +323,9 @@ ar71xx_board_detect() {
>  	*"AC1750DB")
>  		name="f9k1115v2"
>  		;;
> +	*"MiniBox V1.0")
> +		name="minibox-v1"
> +		;;

Bad sort.

>  	*"AirGateway")
>  		name="airgateway"
>  		;;
> Index: 
> openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> ===================================================================
> --- 
> openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -315,6 +315,7 @@ platform_check_image() {
>  	mc-mac1200r | \
>  	onion-omega | \
>  	oolite | \
> +	minibox-v1 |\

Bad sort.

>  	smart-300 | \
>  	tl-mr10u | \
>  	tl-mr11u | \
> Index: openwrt/trunk/target/linux/ar71xx/config-4.1
> ===================================================================
> --- openwrt.orig/trunk/target/linux/ar71xx/config-4.1
> +++ openwrt/trunk/target/linux/ar71xx/config-4.1
> @@ -73,6 +73,7 @@ CONFIG_ATH79_MACH_EW_DORIN=y
>  CONFIG_ATH79_MACH_F9K1115V2=y
>  CONFIG_ATH79_MACH_GL_INET=y
>  CONFIG_ATH79_MACH_GS_OOLITE=y
> +CONFIG_ATH79_MACH_MINIBOX_V1=y


very bad sort.  config files have even strong sorting requirements.

>  CONFIG_ATH79_MACH_HIWIFI_HC6361=y
>  CONFIG_ATH79_MACH_HORNET_UB=y
>  CONFIG_ATH79_MACH_JA76PF=y
> Index: 
> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> ===================================================================
> --- /dev/null
> +++ 
> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> @@ -0,0 +1,85 @@
> +/*
> + *  Oolite board support


Wrong.  Oolite is the board you copied.  This file should be accurately
describe what it does, not what it used to do at some point.

> + *
> + *
> + *  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.
> + */
> +
> +#include <linux/gpio.h>
> +
> +#include <asm/mach-ath79/ath79.h>
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +#include "dev-usb.h"


It's a matter of taste, but you didn't think of putting all the dev-
includes together?

> +
> +#define MINIBOX_V1_GPIO_BTN_RESET	11
> +
> +#define MINIBOX_V1_GPIO_LED_SYSTEM	1
> +
> +#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * 
> MINIBOX_V1_KEYS_POLL_INTERVAL)
> +
> +static const char *MINIBOX_V1_part_probes[] = {
> +	"tp-link",
> +	NULL,
> +};
> +
> +static struct flash_platform_data MINIBOX_V1_flash_data = {
> +	.part_probes	= MINIBOX_V1_part_probes,
> +};
> +
> +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
> +	{
> +		.name		= "minibox-v1:green:system",
> +		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
> +		.active_low	= 0,
> +	},
> +};
> +
> +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "reset",
> +		.type		= EV_KEY,
> +		.code		= KEY_RESTART,
> +		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
> +		.active_low	= 0,
> +	},
> +};
> +
> +static void __init MINIBOX_V1_setup(void)
> +{
> +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
> +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
> +				 MINIBOX_V1_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
> +					MINIBOX_V1_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +	ath79_register_m25p80(&MINIBOX_V1_flash_data);
> +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
> +
> +	ath79_register_mdio(0, 0x0);
> +	ath79_register_eth(1);
> +	ath79_register_eth(0);
> +
> +	ath79_register_wmac(ee, mac);
> +}
> +
> +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
> +	     "MiniBox V1.0", MINIBOX_V1_setup);
> Index: openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> ===================================================================
> --- /dev/null
> +++ openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License 
> v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/MINIBOXV1
> +	NAME:=MINIBOX V1.0
> +	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
> +endef
> +
> +
> +define Profile/MINIBOXV1/Description
> +	Package set optimized for the MINIBOX V1.0
> +endef
> +$(eval $(call Profile,MINIBOXV1))
> Index: openwrt/trunk/target/linux/ar71xx/image/Makefile
> ===================================================================
> --- openwrt.orig/trunk/target/linux/ar71xx/image/Makefile
> +++ openwrt/trunk/target/linux/ar71xx/image/Makefile
> @@ -902,6 +902,15 @@ endef
> 
>  TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus
> 
> +define Device/minibox-v1
> +    $(Device/tplink-16mlzma)
> +    BOARDNAME := MINIBOX-V1
> +    DEVICE_PROFILE := MINIBOXV1
> +    TPLINK_HWID := 0x3C000201
> +    CONSOLE := ttyATH0,115200
> +endef
> +TARGET_DEVICES += minibox-v1
> +
>  rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst 
> squashfs-%,squashfs,$(1)))
> 
>  # $(1): rootfs type.
> Index: 
> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> ===================================================================
> --- /dev/null
> +++ 
> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> @@ -0,0 +1,39 @@
> +--- a/arch/mips/ath79/machtypes.h
> ++++ b/arch/mips/ath79/machtypes.h
> +@@ -61,6 +61,7 @@ enum ath79_mach_type {
> +	ATH79_MACH_ESR1750,		/* EnGenius ESR1750 */
> +	ATH79_MACH_GL_INET,		/* GL-CONNECT GL-INET */
> +	ATH79_MACH_GS_OOLITE,           /* GS OOLITE V1.0 */
> ++	ATH79_MACH_MINIBOX_V1,           /* MINIBOX V1.0 */
> +	ATH79_MACH_HIWIFI_HC6361,	/* HiWiFi HC6361 */
> +	ATH79_MACH_JA76PF,		/* jjPlus JA76PF */
> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
> +--- a/arch/mips/ath79/Kconfig
> ++++ b/arch/mips/ath79/Kconfig
> +@@ -446,6 +446,16 @@ config ATH79_MACH_GS_OOLITE
> +       select ATH79_DEV_USB
> +       select ATH79_DEV_WMAC
> +
> ++config ATH79_MACH_MINIBOX_V1
> ++       bool "OOLITE BOX V1.0 support"

wrong board name again.


> ++       select SOC_AR933X
> ++       select ARH79_DEV_ETH
> ++       select ARH79_DEV_GPIO_BUTTONS
> ++       select ATH79_DEV_LEDS_GPIO
> ++       select ATH79_DEV_M25P80
> ++       select ATH79_DEV_USB
> ++       select ATH79_DEV_WMAC
> ++
> + config ATH79_MACH_HIWIFI_HC6361
> +	bool "HiWiFi HC6361 board support"
> +	select SOC_AR933X
> +--- a/arch/mips/ath79/Makefile
> ++++ b/arch/mips/ath79/Makefile
> +@@ -72,6 +72,7 @@ obj-$(CONFIG_ATH79_MACH_DIR_825_C1)	+= m
> + obj-$(CONFIG_ATH79_MACH_ESR1750)	+= mach-esr1750.o
> + obj-$(CONFIG_ATH79_MACH_GL_INET)	+= mach-gl-inet.o
> + obj-$(CONFIG_ATH79_MACH_GS_OOLITE)	+= mach-gs-oolite.o
> ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
> + obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361)	+= mach-hiwifi-hc6361.o
> + obj-$(CONFIG_ATH79_MACH_JA76PF)		+= mach-ja76pf.o
> + obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

- -- 
Sent using Mailpile, Free Software from www.mailpile.is

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

iQIcBAEBAgAGBQJVyKMrAAoJEBmotQ/U1cr2eTgQAMCTCTW+tAdMfbstFBud1M7U
MqsY2mZWQODU24pCQg4eJX5jskj5zXbxQCPBwZ8xwAfbZ/DBOQH23xauPfFDCqi2
U1mxC60GqS6C5bm0ZF8+kJeSRWnlwOX3vckwpZAnQYvyZUemGWef2JIUc7glS2kn
NvQxCkwhl4PYWMl+Nox1De5NgOi0Ft1dUdXVAdLBm3abZMIYMcijWhR0iMjS3Snt
SAzReHPr0v3XCXwQ+bc7aN1el1KeXhT+Bkv1WPKDrfvACjB6kZup8WKtXGYUy15L
7tMdOeiyHHfZZOaKg+qUzRCj+9g4DQpDqsQVtu/f5eicfOHjDZRA7kyZnxrcUJy1
6v3L8/2vNDxZY/z5gz7ilPl9k+EPECn56GtepWKjE9yzOSgRg1enlmfXh4g2SJgF
+G1GSKsoyO4FuhzGMJ0xd5UMNE93nncK05vYHmUs3+OXoTj+eA8QGnIzByVJT197
NL7Ared98MpB6SenOQVnwKoi8YtPHWqjK2lnjplu0Jxb0ULdAVVa7SlV8Cmyd+89
+KtINxWxKdokzQKPus17YaSdJtcKVtExfaadCqA2HGbIwNCAx+KS7UxGESA/iSaD
XMSAPyCXQCqg9eznZGtZEwq7q0PRvyw98UbdyYG9AMUtO2XdCgxHImxfbb9RMo6p
0EUe8DdJPkWLEXxHd21D
=saX1
-----END PGP SIGNATURE-----
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From florian.siebertz at inf.h-brs.de  Mon Aug 10 10:50:50 2015
From: florian.siebertz at inf.h-brs.de (Florian Siebertz)
Date: Mon, 10 Aug 2015 16:50:50 +0200
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
In-Reply-To: <CA+U=Dsp02P33TROP7PUosOwZ2BqwgCuH4wZbd1TZNC9=YE_5dA@mail.gmail.com>
References: <55C08938.6030507@inf.h-brs.de>
 <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>
 <CA+U=Dsony4dUX2zK3cM07v7v=saskAcW8qh8GswZBRcrXDVKfg@mail.gmail.com>
 <55C20742.6000607@inf.h-brs.de>
 <CA+U=DspR42pDEe+aqZgoNgbuKCLjHaWfH=RBXyziUmrdxHD6Fg@mail.gmail.com>
 <CA+U=Dsp02P33TROP7PUosOwZ2BqwgCuH4wZbd1TZNC9=YE_5dA@mail.gmail.com>
Message-ID: <55C8BA4A.1010901@inf.h-brs.de>

Today I compiled with your fork and everything seemed fine at first.
After flashing to a TP-Link WDR3600 Router I can see the ovsdb-server running
and <ovs-vsctl show> reveals the usual String ID.

When I try to add a bridge with <ovs-vsctl add-br br0> the command does not return
to the input prompt. After pressing ctrl+c and checking <ovs-vsctl show> it seems like
the bridge was created. The same happens when adding ports or changing any
settings on the bridge.

Additionally, the switch does not connect to the controller. I'm not sure how to debug 
this further, but if you have an idea I will test it on the device.


Am 07.08.2015 um 16:14 schrieb Alexandru Ardelean:
> @Florian
> So, I took some time today to patch a bit of support for OVS to compile on
> OpenWRT with kernel 4.1
> 
> Can you pull this from my fork and test it out a bit ?
> Branch is here: https://github.com/commodo/packages/tree/ovs-kernel-4.1
> Commit is this one:
> https://github.com/commodo/packages/commit/de519aac8c751cd8744d839efd071cdf02891db1
> 
> If you need a tarball, send me a message and I can prepare one, or maybe
> Github has a download zip/tar button per branches somewhere not sure.
> 
> Anyway, I'd appreciate if you took the time to test it out a bit.
> I'm a bit swamped and don't have time to do proper testing ; to be honest I
> just made it build, and I haven't managed to get hold of a device with
> which to actually test it.
> If all is good I'll add a PR into the official OpenWRT packages.
> 
> Thanks
> 
> On Wed, Aug 5, 2015 at 5:18 PM, Alexandru Ardelean <ardeleanalex at gmail.com>
> wrote:
> 
>> I will admit I only tested with x86.
>> I ASSumed that it's on kernel 4.1.
>>
>> Will check again and try to spin up a patch for kernel 4.1.
>>
>> On Wed, Aug 5, 2015 at 3:53 PM, Florian Siebertz <
>> florian.siebertz at inf.h-brs.de> wrote:
>>
>>> Thank you for your work, i really appreciate it.
>>> Now the package is back, but at compilation it fails when
>>> checking against the kernel version:
>>>
>>> (cd
>>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/./;
>>> if [ -x ./configure ]; then find
>>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>>> -name config.guess | xargs -r chmod u+w; find
>>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>>> -name config.guess | xargs -r -n1 cp --remove-destination
>>> /home/administrator/openwrt/scripts/config.guess; find
>>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>>> -name config.sub | xargs -r chmod u+w; find
>>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>>> -name config.sub | xargs -r -n1 cp --remove-destination
>>> /home/administrator/openwrt/scripts/config.sub;
>>> AR="mips-openwrt-linux-musl-gcc-ar" AS="mips-openwrt-linux-musl-gcc -c -Os
>>> -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves
>>> -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Wformat !
>>>  -Werror=fo
>>> rmat-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now
>>> -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99"
>>> LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm"
>>> CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc"
>>> CXX="mips-openwrt-linux-musl-g++"
>>> RANLIB="mips-openwrt-linux-musl-gcc-ranlib"
>>> STRIP=mips-openwrt-linux-musl-strip OBJCOPY=mips-openwrt-linux-musl-objcopy
>>> OBJDUMP=mips-openwrt-linux-musl-objdump SIZE=mips-openwrt-linux-musl-size
>>> CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc
>>> -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable
>>> -msoft-float -Wformat -Werror=format-security -fstack-protector
>>> -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -mno-mips16
>>> -mno-interlink-mips16 -flto -std=gnu99 " CXXFLAGS="-Os -pipe
>>> -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts
>>> -Wno-error=unused-but-set-variable -msoft-float -Wformat
>>> -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1!
>>>   -Wl,-z,no
>>> w -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99 "
>>> CPPFLAGS="-I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/include
>>> -I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/include
>>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/include
>>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/fortify
>>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include
>>> "
>>> LDFLAGS="-L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/lib
>>> -L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/lib
>>> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/lib
>>> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/lib
>>> -znow -zrelro "   ./configure --target=mips-openwrt-linux
>>> --host=mips-openwrt-linux --build!
>>>  =x86_64-li
>>> nux-gnu --program-prefix="" --program-suffix="" --prefix=/usr
>>> --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
>>> --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share
>>> --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls
>>>  _python_sysroot="/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10"
>>> _python_prefix="/usr" _python_exec_prefix="/usr"
>>> --with-linux=/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
>>> --with-rundir=/var/run --enable-ndebug --disable-ssl --enable-shared ; fi; )
>>>
>>> [...] (a bunch of checks)
>>>
>>> checking for kernel version... 4.1.3
>>> configure: error: Linux kernel in
>>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
>>> is version 4.1.3, but version newer than 4.0.x is not supported (please
>>> refer to the FAQ for advice)
>>> make[3]: ***
>>> [/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/.configured_yyyyyyyy]
>>> Error 1
>>> make[3]: Leaving directory
>>> `/home/administrator/openwrt/feeds/packages/net/openvswitch'
>>> make[2]: *** [package/feeds/packages/openvswitch/compile] Error 2
>>> make[2]: Leaving directory `/home/administrator/openwrt'
>>> make[1]: ***
>>> [/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile]
>>> Error 2
>>> make[1]: Leaving directory `/home/administrator/openwrt'
>>> make: *** [world] Error 2
>>>
>>>
>>>
>>> Am 04.08.2015 um 16:08 schrieb Alexandru Ardelean:
>>>> Took some 20-30 minutes to upgrade OVS and test it (with kernel 4.1).
>>>> Seems to work fine so far.
>>>>
>>>> Please monitor this PR; after it's merged it should appear.
>>>>
>>>> On Tue, Aug 4, 2015 at 1:37 PM, Alexandru Ardelean <
>>> ardeleanalex at gmail.com>
>>>> wrote:
>>>>
>>>>> Well, OpenVSwitch is a bit behind on kernel support.
>>>>> It's at 3.18 currently.
>>>>> OpenWRT is at 4.1
>>>>>
>>>>> We'd need to do an upgrade of OVS to get it up to speed.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Aug 4, 2015 at 12:43 PM, Florian Siebertz <
>>>>> florian.siebertz at inf.h-brs.de> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> i noticed that the openvswitch package is not available in trunk at
>>> the
>>>>>> moment. It is not in the precompiled snapshots, neither can it be
>>>>>> choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
>>>>>> [update|install] -a).
>>>>>>
>>>>>> Does anyone know why and when it will be back?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> Florian Siebertz
>>>>>> _______________________________________________
>>>>>> openwrt-devel mailing list
>>>>>> openwrt-devel at lists.openwrt.org
>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>>
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tochiro.srchack at gmail.com  Mon Aug 10 11:16:33 2015
From: tochiro.srchack at gmail.com (YuheiOKAWA)
Date: Tue, 11 Aug 2015 00:16:33 +0900
Subject: [OpenWrt-Devel] [PATCH] ramips: add support for Planex DB-WRT01
Message-ID: <1439219793-18015-1-git-send-email-tochiro.srchack@gmail.com>

 This patch add support for Planex DB-WRT01. DANBOARD route on
 the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio.
 DANBOARD is Cartoon character.

Signed-off-by: YuheiOKAWA <tochiro.srchack at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |  3 +
 .../linux/ramips/base-files/etc/board.d/02_network |  1 +
 target/linux/ramips/base-files/etc/diag.sh         |  3 +
 target/linux/ramips/base-files/lib/ramips.sh       |  3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |  1 +
 target/linux/ramips/dts/DB-WRT01.dts               | 99 ++++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |  2 +
 7 files changed, 112 insertions(+)
 create mode 100644 target/linux/ramips/dts/DB-WRT01.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index c6bfd7e..2d4fb92 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -85,6 +85,9 @@ case $board in
 		ucidef_set_led_default "power" "POWER" "d105:red:power" "1"
 		set_usb_led "d105:green:usb"
 		;;
+	db-wrt01)
+		ucidef_set_led_default "power" "power" "dbwrt01:orange:power" "1"
+		;;
 	dcs-930l-b1)
 		ucidef_set_led_default "power" "POWER" "d-link:red:power" "1"
 		ucidef_set_led_netdev "wifi" "WiFi" "d-link:blue:wps"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index da1854a..083081e 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -126,6 +126,7 @@ ramips_setup_interfaces()
 
 	3g-6200n | \
 	ai-br100 | \
+	db-wrt01 | \
 	dir-610-a1 | \
 	dir-300-b7 | \
 	dir-320-b1 | \
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index e63f0df..8e1bc92 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -48,6 +48,9 @@ get_status_led() {
 	d105)
 		status_led="d105:red:power"
 		;;
+	db-wrt01)
+		status_led="dbwrt01:orange:power"
+		;;
 	dcs-930 | dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1| dir-300-b7| dir-320-b1)
 		status_led="d-link:green:status"
 		;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 7db6d37..e745db9 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -211,6 +211,9 @@ ramips_board_detect() {
 	*"Linksys RE6500")
 		name="re6500"
 		;;
+	*"Planex DB-WRT01")
+		name="db-wrt01"
+		;;
 	*"Planex MZK-750DHP")
 		name="mzk-750dhp"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 8221997..d09fc80 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -36,6 +36,7 @@ platform_check_image() {
 	cf-wr800n | \
 	d105 | \
 	dap-1350 | \
+	db-wrt01 | \
 	dcs-930 | \
 	dcs-930l-b1 | \
 	dir-300-b1 | \
diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/DB-WRT01.dts
new file mode 100644
index 0000000..c396cab
--- /dev/null
+++ b/target/linux/ramips/dts/DB-WRT01.dts
@@ -0,0 +1,99 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+	compatible = "ralink,mt7620a-soc";
+	model = "Planex DB-WRT01";
+
+	palmbus at 10000000 {
+		gpio1: gpio at 638 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "en25q64";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l6405d";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x7b0000>;
+				};
+			};
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "spi refclk", "rgmii1";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&ephy_pins>;
+
+		mtd-mac-address = <&factory 0x4>;
+		ralink,port-map = "llllw";
+	};
+
+	gsw at 10110000 {
+		ralink,port4 = "ephy";
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	pcie at 10140000 {
+		status = "okay";
+	};
+	
+	gpio-leds {
+		compatible = "gpio-leds";
+		power {
+			label = "dbwrt01:orange:power";
+			gpios = <&gpio1 1 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		s1 {
+			label = "wps";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x211>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 409ff26..088cf5a 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -857,6 +857,7 @@ Image/Build/Profile/MT7620a_MT7530=$(call BuildFirmware/Default8M/$(1),$(1),mt76
 Image/Build/Profile/MT7620a_V22SG=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_v22sg,MT7620a_V22SG)
 br100_mtd_size=8126464
 Image/Build/Profile/AIBR100=$(call BuildFirmware/CustomFlash/$(1),$(1),ai-br100,AIBR100,$(br100_mtd_size),Ai-BR)
+Image/Build/Profile/DB-WRT01=$(call BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01)
 Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp_n53,RP-N53)
 whr_300hp2_mtd_size=7012352
 Image/Build/Profile/WHR300HP2=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-300hp2,WHR-300HP2,$(whr_300hp2_mtd_size))
@@ -895,6 +896,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/MT7620a_MT7530,$(1))
 	$(call Image/Build/Profile/MT7620a_V22SG,$(1))
 	$(call Image/Build/Profile/AIBR100,$(1))
+	$(call Image/Build/Profile/DB-WRT01,$(1))
 	$(call Image/Build/Profile/CF-WR800N,$(1))
 	$(call Image/Build/Profile/RP-N53,$(1))
 	$(call Image/Build/Profile/DIR-810L,$(1))
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From br1 at einfach.org  Mon Aug 10 12:18:09 2015
From: br1 at einfach.org (Bruno Randolf)
Date: Mon, 10 Aug 2015 17:18:09 +0100
Subject: [OpenWrt-Devel] [PATCH] ar71xx: Add support for Black Swift
Message-ID: <1439223489-19053-1-git-send-email-br1@einfach.org>

Add support for the Black Swift board:
http://www.black-swift.com/

Took relevant parts and slightly adapted from:
https://github.com/blackswift/openwrt/blob/master/bsb.patch

Signed-off-by: Bruno Randolf <br1 at einfach.org>
---
 target/linux/ar71xx/base-files/etc/diag.sh         |  3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  4 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  7 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
 target/linux/ar71xx/config-4.1                     |  1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-bsb.c  | 83 ++++++++++++++++++++++
 .../ar71xx/generic/profiles/smartelectronics.mk    | 17 +++++
 target/linux/ar71xx/image/Makefile                 |  8 +++
 .../814-MIPS-ath79-add-blackswift.patch            | 45 ++++++++++++
 10 files changed, 172 insertions(+)
 mode change 100755 => 100644 target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-bsb.c
 create mode 100644 target/linux/ar71xx/generic/profiles/smartelectronics.mk
 create mode 100644 target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-blackswift.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..abb3f62 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -41,6 +41,9 @@ get_status_led() {
 	aw-nr580)
 		status_led="aw-nr580:green:ready"
 		;;
+	bsb)
+		status_led="bsb:red:sys"
+		;;
 	bullet-m | rocket-m | rocket-m-xw | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw)
 		status_led="ubnt:green:link4"
 		;;
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 2aced37..392be3a 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -55,6 +55,10 @@ ap147-010)
 	ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "ap147:green:wlan-2g" "phy0tpt"
 	;;
 
+bsb)
+	ucidef_set_led_default "sys" "SYS" "bsb:red:sys" "1"
+	;;
+
 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
old mode 100755
new mode 100644
index 2893e62..acaf03f
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -72,6 +72,13 @@ tl-wdr4900-v2)
 	ucidef_add_switch_vlan "switch0" "2" "1 6"
 	;;
 
+bsb)
+	ucidef_set_interfaces_lan_wan "eth1" "eth0"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0 1 3"
+	ucidef_set_interface_wlan
+	;;
+
 cpe510)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 	ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..359a5a6 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -676,6 +676,9 @@ ar71xx_board_detect() {
 	*"SMART-300")
 		name="smart-300"
 		;;
+	"Smart Electronics Black Swift board"*)
+		name="bsb"
+		;;
 	*TEW-632BRP)
 		name="tew-632brp"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..fb9add6 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -263,6 +263,7 @@ platform_check_image() {
 		return 1
 		;;
 
+	bsb | \
 	dir-825-b1 | \
 	tew-673gru)
 		dir825b_check_image "$1" && return 0
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 1e31a01..1951cbb 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -47,6 +47,7 @@ CONFIG_ATH79_MACH_AP96=y
 CONFIG_ATH79_MACH_ARCHER_C7=y
 CONFIG_ATH79_MACH_AW_NR580=y
 CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
+CONFIG_ATH79_MACH_BSB=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-bsb.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-bsb.c
new file mode 100644
index 0000000..9f9be02
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-bsb.c
@@ -0,0 +1,83 @@
+/*
+ *  Smart Electronics Black Swift board support
+ *
+ *  Copyright (C) 2014 Dmitriy Zherebkov dzh at black-swift.com
+ *
+ *  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.
+ */
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-spi.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define BSB_GPIO_LED_SYS		27
+
+#define BSB_GPIO_BTN_RESET		11
+
+#define BSB_KEYS_POLL_INTERVAL		20	/* msecs */
+#define BSB_KEYS_DEBOUNCE_INTERVAL	(3 * BSB_KEYS_POLL_INTERVAL)
+
+#define BSB_MAC_OFFSET			0x0000
+#define BSB_CALDATA_OFFSET		0x1000
+
+static struct gpio_led bsb_leds_gpio[] __initdata = {
+	{
+		.name		= "bsb:red:sys",
+		.gpio		= BSB_GPIO_LED_SYS,
+		.active_low	= 1,
+	}
+};
+
+static struct gpio_keys_button bsb_gpio_keys[] __initdata = {
+	{
+		.desc		= "reset button",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = BSB_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= BSB_GPIO_BTN_RESET,
+		.active_low	= 1,
+	},
+};
+
+static void __init bsb_setup(void)
+{
+	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+
+	/* disable PHY_SWAP and PHY_ADDR_SWAP bits */
+	ath79_setup_ar933x_phy4_switch(false,false);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(bsb_leds_gpio),
+				 bsb_leds_gpio);
+	ath79_register_gpio_keys_polled(-1, BSB_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(bsb_gpio_keys),
+					bsb_gpio_keys);
+
+	ath79_register_usb();
+
+	ath79_register_m25p80(NULL);
+
+	ath79_init_mac(ath79_eth0_data.mac_addr, art + BSB_MAC_OFFSET, 1);
+	ath79_init_mac(ath79_eth1_data.mac_addr, art + BSB_MAC_OFFSET, 2);
+
+	ath79_register_mdio(0, 0x0);
+
+	ath79_register_eth(0);
+	ath79_register_eth(1);
+
+	ath79_register_wmac(art + BSB_CALDATA_OFFSET,
+			    art + BSB_MAC_OFFSET);
+}
+
+MIPS_MACHINE(ATH79_MACH_BSB, "BSB", "Smart Electronics Black Swift board",
+		bsb_setup);
+
diff --git a/target/linux/ar71xx/generic/profiles/smartelectronics.mk b/target/linux/ar71xx/generic/profiles/smartelectronics.mk
new file mode 100644
index 0000000..6d3dc8c
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/smartelectronics.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/BSB
+        NAME:=Smart Electronics Black Swift board
+        PACKAGES:=kmod-usb-core kmod-usb2
+endef
+
+define Profile/BSB/Description
+        Package set optimized for the Smart Electronics Black Swift board.
+endef
+
+$(eval $(call Profile,BSB))
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e894d78..a8d79f7 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -172,6 +172,14 @@ define Device/Default
   IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
+define Device/bsb
+  BOARDNAME = BSB
+  IMAGE_SIZE = 16000k
+  CONSOLE = ttyATH0,115200
+  MTDPARTS = spi0.0:128k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += bsb
+
 define Device/carambola2
   BOARDNAME = CARAMBOLA2
   IMAGE_SIZE = 16000k
diff --git a/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-blackswift.patch b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-blackswift.patch
new file mode 100644
index 0000000..6ec2a8f
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-blackswift.patch
@@ -0,0 +1,45 @@
+Index: linux-4.1.4/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.4.orig/arch/mips/ath79/Kconfig	2015-08-10 16:28:12.409834069 +0100
++++ linux-4.1.4/arch/mips/ath79/Kconfig	2015-08-10 16:30:16.341831945 +0100
+@@ -904,6 +904,16 @@
+ 	select ATH79_DEV_LEDS_GPIO
+ 	select ATH79_DEV_M25P80
+ 
++config ATH79_MACH_BSB
++	bool "Smart Electronics Black Swift board"
++	select SOC_AR933X
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_ARCHER_C7
+ 	bool "TP-LINK Archer C5/C7/TL-WDR4900 v2 board support"
+ 	select SOC_QCA955X
+Index: linux-4.1.4/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.4.orig/arch/mips/ath79/Makefile	2015-08-10 16:28:12.409834069 +0100
++++ linux-4.1.4/arch/mips/ath79/Makefile	2015-08-10 16:30:39.985831540 +0100
+@@ -56,6 +56,7 @@
+ obj-$(CONFIG_ATH79_MACH_ARCHER_C7)	+= mach-archer-c7.o
+ obj-$(CONFIG_ATH79_MACH_AW_NR580)	+= mach-aw-nr580.o
+ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)+= mach-bhu-bxu2000n2-a.o
++obj-$(CONFIG_ATH79_MACH_BSB)		+= mach-bsb.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+Index: linux-4.1.4/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.4.orig/arch/mips/ath79/machtypes.h	2015-08-10 16:28:12.409834069 +0100
++++ linux-4.1.4/arch/mips/ath79/machtypes.h	2015-08-10 16:31:13.693830962 +0100
+@@ -39,6 +39,7 @@
+ 	ATH79_MACH_ARCHER_C7,		/* TP-LINK Archer C7 board */
+ 	ATH79_MACH_AW_NR580,		/* AzureWave AW-NR580 */
+ 	ATH79_MACH_BHU_BXU2000N2_A1,	/* BHU BXU2000n-2 A1 */
++	ATH79_MACH_BSB,			/* Smart Electronics Black Swift board */
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From br1 at einfach.org  Mon Aug 10 12:18:28 2015
From: br1 at einfach.org (Bruno Randolf)
Date: Mon, 10 Aug 2015 17:18:28 +0100
Subject: [OpenWrt-Devel] [PATCH] CC: ar71xx: Add support for Black Swift
Message-ID: <1439223508-19540-1-git-send-email-br1@einfach.org>

Add support for the Black Swift board:
http://www.black-swift.com/

Took relevant parts and slightly adapted from:
https://github.com/blackswift/openwrt/blob/master/bsb.patch

Signed-off-by: Bruno Randolf <br1 at einfach.org>
---
 target/linux/ar71xx/base-files/etc/diag.sh         |  3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  4 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  7 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
 target/linux/ar71xx/config-3.18                    |  1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-bsb.c  | 83 ++++++++++++++++++++++
 .../ar71xx/generic/profiles/smartelectronics.mk    | 17 +++++
 target/linux/ar71xx/image/Makefile                 |  8 +++
 .../906-MIPS-ath79-add-blackswift.patch            | 45 ++++++++++++
 10 files changed, 172 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-bsb.c
 create mode 100644 target/linux/ar71xx/generic/profiles/smartelectronics.mk
 create mode 100644 target/linux/ar71xx/patches-3.18/906-MIPS-ath79-add-blackswift.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index d6c7ec9..ece7098 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -38,6 +38,9 @@ get_status_led() {
 	aw-nr580)
 		status_led="aw-nr580:green:ready"
 		;;
+	bsb)
+		status_led="bsb:red:sys"
+		;;
 	bullet-m | rocket-m | rocket-m-xw | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw)
 		status_led="ubnt:green:link4"
 		;;
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 ae45503..d628f1a 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -46,6 +46,10 @@ ap113)
 	ucidef_set_led_usbdev "usb" "USB" "ap113:green:usb" "1-1"
 	;;
 
+bsb)
+	ucidef_set_led_default "sys" "SYS" "bsb:red:sys" "1"
+	;;
+
 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 d577fc6..7e26886 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -64,6 +64,13 @@ tl-wdr4900-v2)
 	ucidef_add_switch_vlan "switch0" "2" "1 6"
 	;;
 
+bsb)
+	ucidef_set_interfaces_lan_wan "eth1" "eth0"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0 1 3"
+	ucidef_set_interface_wlan
+	;;
+
 cpe510)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 	ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 4c10ab2..cacf362 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -664,6 +664,9 @@ ar71xx_board_detect() {
 	*"SMART-300")
 		name="smart-300"
 		;;
+	"Smart Electronics Black Swift board"*)
+		name="bsb"
+		;;
 	*TEW-632BRP)
 		name="tew-632brp"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index f3dd61b..e5376ef 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -260,6 +260,7 @@ platform_check_image() {
 		return 1
 		;;
 
+	bsb | \
 	dir-825-b1 | \
 	tew-673gru)
 		dir825b_check_image "$1" && return 0
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 4f52332..d661aa7 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -43,6 +43,7 @@ CONFIG_ATH79_MACH_AW_NR580=y
 CONFIG_ATH79_MACH_ANTMINER_S1=y
 CONFIG_ATH79_MACH_ANTMINER_S3=y
 CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
+CONFIG_ATH79_MACH_BSB=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-bsb.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-bsb.c
new file mode 100644
index 0000000..9f9be02
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-bsb.c
@@ -0,0 +1,83 @@
+/*
+ *  Smart Electronics Black Swift board support
+ *
+ *  Copyright (C) 2014 Dmitriy Zherebkov dzh at black-swift.com
+ *
+ *  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.
+ */
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-spi.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define BSB_GPIO_LED_SYS		27
+
+#define BSB_GPIO_BTN_RESET		11
+
+#define BSB_KEYS_POLL_INTERVAL		20	/* msecs */
+#define BSB_KEYS_DEBOUNCE_INTERVAL	(3 * BSB_KEYS_POLL_INTERVAL)
+
+#define BSB_MAC_OFFSET			0x0000
+#define BSB_CALDATA_OFFSET		0x1000
+
+static struct gpio_led bsb_leds_gpio[] __initdata = {
+	{
+		.name		= "bsb:red:sys",
+		.gpio		= BSB_GPIO_LED_SYS,
+		.active_low	= 1,
+	}
+};
+
+static struct gpio_keys_button bsb_gpio_keys[] __initdata = {
+	{
+		.desc		= "reset button",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = BSB_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= BSB_GPIO_BTN_RESET,
+		.active_low	= 1,
+	},
+};
+
+static void __init bsb_setup(void)
+{
+	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+
+	/* disable PHY_SWAP and PHY_ADDR_SWAP bits */
+	ath79_setup_ar933x_phy4_switch(false,false);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(bsb_leds_gpio),
+				 bsb_leds_gpio);
+	ath79_register_gpio_keys_polled(-1, BSB_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(bsb_gpio_keys),
+					bsb_gpio_keys);
+
+	ath79_register_usb();
+
+	ath79_register_m25p80(NULL);
+
+	ath79_init_mac(ath79_eth0_data.mac_addr, art + BSB_MAC_OFFSET, 1);
+	ath79_init_mac(ath79_eth1_data.mac_addr, art + BSB_MAC_OFFSET, 2);
+
+	ath79_register_mdio(0, 0x0);
+
+	ath79_register_eth(0);
+	ath79_register_eth(1);
+
+	ath79_register_wmac(art + BSB_CALDATA_OFFSET,
+			    art + BSB_MAC_OFFSET);
+}
+
+MIPS_MACHINE(ATH79_MACH_BSB, "BSB", "Smart Electronics Black Swift board",
+		bsb_setup);
+
diff --git a/target/linux/ar71xx/generic/profiles/smartelectronics.mk b/target/linux/ar71xx/generic/profiles/smartelectronics.mk
new file mode 100644
index 0000000..6d3dc8c
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/smartelectronics.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/BSB
+        NAME:=Smart Electronics Black Swift board
+        PACKAGES:=kmod-usb-core kmod-usb2
+endef
+
+define Profile/BSB/Description
+        Package set optimized for the Smart Electronics Black Swift board.
+endef
+
+$(eval $(call Profile,BSB))
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 3c77465..bb5de17 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -120,6 +120,14 @@ define Device/Default
   IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
 endef
 
+define Device/bsb
+  BOARDNAME = BSB
+  IMAGE_SIZE = 16000k
+  CONSOLE = ttyATH0,115200
+  MTDPARTS = spi0.0:128k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += bsb
+
 define Device/carambola2
   BOARDNAME = CARAMBOLA2
   IMAGE_SIZE = 16000k
diff --git a/target/linux/ar71xx/patches-3.18/906-MIPS-ath79-add-blackswift.patch b/target/linux/ar71xx/patches-3.18/906-MIPS-ath79-add-blackswift.patch
new file mode 100644
index 0000000..15196bb
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.18/906-MIPS-ath79-add-blackswift.patch
@@ -0,0 +1,45 @@
+Index: linux-3.18.19/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-3.18.19.orig/arch/mips/ath79/Kconfig	2015-08-10 17:08:03.191320098 +0100
++++ linux-3.18.19/arch/mips/ath79/Kconfig	2015-08-10 17:08:03.195320098 +0100
+@@ -866,6 +866,16 @@
+ 	select ATH79_DEV_LEDS_GPIO
+ 	select ATH79_DEV_M25P80
+ 
++config ATH79_MACH_BSB
++	bool "Smart Electronics Black Swift board"
++	select SOC_AR933X
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_ARCHER_C7
+ 	bool "TP-LINK Archer C5/C7/TL-WDR4900 v2 board support"
+ 	select SOC_QCA955X
+Index: linux-3.18.19/arch/mips/ath79/Makefile
+===================================================================
+--- linux-3.18.19.orig/arch/mips/ath79/Makefile	2015-08-10 17:08:03.191320098 +0100
++++ linux-3.18.19/arch/mips/ath79/Makefile	2015-08-10 17:08:03.195320098 +0100
+@@ -54,6 +54,7 @@
+ obj-$(CONFIG_ATH79_MACH_ARCHER_C7)	+= mach-archer-c7.o
+ obj-$(CONFIG_ATH79_MACH_AW_NR580)	+= mach-aw-nr580.o
+ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)+= mach-bhu-bxu2000n2-a.o
++obj-$(CONFIG_ATH79_MACH_BSB)		+= mach-bsb.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+Index: linux-3.18.19/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-3.18.19.orig/arch/mips/ath79/machtypes.h	2015-08-10 17:08:03.191320098 +0100
++++ linux-3.18.19/arch/mips/ath79/machtypes.h	2015-08-10 17:10:41.455317386 +0100
+@@ -37,6 +37,7 @@
+ 	ATH79_MACH_ARCHER_C7,		/* TP-LINK Archer C7 board */
+ 	ATH79_MACH_AW_NR580,		/* AzureWave AW-NR580 */
+ 	ATH79_MACH_BHU_BXU2000N2_A1,	/* BHU BXU2000n-2 A1 */
++	ATH79_MACH_BSB,			/* Smart Electronics Black Swift board */
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From david at lang.hm  Mon Aug 10 12:45:44 2015
From: david at lang.hm (David Lang)
Date: Mon, 10 Aug 2015 09:45:44 -0700 (PDT)
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>

On Mon, 10 Aug 2015, John kerry wrote:

> I followed the same steps and its working too. But this i want in wireless
> config file, Because i dont want every time to add using GUI. So When i
> connect to another router also, no need to add one more. I mean to say it
> should be in default wireless config file.

what do you mean by "default wireless config file"

Once you have set it from the GUI, it is in the config files. The next time you 
boot it will use that config.

If you mean that you want it in the factory default config (for when you first 
flash the router or do a factory reset), then take the /etc/config/wireless and 
/etc/config/network files and add them to your build under /files

David Lang

> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm> wrote:
>
>> On Mon, 10 Aug 2015, John kerry wrote:
>>
>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>> From: John kerry <kerry9842 at gmail.com>
>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
>>> Wi-Fi
>>>     client/AP interfaces on one radio)
>>>
>>> Firstly i configure wireless config as below:
>>>
>>> config wifi-device 'wifi0'
>>>        option type 'qcawifi'
>>>        option macaddr '00:01:11:00:01:00'
>>>        option hwmode '11ng'
>>>        option txpower '17'
>>>        option htmode 'HT20'
>>>        option disabled '0'
>>>        option channel '1'
>>>
>>> config wifi-iface
>>>        option device 'wifi0'
>>>        option mode 'ap'
>>>        option ssid 'Testing_ap'
>>>        option network 'lan'
>>>        option encryption 'psk2'
>>>        option key 'Testing_ap'
>>>
>>> so its SSID was showing and able to connect any device to it.
>>>
>>> Then i scan the device and connect to one of it. While joining the network
>>> i selected Client(WDS) then the wireless config becomes like below:
>>>
>>
>> why don't you try following the steps in the video that you posted.
>>
>> first connect as a client, then add an additional interface and make the
>> second interface the AP for things to connect to.
>>
>> the order may make a difference.
>>
>> David Lang
>>
>>
>> config wifi-device 'wifi0'
>>>        option type 'qcawifi'
>>>        option macaddr '00:01:11:00:01:00'
>>>        option hwmode '11ng'
>>>        option txpower '17'
>>>        option htmode 'HT20'
>>>        option disabled '0'
>>>        option channel '1'
>>>
>>> config wifi-iface
>>>        option network 'wwan'
>>>        option ssid 'D_Link_Router'
>>>        option encryption 'psk2'
>>>        option device 'wifi0'
>>>        option mode 'sta'
>>>        option key 'Dlink_Router'
>>>        option wds '1'
>>>
>>> Then  i added one as shown in the video. Now its connected to router also
>>> and this add one also showing so i can connect to this also.
>>>
>>> But i am not getting how to keep this in default wireless config.
>>>
>>> Because every time we cant add one to configure like this. It should be
>>> like default should be in ap mode so any device we can connect, if its
>>> connected to another router also that SSID still should be visible and
>>> able
>>> to connect to this.
>>>
>>
>>
>>
>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com> wrote:
>>>
>>> When i try to configure based on video, its shows 2 one as client another
>>>> one as Master but i am not able to enable it . I mean to say wireless
>>>> becomes disable. If i enable it using GUI also its not happening.
>>>>
>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>>>>
>>>> What happens when you try to follow the video?
>>>>>
>>>>> Based on your comments, i'm guessing that things don't work when you try
>>>>> and configure the second network and have it with a different SSID than
>>>>> the
>>>>> first network that you put in client mode.
>>>>>
>>>>> Is this correct?
>>>>>
>>>>> David Lang
>>>>>
>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>
>>>>> Yes, When i am connecting to Another router its changed to Client mode.
>>>>>
>>>>>>
>>>>>> Can i configure this in repeater mode like its shows in below link:
>>>>>>
>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>
>>>>>>
>>>>>
>>>>
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
>>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Mon Aug 10 16:17:42 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Mon, 10 Aug 2015 13:17:42 -0700
Subject: [OpenWrt-Devel] [PATCH] ipq806x: disable DMA on the SPI flash
Message-ID: <1439237862-29637-1-git-send-email-mathieu@codeaurora.org>

Previous patch 6f2905eeb6ce5ddec8d12d677e1f377a940b537b enabled ADM in
the kernel, which causes a kernel panic when accessing the SPI flash.

As a workaround, We'll disable DMA for the flash for now. It was not
enabled previously anyway so we'll just leave it as is.

Reported-by: Jonas Gorski <jogo at openwrt.org>
Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch            | 13 -------------
 ...com-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch |  2 +-
 .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch    |  2 +-
 ...8-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index 64b0022..4d9e613 100644
--- a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -11,19 +11,6 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
  arch/arm/boot/dts/qcom-ipq8064.dtsi      | 21 +++++++++++++++++++++
  2 files changed, 25 insertions(+)
 
---- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -90,6 +90,10 @@
- 
- 				cs-gpios = <&qcom_pinmux 20 0>;
- 
-+				dmas = <&adm_dma 6>,
-+					<&adm_dma 5>;
-+				dma-names = "rx", "tx";
-+
- 				flash: m25p80 at 0 {
- 					compatible = "s25fl256s1";
- 					#address-cells = <1>;
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
 @@ -657,5 +657,25 @@
diff --git a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
index 94e4e6b..77be886 100644
--- a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
+++ b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -57,7 +57,7 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
  		};
  
  		gsbi at 16300000 {
-@@ -174,5 +199,19 @@
+@@ -170,5 +195,19 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 75ebfe6..da8286a 100644
--- a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -209,6 +219,34 @@
+@@ -205,6 +215,34 @@
  			nand-ecc-strength = <4>;
  			nand-bus-width = <8>;
  		};
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 72a9f8b..8cfc38b 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -247,6 +257,27 @@
+@@ -243,6 +253,27 @@
  				reg = <4>;
  			};
  		};
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From zajec5 at gmail.com  Mon Aug 10 19:57:24 2015
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Tue, 11 Aug 2015 01:57:24 +0200
Subject: [OpenWrt-Devel] [PATCH] base-files: rework reset button script to
	indicate factory reset
Message-ID: <1439251044-15693-1-git-send-email-zajec5@gmail.com>

With this change we let user know 5 seconds have passed and reset button
can be released (to trigger factory reset)

Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
---
 package/base-files/files/etc/rc.button/reset | 35 +++++++++++++++++-----------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset
index 3e24146..c6dc7cf 100755
--- a/package/base-files/files/etc/rc.button/reset
+++ b/package/base-files/files/etc/rc.button/reset
@@ -1,20 +1,27 @@
 #!/bin/sh
 
-[ "${ACTION}" = "released" ] || exit 0
-
 . /lib/functions.sh
 
-logger "$BUTTON pressed for $SEEN seconds"
-
-if [ "$SEEN" -lt 1 ]
-then
-	echo "REBOOT" > /dev/console
-	sync
-	reboot
-elif [ "$SEEN" -gt 5 ]
-then
-	echo "FACTORY RESET" > /dev/console
-	jffs2reset -y && reboot &
-fi
+case "$ACTION" in
+pressed)
+	return 5
+;;
+timeout)
+	. /etc/diag.sh
+	set_state failsafe
+;;
+released)
+	if [ "$SEEN" -lt 1 ]
+	then
+		echo "REBOOT" > /dev/console
+		sync
+		reboot
+	elif [ "$SEEN" -gt 5 ]
+	then
+		echo "FACTORY RESET" > /dev/console
+		jffs2reset -y && reboot &
+	fi
+;;
+esac
 
 return 0
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From yszhou4tech at gmail.com  Mon Aug 10 22:00:42 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Tue, 11 Aug 2015 10:00:42 +0800
Subject: [OpenWrt-Devel] [PATCH 1/1] [polarssl] Fix build failures due
 to PKG_NAME != dir name
In-Reply-To: <20150810153015.371DF23A1534@danielcent.thecshore.com>
References: <20150810153015.371DF23A1534@danielcent.thecshore.com>
Message-ID: <CAECwjAi4xEsDpQns65uMs0oO4woKrPHG6UOxwTnuhq4L2zDuqQ@mail.gmail.com>

On 2 August 2015 at 19:46, Daniel Dickinson
<openwrt at daniel.thecshore.com> wrote:
> Packages that depend on PolarSSL fail to build because polarssl's InstallDev
> section never actually gets executed because (prior to this patch) the package
> name does not match the subdir the package is in (presumably due to upstream
> name change).  As a workaround I have changed the package name back to
> polarssl and used a new variable SRC_PKG_NAME for the purposes of downloading
> the upstream tarball and creating PKG_BUILD_DIR.
>

Nice catch, but only setting PKG_BUILD_DIR should be enough to fix
this.  No need to introduce a new variable.

                yousong


> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
> ---
>  package/libs/polarssl/Makefile | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/package/libs/polarssl/Makefile b/package/libs/polarssl/Makefile
> index c7e6036..5d5e857 100644
> --- a/package/libs/polarssl/Makefile
> +++ b/package/libs/polarssl/Makefile
> @@ -7,15 +7,18 @@
>
>  include $(TOPDIR)/rules.mk
>
> -PKG_NAME:=mbedtls
> +PKG_NAME:=polarssl
> +SRC_PKG_NAME:=mbedtls
>  PKG_VERSION:=1.3.11
>  PKG_RELEASE:=2
>  PKG_USE_MIPS16:=0
>
> -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz
> +PKG_SOURCE:=$(SRC_PKG_NAME)-$(PKG_VERSION)-gpl.tgz
>  PKG_SOURCE_URL:=https://polarssl.org/download/
>  PKG_MD5SUM:=c02ce2e54862d678604794ee484fb59e
>
> +PKG_BUILD_DIR:=$(BUILD_DIR)/$(SRC_PKG_NAME)-$(PKG_VERSION)
> +
>  PKG_BUILD_PARALLEL:=1
>  PKG_LICENSE:=GPL-2.0+
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 10 22:13:12 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 10 Aug 2015 22:13:12 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [polarssl] Fix build failures due
 to PKG_NAME != dir name
In-Reply-To: <CAECwjAi4xEsDpQns65uMs0oO4woKrPHG6UOxwTnuhq4L2zDuqQ@mail.gmail.com>
References: <20150810153015.371DF23A1534@danielcent.thecshore.com>
 <CAECwjAi4xEsDpQns65uMs0oO4woKrPHG6UOxwTnuhq4L2zDuqQ@mail.gmail.com>
Message-ID: <55C95A38.8090502@daniel.thecshore.com>

On 2015-08-10 10:00 PM, Yousong Zhou wrote:
>
> Nice catch, but only setting PKG_BUILD_DIR should be enough to fix
> this.  No need to introduce a new variable.
>

Actually the source package is used *two* places.  For the download and 
for PKG_BUILD_DIR.  It's needed for the download because you need the 
upstream tarball name, and it is also used for PKG_BUILD_DIR because 
general convention (at least of F/LOSS) for source tarballs is to have a 
subdirectory with <upstream-package>-<version> in the tarball (which is 
why PKG_BUILD_DIR uses <upstream-package>-<version>, not for an 
OpenWrt-specific reason).

Regards,

Daniel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 10 22:58:37 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 10 Aug 2015 22:58:37 -0400
Subject: [OpenWrt-Devel] [PATCH 0/9] Resolved email/series creation issues:
	PowerCloud device support
Message-ID: <20150811030611.F266A23A1542@danielcent.thecshore.com>

Hi all,

Sorrry for all the noise; due to various issues with email and using the wrong starting commit when creating the patch series I am sending this patch series one last time.

This patch series is based on a Nov 2012 patch series for which permission was granted to release, but which was never reworked into a format sufficient to get incorporated into OpenWrt.

I have takes that patch series, updated based on more recent BSP patches in OpenWrt, and add some elbow grease and gotten what I think is a patch series that ought to be ready for inclusion, maybe even without the need for tweaking (unless non-DTS patches are no longer accepted even though the majority of ar71xx BSPs are not yet DTS).

Regards,

Daniel

Daniel Dickinson (9):
  CC PowerCloud CAP324 Kernel BSP
  CC PowerCloud CAP324 Image generation
  CC PowerCloud CAP324 OpenWrt configuration
  CC PowerCloud CR3000 Kernel BSP
  CC PowerCloud CR3000 image generation
  CC PowerCloud CR3000 OpenWrt configuration
  CC PowerCloud CR5000 Kernel BSP
  CC PowerCloud CR5000 image generation
  CC PowerCloud CR5000 OpenWrt configuration

 package/boot/uboot-envtools/files/ar71xx           |   3 +
 target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
 target/linux/ar71xx/config-4.1                     |   3 +
 target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
 target/linux/ar71xx/image/Makefile                 |  12 ++
 .../814-MIPS-ath79-add-cap324-support.patch        | 183 ++++++++++++++++
 .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
 .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
 12 files changed, 771 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From banglang.huang at foxmail.com  Mon Aug 10 23:09:21 2015
From: banglang.huang at foxmail.com (=?ISO-8859-1?B?VHltb24=?=)
Date: Tue, 11 Aug 2015 11:09:21 +0800
Subject: [OpenWrt-Devel] MT7621 board (512MB) high memory relevant issue.
Message-ID: <tencent_26BDED66742896B5534BCFDD@qq.com>

My testbed's memory is 512MB, but the memory showed to us is 448MB( init as BOOT_MEM_RAM) and the high memory is 0 K, why ?

And I found that if both the 448MB and other 64MB init as BOOT_MEM_RAM, the samba(pbsam-util accelerate) service will work with a low speed transmission(20MB/s) while it is 70MB/s when 448MB init as BOOT_MEM_RAM and the other 64MB init as BOOT_MEM_INIT_RAM.




below is the bootlog:

## Transferring control to Linux (at address 80001000) ...
## Giving linux memsize in MB, 512

Starting kernel ...


xxxBoxx For Ralink/MTK APSoC. Copyright 2013-2014 xxx Technology CHN


LINUX started...

THIS IS ASIC
[    0.000000] Linux version 3.14.49 (xxxx at xxxx) (gcc version 4.8.3 (xxxxx/Linaro GCC 4.8-2014.04 xxxx) ) #11 SMP Tue Aug 11 09:56:58 CST 2015
[    0.000000] MT7621: MPLL enabled.
[    0.000000] xxxxBox CPUID Module for Ralink/MTK SoC v1.1.
[    0.000000] MediaTek MT7621 pkg:BGA rev:1 eco:3 CPU:880MHz, Bus:293MHz Uart:50MHz
[    0.000000] CPU running in Little Endian
[    0.000000] Board VLAN:LLLLW 
[    0.000000] Flash:SPI Size: 32MB
[    0.000000] DRAM: 512MB DDR3 16 bits
[    0.000000] Kernel Support [PCI] [USB] 
[    0.000000] prom memory:512MB
[    0.000000] MT7621:Reserved highmem for 512MB DRAM 24000000
[    0.000000] GCMP present
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] Software DMA cache coherency
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 1c000000 @ 00000000 (usable)
[    0.000000]  memory: 04000000 @ 20000000 (usable after init)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x1bffffff]
[    0.000000]   HighMem  empty 
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x1bffffff]
[    0.000000]   node   0: [mem 0x20000000-0x23ffffff]
[    0.000000] Detected 3 available secondary CPU(s)
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.000000] PERCPU: Embedded 7 pages/cpu @81384000 s5696 r8192 d14784 u32768
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 113792
[    0.000000] Kernel command line: pause_on_oops=10 noresume  board=PBR-M1 console=ttyS1,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Writing ErrCtl register=00030004
[    0.000000] Readback ErrCtl register=00030004
[    0.000000] Memory: 450772K/458752K available (2673K kernel code, 141K rwdata, 508K rodata, 184K init, 289K bss, 7980K reserved, 0K highmem) 
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:256



------------------
Regards,

banglang huang
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150811/bdb3d043/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Mon Aug 10 23:27:12 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 10 Aug 2015 23:27:12 -0400
Subject: [OpenWrt-Devel] Mailman configuration issue?
Message-ID: <55C96B90.2070708@daniel.thecshore.com>

Hi,

I've noticed that mailman uses the timestamp in the email (which in the 
case of git format-patch is the timestamp of the commit) when adding 
emails to the archive list, rather than actual time the email arrived at 
the mailing list.

This is probably not ideal since it means email in the archives is 
actually not shown in the order of appearance on the list (although 
within threads keeping the thread is preferrable of course).

If this is just a configuration option in mailman it probably ought to e 
tweaked, otherwise this is actually discussion for the mailman list.

Regards,

Daniel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Tue Aug 11 03:51:38 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 11 Aug 2015 15:51:38 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508062248580.2597@nftneq.ynat.uz>
 <CAGUNxBGrapAth-HWiT5OQ+pFZABqVHVFzPqa03TLVM3a3gMF7w@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
Message-ID: <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>

Yes,

i can copy the config and build with this configuration,

for example now i have connected to some router, another time we can
connect to any router. So how i can fix the settings by default.

On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm> wrote:

> On Mon, 10 Aug 2015, John kerry wrote:
>
> I followed the same steps and its working too. But this i want in wireless
>> config file, Because i dont want every time to add using GUI. So When i
>> connect to another router also, no need to add one more. I mean to say it
>> should be in default wireless config file.
>>
>
> what do you mean by "default wireless config file"
>
> Once you have set it from the GUI, it is in the config files. The next
> time you boot it will use that config.
>
> If you mean that you want it in the factory default config (for when you
> first flash the router or do a factory reset), then take the
> /etc/config/wireless and /etc/config/network files and add them to your
> build under /files
>
> David Lang
>
>
> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm> wrote:
>>
>> On Mon, 10 Aug 2015, John kerry wrote:
>>>
>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>
>>>> From: John kerry <kerry9842 at gmail.com>
>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
>>>> Wi-Fi
>>>>     client/AP interfaces on one radio)
>>>>
>>>> Firstly i configure wireless config as below:
>>>>
>>>> config wifi-device 'wifi0'
>>>>        option type 'qcawifi'
>>>>        option macaddr '00:01:11:00:01:00'
>>>>        option hwmode '11ng'
>>>>        option txpower '17'
>>>>        option htmode 'HT20'
>>>>        option disabled '0'
>>>>        option channel '1'
>>>>
>>>> config wifi-iface
>>>>        option device 'wifi0'
>>>>        option mode 'ap'
>>>>        option ssid 'Testing_ap'
>>>>        option network 'lan'
>>>>        option encryption 'psk2'
>>>>        option key 'Testing_ap'
>>>>
>>>> so its SSID was showing and able to connect any device to it.
>>>>
>>>> Then i scan the device and connect to one of it. While joining the
>>>> network
>>>> i selected Client(WDS) then the wireless config becomes like below:
>>>>
>>>>
>>> why don't you try following the steps in the video that you posted.
>>>
>>> first connect as a client, then add an additional interface and make the
>>> second interface the AP for things to connect to.
>>>
>>> the order may make a difference.
>>>
>>> David Lang
>>>
>>>
>>> config wifi-device 'wifi0'
>>>
>>>>        option type 'qcawifi'
>>>>        option macaddr '00:01:11:00:01:00'
>>>>        option hwmode '11ng'
>>>>        option txpower '17'
>>>>        option htmode 'HT20'
>>>>        option disabled '0'
>>>>        option channel '1'
>>>>
>>>> config wifi-iface
>>>>        option network 'wwan'
>>>>        option ssid 'D_Link_Router'
>>>>        option encryption 'psk2'
>>>>        option device 'wifi0'
>>>>        option mode 'sta'
>>>>        option key 'Dlink_Router'
>>>>        option wds '1'
>>>>
>>>> Then  i added one as shown in the video. Now its connected to router
>>>> also
>>>> and this add one also showing so i can connect to this also.
>>>>
>>>> But i am not getting how to keep this in default wireless config.
>>>>
>>>> Because every time we cant add one to configure like this. It should be
>>>> like default should be in ap mode so any device we can connect, if its
>>>> connected to another router also that SSID still should be visible and
>>>> able
>>>> to connect to this.
>>>>
>>>>
>>>
>>>
>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com> wrote:
>>>>
>>>> When i try to configure based on video, its shows 2 one as client
>>>> another
>>>>
>>>>> one as Master but i am not able to enable it . I mean to say wireless
>>>>> becomes disable. If i enable it using GUI also its not happening.
>>>>>
>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>>>>>
>>>>> What happens when you try to follow the video?
>>>>>
>>>>>>
>>>>>> Based on your comments, i'm guessing that things don't work when you
>>>>>> try
>>>>>> and configure the second network and have it with a different SSID
>>>>>> than
>>>>>> the
>>>>>> first network that you put in client mode.
>>>>>>
>>>>>> Is this correct?
>>>>>>
>>>>>> David Lang
>>>>>>
>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>
>>>>>> Yes, When i am connecting to Another router its changed to Client
>>>>>> mode.
>>>>>>
>>>>>>
>>>>>>> Can i configure this in repeater mode like its shows in below link:
>>>>>>>
>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>> _______________________________________________
>>> openwrt-devel mailing list
>>> openwrt-devel at lists.openwrt.org
>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>
>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150811/3ae0b867/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Tue Aug 11 04:30:09 2015
From: david at lang.hm (David Lang)
Date: Tue, 11 Aug 2015 01:30:09 -0700 (PDT)
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>

you have a working config

but you want to do something by default

what you want to do is different at different times.

what is it that you want to be the default? when do you want this default to 
apply? This isn't clear.

David Lang

On Tue, 11 Aug 2015, John kerry wrote:

> Date: Tue, 11 Aug 2015 15:51:38 +0800
> From: John kerry <kerry9842 at gmail.com>
> To: David Lang <david at lang.hm>
> Cc: Alex Weedy <weedy2887 at gmail.com>,
>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
>     Wi-Fi client/AP interfaces on one radio)
> 
> Yes,
>
> i can copy the config and build with this configuration,
>
> for example now i have connected to some router, another time we can
> connect to any router. So how i can fix the settings by default.
>
> On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm> wrote:
>
>> On Mon, 10 Aug 2015, John kerry wrote:
>>
>> I followed the same steps and its working too. But this i want in wireless
>>> config file, Because i dont want every time to add using GUI. So When i
>>> connect to another router also, no need to add one more. I mean to say it
>>> should be in default wireless config file.
>>>
>>
>> what do you mean by "default wireless config file"
>>
>> Once you have set it from the GUI, it is in the config files. The next
>> time you boot it will use that config.
>>
>> If you mean that you want it in the factory default config (for when you
>> first flash the router or do a factory reset), then take the
>> /etc/config/wireless and /etc/config/network files and add them to your
>> build under /files
>>
>> David Lang
>>
>>
>> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm> wrote:
>>>
>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>
>>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>>
>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
>>>>> Wi-Fi
>>>>>     client/AP interfaces on one radio)
>>>>>
>>>>> Firstly i configure wireless config as below:
>>>>>
>>>>> config wifi-device 'wifi0'
>>>>>        option type 'qcawifi'
>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>        option hwmode '11ng'
>>>>>        option txpower '17'
>>>>>        option htmode 'HT20'
>>>>>        option disabled '0'
>>>>>        option channel '1'
>>>>>
>>>>> config wifi-iface
>>>>>        option device 'wifi0'
>>>>>        option mode 'ap'
>>>>>        option ssid 'Testing_ap'
>>>>>        option network 'lan'
>>>>>        option encryption 'psk2'
>>>>>        option key 'Testing_ap'
>>>>>
>>>>> so its SSID was showing and able to connect any device to it.
>>>>>
>>>>> Then i scan the device and connect to one of it. While joining the
>>>>> network
>>>>> i selected Client(WDS) then the wireless config becomes like below:
>>>>>
>>>>>
>>>> why don't you try following the steps in the video that you posted.
>>>>
>>>> first connect as a client, then add an additional interface and make the
>>>> second interface the AP for things to connect to.
>>>>
>>>> the order may make a difference.
>>>>
>>>> David Lang
>>>>
>>>>
>>>> config wifi-device 'wifi0'
>>>>
>>>>>        option type 'qcawifi'
>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>        option hwmode '11ng'
>>>>>        option txpower '17'
>>>>>        option htmode 'HT20'
>>>>>        option disabled '0'
>>>>>        option channel '1'
>>>>>
>>>>> config wifi-iface
>>>>>        option network 'wwan'
>>>>>        option ssid 'D_Link_Router'
>>>>>        option encryption 'psk2'
>>>>>        option device 'wifi0'
>>>>>        option mode 'sta'
>>>>>        option key 'Dlink_Router'
>>>>>        option wds '1'
>>>>>
>>>>> Then  i added one as shown in the video. Now its connected to router
>>>>> also
>>>>> and this add one also showing so i can connect to this also.
>>>>>
>>>>> But i am not getting how to keep this in default wireless config.
>>>>>
>>>>> Because every time we cant add one to configure like this. It should be
>>>>> like default should be in ap mode so any device we can connect, if its
>>>>> connected to another router also that SSID still should be visible and
>>>>> able
>>>>> to connect to this.
>>>>>
>>>>>
>>>>
>>>>
>>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com> wrote:
>>>>>
>>>>> When i try to configure based on video, its shows 2 one as client
>>>>> another
>>>>>
>>>>>> one as Master but i am not able to enable it . I mean to say wireless
>>>>>> becomes disable. If i enable it using GUI also its not happening.
>>>>>>
>>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>>>>>>
>>>>>> What happens when you try to follow the video?
>>>>>>
>>>>>>>
>>>>>>> Based on your comments, i'm guessing that things don't work when you
>>>>>>> try
>>>>>>> and configure the second network and have it with a different SSID
>>>>>>> than
>>>>>>> the
>>>>>>> first network that you put in client mode.
>>>>>>>
>>>>>>> Is this correct?
>>>>>>>
>>>>>>> David Lang
>>>>>>>
>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>
>>>>>>> Yes, When i am connecting to Another router its changed to Client
>>>>>>> mode.
>>>>>>>
>>>>>>>
>>>>>>>> Can i configure this in repeater mode like its shows in below link:
>>>>>>>>
>>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>> openwrt-devel mailing list
>>>> openwrt-devel at lists.openwrt.org
>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>
>>>>
>>>>
>>>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Tue Aug 11 05:05:21 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Tue, 11 Aug 2015 12:05:21 +0300
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
In-Reply-To: <55C8BA4A.1010901@inf.h-brs.de>
References: <55C08938.6030507@inf.h-brs.de>
 <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>
 <CA+U=Dsony4dUX2zK3cM07v7v=saskAcW8qh8GswZBRcrXDVKfg@mail.gmail.com>
 <55C20742.6000607@inf.h-brs.de>
 <CA+U=DspR42pDEe+aqZgoNgbuKCLjHaWfH=RBXyziUmrdxHD6Fg@mail.gmail.com>
 <CA+U=Dsp02P33TROP7PUosOwZ2BqwgCuH4wZbd1TZNC9=YE_5dA@mail.gmail.com>
 <55C8BA4A.1010901@inf.h-brs.de>
Message-ID: <CA+U=DsqDxj763m_6XOc93_h=eL3yRkDpAgSCc0rgcz3EBZtOfA@mail.gmail.com>

Will make some more time to try this.

Thanks for testing

On Mon, Aug 10, 2015 at 5:50 PM, Florian Siebertz <
florian.siebertz at inf.h-brs.de> wrote:

> Today I compiled with your fork and everything seemed fine at first.
> After flashing to a TP-Link WDR3600 Router I can see the ovsdb-server
> running
> and <ovs-vsctl show> reveals the usual String ID.
>
> When I try to add a bridge with <ovs-vsctl add-br br0> the command does
> not return
> to the input prompt. After pressing ctrl+c and checking <ovs-vsctl show>
> it seems like
> the bridge was created. The same happens when adding ports or changing any
> settings on the bridge.
>
> Additionally, the switch does not connect to the controller. I'm not sure
> how to debug
> this further, but if you have an idea I will test it on the device.
>
>
> Am 07.08.2015 um 16:14 schrieb Alexandru Ardelean:
> > @Florian
> > So, I took some time today to patch a bit of support for OVS to compile
> on
> > OpenWRT with kernel 4.1
> >
> > Can you pull this from my fork and test it out a bit ?
> > Branch is here: https://github.com/commodo/packages/tree/ovs-kernel-4.1
> > Commit is this one:
> >
> https://github.com/commodo/packages/commit/de519aac8c751cd8744d839efd071cdf02891db1
> >
> > If you need a tarball, send me a message and I can prepare one, or maybe
> > Github has a download zip/tar button per branches somewhere not sure.
> >
> > Anyway, I'd appreciate if you took the time to test it out a bit.
> > I'm a bit swamped and don't have time to do proper testing ; to be
> honest I
> > just made it build, and I haven't managed to get hold of a device with
> > which to actually test it.
> > If all is good I'll add a PR into the official OpenWRT packages.
> >
> > Thanks
> >
> > On Wed, Aug 5, 2015 at 5:18 PM, Alexandru Ardelean <
> ardeleanalex at gmail.com>
> > wrote:
> >
> >> I will admit I only tested with x86.
> >> I ASSumed that it's on kernel 4.1.
> >>
> >> Will check again and try to spin up a patch for kernel 4.1.
> >>
> >> On Wed, Aug 5, 2015 at 3:53 PM, Florian Siebertz <
> >> florian.siebertz at inf.h-brs.de> wrote:
> >>
> >>> Thank you for your work, i really appreciate it.
> >>> Now the package is back, but at compilation it fails when
> >>> checking against the kernel version:
> >>>
> >>> (cd
> >>>
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/./;
> >>> if [ -x ./configure ]; then find
> >>>
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
> >>> -name config.guess | xargs -r chmod u+w; find
> >>>
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
> >>> -name config.guess | xargs -r -n1 cp --remove-destination
> >>> /home/administrator/openwrt/scripts/config.guess; find
> >>>
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
> >>> -name config.sub | xargs -r chmod u+w; find
> >>>
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
> >>> -name config.sub | xargs -r -n1 cp --remove-destination
> >>> /home/administrator/openwrt/scripts/config.sub;
> >>> AR="mips-openwrt-linux-musl-gcc-ar" AS="mips-openwrt-linux-musl-gcc -c
> -Os
> >>> -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves
> >>> -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float
> -Wformat !
> >>>  -Werror=fo
> >>> rmat-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now
> >>> -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99"
> >>> LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm"
> >>> CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc"
> >>> CXX="mips-openwrt-linux-musl-g++"
> >>> RANLIB="mips-openwrt-linux-musl-gcc-ranlib"
> >>> STRIP=mips-openwrt-linux-musl-strip
> OBJCOPY=mips-openwrt-linux-musl-objcopy
> >>> OBJDUMP=mips-openwrt-linux-musl-objdump
> SIZE=mips-openwrt-linux-musl-size
> >>> CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc
> >>> -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable
> >>> -msoft-float -Wformat -Werror=format-security -fstack-protector
> >>> -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -mno-mips16
> >>> -mno-interlink-mips16 -flto -std=gnu99 " CXXFLAGS="-Os -pipe
> >>> -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves
> -fhonour-copts
> >>> -Wno-error=unused-but-set-variable -msoft-float -Wformat
> >>> -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1!
> >>>   -Wl,-z,no
> >>> w -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99 "
> >>>
> CPPFLAGS="-I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/include
> >>>
> -I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/include
> >>>
> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/include
> >>>
> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/fortify
> >>>
> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include
> >>> "
> >>>
> LDFLAGS="-L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/lib
> >>>
> -L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/lib
> >>>
> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/lib
> >>>
> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/lib
> >>> -znow -zrelro "   ./configure --target=mips-openwrt-linux
> >>> --host=mips-openwrt-linux --build!
> >>>  =x86_64-li
> >>> nux-gnu --program-prefix="" --program-suffix="" --prefix=/usr
> >>> --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
> >>> --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share
> >>> --localstatedir=/var --mandir=/usr/man --infodir=/usr/info
> --disable-nls
> >>>
> _python_sysroot="/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10"
> >>> _python_prefix="/usr" _python_exec_prefix="/usr"
> >>>
> --with-linux=/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
> >>> --with-rundir=/var/run --enable-ndebug --disable-ssl --enable-shared ;
> fi; )
> >>>
> >>> [...] (a bunch of checks)
> >>>
> >>> checking for kernel version... 4.1.3
> >>> configure: error: Linux kernel in
> >>>
> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
> >>> is version 4.1.3, but version newer than 4.0.x is not supported (please
> >>> refer to the FAQ for advice)
> >>> make[3]: ***
> >>>
> [/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/.configured_yyyyyyyy]
> >>> Error 1
> >>> make[3]: Leaving directory
> >>> `/home/administrator/openwrt/feeds/packages/net/openvswitch'
> >>> make[2]: *** [package/feeds/packages/openvswitch/compile] Error 2
> >>> make[2]: Leaving directory `/home/administrator/openwrt'
> >>> make[1]: ***
> >>>
> [/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile]
> >>> Error 2
> >>> make[1]: Leaving directory `/home/administrator/openwrt'
> >>> make: *** [world] Error 2
> >>>
> >>>
> >>>
> >>> Am 04.08.2015 um 16:08 schrieb Alexandru Ardelean:
> >>>> Took some 20-30 minutes to upgrade OVS and test it (with kernel 4.1).
> >>>> Seems to work fine so far.
> >>>>
> >>>> Please monitor this PR; after it's merged it should appear.
> >>>>
> >>>> On Tue, Aug 4, 2015 at 1:37 PM, Alexandru Ardelean <
> >>> ardeleanalex at gmail.com>
> >>>> wrote:
> >>>>
> >>>>> Well, OpenVSwitch is a bit behind on kernel support.
> >>>>> It's at 3.18 currently.
> >>>>> OpenWRT is at 4.1
> >>>>>
> >>>>> We'd need to do an upgrade of OVS to get it up to speed.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Tue, Aug 4, 2015 at 12:43 PM, Florian Siebertz <
> >>>>> florian.siebertz at inf.h-brs.de> wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> i noticed that the openvswitch package is not available in trunk at
> >>> the
> >>>>>> moment. It is not in the precompiled snapshots, neither can it be
> >>>>>> choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
> >>>>>> [update|install] -a).
> >>>>>>
> >>>>>> Does anyone know why and when it will be back?
> >>>>>>
> >>>>>> Thanks!
> >>>>>>
> >>>>>> Florian Siebertz
> >>>>>> _______________________________________________
> >>>>>> openwrt-devel mailing list
> >>>>>> openwrt-devel at lists.openwrt.org
> >>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>
> >>
> >>
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150811/8262bd13/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Tue Aug 11 05:34:53 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 11 Aug 2015 17:34:53 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
Message-ID: <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>

When i load firmware the wireless config will be like below:

config wifi-device 'wifi0'
        option type 'qcawifi'
        option macaddr '00:26:75:bd:37:24'
        option hwmode '11ng'
        option txpower '16'
        option htmode 'HT20'
        option disabled '0'
        option channel '1'

config wifi-iface
        option device 'wifi0'
        option mode 'ap'
        option ssid 'Test_ap'
        option network 'lan'
        option encryption 'psk2'
        option key 'Test_ap'
        option wds '1'

so it works as Access point, i can connect to it any devices. When i scan
it shows me list of devices then connect to anyone. then the wireless
config  will becomes like below:

config wifi-device 'wifi0'
        option type 'qcawifi'
        option macaddr '00:26:75:bd:37:24'
        option hwmode '11ng'
        option txpower '16'
        option htmode 'HT20'
        option disabled '0'
        option channel '1'

config wifi-iface
        option network 'wwan'
        option ssid 'D-link-Router'
        option encryption 'psk2'
        option device 'wifi0'
        option mode 'sta'
        option key '0010069039'
        option wds '1'

Then i add one more ap mode so wireless config becomes,
config wifi-device 'wifi0'
        option type 'qcawifi'
        option macaddr '00:26:75:bd:37:24'
        option hwmode '11ng'
        option txpower '16'
        option htmode 'HT20'
        option disabled '0'
        option channel '1'

config wifi-iface
       option network 'wwan'
        option ssid 'D-link-Router'
        option encryption 'psk2'
        option device 'wifi0'
        option mode 'sta'
        option key '0010069039'
        option wds '1'

config wifi-iface
        option device 'wifi0'
        option mode 'ap'
        option ssid 'Test_ap'
        option network 'lan'
        option encryption 'psk2'
        option key 'Test_ap'
        option wds '1'

This i added manually one ap mode.

So if i copy this config file, build and load this firmware, its load what
it was there so it shows one client which i was connected last time and one
AP which i added.

But now i cannot scan anymore and connect to new router instead of old
client.

This is the problem i am facing.

Basically i need to configure the wireless file for repeater mode.

So after connecting to another router this SSID still should be there and
other device can connect to it.

On Tue, Aug 11, 2015 at 4:30 PM, David Lang <david at lang.hm> wrote:

> you have a working config
>
> but you want to do something by default
>
> what you want to do is different at different times.
>
> what is it that you want to be the default? when do you want this default
> to apply? This isn't clear.
>
> David Lang
>
> On Tue, 11 Aug 2015, John kerry wrote:
>
> Date: Tue, 11 Aug 2015 15:51:38 +0800
>> From: John kerry <kerry9842 at gmail.com>
>> To: David Lang <david at lang.hm>
>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>> Multiple
>>
>>     Wi-Fi client/AP interfaces on one radio)
>>
>> Yes,
>>
>> i can copy the config and build with this configuration,
>>
>> for example now i have connected to some router, another time we can
>> connect to any router. So how i can fix the settings by default.
>>
>> On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm> wrote:
>>
>> On Mon, 10 Aug 2015, John kerry wrote:
>>>
>>> I followed the same steps and its working too. But this i want in
>>> wireless
>>>
>>>> config file, Because i dont want every time to add using GUI. So When i
>>>> connect to another router also, no need to add one more. I mean to say
>>>> it
>>>> should be in default wireless config file.
>>>>
>>>>
>>> what do you mean by "default wireless config file"
>>>
>>> Once you have set it from the GUI, it is in the config files. The next
>>> time you boot it will use that config.
>>>
>>> If you mean that you want it in the factory default config (for when you
>>> first flash the router or do a factory reset), then take the
>>> /etc/config/wireless and /etc/config/network files and add them to your
>>> build under /files
>>>
>>> David Lang
>>>
>>>
>>> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm> wrote:
>>>
>>>>
>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>
>>>>>
>>>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>>>
>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>> Multiple
>>>>>> Wi-Fi
>>>>>>     client/AP interfaces on one radio)
>>>>>>
>>>>>> Firstly i configure wireless config as below:
>>>>>>
>>>>>> config wifi-device 'wifi0'
>>>>>>        option type 'qcawifi'
>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>        option hwmode '11ng'
>>>>>>        option txpower '17'
>>>>>>        option htmode 'HT20'
>>>>>>        option disabled '0'
>>>>>>        option channel '1'
>>>>>>
>>>>>> config wifi-iface
>>>>>>        option device 'wifi0'
>>>>>>        option mode 'ap'
>>>>>>        option ssid 'Testing_ap'
>>>>>>        option network 'lan'
>>>>>>        option encryption 'psk2'
>>>>>>        option key 'Testing_ap'
>>>>>>
>>>>>> so its SSID was showing and able to connect any device to it.
>>>>>>
>>>>>> Then i scan the device and connect to one of it. While joining the
>>>>>> network
>>>>>> i selected Client(WDS) then the wireless config becomes like below:
>>>>>>
>>>>>>
>>>>>> why don't you try following the steps in the video that you posted.
>>>>>
>>>>> first connect as a client, then add an additional interface and make
>>>>> the
>>>>> second interface the AP for things to connect to.
>>>>>
>>>>> the order may make a difference.
>>>>>
>>>>> David Lang
>>>>>
>>>>>
>>>>> config wifi-device 'wifi0'
>>>>>
>>>>>        option type 'qcawifi'
>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>        option hwmode '11ng'
>>>>>>        option txpower '17'
>>>>>>        option htmode 'HT20'
>>>>>>        option disabled '0'
>>>>>>        option channel '1'
>>>>>>
>>>>>> config wifi-iface
>>>>>>        option network 'wwan'
>>>>>>        option ssid 'D_Link_Router'
>>>>>>        option encryption 'psk2'
>>>>>>        option device 'wifi0'
>>>>>>        option mode 'sta'
>>>>>>        option key 'Dlink_Router'
>>>>>>        option wds '1'
>>>>>>
>>>>>> Then  i added one as shown in the video. Now its connected to router
>>>>>> also
>>>>>> and this add one also showing so i can connect to this also.
>>>>>>
>>>>>> But i am not getting how to keep this in default wireless config.
>>>>>>
>>>>>> Because every time we cant add one to configure like this. It should
>>>>>> be
>>>>>> like default should be in ap mode so any device we can connect, if its
>>>>>> connected to another router also that SSID still should be visible and
>>>>>> able
>>>>>> to connect to this.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>> When i try to configure based on video, its shows 2 one as client
>>>>>> another
>>>>>>
>>>>>> one as Master but i am not able to enable it . I mean to say wireless
>>>>>>> becomes disable. If i enable it using GUI also its not happening.
>>>>>>>
>>>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>>>>>>>
>>>>>>> What happens when you try to follow the video?
>>>>>>>
>>>>>>>
>>>>>>>> Based on your comments, i'm guessing that things don't work when you
>>>>>>>> try
>>>>>>>> and configure the second network and have it with a different SSID
>>>>>>>> than
>>>>>>>> the
>>>>>>>> first network that you put in client mode.
>>>>>>>>
>>>>>>>> Is this correct?
>>>>>>>>
>>>>>>>> David Lang
>>>>>>>>
>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>
>>>>>>>> Yes, When i am connecting to Another router its changed to Client
>>>>>>>> mode.
>>>>>>>>
>>>>>>>>
>>>>>>>> Can i configure this in repeater mode like its shows in below link:
>>>>>>>>>
>>>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>
>>>>>> openwrt-devel mailing list
>>>>> openwrt-devel at lists.openwrt.org
>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150811/3c094116/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Tue Aug 11 09:20:58 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 11 Aug 2015 21:20:58 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508081602190.2141@nftneq.ynat.uz>
 <CAGUNxBGq7PABLM4kp6-7gLT+cEs-5Any2Q_31_=fP7AgaLHZCw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
Message-ID: <CAGUNxBH09gzGJEA-4_jr4C=T5QgdvN4zOuzYt3QT2bNBn8zGYQ@mail.gmail.com>

Hi,

How to config wireless config file for repeater mode. I am not able to
config.

On Tue, Aug 11, 2015 at 5:34 PM, John kerry <kerry9842 at gmail.com> wrote:

> When i load firmware the wireless config will be like below:
>
> config wifi-device 'wifi0'
>         option type 'qcawifi'
>         option macaddr '00:26:75:bd:37:24'
>         option hwmode '11ng'
>         option txpower '16'
>         option htmode 'HT20'
>         option disabled '0'
>         option channel '1'
>
> config wifi-iface
>         option device 'wifi0'
>         option mode 'ap'
>         option ssid 'Test_ap'
>         option network 'lan'
>         option encryption 'psk2'
>         option key 'Test_ap'
>         option wds '1'
>
> so it works as Access point, i can connect to it any devices. When i scan
> it shows me list of devices then connect to anyone. then the wireless
> config  will becomes like below:
>
> config wifi-device 'wifi0'
>         option type 'qcawifi'
>         option macaddr '00:26:75:bd:37:24'
>         option hwmode '11ng'
>         option txpower '16'
>         option htmode 'HT20'
>         option disabled '0'
>         option channel '1'
>
> config wifi-iface
>         option network 'wwan'
>         option ssid 'D-link-Router'
>         option encryption 'psk2'
>         option device 'wifi0'
>         option mode 'sta'
>         option key '0010069039'
>         option wds '1'
>
> Then i add one more ap mode so wireless config becomes,
> config wifi-device 'wifi0'
>         option type 'qcawifi'
>         option macaddr '00:26:75:bd:37:24'
>         option hwmode '11ng'
>         option txpower '16'
>         option htmode 'HT20'
>         option disabled '0'
>         option channel '1'
>
> config wifi-iface
>        option network 'wwan'
>         option ssid 'D-link-Router'
>         option encryption 'psk2'
>         option device 'wifi0'
>         option mode 'sta'
>         option key '0010069039'
>         option wds '1'
>
> config wifi-iface
>         option device 'wifi0'
>         option mode 'ap'
>         option ssid 'Test_ap'
>         option network 'lan'
>         option encryption 'psk2'
>         option key 'Test_ap'
>         option wds '1'
>
> This i added manually one ap mode.
>
> So if i copy this config file, build and load this firmware, its load what
> it was there so it shows one client which i was connected last time and one
> AP which i added.
>
> But now i cannot scan anymore and connect to new router instead of old
> client.
>
> This is the problem i am facing.
>
> Basically i need to configure the wireless file for repeater mode.
>
> So after connecting to another router this SSID still should be there and
> other device can connect to it.
>
> On Tue, Aug 11, 2015 at 4:30 PM, David Lang <david at lang.hm> wrote:
>
>> you have a working config
>>
>> but you want to do something by default
>>
>> what you want to do is different at different times.
>>
>> what is it that you want to be the default? when do you want this default
>> to apply? This isn't clear.
>>
>> David Lang
>>
>> On Tue, 11 Aug 2015, John kerry wrote:
>>
>> Date: Tue, 11 Aug 2015 15:51:38 +0800
>>> From: John kerry <kerry9842 at gmail.com>
>>> To: David Lang <david at lang.hm>
>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>> Multiple
>>>
>>>     Wi-Fi client/AP interfaces on one radio)
>>>
>>> Yes,
>>>
>>> i can copy the config and build with this configuration,
>>>
>>> for example now i have connected to some router, another time we can
>>> connect to any router. So how i can fix the settings by default.
>>>
>>> On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm> wrote:
>>>
>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>
>>>> I followed the same steps and its working too. But this i want in
>>>> wireless
>>>>
>>>>> config file, Because i dont want every time to add using GUI. So When i
>>>>> connect to another router also, no need to add one more. I mean to say
>>>>> it
>>>>> should be in default wireless config file.
>>>>>
>>>>>
>>>> what do you mean by "default wireless config file"
>>>>
>>>> Once you have set it from the GUI, it is in the config files. The next
>>>> time you boot it will use that config.
>>>>
>>>> If you mean that you want it in the factory default config (for when you
>>>> first flash the router or do a factory reset), then take the
>>>> /etc/config/wireless and /etc/config/network files and add them to your
>>>> build under /files
>>>>
>>>> David Lang
>>>>
>>>>
>>>> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm> wrote:
>>>>
>>>>>
>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>
>>>>>>
>>>>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>>>>
>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>> Multiple
>>>>>>> Wi-Fi
>>>>>>>     client/AP interfaces on one radio)
>>>>>>>
>>>>>>> Firstly i configure wireless config as below:
>>>>>>>
>>>>>>> config wifi-device 'wifi0'
>>>>>>>        option type 'qcawifi'
>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>        option hwmode '11ng'
>>>>>>>        option txpower '17'
>>>>>>>        option htmode 'HT20'
>>>>>>>        option disabled '0'
>>>>>>>        option channel '1'
>>>>>>>
>>>>>>> config wifi-iface
>>>>>>>        option device 'wifi0'
>>>>>>>        option mode 'ap'
>>>>>>>        option ssid 'Testing_ap'
>>>>>>>        option network 'lan'
>>>>>>>        option encryption 'psk2'
>>>>>>>        option key 'Testing_ap'
>>>>>>>
>>>>>>> so its SSID was showing and able to connect any device to it.
>>>>>>>
>>>>>>> Then i scan the device and connect to one of it. While joining the
>>>>>>> network
>>>>>>> i selected Client(WDS) then the wireless config becomes like below:
>>>>>>>
>>>>>>>
>>>>>>> why don't you try following the steps in the video that you posted.
>>>>>>
>>>>>> first connect as a client, then add an additional interface and make
>>>>>> the
>>>>>> second interface the AP for things to connect to.
>>>>>>
>>>>>> the order may make a difference.
>>>>>>
>>>>>> David Lang
>>>>>>
>>>>>>
>>>>>> config wifi-device 'wifi0'
>>>>>>
>>>>>>        option type 'qcawifi'
>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>        option hwmode '11ng'
>>>>>>>        option txpower '17'
>>>>>>>        option htmode 'HT20'
>>>>>>>        option disabled '0'
>>>>>>>        option channel '1'
>>>>>>>
>>>>>>> config wifi-iface
>>>>>>>        option network 'wwan'
>>>>>>>        option ssid 'D_Link_Router'
>>>>>>>        option encryption 'psk2'
>>>>>>>        option device 'wifi0'
>>>>>>>        option mode 'sta'
>>>>>>>        option key 'Dlink_Router'
>>>>>>>        option wds '1'
>>>>>>>
>>>>>>> Then  i added one as shown in the video. Now its connected to router
>>>>>>> also
>>>>>>> and this add one also showing so i can connect to this also.
>>>>>>>
>>>>>>> But i am not getting how to keep this in default wireless config.
>>>>>>>
>>>>>>> Because every time we cant add one to configure like this. It should
>>>>>>> be
>>>>>>> like default should be in ap mode so any device we can connect, if
>>>>>>> its
>>>>>>> connected to another router also that SSID still should be visible
>>>>>>> and
>>>>>>> able
>>>>>>> to connect to this.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>>
>>>>>>> When i try to configure based on video, its shows 2 one as client
>>>>>>> another
>>>>>>>
>>>>>>> one as Master but i am not able to enable it . I mean to say wireless
>>>>>>>> becomes disable. If i enable it using GUI also its not happening.
>>>>>>>>
>>>>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>>>>>>>>
>>>>>>>> What happens when you try to follow the video?
>>>>>>>>
>>>>>>>>
>>>>>>>>> Based on your comments, i'm guessing that things don't work when
>>>>>>>>> you
>>>>>>>>> try
>>>>>>>>> and configure the second network and have it with a different SSID
>>>>>>>>> than
>>>>>>>>> the
>>>>>>>>> first network that you put in client mode.
>>>>>>>>>
>>>>>>>>> Is this correct?
>>>>>>>>>
>>>>>>>>> David Lang
>>>>>>>>>
>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>
>>>>>>>>> Yes, When i am connecting to Another router its changed to Client
>>>>>>>>> mode.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Can i configure this in repeater mode like its shows in below link:
>>>>>>>>>>
>>>>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>
>>>>>>> openwrt-devel mailing list
>>>>>> openwrt-devel at lists.openwrt.org
>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150811/e26bc597/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From m.storchak at gmail.com  Tue Aug 11 13:13:46 2015
From: m.storchak at gmail.com (Maxim Storchak)
Date: Tue, 11 Aug 2015 20:13:46 +0300
Subject: [OpenWrt-Devel] issues with service jailing
Message-ID: <55CA2D4A.5020503@gmail.com>

Hi,

I'm trying to build latest trunk with CONFIG_PROCD_JAIL_SUPPORT=y, and
it appears that ujail can't run anything in jail. The reason is that
/lib/ld-musl-mips-sf.so.1 (I have ar71xx router) is not present in jail
root. As I understand, ujail parses ELF headers of the target binary and
bind-mounts all libs into jail. All but not that one. Unfortunately I
can't fix it myself, so I'd like core devs to take a look at this issue.

Reproduction:
root at OpenWrt:~# ldd /bin/busybox
        /lib/ld-musl-mips-sf.so.1 (0x55c30000)
        librpc.so => /lib/librpc.so (0x77b8a000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x77b66000)
        libc.so => /lib/ld-musl-mips-sf.so.1 (0x55c30000)
root at OpenWrt:~# ls -la /lib/ld-musl-mips-sf.so.1
lrwxrwxrwx 1 root root 7 Aug 10 20:43 /lib/ld-musl-mips-sf.so.1 -> libc.so

root at OpenWrt:~# /sbin/ujail -n busybox  -P /tmp/.jail/busybox --
/bin/busybox ash
jail: spawning /bin/busybox
jail: failed to spawn child /bin/busybox: No such file or directory
jail: child (2) exited: 65280
jail: namespace (3319) exited: 10

root at OpenWrt:~# /sbin/ujail -n busybox  -P /tmp/.jail/busybox -r
/lib/ld-musl-mips-sf.so.1  -- /bin/busybox ash
jail: spawning /bin/busybox
/ # /bin/busybox ls /
bin  lib  usr


One more request would be to add support for "helper" binaries. Consider
this case: I want to run transmission with idle IO priority. At the
moment procd doesn't support ionoce, so I try to run /bin/ionice -c3
/usr/bin/transmission-daemon. In this case ujail correctly creates jail
for ionice, but everything required to run transmission-daemon has to be
added by hands.
It would be nice to be able to pass single reference to a binary
(/usr/bin/transmission-daemon in this case) and have ujail automatically
pull all required libs. init subsystem should export this ability as
something like procd_add_jail_mount_bin.

Reproduction:
root at OpenWrt:~# /sbin/ujail -n busybox  -P /tmp/.jail/busybox -r
/lib/ld-musl-mips-sf.so.1  -- /bin/ionice -c3 /usr/bin/wget-ssl
jail: spawning /bin/ionice
ionice: can't execute '/usr/bin/wget-ssl': No such file or directory
jail: child (2) exited: 32512
jail: namespace (3375) exited: 10

root at OpenWrt:~# /sbin/ujail -n busybox  -P /tmp/.jail/busybox -r
/lib/ld-musl-mips-sf.so.1 -r /usr/lib/libpcre.so.1 -r
/usr/lib/libssl.so.1.0.0 -r /usr/lib/libcrypto.so.1.0.0 -r
/usr/lib/libz.so.1 -r /usr/bin/wget-ssl -- /bin/ionice -c3 /usr/bin/wget-ssl
jail: spawning /bin/ionice
wget-ssl: missing URL
Usage: wget-ssl [OPTION]... [URL]...

Try `wget-ssl --help' for more options.
jail: child (2) exited: 256
jail: namespace (3393) exited: 10


With patch applied:
root at OpenWrt:~# /tmp/ujail -n busybox -b /usr/bin/wget-ssl -b
/usr/bin/curl -b /usr/bin/tmux -P /tmp/.jail/busybox -r
/lib/ld-musl-mips-sf.so.1  -- /bin/busybox ls -1 /lib /usr/lib
jail: spawning /bin/busybox
/lib:
ld-musl-mips-sf.so.1
libblobmsg_json.so
libc.so
libgcc_s.so.1
libpreload-seccomp.so
librpc.so
libubox.so

/usr/lib:
libcrypto.so.1.0.0
libcurl.so.4
libevent-2.0.so.5
libjson-c.so.2
libncurses.so.5
libpcre.so.1
libssl.so.1.0.0
libz.so.1
jail: child (2) exited: 0
jail: namespace (4500) exited: 10


-- 
Best regards,
Maxim Storchak
mailto:m.storchak at gmail.com
-------------- next part --------------
    Signed-off-by: Maxim Storchak <m.storchak at gmail.com>

diff --git a/jail/jail.c b/jail/jail.c
index 2bba292..22fda87 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -43,7 +43,7 @@
 #include <libubox/uloop.h>
 
 #define STACK_SIZE	(1024 * 1024)
-#define OPT_ARGS	"P:S:n:r:w:psuldo"
+#define OPT_ARGS	"P:S:n:r:w:b:psuldo"
 
 struct extra {
 	struct list_head list;
@@ -260,6 +260,7 @@ static int usage(void)
 	fprintf(stderr, "  -n <name>\tthe name of the jail\n");
 	fprintf(stderr, "  -r <file>\treadonly files that should be staged\n");
 	fprintf(stderr, "  -w <file>\twriteable files that should be staged\n");
+	fprintf(stderr, "  -b <file>\tadditional binaries that should be staged\n");
 	fprintf(stderr, "  -p\t\tjail has /proc\t\n");
 	fprintf(stderr, "  -s\t\tjail has /sys\t\n");
 	fprintf(stderr, "  -l\t\tjail has /dev/log\t\n");
@@ -433,6 +434,12 @@ int main(int argc, char **argv)
 
 	umask(022);
 
+	avl_init(&libraries, avl_strcmp, false, NULL);
+	alloc_library_path("/lib64");
+	alloc_library_path("/lib");
+	alloc_library_path("/usr/lib");
+	load_ldso_conf("/etc/ld.so.conf");
+
 	while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
 		switch (ch) {
 		case 'd':
@@ -457,6 +464,11 @@ int main(int argc, char **argv)
 		case 'l':
 			add_extra(log, 0);
 			break;
+		case 'b':
+			if (elf_load_deps(optarg)) {
+				ERROR("failed to load dependencies for %s\n", optarg);
+				return -1;
+			}
 		}
 	}
 
@@ -476,11 +488,6 @@ int main(int argc, char **argv)
 	if (name)
 		prctl(PR_SET_NAME, name, NULL, NULL, NULL);
 
-	avl_init(&libraries, avl_strcmp, false, NULL);
-	alloc_library_path("/lib64");
-	alloc_library_path("/lib");
-	alloc_library_path("/usr/lib");
-	load_ldso_conf("/etc/ld.so.conf");
 
 	if (elf_load_deps(argv[optind])) {
 		ERROR("failed to load dependencies\n");
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From david at lang.hm  Tue Aug 11 13:36:44 2015
From: david at lang.hm (David Lang)
Date: Tue, 11 Aug 2015 10:36:44 -0700 (PDT)
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBH09gzGJEA-4_jr4C=T5QgdvN4zOuzYt3QT2bNBn8zGYQ@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
 <CAGUNxBH09gzGJEA-4_jr4C=T5QgdvN4zOuzYt3QT2bNBn8zGYQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508111033430.8204@nftneq.ynat.uz>

I thought you said a couple posts ago that you were able to configure it through 
the GUI to work the way you wanted it to, you were just wanting to make 
something the default.

So do you have it working or not?

If you have it working, it should keep working after a reboot. What are you 
meaning when you say that you want to change the default?

Are you meaning that you want to create an image that will behave this way when 
you do a factory reset (or when you first flash it)? If so, then you need to 
take your working config and make it part of your image via the files/ 
mechansim.

If you are meaning something else, I'm still not understanding what you are 
trying to do.

David Lang



On Tue, 11 Aug 2015, John kerry wrote:

> Date: Tue, 11 Aug 2015 21:20:58 +0800
> From: John kerry <kerry9842 at gmail.com>
> To: David Lang <david at lang.hm>
> Cc: Alex Weedy <weedy2887 at gmail.com>,
>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
>     Wi-Fi client/AP interfaces on one radio)
> 
> Hi,
>
> How to config wireless config file for repeater mode. I am not able to
> config.
>
> On Tue, Aug 11, 2015 at 5:34 PM, John kerry <kerry9842 at gmail.com> wrote:
>
>> When i load firmware the wireless config will be like below:
>>
>> config wifi-device 'wifi0'
>>         option type 'qcawifi'
>>         option macaddr '00:26:75:bd:37:24'
>>         option hwmode '11ng'
>>         option txpower '16'
>>         option htmode 'HT20'
>>         option disabled '0'
>>         option channel '1'
>>
>> config wifi-iface
>>         option device 'wifi0'
>>         option mode 'ap'
>>         option ssid 'Test_ap'
>>         option network 'lan'
>>         option encryption 'psk2'
>>         option key 'Test_ap'
>>         option wds '1'
>>
>> so it works as Access point, i can connect to it any devices. When i scan
>> it shows me list of devices then connect to anyone. then the wireless
>> config  will becomes like below:
>>
>> config wifi-device 'wifi0'
>>         option type 'qcawifi'
>>         option macaddr '00:26:75:bd:37:24'
>>         option hwmode '11ng'
>>         option txpower '16'
>>         option htmode 'HT20'
>>         option disabled '0'
>>         option channel '1'
>>
>> config wifi-iface
>>         option network 'wwan'
>>         option ssid 'D-link-Router'
>>         option encryption 'psk2'
>>         option device 'wifi0'
>>         option mode 'sta'
>>         option key '0010069039'
>>         option wds '1'
>>
>> Then i add one more ap mode so wireless config becomes,
>> config wifi-device 'wifi0'
>>         option type 'qcawifi'
>>         option macaddr '00:26:75:bd:37:24'
>>         option hwmode '11ng'
>>         option txpower '16'
>>         option htmode 'HT20'
>>         option disabled '0'
>>         option channel '1'
>>
>> config wifi-iface
>>        option network 'wwan'
>>         option ssid 'D-link-Router'
>>         option encryption 'psk2'
>>         option device 'wifi0'
>>         option mode 'sta'
>>         option key '0010069039'
>>         option wds '1'
>>
>> config wifi-iface
>>         option device 'wifi0'
>>         option mode 'ap'
>>         option ssid 'Test_ap'
>>         option network 'lan'
>>         option encryption 'psk2'
>>         option key 'Test_ap'
>>         option wds '1'
>>
>> This i added manually one ap mode.
>>
>> So if i copy this config file, build and load this firmware, its load what
>> it was there so it shows one client which i was connected last time and one
>> AP which i added.
>>
>> But now i cannot scan anymore and connect to new router instead of old
>> client.
>>
>> This is the problem i am facing.
>>
>> Basically i need to configure the wireless file for repeater mode.
>>
>> So after connecting to another router this SSID still should be there and
>> other device can connect to it.
>>
>> On Tue, Aug 11, 2015 at 4:30 PM, David Lang <david at lang.hm> wrote:
>>
>>> you have a working config
>>>
>>> but you want to do something by default
>>>
>>> what you want to do is different at different times.
>>>
>>> what is it that you want to be the default? when do you want this default
>>> to apply? This isn't clear.
>>>
>>> David Lang
>>>
>>> On Tue, 11 Aug 2015, John kerry wrote:
>>>
>>> Date: Tue, 11 Aug 2015 15:51:38 +0800
>>>> From: John kerry <kerry9842 at gmail.com>
>>>> To: David Lang <david at lang.hm>
>>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>> Multiple
>>>>
>>>>     Wi-Fi client/AP interfaces on one radio)
>>>>
>>>> Yes,
>>>>
>>>> i can copy the config and build with this configuration,
>>>>
>>>> for example now i have connected to some router, another time we can
>>>> connect to any router. So how i can fix the settings by default.
>>>>
>>>> On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm> wrote:
>>>>
>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>
>>>>> I followed the same steps and its working too. But this i want in
>>>>> wireless
>>>>>
>>>>>> config file, Because i dont want every time to add using GUI. So When i
>>>>>> connect to another router also, no need to add one more. I mean to say
>>>>>> it
>>>>>> should be in default wireless config file.
>>>>>>
>>>>>>
>>>>> what do you mean by "default wireless config file"
>>>>>
>>>>> Once you have set it from the GUI, it is in the config files. The next
>>>>> time you boot it will use that config.
>>>>>
>>>>> If you mean that you want it in the factory default config (for when you
>>>>> first flash the router or do a factory reset), then take the
>>>>> /etc/config/wireless and /etc/config/network files and add them to your
>>>>> build under /files
>>>>>
>>>>> David Lang
>>>>>
>>>>>
>>>>> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm> wrote:
>>>>>
>>>>>>
>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>
>>>>>>>
>>>>>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>>>>>
>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>>> Multiple
>>>>>>>> Wi-Fi
>>>>>>>>     client/AP interfaces on one radio)
>>>>>>>>
>>>>>>>> Firstly i configure wireless config as below:
>>>>>>>>
>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>        option type 'qcawifi'
>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>        option hwmode '11ng'
>>>>>>>>        option txpower '17'
>>>>>>>>        option htmode 'HT20'
>>>>>>>>        option disabled '0'
>>>>>>>>        option channel '1'
>>>>>>>>
>>>>>>>> config wifi-iface
>>>>>>>>        option device 'wifi0'
>>>>>>>>        option mode 'ap'
>>>>>>>>        option ssid 'Testing_ap'
>>>>>>>>        option network 'lan'
>>>>>>>>        option encryption 'psk2'
>>>>>>>>        option key 'Testing_ap'
>>>>>>>>
>>>>>>>> so its SSID was showing and able to connect any device to it.
>>>>>>>>
>>>>>>>> Then i scan the device and connect to one of it. While joining the
>>>>>>>> network
>>>>>>>> i selected Client(WDS) then the wireless config becomes like below:
>>>>>>>>
>>>>>>>>
>>>>>>>> why don't you try following the steps in the video that you posted.
>>>>>>>
>>>>>>> first connect as a client, then add an additional interface and make
>>>>>>> the
>>>>>>> second interface the AP for things to connect to.
>>>>>>>
>>>>>>> the order may make a difference.
>>>>>>>
>>>>>>> David Lang
>>>>>>>
>>>>>>>
>>>>>>> config wifi-device 'wifi0'
>>>>>>>
>>>>>>>        option type 'qcawifi'
>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>        option hwmode '11ng'
>>>>>>>>        option txpower '17'
>>>>>>>>        option htmode 'HT20'
>>>>>>>>        option disabled '0'
>>>>>>>>        option channel '1'
>>>>>>>>
>>>>>>>> config wifi-iface
>>>>>>>>        option network 'wwan'
>>>>>>>>        option ssid 'D_Link_Router'
>>>>>>>>        option encryption 'psk2'
>>>>>>>>        option device 'wifi0'
>>>>>>>>        option mode 'sta'
>>>>>>>>        option key 'Dlink_Router'
>>>>>>>>        option wds '1'
>>>>>>>>
>>>>>>>> Then  i added one as shown in the video. Now its connected to router
>>>>>>>> also
>>>>>>>> and this add one also showing so i can connect to this also.
>>>>>>>>
>>>>>>>> But i am not getting how to keep this in default wireless config.
>>>>>>>>
>>>>>>>> Because every time we cant add one to configure like this. It should
>>>>>>>> be
>>>>>>>> like default should be in ap mode so any device we can connect, if
>>>>>>>> its
>>>>>>>> connected to another router also that SSID still should be visible
>>>>>>>> and
>>>>>>>> able
>>>>>>>> to connect to this.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> When i try to configure based on video, its shows 2 one as client
>>>>>>>> another
>>>>>>>>
>>>>>>>> one as Master but i am not able to enable it . I mean to say wireless
>>>>>>>>> becomes disable. If i enable it using GUI also its not happening.
>>>>>>>>>
>>>>>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm> wrote:
>>>>>>>>>
>>>>>>>>> What happens when you try to follow the video?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Based on your comments, i'm guessing that things don't work when
>>>>>>>>>> you
>>>>>>>>>> try
>>>>>>>>>> and configure the second network and have it with a different SSID
>>>>>>>>>> than
>>>>>>>>>> the
>>>>>>>>>> first network that you put in client mode.
>>>>>>>>>>
>>>>>>>>>> Is this correct?
>>>>>>>>>>
>>>>>>>>>> David Lang
>>>>>>>>>>
>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>
>>>>>>>>>> Yes, When i am connecting to Another router its changed to Client
>>>>>>>>>> mode.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Can i configure this in repeater mode like its shows in below link:
>>>>>>>>>>>
>>>>>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>
>>>>>>>> openwrt-devel mailing list
>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From eschultz at prplfoundation.org  Tue Aug 11 14:26:01 2015
From: eschultz at prplfoundation.org (Eric Schultz)
Date: Tue, 11 Aug 2015 13:26:01 -0500
Subject: [OpenWrt-Devel] FCC Wifi regulation list
Message-ID: <CAMkzgA6hcyRrv34ZkZQ1jzHA8b78JAsGWPPed7R+BqmX+XXbCw@mail.gmail.com>

I've set up a mailing list for the relevant FCC wifi regulation discussion.
We have folks from a number of different organizations so I encourage
everyone interested to join the list if they're not already on it. I think
we're going to be able to come up with a solid response to at least
publicize this change and see if any improvements can be made in the policy.

The list address is fcc at lists.prplfoundation.org and you can join at
http://lists.prplfoundation.org/cgi-bin/mailman/listinfo/fcc

I look forward to working with everyone on the topic and we can make a
positive change for the better.

Thanks,

Eric

-- 
Eric Schultz, Community Manager, prpl Foundation
http://www.prplfoundation.org
eschultz at prplfoundation.org
cell: 920-539-0404
skype: ericschultzwi
@EricPrpl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150811/7641a9a0/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Tue Aug 11 14:26:31 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Tue, 11 Aug 2015 20:26:31 +0200
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging"
In-Reply-To: <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
Message-ID: <55CA3E57.7060509@openwrt.org>

On 2015-08-11 11:34, John kerry wrote:
> 
> This i added manually one ap mode.
> 
> So if i copy this config file, build and load this firmware, its load
> what it was there so it shows one client which i was connected last time
> and one AP which i added.
> 
> But now i cannot scan anymore and connect to new router instead of old
> client.
> 
> This is the problem i am facing.
> 
> Basically i need to configure the wireless file for repeater mode.
You seem to be using a proprietary driver from QCA, probably even a
heavily modified version of OpenWrt. We can't help you with that, since
the driver and probably other parts of the code that you're running are
not made or maintained by the OpenWrt team.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From david at lang.hm  Tue Aug 11 15:31:11 2015
From: david at lang.hm (David Lang)
Date: Tue, 11 Aug 2015 12:31:11 -0700 (PDT)
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging"
In-Reply-To: <55CA3E57.7060509@openwrt.org>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508090341400.2141@nftneq.ynat.uz>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
 <55CA3E57.7060509@openwrt.org>
Message-ID: <alpine.DEB.2.02.1508111230360.8204@nftneq.ynat.uz>

On Tue, 11 Aug 2015, Felix Fietkau wrote:

> On 2015-08-11 11:34, John kerry wrote:
>>
>> This i added manually one ap mode.
>>
>> So if i copy this config file, build and load this firmware, its load
>> what it was there so it shows one client which i was connected last time
>> and one AP which i added.
>>
>> But now i cannot scan anymore and connect to new router instead of old
>> client.
>>
>> This is the problem i am facing.
>>
>> Basically i need to configure the wireless file for repeater mode.
> You seem to be using a proprietary driver from QCA, probably even a
> heavily modified version of OpenWrt. We can't help you with that, since
> the driver and probably other parts of the code that you're running are
> not made or maintained by the OpenWrt team.
>
> - Felix

Felix, I don't remember him saying what he's using, how did you spot that?

David Lang
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Tue Aug 11 15:46:59 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Tue, 11 Aug 2015 21:46:59 +0200
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging"
In-Reply-To: <alpine.DEB.2.02.1508111230360.8204@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
 <55CA3E57.7060509@openwrt.org>
 <alpine.DEB.2.02.1508111230360.8204@nftneq.ynat.uz>
Message-ID: <55CA5133.4090801@openwrt.org>

On 2015-08-11 21:31, David Lang wrote:
> On Tue, 11 Aug 2015, Felix Fietkau wrote:
> 
>> On 2015-08-11 11:34, John kerry wrote:
>>>
>>> This i added manually one ap mode.
>>>
>>> So if i copy this config file, build and load this firmware, its load
>>> what it was there so it shows one client which i was connected last time
>>> and one AP which i added.
>>>
>>> But now i cannot scan anymore and connect to new router instead of old
>>> client.
>>>
>>> This is the problem i am facing.
>>>
>>> Basically i need to configure the wireless file for repeater mode.
>> You seem to be using a proprietary driver from QCA, probably even a
>> heavily modified version of OpenWrt. We can't help you with that, since
>> the driver and probably other parts of the code that you're running are
>> not made or maintained by the OpenWrt team.
>>
>> - Felix
> 
> Felix, I don't remember him saying what he's using, how did you spot that?
The "qcawifi" type in the wifi-device section in his wireless config.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Tue Aug 11 21:29:21 2015
From: kerry9842 at gmail.com (John kerry)
Date: Wed, 12 Aug 2015 09:29:21 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <alpine.DEB.2.02.1508111033430.8204@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBF-7Dhex5U4pwRQXQh7A5B6R-bvW=yGoREDu-rcA2ih=g@mail.gmail.com>
 <alpine.DEB.2.02.1508092211030.2141@nftneq.ynat.uz>
 <CAGUNxBFtA9_PCipZcHRufOeLdjg4eBQB8K2GraOey6p-Gc7C3w@mail.gmail.com>
 <alpine.DEB.2.02.1508092351500.15597@nftneq.ynat.uz>
 <CAGUNxBFx-ZhP1-n+fCaNFW3tU8y8XDCevGVquo6St1yJwLYFJw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
 <CAGUNxBH09gzGJEA-4_jr4C=T5QgdvN4zOuzYt3QT2bNBn8zGYQ@mail.gmail.com>
 <alpine.DEB.2.02.1508111033430.8204@nftneq.ynat.uz>
Message-ID: <CAGUNxBEJOvnKra7dxvVmUiqVk-VdvtdjT5SFcDOwXhCAfYbDvg@mail.gmail.com>

Yes i able to config using GUI, But when i am configuring GUI i scan and
connect to one AP and then add one more AP mode to it. So finally i will
have wireless configuration.

But i cant keep this config in build option because if i load this
configuration it will load what i connected last time, so next time i cant
scan it anymore it showing the same connected to last AP.




On Wed, Aug 12, 2015 at 1:36 AM, David Lang <david at lang.hm> wrote:

> I thought you said a couple posts ago that you were able to configure it
> through the GUI to work the way you wanted it to, you were just wanting to
> make something the default.
>
> So do you have it working or not?
>
> If you have it working, it should keep working after a reboot. What are
> you meaning when you say that you want to change the default?
>
> Are you meaning that you want to create an image that will behave this way
> when you do a factory reset (or when you first flash it)? If so, then you
> need to take your working config and make it part of your image via the
> files/ mechansim.
>
> If you are meaning something else, I'm still not understanding what you
> are trying to do.
>
> David Lang
>
>
>
> On Tue, 11 Aug 2015, John kerry wrote:
>
> Date: Tue, 11 Aug 2015 21:20:58 +0800
>>
>> From: John kerry <kerry9842 at gmail.com>
>> To: David Lang <david at lang.hm>
>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>> Multiple
>>     Wi-Fi client/AP interfaces on one radio)
>>
>> Hi,
>>
>> How to config wireless config file for repeater mode. I am not able to
>> config.
>>
>> On Tue, Aug 11, 2015 at 5:34 PM, John kerry <kerry9842 at gmail.com> wrote:
>>
>> When i load firmware the wireless config will be like below:
>>>
>>> config wifi-device 'wifi0'
>>>         option type 'qcawifi'
>>>         option macaddr '00:26:75:bd:37:24'
>>>         option hwmode '11ng'
>>>         option txpower '16'
>>>         option htmode 'HT20'
>>>         option disabled '0'
>>>         option channel '1'
>>>
>>> config wifi-iface
>>>         option device 'wifi0'
>>>         option mode 'ap'
>>>         option ssid 'Test_ap'
>>>         option network 'lan'
>>>         option encryption 'psk2'
>>>         option key 'Test_ap'
>>>         option wds '1'
>>>
>>> so it works as Access point, i can connect to it any devices. When i scan
>>> it shows me list of devices then connect to anyone. then the wireless
>>> config  will becomes like below:
>>>
>>> config wifi-device 'wifi0'
>>>         option type 'qcawifi'
>>>         option macaddr '00:26:75:bd:37:24'
>>>         option hwmode '11ng'
>>>         option txpower '16'
>>>         option htmode 'HT20'
>>>         option disabled '0'
>>>         option channel '1'
>>>
>>> config wifi-iface
>>>         option network 'wwan'
>>>         option ssid 'D-link-Router'
>>>         option encryption 'psk2'
>>>         option device 'wifi0'
>>>         option mode 'sta'
>>>         option key '0010069039'
>>>         option wds '1'
>>>
>>> Then i add one more ap mode so wireless config becomes,
>>> config wifi-device 'wifi0'
>>>         option type 'qcawifi'
>>>         option macaddr '00:26:75:bd:37:24'
>>>         option hwmode '11ng'
>>>         option txpower '16'
>>>         option htmode 'HT20'
>>>         option disabled '0'
>>>         option channel '1'
>>>
>>> config wifi-iface
>>>        option network 'wwan'
>>>         option ssid 'D-link-Router'
>>>         option encryption 'psk2'
>>>         option device 'wifi0'
>>>         option mode 'sta'
>>>         option key '0010069039'
>>>         option wds '1'
>>>
>>> config wifi-iface
>>>         option device 'wifi0'
>>>         option mode 'ap'
>>>         option ssid 'Test_ap'
>>>         option network 'lan'
>>>         option encryption 'psk2'
>>>         option key 'Test_ap'
>>>         option wds '1'
>>>
>>> This i added manually one ap mode.
>>>
>>> So if i copy this config file, build and load this firmware, its load
>>> what
>>> it was there so it shows one client which i was connected last time and
>>> one
>>> AP which i added.
>>>
>>> But now i cannot scan anymore and connect to new router instead of old
>>> client.
>>>
>>> This is the problem i am facing.
>>>
>>> Basically i need to configure the wireless file for repeater mode.
>>>
>>> So after connecting to another router this SSID still should be there and
>>> other device can connect to it.
>>>
>>> On Tue, Aug 11, 2015 at 4:30 PM, David Lang <david at lang.hm> wrote:
>>>
>>> you have a working config
>>>>
>>>> but you want to do something by default
>>>>
>>>> what you want to do is different at different times.
>>>>
>>>> what is it that you want to be the default? when do you want this
>>>> default
>>>> to apply? This isn't clear.
>>>>
>>>> David Lang
>>>>
>>>> On Tue, 11 Aug 2015, John kerry wrote:
>>>>
>>>> Date: Tue, 11 Aug 2015 15:51:38 +0800
>>>>
>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>> To: David Lang <david at lang.hm>
>>>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>> Multiple
>>>>>
>>>>>     Wi-Fi client/AP interfaces on one radio)
>>>>>
>>>>> Yes,
>>>>>
>>>>> i can copy the config and build with this configuration,
>>>>>
>>>>> for example now i have connected to some router, another time we can
>>>>> connect to any router. So how i can fix the settings by default.
>>>>>
>>>>> On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm> wrote:
>>>>>
>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>
>>>>>>
>>>>>> I followed the same steps and its working too. But this i want in
>>>>>> wireless
>>>>>>
>>>>>> config file, Because i dont want every time to add using GUI. So When
>>>>>>> i
>>>>>>> connect to another router also, no need to add one more. I mean to
>>>>>>> say
>>>>>>> it
>>>>>>> should be in default wireless config file.
>>>>>>>
>>>>>>>
>>>>>>> what do you mean by "default wireless config file"
>>>>>>
>>>>>> Once you have set it from the GUI, it is in the config files. The next
>>>>>> time you boot it will use that config.
>>>>>>
>>>>>> If you mean that you want it in the factory default config (for when
>>>>>> you
>>>>>> first flash the router or do a factory reset), then take the
>>>>>> /etc/config/wireless and /etc/config/network files and add them to
>>>>>> your
>>>>>> build under /files
>>>>>>
>>>>>> David Lang
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm> wrote:
>>>>>>
>>>>>>
>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>
>>>>>>>
>>>>>>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>>>>>>
>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>>
>>>>>>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>>>> Multiple
>>>>>>>>> Wi-Fi
>>>>>>>>>     client/AP interfaces on one radio)
>>>>>>>>>
>>>>>>>>> Firstly i configure wireless config as below:
>>>>>>>>>
>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>        option type 'qcawifi'
>>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>>        option hwmode '11ng'
>>>>>>>>>        option txpower '17'
>>>>>>>>>        option htmode 'HT20'
>>>>>>>>>        option disabled '0'
>>>>>>>>>        option channel '1'
>>>>>>>>>
>>>>>>>>> config wifi-iface
>>>>>>>>>        option device 'wifi0'
>>>>>>>>>        option mode 'ap'
>>>>>>>>>        option ssid 'Testing_ap'
>>>>>>>>>        option network 'lan'
>>>>>>>>>        option encryption 'psk2'
>>>>>>>>>        option key 'Testing_ap'
>>>>>>>>>
>>>>>>>>> so its SSID was showing and able to connect any device to it.
>>>>>>>>>
>>>>>>>>> Then i scan the device and connect to one of it. While joining the
>>>>>>>>> network
>>>>>>>>> i selected Client(WDS) then the wireless config becomes like below:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> why don't you try following the steps in the video that you posted.
>>>>>>>>>
>>>>>>>>
>>>>>>>> first connect as a client, then add an additional interface and make
>>>>>>>> the
>>>>>>>> second interface the AP for things to connect to.
>>>>>>>>
>>>>>>>> the order may make a difference.
>>>>>>>>
>>>>>>>> David Lang
>>>>>>>>
>>>>>>>>
>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>
>>>>>>>>        option type 'qcawifi'
>>>>>>>>
>>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>>        option hwmode '11ng'
>>>>>>>>>        option txpower '17'
>>>>>>>>>        option htmode 'HT20'
>>>>>>>>>        option disabled '0'
>>>>>>>>>        option channel '1'
>>>>>>>>>
>>>>>>>>> config wifi-iface
>>>>>>>>>        option network 'wwan'
>>>>>>>>>        option ssid 'D_Link_Router'
>>>>>>>>>        option encryption 'psk2'
>>>>>>>>>        option device 'wifi0'
>>>>>>>>>        option mode 'sta'
>>>>>>>>>        option key 'Dlink_Router'
>>>>>>>>>        option wds '1'
>>>>>>>>>
>>>>>>>>> Then  i added one as shown in the video. Now its connected to
>>>>>>>>> router
>>>>>>>>> also
>>>>>>>>> and this add one also showing so i can connect to this also.
>>>>>>>>>
>>>>>>>>> But i am not getting how to keep this in default wireless config.
>>>>>>>>>
>>>>>>>>> Because every time we cant add one to configure like this. It
>>>>>>>>> should
>>>>>>>>> be
>>>>>>>>> like default should be in ap mode so any device we can connect, if
>>>>>>>>> its
>>>>>>>>> connected to another router also that SSID still should be visible
>>>>>>>>> and
>>>>>>>>> able
>>>>>>>>> to connect to this.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <kerry9842 at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> When i try to configure based on video, its shows 2 one as client
>>>>>>>>> another
>>>>>>>>>
>>>>>>>>> one as Master but i am not able to enable it . I mean to say
>>>>>>>>> wireless
>>>>>>>>>
>>>>>>>>>> becomes disable. If i enable it using GUI also its not happening.
>>>>>>>>>>
>>>>>>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> What happens when you try to follow the video?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Based on your comments, i'm guessing that things don't work when
>>>>>>>>>>> you
>>>>>>>>>>> try
>>>>>>>>>>> and configure the second network and have it with a different
>>>>>>>>>>> SSID
>>>>>>>>>>> than
>>>>>>>>>>> the
>>>>>>>>>>> first network that you put in client mode.
>>>>>>>>>>>
>>>>>>>>>>> Is this correct?
>>>>>>>>>>>
>>>>>>>>>>> David Lang
>>>>>>>>>>>
>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>
>>>>>>>>>>> Yes, When i am connecting to Another router its changed to Client
>>>>>>>>>>> mode.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Can i configure this in repeater mode like its shows in below
>>>>>>>>>>> link:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>
>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150812/3fc8236c/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From yszhou4tech at gmail.com  Wed Aug 12 00:21:29 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Wed, 12 Aug 2015 12:21:29 +0800
Subject: [OpenWrt-Devel] [PATCH 1/1] [polarssl] Fix build failures due
 to PKG_NAME != dir name
In-Reply-To: <CAECwjAi4xEsDpQns65uMs0oO4woKrPHG6UOxwTnuhq4L2zDuqQ@mail.gmail.com>
References: <20150810153015.371DF23A1534@danielcent.thecshore.com>
 <CAECwjAi4xEsDpQns65uMs0oO4woKrPHG6UOxwTnuhq4L2zDuqQ@mail.gmail.com>
Message-ID: <CAECwjAh+0A48bJ5FWgSP2J2O20_m26ov-gzMME6k8Up8vCi9kA@mail.gmail.com>

On 11 August 2015 at 10:00, Yousong Zhou <yszhou4tech at gmail.com> wrote:
> On 2 August 2015 at 19:46, Daniel Dickinson
> <openwrt at daniel.thecshore.com> wrote:
>> Packages that depend on PolarSSL fail to build because polarssl's InstallDev
>> section never actually gets executed because (prior to this patch) the package
>> name does not match the subdir the package is in (presumably due to upstream
>> name change).  As a workaround I have changed the package name back to
>> polarssl and used a new variable SRC_PKG_NAME for the purposes of downloading
>> the upstream tarball and creating PKG_BUILD_DIR.
>>
>
> Nice catch, but only setting PKG_BUILD_DIR should be enough to fix
> this.  No need to introduce a new variable.
>

Hello, Daniel

After a second look on the code, I didn't get why there was a problem.
Anyway, openvpn-polarssl built and run fine in my environment.

                yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bittorf at bluebottle.com  Wed Aug 12 03:32:56 2015
From: bittorf at bluebottle.com (Bastian Bittorf)
Date: Wed, 12 Aug 2015 09:32:56 +0200
Subject: [OpenWrt-Devel] [PATCH] base-files: rework reset button script
 to indicate factory reset
In-Reply-To: <1439251044-15693-1-git-send-email-zajec5@gmail.com>
References: <1439251044-15693-1-git-send-email-zajec5@gmail.com>
Message-ID: <20150812073256.GE19496@medion.lan>

* Rafa? Mi?ecki <zajec5 at gmail.com> [11.08.2015 21:01]:

is there a special reason, that you are using

exec /sbin/poweroff

instead of just

/sbin/poweroff

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From m.storchak at gmail.com  Wed Aug 12 07:24:09 2015
From: m.storchak at gmail.com (Maxim Storchak)
Date: Wed, 12 Aug 2015 14:24:09 +0300
Subject: [OpenWrt-Devel] [PATCH] procd: add helper binaries to jail
In-Reply-To: <55CA2D4A.5020503@gmail.com>
References: <55CA2D4A.5020503@gmail.com>
Message-ID: <1439378649-4630-1-git-send-email-m.storchak@gmail.com>

This allows to build jails with more than a single binary.
May be used to run main program with a wrapper, f.e. ionice,
or to add helper binaries for the main one (like gzip for tar with no
build-in compression support).

Usage:
directly:
ujail ... -b /usr/bin/main ... -- /bin/wrapper ... /usr/bin/main
ujail ... -b /usr/bin/helper1 -b /bin/helper2 ... -- /usr/bin/main
in init scripts:
procd_add_jail_mount_bin /usr/bin/something /bin/helper

Signed-off-by: Maxim Storchak <m.storchak at gmail.com>
---
 package/system/procd/files/procd.sh                | 18 +++++++
 .../procd/patches/100-ujail-helper-binary.patch    | 58 ++++++++++++++++++++++
 .../procd/patches/101-service-helper-binary.patch  | 15 ++++++
 3 files changed, 91 insertions(+)
 create mode 100644 package/system/procd/patches/100-ujail-helper-binary.patch
 create mode 100644 package/system/procd/patches/101-service-helper-binary.patch

diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index e83e75c..bc9f78d 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -177,6 +177,23 @@ _procd_add_jail_mount_rw() {
 	json_select ..
 }
 
+_procd_add_jail_mount_bin() {
+	local _json_no_warning=1
+
+	json_select "jail"
+	[ $? = 0 ] || return
+	json_select "mount"
+	[ $? = 0 ] || {
+		json_select ..
+		return
+	}
+	for a in $@; do
+		json_add_string "$a" "2"
+	done
+	json_select ..
+	json_select ..
+}
+
 _procd_set_param() {
 	local type="$1"; shift
 
@@ -423,6 +440,7 @@ _procd_wrapper \
 	procd_add_jail \
 	procd_add_jail_mount \
 	procd_add_jail_mount_rw \
+	procd_add_jail_mount_bin \
 	procd_set_param \
 	procd_append_param \
 	procd_add_validation \
diff --git a/package/system/procd/patches/100-ujail-helper-binary.patch b/package/system/procd/patches/100-ujail-helper-binary.patch
new file mode 100644
index 0000000..dd7ab64
--- /dev/null
+++ b/package/system/procd/patches/100-ujail-helper-binary.patch
@@ -0,0 +1,58 @@
+diff --git a/jail/jail.c b/jail/jail.c
+index 2bba292..22fda87 100644
+--- a/jail/jail.c
++++ b/jail/jail.c
+@@ -43,7 +43,7 @@
+ #include <libubox/uloop.h>
+ 
+ #define STACK_SIZE	(1024 * 1024)
+-#define OPT_ARGS	"P:S:n:r:w:psuldo"
++#define OPT_ARGS	"P:S:n:r:w:b:psuldo"
+ 
+ struct extra {
+ 	struct list_head list;
+@@ -260,6 +260,7 @@ static int usage(void)
+ 	fprintf(stderr, "  -n <name>\tthe name of the jail\n");
+ 	fprintf(stderr, "  -r <file>\treadonly files that should be staged\n");
+ 	fprintf(stderr, "  -w <file>\twriteable files that should be staged\n");
++	fprintf(stderr, "  -b <file>\tadditional binaries that should be staged\n");
+ 	fprintf(stderr, "  -p\t\tjail has /proc\t\n");
+ 	fprintf(stderr, "  -s\t\tjail has /sys\t\n");
+ 	fprintf(stderr, "  -l\t\tjail has /dev/log\t\n");
+@@ -433,6 +434,12 @@ int main(int argc, char **argv)
+ 
+ 	umask(022);
+ 
++	avl_init(&libraries, avl_strcmp, false, NULL);
++	alloc_library_path("/lib64");
++	alloc_library_path("/lib");
++	alloc_library_path("/usr/lib");
++	load_ldso_conf("/etc/ld.so.conf");
++
+ 	while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
+ 		switch (ch) {
+ 		case 'd':
+@@ -457,6 +464,11 @@ int main(int argc, char **argv)
+ 		case 'l':
+ 			add_extra(log, 0);
+ 			break;
++		case 'b':
++			if (elf_load_deps(optarg)) {
++				ERROR("failed to load dependencies for %s\n", optarg);
++				return -1;
++			}
+ 		}
+ 	}
+ 
+@@ -476,11 +488,6 @@ int main(int argc, char **argv)
+ 	if (name)
+ 		prctl(PR_SET_NAME, name, NULL, NULL, NULL);
+ 
+-	avl_init(&libraries, avl_strcmp, false, NULL);
+-	alloc_library_path("/lib64");
+-	alloc_library_path("/lib");
+-	alloc_library_path("/usr/lib");
+-	load_ldso_conf("/etc/ld.so.conf");
+ 
+ 	if (elf_load_deps(argv[optind])) {
+ 		ERROR("failed to load dependencies\n");
diff --git a/package/system/procd/patches/101-service-helper-binary.patch b/package/system/procd/patches/101-service-helper-binary.patch
new file mode 100644
index 0000000..0b4a274
--- /dev/null
+++ b/package/system/procd/patches/101-service-helper-binary.patch
@@ -0,0 +1,15 @@
+diff --git a/service/instance.c b/service/instance.c
+index 40ff021..9fec647 100644
+--- a/service/instance.c
++++ b/service/instance.c
+@@ -208,7 +208,9 @@ jail_run(struct service_instance *in, char **argv)
+ 	blobmsg_list_for_each(&jail->mount, var) {
+ 		const char *type = blobmsg_data(var->data);
+ 
+-		if (*type == '1')
++		if (*type == '2')
++			argv[argc++] = "-b";
++		else if (*type == '1')
+ 			argv[argc++] = "-w";
+ 		else
+ 			argv[argc++] = "-r";
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 12 08:22:51 2015
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Wed, 12 Aug 2015 14:22:51 +0200
Subject: [OpenWrt-Devel] [PATCH] procd: add helper binaries to jail
In-Reply-To: <1439378649-4630-1-git-send-email-m.storchak@gmail.com>
References: <55CA2D4A.5020503@gmail.com>
 <1439378649-4630-1-git-send-email-m.storchak@gmail.com>
Message-ID: <CAOdf3goezFqCXeAiLciyepwCinWmX7-3xOesv07EauL2d5c68A@mail.gmail.com>

Hi Maxim,
Le 12 ao?t 2015 13:25, "Maxim Storchak" <m.storchak at gmail.com> a ?crit :
>
> This allows to build jails with more than a single binary.
> May be used to run main program with a wrapper, f.e. ionice,
> or to add helper binaries for the main one (like gzip for tar with no
> build-in compression support).
>
> Usage:
> directly:
> ujail ... -b /usr/bin/main ... -- /bin/wrapper ... /usr/bin/main
> ujail ... -b /usr/bin/helper1 -b /bin/helper2 ... -- /usr/bin/main
> in init scripts:
> procd_add_jail_mount_bin /usr/bin/something /bin/helper
>
> Signed-off-by: Maxim Storchak <m.storchak at gmail.com>
> ---
>  package/system/procd/files/procd.sh                | 18 +++++++
>  .../procd/patches/100-ujail-helper-binary.patch    | 58
++++++++++++++++++++++
>  .../procd/patches/101-service-helper-binary.patch  | 15 ++++++

Procd is an OpenWrt project, you should send a patch against procd git on
this ML

I haven't tested your patch, but i really like the idea/feature

Regards,
Etienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150812/6a8bef06/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From zajec5 at gmail.com  Wed Aug 12 08:48:10 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Wed, 12 Aug 2015 14:48:10 +0200
Subject: [OpenWrt-Devel] [PATCH] base-files: rework reset button script
 to indicate factory reset
In-Reply-To: <20150812073256.GE19496@medion.lan>
References: <1439251044-15693-1-git-send-email-zajec5@gmail.com>
 <20150812073256.GE19496@medion.lan>
Message-ID: <CACna6rw52ChV_QSpHKE_PW=Aip+B6Pf8qv6mvxB3L6TknbXH3g@mail.gmail.com>

On 12 August 2015 at 09:32, Bastian Bittorf <bittorf at bluebottle.com> wrote:
> * Rafa? Mi?ecki <zajec5 at gmail.com> [11.08.2015 21:01]:
>
> is there a special reason, that you are using
>
> exec /sbin/poweroff
>
> instead of just
>
> /sbin/poweroff

I think you're commenting on a wrong patch.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From smilebef at gmail.com  Wed Aug 12 09:00:58 2015
From: smilebef at gmail.com (smilebef at gmail.com)
Date: Wed, 12 Aug 2015 15:00:58 +0200
Subject: [OpenWrt-Devel] TP-WA7510 not in CC
Message-ID: <20150812150058.7d47b81d@None>

I try to build a Image with the trunk of CC.

I use 


Target System (Atheros AR7xxx/AR9xxx)
Subtarget (Generic)
Target Profile (TP-LINK TL-WA7510N)

The make process runs without fail,
but the Image openwrt-ar71xx-generic-TL-WA7510N... is not in bin/AR71xx.
Only the Images from the process with 

Target Profile (Default Profile (all drivers))

see file in append.

Any ideas?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datei
Type: application/octet-stream
Size: 17324 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150812/ed057105/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150812/ed057105/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From yszhou4tech at gmail.com  Wed Aug 12 09:08:15 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Wed, 12 Aug 2015 21:08:15 +0800
Subject: [OpenWrt-Devel] [PATCH 1/2] Changes for more readability.
Message-ID: <1439384896-11218-1-git-send-email-yszhou4tech@gmail.com>

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 device.h    |    3 +++
 interface.c |    4 ++--
 interface.h |    1 +
 ubus.c      |    2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/device.h b/device.h
index ce135ba..798e19e 100644
--- a/device.h
+++ b/device.h
@@ -160,8 +160,11 @@ struct device {
 	struct blob_attr *config;
 	bool config_pending;
 	bool sys_present;
+	/* DEV_EVENT_ADD */
 	bool present;
+	/* DEV_EVENT_UP */
 	int active;
+	/* DEV_EVENT_LINK_UP */
 	bool link_active;
 
 	bool external;
diff --git a/interface.c b/interface.c
index 848990e..ffe7988 100644
--- a/interface.c
+++ b/interface.c
@@ -649,7 +649,7 @@ interface_handle_config_change(struct interface *iface)
 }
 
 static void
-interface_proto_cb(struct interface_proto_state *state, enum interface_proto_event ev)
+interface_proto_event_cb(struct interface_proto_state *state, enum interface_proto_event ev)
 {
 	struct interface *iface = state->iface;
 
@@ -708,7 +708,7 @@ void interface_set_proto_state(struct interface *iface, struct interface_proto_s
 	if (!state)
 		return;
 
-	state->proto_event = interface_proto_cb;
+	state->proto_event = interface_proto_event_cb;
 	state->iface = iface;
 }
 
diff --git a/interface.h b/interface.h
index 8eeb7db..6f9112c 100644
--- a/interface.h
+++ b/interface.h
@@ -120,6 +120,7 @@ struct interface {
 
 	struct list_head users;
 
+	/* for alias interface */
 	const char *parent_ifname;
 	struct interface_user parent_iface;
 
diff --git a/ubus.c b/ubus.c
index 56f7bdd..c834d11 100644
--- a/ubus.c
+++ b/ubus.c
@@ -817,7 +817,7 @@ netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
 
 	cur = tb[DEV_LINK_EXT];
 	if (cur)
-		link_ext = !!blobmsg_get_u8(cur);
+		link_ext = blobmsg_get_bool(cur);
 
 	return interface_handle_link(iface, blobmsg_data(tb[DEV_LINK_NAME]), add, link_ext);
 }
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From yszhou4tech at gmail.com  Wed Aug 12 09:08:16 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Wed, 12 Aug 2015 21:08:16 +0800
Subject: [OpenWrt-Devel] [PATCH 2/2] proto-shell: add checkup timeout to
	restart interface.
In-Reply-To: <1439384896-11218-1-git-send-email-yszhou4tech@gmail.com>
References: <1439384896-11218-1-git-send-email-yszhou4tech@gmail.com>
Message-ID: <1439384896-11218-2-git-send-email-yszhou4tech@gmail.com>

This is mainly for protocols with no_proto_task set.  L2TP with xl2tpd
is such a case and the issue this commit tries to address is that xl2tpd
could fail redialing the connection (segfault or abort) without the
notice of netifd causing the concerned interface being left down.

This patch solves it by allowing users to configure an timeout value
instructing netifd to check if the interface is in up state after its
last attempt to setup it and try again if that is not the case.

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 proto-shell.c |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/proto-shell.c b/proto-shell.c
index e2e765f..dfb14a9 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -69,6 +69,15 @@ struct proto_shell_state {
 
 	struct uloop_timeout teardown_timeout;
 
+	/*
+	 * Teardown and setup interface again if it is still not up (IFS_UP)
+	 * after checkup_interval seconds since previous attempt.  This check
+	 * will be disabled when the config option "checkup_interval" is
+	 * missing or has a negative value
+	 */
+	int checkup_interval;
+	struct uloop_timeout checkup_timeout;
+
 	struct netifd_process script_task;
 	struct netifd_process proto_task;
 
@@ -303,6 +312,10 @@ proto_shell_task_finish(struct proto_shell_state *state,
 				proto_shell_handler(&state->proto,
 						    PROTO_CMD_TEARDOWN,
 						    false);
+			if (state->checkup_interval > 0) {
+				uloop_timeout_set(&state->checkup_timeout,
+						  state->checkup_interval * 1000);
+			}
 		}
 		break;
 
@@ -768,6 +781,45 @@ proto_shell_notify(struct interface_proto_state *proto, struct blob_attr *attr)
 	}
 }
 
+static void
+proto_shell_checkup_timeout_cb(struct uloop_timeout *timeout)
+{
+	struct proto_shell_state *state = container_of(timeout, struct
+			proto_shell_state, checkup_timeout);
+	struct interface_proto_state *proto = &state->proto;
+	struct interface *iface = proto->iface;
+
+	if (!iface->autostart)
+		return;
+
+	if (iface->state == IFS_UP)
+		return;
+
+	D(INTERFACE, "Interface '%s' is not up after %d sec\n",
+			iface->name, state->checkup_interval);
+	proto_shell_handler(proto, PROTO_CMD_TEARDOWN, false);
+}
+
+static void
+proto_shell_checkup_attach(struct proto_shell_state *state,
+		const struct blob_attr *attr)
+{
+	struct blob_attr *tb;
+	struct blobmsg_policy checkup_policy = {
+		.name = "checkup_interval",
+		.type = BLOBMSG_TYPE_INT32
+	};
+
+	blobmsg_parse(&checkup_policy, 1, &tb, blob_data(attr), blob_len(attr));
+	if (!tb) {
+		state->checkup_interval = -1;
+		state->checkup_timeout.cb = NULL;
+	} else {
+		state->checkup_interval = blobmsg_get_u32(tb);
+		state->checkup_timeout.cb = proto_shell_checkup_timeout_cb;
+	}
+}
+
 static struct interface_proto_state *
 proto_shell_attach(const struct proto_handler *h, struct interface *iface,
 		   struct blob_attr *attr)
@@ -782,6 +834,7 @@ proto_shell_attach(const struct proto_handler *h, struct interface *iface,
 		goto error;
 
 	memcpy(state->config, attr, blob_pad_len(attr));
+	proto_shell_checkup_attach(state, state->config);
 	state->proto.free = proto_shell_free;
 	state->proto.notify = proto_shell_notify;
 	state->proto.cb = proto_shell_handler;
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bittorf at bluebottle.com  Wed Aug 12 09:19:24 2015
From: bittorf at bluebottle.com (Bastian Bittorf)
Date: Wed, 12 Aug 2015 15:19:24 +0200
Subject: [OpenWrt-Devel] [PATCH] base-files: rework reset button script
 to indicate factory reset
In-Reply-To: <CACna6rw52ChV_QSpHKE_PW=Aip+B6Pf8qv6mvxB3L6TknbXH3g@mail.gmail.com>
References: <1439251044-15693-1-git-send-email-zajec5@gmail.com>
 <20150812073256.GE19496@medion.lan>
 <CACna6rw52ChV_QSpHKE_PW=Aip+B6Pf8qv6mvxB3L6TknbXH3g@mail.gmail.com>
Message-ID: <20150812131924.GO19496@medion.lan>

* Rafa? Mi?ecki <zajec5 at gmail.com> [12.08.2015 15:10]:
> I think you're commenting on a wrong patch.

sorry, yes - the comment applies to:
a643de25/r40909 and i just stumpled upon this
while reading the affected sources of your patch.

@stefan: why is this 'exec' needed?

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From francesco.borromini at inventati.org  Wed Aug 12 14:28:34 2015
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Wed, 12 Aug 2015 20:28:34 +0200
Subject: [OpenWrt-Devel] [PATCH] Ar71xx: Add Minibox v1.0 support
In-Reply-To: <20150810130740-31735-43528-mailpile@palmtree-beeroclock-net>
Message-ID: <1439404114.2716.0@smtp.autistici.org>

Hi Karl,

Thanks for your time.

I have reworked the patch and re-ordered where possible (files like 
ar71xx.sh and diag.sh lack any alphabetical
order). I have removed the code that set the led to status_led_off. 
What file should I be looking at, when you talk
about the board file? Is it the minibox-v1.mk file? I diffed from the 
vendor's code (and added a profile by comparing
with other devices) but that was it.

I don't have the hardware myself but I have found a tester willing to 
run the image (and see how the LED behaves with
the default OpenWrt settings).


The new patch can be found here:

https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-trunk.patch

If that doesn't work, a backup: http://sprunge.us/AUbX


And for those wanting to try on 15.05:

https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-15.05.patch

Thanks

Stijn



Op ma, 10 aug 2015 om 3:12 , schreef Karl Palsson <karlp at tweak.net.au>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> This has many cases where you have added the board out of order.  The
> lists are generally alphabetically sorted, and should be maintained 
> that
> way, even though a few boards escaped this.
> 
> More comments inline.
> 
> 
> Stijn Segers <francesco.borromini at inventati.org> wrote:
>>  Hello,
>> 
>>  The patch below adds support for the Gainstrong Minibox v1.0 mini
>>  router into trunk. This is based off the Barrier Breaker based 
>> source
>>  code at http://ooioe.com/miniboxv1/Sourcecode/.
>> 
>>  Patch applies cleanly, has been compile-tested on a 15.05 tree (the
>>  patch below is for the trunk ar17xx target with kernel 4.1). For 
>> those
>>  interested, I can provide the 15.05 patch as well.
>> 
>>  Any questions, let me know.
>> 
>>  Thank you
>> 
>>  Stijn
>> 
>> 
>> 
>> 
>>  Index: openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>  ===================================================================
>>  --- openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>  +++ openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>  @@ -222,6 +222,9 @@ get_status_led() {
>>   	qihoo-c301)
>>   		status_led="qihoo:green:status"
>>   		;;
>>  +	minibox-v1)
>>  +		status_led="minibox-v1:green:system"
>>  +		;;
>>   	tew-632brp)
>>   		status_led="tew-632brp:green:status"
>>   		;;
>>  @@ -366,7 +369,7 @@ set_state() {
>>   		status_led_blink_preinit_regular
>>   		;;
>>   	done)
>>  -		status_led_on
>>  +		status_led_off
> 
> Pretty sure you can't just change this for everyone.  If you have an
> active low/active high issue, you should fix that in your board file.
> 
>>   		case $(ar71xx_board_name) in
>>   		qihoo-c301)
>>   			local n=$(fw_printenv activeregion | cut -d = -f 2)
>>  Index:
>>  
>> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>  ===================================================================
>>  ---
>>  
>> openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>  +++
>>  
>> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>  @@ -419,6 +419,7 @@ ja76pf |\
>>   mc-mac1200r|\
>>   mynet-n600 |\
>>   oolite |\
>>  +minibox-v1 |\
> 
> 
> I know gainstrong makes the oolite too, but at this point in this 
> file,
> that's irrelevant, keep the alphabetical sorting.
> 
>>   qihoo-c301 |\
>>   rb-750 |\
>>   rb-751 |\
>>  Index: openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>  ===================================================================
>>  --- openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>  +++ openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>  @@ -119,6 +119,9 @@ tplink_board_detect() {
>>   	"3C0001"*)
>>   		model="OOLITE"
>>   		;;
>>  +	"3C0002"*)
>>  +		model="MINIBOX_V1"
>>  +		;;
>>   	"070300"*)
>>   		model="TP-Link TL-WR703N"
>>   		;;
>>  @@ -320,6 +323,9 @@ ar71xx_board_detect() {
>>   	*"AC1750DB")
>>   		name="f9k1115v2"
>>   		;;
>>  +	*"MiniBox V1.0")
>>  +		name="minibox-v1"
>>  +		;;
> 
> Bad sort.
> 
>>   	*"AirGateway")
>>   		name="airgateway"
>>   		;;
>>  Index:
>>  openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>  ===================================================================
>>  ---
>>  
>> openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>  +++ 
>> openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>  @@ -315,6 +315,7 @@ platform_check_image() {
>>   	mc-mac1200r | \
>>   	onion-omega | \
>>   	oolite | \
>>  +	minibox-v1 |\
> 
> Bad sort.
> 
>>   	smart-300 | \
>>   	tl-mr10u | \
>>   	tl-mr11u | \
>>  Index: openwrt/trunk/target/linux/ar71xx/config-4.1
>>  ===================================================================
>>  --- openwrt.orig/trunk/target/linux/ar71xx/config-4.1
>>  +++ openwrt/trunk/target/linux/ar71xx/config-4.1
>>  @@ -73,6 +73,7 @@ CONFIG_ATH79_MACH_EW_DORIN=y
>>   CONFIG_ATH79_MACH_F9K1115V2=y
>>   CONFIG_ATH79_MACH_GL_INET=y
>>   CONFIG_ATH79_MACH_GS_OOLITE=y
>>  +CONFIG_ATH79_MACH_MINIBOX_V1=y
> 
> 
> very bad sort.  config files have even strong sorting requirements.
> 
>>   CONFIG_ATH79_MACH_HIWIFI_HC6361=y
>>   CONFIG_ATH79_MACH_HORNET_UB=y
>>   CONFIG_ATH79_MACH_JA76PF=y
>>  Index:
>>  
>> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>>  ===================================================================
>>  --- /dev/null
>>  +++
>>  
>> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>>  @@ -0,0 +1,85 @@
>>  +/*
>>  + *  Oolite board support
> 
> 
> Wrong.  Oolite is the board you copied.  This file should be 
> accurately
> describe what it does, not what it used to do at some point.
> 
>>  + *
>>  + *
>>  + *  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.
>>  + */
>>  +
>>  +#include <linux/gpio.h>
>>  +
>>  +#include <asm/mach-ath79/ath79.h>
>>  +#include <asm/mach-ath79/ar71xx_regs.h>
>>  +
>>  +#include "common.h"
>>  +#include "dev-eth.h"
>>  +#include "dev-gpio-buttons.h"
>>  +#include "dev-leds-gpio.h"
>>  +#include "dev-m25p80.h"
>>  +#include "dev-wmac.h"
>>  +#include "machtypes.h"
>>  +#include "dev-usb.h"
> 
> 
> It's a matter of taste, but you didn't think of putting all the dev-
> includes together?
> 
>>  +
>>  +#define MINIBOX_V1_GPIO_BTN_RESET	11
>>  +
>>  +#define MINIBOX_V1_GPIO_LED_SYSTEM	1
>>  +
>>  +#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
>>  +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 *
>>  MINIBOX_V1_KEYS_POLL_INTERVAL)
>>  +
>>  +static const char *MINIBOX_V1_part_probes[] = {
>>  +	"tp-link",
>>  +	NULL,
>>  +};
>>  +
>>  +static struct flash_platform_data MINIBOX_V1_flash_data = {
>>  +	.part_probes	= MINIBOX_V1_part_probes,
>>  +};
>>  +
>>  +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
>>  +	{
>>  +		.name		= "minibox-v1:green:system",
>>  +		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
>>  +		.active_low	= 0,
>>  +	},
>>  +};
>>  +
>>  +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = 
>> {
>>  +	{
>>  +		.desc		= "reset",
>>  +		.type		= EV_KEY,
>>  +		.code		= KEY_RESTART,
>>  +		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
>>  +		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
>>  +		.active_low	= 0,
>>  +	},
>>  +};
>>  +
>>  +static void __init MINIBOX_V1_setup(void)
>>  +{
>>  +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
>>  +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
>>  +
>>  +	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
>>  +				 MINIBOX_V1_leds_gpio);
>>  +
>>  +	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
>>  +					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
>>  +					MINIBOX_V1_gpio_keys);
>>  +
>>  +	ath79_register_usb();
>>  +
>>  +	ath79_register_m25p80(&MINIBOX_V1_flash_data);
>>  +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
>>  +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
>>  +
>>  +	ath79_register_mdio(0, 0x0);
>>  +	ath79_register_eth(1);
>>  +	ath79_register_eth(0);
>>  +
>>  +	ath79_register_wmac(ee, mac);
>>  +}
>>  +
>>  +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
>>  +	     "MiniBox V1.0", MINIBOX_V1_setup);
>>  Index: 
>> openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>>  ===================================================================
>>  --- /dev/null
>>  +++ openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>>  @@ -0,0 +1,17 @@
>>  +#
>>  +# Copyright (C) 2015 OpenWrt.org
>>  +#
>>  +# This is free software, licensed under the GNU General Public 
>> License
>>  v2.
>>  +# See /LICENSE for more information.
>>  +#
>>  +
>>  +define Profile/MINIBOXV1
>>  +	NAME:=MINIBOX V1.0
>>  +	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
>>  +endef
>>  +
>>  +
>>  +define Profile/MINIBOXV1/Description
>>  +	Package set optimized for the MINIBOX V1.0
>>  +endef
>>  +$(eval $(call Profile,MINIBOXV1))
>>  Index: openwrt/trunk/target/linux/ar71xx/image/Makefile
>>  ===================================================================
>>  --- openwrt.orig/trunk/target/linux/ar71xx/image/Makefile
>>  +++ openwrt/trunk/target/linux/ar71xx/image/Makefile
>>  @@ -902,6 +902,15 @@ endef
>> 
>>   TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus
>> 
>>  +define Device/minibox-v1
>>  +    $(Device/tplink-16mlzma)
>>  +    BOARDNAME := MINIBOX-V1
>>  +    DEVICE_PROFILE := MINIBOXV1
>>  +    TPLINK_HWID := 0x3C000201
>>  +    CONSOLE := ttyATH0,115200
>>  +endef
>>  +TARGET_DEVICES += minibox-v1
>>  +
>>   rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst
>>  squashfs-%,squashfs,$(1)))
>> 
>>   # $(1): rootfs type.
>>  Index:
>>  
>> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>>  ===================================================================
>>  --- /dev/null
>>  +++
>>  
>> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>>  @@ -0,0 +1,39 @@
>>  +--- a/arch/mips/ath79/machtypes.h
>>  ++++ b/arch/mips/ath79/machtypes.h
>>  +@@ -61,6 +61,7 @@ enum ath79_mach_type {
>>  +	ATH79_MACH_ESR1750,		/* EnGenius ESR1750 */
>>  +	ATH79_MACH_GL_INET,		/* GL-CONNECT GL-INET */
>>  +	ATH79_MACH_GS_OOLITE,           /* GS OOLITE V1.0 */
>>  ++	ATH79_MACH_MINIBOX_V1,           /* MINIBOX V1.0 */
>>  +	ATH79_MACH_HIWIFI_HC6361,	/* HiWiFi HC6361 */
>>  +	ATH79_MACH_JA76PF,		/* jjPlus JA76PF */
>>  +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
>>  +--- a/arch/mips/ath79/Kconfig
>>  ++++ b/arch/mips/ath79/Kconfig
>>  +@@ -446,6 +446,16 @@ config ATH79_MACH_GS_OOLITE
>>  +       select ATH79_DEV_USB
>>  +       select ATH79_DEV_WMAC
>>  +
>>  ++config ATH79_MACH_MINIBOX_V1
>>  ++       bool "OOLITE BOX V1.0 support"
> 
> wrong board name again.
> 
> 
>>  ++       select SOC_AR933X
>>  ++       select ARH79_DEV_ETH
>>  ++       select ARH79_DEV_GPIO_BUTTONS
>>  ++       select ATH79_DEV_LEDS_GPIO
>>  ++       select ATH79_DEV_M25P80
>>  ++       select ATH79_DEV_USB
>>  ++       select ATH79_DEV_WMAC
>>  ++
>>  + config ATH79_MACH_HIWIFI_HC6361
>>  +	bool "HiWiFi HC6361 board support"
>>  +	select SOC_AR933X
>>  +--- a/arch/mips/ath79/Makefile
>>  ++++ b/arch/mips/ath79/Makefile
>>  +@@ -72,6 +72,7 @@ obj-$(CONFIG_ATH79_MACH_DIR_825_C1)	+= m
>>  + obj-$(CONFIG_ATH79_MACH_ESR1750)	+= mach-esr1750.o
>>  + obj-$(CONFIG_ATH79_MACH_GL_INET)	+= mach-gl-inet.o
>>  + obj-$(CONFIG_ATH79_MACH_GS_OOLITE)	+= mach-gs-oolite.o
>>  ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
>>  + obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361)	+= mach-hiwifi-hc6361.o
>>  + obj-$(CONFIG_ATH79_MACH_JA76PF)		+= mach-ja76pf.o
>>  + obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
>> 
>> 
>>  _______________________________________________
>>  openwrt-devel mailing list
>>  openwrt-devel at lists.openwrt.org
>>  https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
> - --
> Sent using Mailpile, Free Software from www.mailpile.is
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> 
> iQIcBAEBAgAGBQJVyKMrAAoJEBmotQ/U1cr2eTgQAMCTCTW+tAdMfbstFBud1M7U
> MqsY2mZWQODU24pCQg4eJX5jskj5zXbxQCPBwZ8xwAfbZ/DBOQH23xauPfFDCqi2
> U1mxC60GqS6C5bm0ZF8+kJeSRWnlwOX3vckwpZAnQYvyZUemGWef2JIUc7glS2kn
> NvQxCkwhl4PYWMl+Nox1De5NgOi0Ft1dUdXVAdLBm3abZMIYMcijWhR0iMjS3Snt
> SAzReHPr0v3XCXwQ+bc7aN1el1KeXhT+Bkv1WPKDrfvACjB6kZup8WKtXGYUy15L
> 7tMdOeiyHHfZZOaKg+qUzRCj+9g4DQpDqsQVtu/f5eicfOHjDZRA7kyZnxrcUJy1
> 6v3L8/2vNDxZY/z5gz7ilPl9k+EPECn56GtepWKjE9yzOSgRg1enlmfXh4g2SJgF
> +G1GSKsoyO4FuhzGMJ0xd5UMNE93nncK05vYHmUs3+OXoTj+eA8QGnIzByVJT197
> NL7Ared98MpB6SenOQVnwKoi8YtPHWqjK2lnjplu0Jxb0ULdAVVa7SlV8Cmyd+89
> +KtINxWxKdokzQKPus17YaSdJtcKVtExfaadCqA2HGbIwNCAx+KS7UxGESA/iSaD
> XMSAPyCXQCqg9eznZGtZEwq7q0PRvyw98UbdyYG9AMUtO2XdCgxHImxfbb9RMo6p
> 0EUe8DdJPkWLEXxHd21D
> =saX1
> -----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150812/50742ee0/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From francesco.borromini at inventati.org  Wed Aug 12 15:05:48 2015
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Wed, 12 Aug 2015 21:05:48 +0200
Subject: [OpenWrt-Devel] [PATCH] Ar71xx: Add Minibox v1.0 support
In-Reply-To: <1439404114.2716.0@smtp.autistici.org>
References: <1439404114.2716.0@smtp.autistici.org>
Message-ID: <1439406348.3047.0@smtp.autistici.org>

There was an error in the patch on Sprunge, so new link:

http://sprunge.us/biVc

The other links are fine.

Cheers

Stijn

Op wo, 12 aug 2015 om 8:28 , schreef Stijn Segers 
<francesco.borromini at inventati.org>:
> Hi Karl,
> 
> Thanks for your time.
> 
> I have reworked the patch and re-ordered where possible (files like 
> ar71xx.sh and diag.sh lack any alphabetical
> order). I have removed the code that set the led to status_led_off. 
> What file should I be looking at, when you talk
> about the board file? Is it the minibox-v1.mk file? I diffed from the 
> vendor's code (and added a profile by comparing
> with other devices) but that was it.
> 
> I don't have the hardware myself but I have found a tester willing to 
> run the image (and see how the LED behaves with
> the default OpenWrt settings).
> 
> 
> The new patch can be found here:
> 
> https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-trunk.patch
> 
> If that doesn't work, a backup: http://sprunge.us/AUbX
> 
> 
> And for those wanting to try on 15.05:
> 
> https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-15.05.patch
> 
> Thanks
> 
> Stijn
> 
> 
> 
> Op ma, 10 aug 2015 om 3:12 , schreef Karl Palsson 
> <karlp at tweak.net.au>:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> 
>> This has many cases where you have added the board out of order.  The
>> lists are generally alphabetically sorted, and should be maintained 
>> that
>> way, even though a few boards escaped this.
>> 
>> More comments inline.
>> 
>> 
>> Stijn Segers <francesco.borromini at inventati.org> wrote:
>>>  Hello,
>>> 
>>>  The patch below adds support for the Gainstrong Minibox v1.0 mini
>>>  router into trunk. This is based off the Barrier Breaker based 
>>> source
>>>  code at http://ooioe.com/miniboxv1/Sourcecode/.
>>> 
>>>  Patch applies cleanly, has been compile-tested on a 15.05 tree (the
>>>  patch below is for the trunk ar17xx target with kernel 4.1). For 
>>> those
>>>  interested, I can provide the 15.05 patch as well.
>>> 
>>>  Any questions, let me know.
>>> 
>>>  Thank you
>>> 
>>>  Stijn
>>> 
>>> 
>>> 
>>> 
>>>  Index: openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>>  ===================================================================
>>>  --- openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>>  +++ openwrt/trunk/target/linux/ar71xx/base-files/etc/diag.sh
>>>  @@ -222,6 +222,9 @@ get_status_led() {
>>>   	qihoo-c301)
>>>   		status_led="qihoo:green:status"
>>>   		;;
>>>  +	minibox-v1)
>>>  +		status_led="minibox-v1:green:system"
>>>  +		;;
>>>   	tew-632brp)
>>>   		status_led="tew-632brp:green:status"
>>>   		;;
>>>  @@ -366,7 +369,7 @@ set_state() {
>>>   		status_led_blink_preinit_regular
>>>   		;;
>>>   	done)
>>>  -		status_led_on
>>>  +		status_led_off
>> 
>> Pretty sure you can't just change this for everyone.  If you have an
>> active low/active high issue, you should fix that in your board file.
>> 
>>>   		case $(ar71xx_board_name) in
>>>   		qihoo-c301)
>>>   			local n=$(fw_printenv activeregion | cut -d = -f 2)
>>>  Index:
>>>  
>>> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>>  ===================================================================
>>>  ---
>>>  
>>> openwrt.orig/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>>  +++
>>>  
>>> openwrt/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>>>  @@ -419,6 +419,7 @@ ja76pf |\
>>>   mc-mac1200r|\
>>>   mynet-n600 |\
>>>   oolite |\
>>>  +minibox-v1 |\
>> 
>> 
>> I know gainstrong makes the oolite too, but at this point in this 
>> file,
>> that's irrelevant, keep the alphabetical sorting.
>> 
>>>   qihoo-c301 |\
>>>   rb-750 |\
>>>   rb-751 |\
>>>  Index: openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>>  ===================================================================
>>>  --- openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>>  +++ openwrt/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>>  @@ -119,6 +119,9 @@ tplink_board_detect() {
>>>   	"3C0001"*)
>>>   		model="OOLITE"
>>>   		;;
>>>  +	"3C0002"*)
>>>  +		model="MINIBOX_V1"
>>>  +		;;
>>>   	"070300"*)
>>>   		model="TP-Link TL-WR703N"
>>>   		;;
>>>  @@ -320,6 +323,9 @@ ar71xx_board_detect() {
>>>   	*"AC1750DB")
>>>   		name="f9k1115v2"
>>>   		;;
>>>  +	*"MiniBox V1.0")
>>>  +		name="minibox-v1"
>>>  +		;;
>> 
>> Bad sort.
>> 
>>>   	*"AirGateway")
>>>   		name="airgateway"
>>>   		;;
>>>  Index:
>>>  
>>> openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>>  ===================================================================
>>>  ---
>>>  
>>> openwrt.orig/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>>  +++ 
>>> openwrt/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>>>  @@ -315,6 +315,7 @@ platform_check_image() {
>>>   	mc-mac1200r | \
>>>   	onion-omega | \
>>>   	oolite | \
>>>  +	minibox-v1 |\
>> 
>> Bad sort.
>> 
>>>   	smart-300 | \
>>>   	tl-mr10u | \
>>>   	tl-mr11u | \
>>>  Index: openwrt/trunk/target/linux/ar71xx/config-4.1
>>>  ===================================================================
>>>  --- openwrt.orig/trunk/target/linux/ar71xx/config-4.1
>>>  +++ openwrt/trunk/target/linux/ar71xx/config-4.1
>>>  @@ -73,6 +73,7 @@ CONFIG_ATH79_MACH_EW_DORIN=y
>>>   CONFIG_ATH79_MACH_F9K1115V2=y
>>>   CONFIG_ATH79_MACH_GL_INET=y
>>>   CONFIG_ATH79_MACH_GS_OOLITE=y
>>>  +CONFIG_ATH79_MACH_MINIBOX_V1=y
>> 
>> 
>> very bad sort.  config files have even strong sorting requirements.
>> 
>>>   CONFIG_ATH79_MACH_HIWIFI_HC6361=y
>>>   CONFIG_ATH79_MACH_HORNET_UB=y
>>>   CONFIG_ATH79_MACH_JA76PF=y
>>>  Index:
>>>  
>>> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>>>  ===================================================================
>>>  --- /dev/null
>>>  +++
>>>  
>>> openwrt/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>>>  @@ -0,0 +1,85 @@
>>>  +/*
>>>  + *  Oolite board support
>> 
>> 
>> Wrong.  Oolite is the board you copied.  This file should be 
>> accurately
>> describe what it does, not what it used to do at some point.
>> 
>>>  + *
>>>  + *
>>>  + *  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.
>>>  + */
>>>  +
>>>  +#include <linux/gpio.h>
>>>  +
>>>  +#include <asm/mach-ath79/ath79.h>
>>>  +#include <asm/mach-ath79/ar71xx_regs.h>
>>>  +
>>>  +#include "common.h"
>>>  +#include "dev-eth.h"
>>>  +#include "dev-gpio-buttons.h"
>>>  +#include "dev-leds-gpio.h"
>>>  +#include "dev-m25p80.h"
>>>  +#include "dev-wmac.h"
>>>  +#include "machtypes.h"
>>>  +#include "dev-usb.h"
>> 
>> 
>> It's a matter of taste, but you didn't think of putting all the dev-
>> includes together?
>> 
>>>  +
>>>  +#define MINIBOX_V1_GPIO_BTN_RESET	11
>>>  +
>>>  +#define MINIBOX_V1_GPIO_LED_SYSTEM	1
>>>  +
>>>  +#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
>>>  +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 *
>>>  MINIBOX_V1_KEYS_POLL_INTERVAL)
>>>  +
>>>  +static const char *MINIBOX_V1_part_probes[] = {
>>>  +	"tp-link",
>>>  +	NULL,
>>>  +};
>>>  +
>>>  +static struct flash_platform_data MINIBOX_V1_flash_data = {
>>>  +	.part_probes	= MINIBOX_V1_part_probes,
>>>  +};
>>>  +
>>>  +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
>>>  +	{
>>>  +		.name		= "minibox-v1:green:system",
>>>  +		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
>>>  +		.active_low	= 0,
>>>  +	},
>>>  +};
>>>  +
>>>  +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata 
>>> = {
>>>  +	{
>>>  +		.desc		= "reset",
>>>  +		.type		= EV_KEY,
>>>  +		.code		= KEY_RESTART,
>>>  +		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
>>>  +		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
>>>  +		.active_low	= 0,
>>>  +	},
>>>  +};
>>>  +
>>>  +static void __init MINIBOX_V1_setup(void)
>>>  +{
>>>  +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
>>>  +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
>>>  +
>>>  +	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
>>>  +				 MINIBOX_V1_leds_gpio);
>>>  +
>>>  +	ath79_register_gpio_keys_polled(-1, 
>>> MINIBOX_V1_KEYS_POLL_INTERVAL,
>>>  +					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
>>>  +					MINIBOX_V1_gpio_keys);
>>>  +
>>>  +	ath79_register_usb();
>>>  +
>>>  +	ath79_register_m25p80(&MINIBOX_V1_flash_data);
>>>  +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
>>>  +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
>>>  +
>>>  +	ath79_register_mdio(0, 0x0);
>>>  +	ath79_register_eth(1);
>>>  +	ath79_register_eth(0);
>>>  +
>>>  +	ath79_register_wmac(ee, mac);
>>>  +}
>>>  +
>>>  +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
>>>  +	     "MiniBox V1.0", MINIBOX_V1_setup);
>>>  Index: 
>>> openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>>>  ===================================================================
>>>  --- /dev/null
>>>  +++ 
>>> openwrt/trunk/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>>>  @@ -0,0 +1,17 @@
>>>  +#
>>>  +# Copyright (C) 2015 OpenWrt.org
>>>  +#
>>>  +# This is free software, licensed under the GNU General Public 
>>> License
>>>  v2.
>>>  +# See /LICENSE for more information.
>>>  +#
>>>  +
>>>  +define Profile/MINIBOXV1
>>>  +	NAME:=MINIBOX V1.0
>>>  +	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
>>>  +endef
>>>  +
>>>  +
>>>  +define Profile/MINIBOXV1/Description
>>>  +	Package set optimized for the MINIBOX V1.0
>>>  +endef
>>>  +$(eval $(call Profile,MINIBOXV1))
>>>  Index: openwrt/trunk/target/linux/ar71xx/image/Makefile
>>>  ===================================================================
>>>  --- openwrt.orig/trunk/target/linux/ar71xx/image/Makefile
>>>  +++ openwrt/trunk/target/linux/ar71xx/image/Makefile
>>>  @@ -902,6 +902,15 @@ endef
>>> 
>>>   TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus
>>> 
>>>  +define Device/minibox-v1
>>>  +    $(Device/tplink-16mlzma)
>>>  +    BOARDNAME := MINIBOX-V1
>>>  +    DEVICE_PROFILE := MINIBOXV1
>>>  +    TPLINK_HWID := 0x3C000201
>>>  +    CONSOLE := ttyATH0,115200
>>>  +endef
>>>  +TARGET_DEVICES += minibox-v1
>>>  +
>>>   rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst
>>>  squashfs-%,squashfs,$(1)))
>>> 
>>>   # $(1): rootfs type.
>>>  Index:
>>>  
>>> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>>>  ===================================================================
>>>  --- /dev/null
>>>  +++
>>>  
>>> openwrt/trunk/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>>>  @@ -0,0 +1,39 @@
>>>  +--- a/arch/mips/ath79/machtypes.h
>>>  ++++ b/arch/mips/ath79/machtypes.h
>>>  +@@ -61,6 +61,7 @@ enum ath79_mach_type {
>>>  +	ATH79_MACH_ESR1750,		/* EnGenius ESR1750 */
>>>  +	ATH79_MACH_GL_INET,		/* GL-CONNECT GL-INET */
>>>  +	ATH79_MACH_GS_OOLITE,           /* GS OOLITE V1.0 */
>>>  ++	ATH79_MACH_MINIBOX_V1,           /* MINIBOX V1.0 */
>>>  +	ATH79_MACH_HIWIFI_HC6361,	/* HiWiFi HC6361 */
>>>  +	ATH79_MACH_JA76PF,		/* jjPlus JA76PF */
>>>  +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
>>>  +--- a/arch/mips/ath79/Kconfig
>>>  ++++ b/arch/mips/ath79/Kconfig
>>>  +@@ -446,6 +446,16 @@ config ATH79_MACH_GS_OOLITE
>>>  +       select ATH79_DEV_USB
>>>  +       select ATH79_DEV_WMAC
>>>  +
>>>  ++config ATH79_MACH_MINIBOX_V1
>>>  ++       bool "OOLITE BOX V1.0 support"
>> 
>> wrong board name again.
>> 
>> 
>>>  ++       select SOC_AR933X
>>>  ++       select ARH79_DEV_ETH
>>>  ++       select ARH79_DEV_GPIO_BUTTONS
>>>  ++       select ATH79_DEV_LEDS_GPIO
>>>  ++       select ATH79_DEV_M25P80
>>>  ++       select ATH79_DEV_USB
>>>  ++       select ATH79_DEV_WMAC
>>>  ++
>>>  + config ATH79_MACH_HIWIFI_HC6361
>>>  +	bool "HiWiFi HC6361 board support"
>>>  +	select SOC_AR933X
>>>  +--- a/arch/mips/ath79/Makefile
>>>  ++++ b/arch/mips/ath79/Makefile
>>>  +@@ -72,6 +72,7 @@ obj-$(CONFIG_ATH79_MACH_DIR_825_C1)	+= m
>>>  + obj-$(CONFIG_ATH79_MACH_ESR1750)	+= mach-esr1750.o
>>>  + obj-$(CONFIG_ATH79_MACH_GL_INET)	+= mach-gl-inet.o
>>>  + obj-$(CONFIG_ATH79_MACH_GS_OOLITE)	+= mach-gs-oolite.o
>>>  ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
>>>  + obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361)	+= mach-hiwifi-hc6361.o
>>>  + obj-$(CONFIG_ATH79_MACH_JA76PF)		+= mach-ja76pf.o
>>>  + obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
>>> 
>>> 
>>>  _______________________________________________
>>>  openwrt-devel mailing list
>>>  openwrt-devel at lists.openwrt.org
>>>  https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>> 
>> - --
>> Sent using Mailpile, Free Software from www.mailpile.is
>> 
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.11 (GNU/Linux)
>> 
>> iQIcBAEBAgAGBQJVyKMrAAoJEBmotQ/U1cr2eTgQAMCTCTW+tAdMfbstFBud1M7U
>> MqsY2mZWQODU24pCQg4eJX5jskj5zXbxQCPBwZ8xwAfbZ/DBOQH23xauPfFDCqi2
>> U1mxC60GqS6C5bm0ZF8+kJeSRWnlwOX3vckwpZAnQYvyZUemGWef2JIUc7glS2kn
>> NvQxCkwhl4PYWMl+Nox1De5NgOi0Ft1dUdXVAdLBm3abZMIYMcijWhR0iMjS3Snt
>> SAzReHPr0v3XCXwQ+bc7aN1el1KeXhT+Bkv1WPKDrfvACjB6kZup8WKtXGYUy15L
>> 7tMdOeiyHHfZZOaKg+qUzRCj+9g4DQpDqsQVtu/f5eicfOHjDZRA7kyZnxrcUJy1
>> 6v3L8/2vNDxZY/z5gz7ilPl9k+EPECn56GtepWKjE9yzOSgRg1enlmfXh4g2SJgF
>> +G1GSKsoyO4FuhzGMJ0xd5UMNE93nncK05vYHmUs3+OXoTj+eA8QGnIzByVJT197
>> NL7Ared98MpB6SenOQVnwKoi8YtPHWqjK2lnjplu0Jxb0ULdAVVa7SlV8Cmyd+89
>> +KtINxWxKdokzQKPus17YaSdJtcKVtExfaadCqA2HGbIwNCAx+KS7UxGESA/iSaD
>> XMSAPyCXQCqg9eznZGtZEwq7q0PRvyw98UbdyYG9AMUtO2XdCgxHImxfbb9RMo6p
>> 0EUe8DdJPkWLEXxHd21D
>> =saX1
>> -----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150812/e8e59de7/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From smilebef at gmail.com  Wed Aug 12 15:29:18 2015
From: smilebef at gmail.com (smilebef at gmail.com)
Date: Wed, 12 Aug 2015 21:29:18 +0200
Subject: [OpenWrt-Devel] i get no image for TL-WA7510
Message-ID: <20150812212918.592b6053@None>

I miss not only the TL-WA7510 image. I missing also several images
for other 4MB Flash-Router.

Is there a Funktion in Openwrt which build images only if the image-size
not excite the flash-size?

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150812/07e3c7a5/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From hauke at hauke-m.de  Wed Aug 12 16:01:25 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Wed, 12 Aug 2015 22:01:25 +0200
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <1436955076.2904.33.camel@pluto.fritz.box>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>
 <20150310033038.9542.63440.stgit@perseus.themaw.net>
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>
 <1435462659.17034.23.camel@perseus.themaw.net>
 <CACna6rwaqcWndm06S8kGXUYGtHsy74Lre_xEm2oy_R6mbcO7Jg@mail.gmail.com>
 <1436955076.2904.33.camel@pluto.fritz.box>
Message-ID: <55CBA615.60308@hauke-m.de>

On 07/15/2015 12:11 PM, Ian Kent wrote:
> On Tue, 2015-07-14 at 18:19 +0200, Rafa? Mi?ecki wrote:
>> On 28 June 2015 at 05:37, Ian Kent <raven at themaw.net> wrote:
>>> Let me rework this using the bus number as you recommend.
>>> I'll repost my updated patch series once I've done that.
>>
>> Hi Ian,
>>
>> Is there any chance you'll find a moment for it anytime soon? It'd be
>> awesome to get R8000 support for CC release.
> 
> I have reworked the patch and a broken package build problem I had is
> gone but I didn't get time to fix build problems with a third patch I
> have.
> 
> Just didn't get time last weekend and this week has been quite busy too.
> I'll try and get onto this in the next few days.
> 
> Ian

Hi Ian,

you patch looks better than the hack Broadcom did in their vendor driver.

Could you send me a lspci output or the content of /proc/bus/pci/devices
of the original firmware or of OpenWrt with your patch applied? I would
prefer lspci because it is easier to read but cat from
/proc/bus/pci/devices also works. I do not have such a device and want
to understand how this PCIe switch looks like on the software side, so
we can fix the domain, bus, slot, function mixup.

On the hardware side this SoC has 3 PCIe controllers, but one shares a
PHY with the USB 3.0 controller. Instead of using the 3rd PCIe
controller they used USB 3.0 and split one of the PCIe controllers into
2 PCIE lanes.

If someone else has an Netgear R8000 or any other device with this PCIe
switch also feel free to send some information about the PCIe switch.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From mathieu at codeaurora.org  Wed Aug 12 22:37:39 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed, 12 Aug 2015 19:37:39 -0700
Subject: [OpenWrt-Devel] [PATCH 0/5] ipq806x: add support for SMEM based MTD
	parser
Message-ID: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>

This patch sets intents to add a new MTD parser for QCOM parser which
makes use of the information available in SMEM to provide the flash
layout. We're also cherry-picking drivers for SMEM & HW spinlocks from
LKML as dependencies.

This has been tested on AP148, both for NOR & NAND flash. The MTD layout
was detected accurately on both boot methods.

Mathieu Olivari (5):
  kernel: move linux,part-probe dt parsing in generic code
  ipq806x: add hwspinlock support
  ipq806x: add SMEM support
  ipq806x: add QCOM SMEM based MTD parser
  ipq806x: switch AP148 to using SMEM based MTD parser

 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 -----
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++
 .../400-mtd-add-rootfs-split-support.patch         |  16 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch        |   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
 .../411-mtd-partial_eraseblock_write.patch         |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++
 .../400-mtd-add-rootfs-split-support.patch         |  15 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch        |   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
 .../411-mtd-partial_eraseblock_write.patch         |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
 target/linux/ipq806x/config-3.18                   |   4 +
 target/linux/ipq806x/config-4.1                    |   8 +-
 .../patches-3.18/021-add-ap148-partitions.patch    |  34 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 ++++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 ++++++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  20 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +++++++++++++++++++++
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  26 +
 .../037-mtd-add-qcom-smem-parser.patch             | 253 +++++++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   8 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   6 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch    |   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   4 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-4.1/021-add-ap148-partitions.patch     |  34 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 ++++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 ++++++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  21 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +++++++++++++++++++++
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  27 +
 .../patches-4.1/037-mtd-add-qcom-smem-parser.patch | 253 +++++++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch     |   6 +-
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |   4 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   4 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   4 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 56 files changed, 3765 insertions(+), 313 deletions(-)
 delete mode 100644 target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/037-mtd-add-qcom-smem-parser.patch

-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Wed Aug 12 22:37:40 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed, 12 Aug 2015 19:37:40 -0700
Subject: [OpenWrt-Devel] [PATCH 1/5] kernel: move linux,
	part-probe dt parsing in generic code
In-Reply-To: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
References: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439433464-1526-2-git-send-email-mathieu@codeaurora.org>

The "linux,part-probe" dts parsing is a pretty neat generic feature.
It has been posted to kernel.org and could easily be reused by all
targets.

This change moves the patch to the 3.18 and 4.1 generic folders, and
makes the feature available to all platforms who may want to use it.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 ---------------------
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++++++++++++++++++
 .../400-mtd-add-rootfs-split-support.patch         |  16 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch        |   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
 .../411-mtd-partial_eraseblock_write.patch         |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++++++++++++++++++
 .../400-mtd-add-rootfs-split-support.patch         |  15 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch        |   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
 .../411-mtd-partial_eraseblock_write.patch         |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
 19 files changed, 400 insertions(+), 224 deletions(-)
 delete mode 100644 target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch

diff --git a/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
deleted file mode 100644
index 686696e..0000000
--- a/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-From 173b0add0cff6558f950c0cb1eacfb729d482711 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke at hauke-m.de>
-Date: Sun, 17 May 2015 18:48:38 +0200
-Subject: [PATCH 4/8] mtd: part: add generic parsing of linux,part-probe
-
-This moves the linux,part-probe device tree parsing code from
-physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
-providing a reference to their device tree node in struct
-mtd_part_parser_data.
-
-Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
----
- Documentation/devicetree/bindings/mtd/nand.txt | 16 ++++++++++
- drivers/mtd/maps/physmap_of.c                  | 40 +-----------------------
- drivers/mtd/mtdpart.c                          | 43 ++++++++++++++++++++++++++
- 3 files changed, 60 insertions(+), 39 deletions(-)
-
---- a/Documentation/devicetree/bindings/mtd/nand.txt
-+++ b/Documentation/devicetree/bindings/mtd/nand.txt
-@@ -12,6 +12,22 @@
- - nand-ecc-step-size: integer representing the number of data bytes
- 		      that are covered by a single ECC step.
- 
-+- linux,part-probe: list of name as strings of the partition parser
-+		    which should be used to parse the partition table.
-+		    They will be tried in the specified ordering and
-+		    the next one will be used if the previous one
-+		    failed.
-+
-+		    Example: linux,part-probe = "cmdlinepart", "ofpart";
-+
-+		    This is also the default value, which will be used
-+		    if this attribute is not specified. It could be
-+		    that the flash driver in use overwrote the default
-+		    value and uses some other default.
-+
-+		    Possible values are: bcm47xxpart, afs, ar7part,
-+		    ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart
-+
- The ECC strength and ECC step size properties define the correction capability
- of a controller. Together, they say a controller can correct "{strength} bit
- errors per {size} bytes".
---- a/drivers/mtd/maps/physmap_of.c
-+++ b/drivers/mtd/maps/physmap_of.c
-@@ -112,45 +112,9 @@ static struct mtd_info *obsolete_probe(s
- static const char * const part_probe_types_def[] = {
- 	"cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
- 
--static const char * const *of_get_probes(struct device_node *dp)
--{
--	const char *cp;
--	int cplen;
--	unsigned int l;
--	unsigned int count;
--	const char **res;
--
--	cp = of_get_property(dp, "linux,part-probe", &cplen);
--	if (cp == NULL)
--		return part_probe_types_def;
--
--	count = 0;
--	for (l = 0; l != cplen; l++)
--		if (cp[l] == 0)
--			count++;
--
--	res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL);
--	count = 0;
--	while (cplen > 0) {
--		res[count] = cp;
--		l = strlen(cp) + 1;
--		cp += l;
--		cplen -= l;
--		count++;
--	}
--	return res;
--}
--
--static void of_free_probes(const char * const *probes)
--{
--	if (probes != part_probe_types_def)
--		kfree(probes);
--}
--
- static struct of_device_id of_flash_match[];
- static int of_flash_probe(struct platform_device *dev)
- {
--	const char * const *part_probe_types;
- 	const struct of_device_id *match;
- 	struct device_node *dp = dev->dev.of_node;
- 	struct resource res;
-@@ -310,10 +274,8 @@ static int of_flash_probe(struct platfor
- 		goto err_out;
- 
- 	ppdata.of_node = dp;
--	part_probe_types = of_get_probes(dp);
--	mtd_device_parse_register(info->cmtd, part_probe_types, &ppdata,
-+	mtd_device_parse_register(info->cmtd, part_probe_types_def, &ppdata,
- 			NULL, 0);
--	of_free_probes(part_probe_types);
- 
- 	kfree(mtd_list);
- 
---- a/drivers/mtd/mtdpart.c
-+++ b/drivers/mtd/mtdpart.c
-@@ -29,6 +29,7 @@
- #include <linux/kmod.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/partitions.h>
-+#include <linux/of.h>
- #include <linux/magic.h>
- #include <linux/err.h>
- #include <linux/kconfig.h>
-@@ -992,6 +993,40 @@ void deregister_mtd_parser(struct mtd_pa
- EXPORT_SYMBOL_GPL(deregister_mtd_parser);
- 
- /*
-+ * Parses the linux,part-probe device tree property.
-+ * When a non null value is returned it has to be freed with kfree() by
-+ * the caller.
-+ */
-+static const char * const *of_get_probes(struct device_node *dp)
-+{
-+	const char *cp;
-+	int cplen;
-+	unsigned int l;
-+	unsigned int count;
-+	const char **res;
-+
-+	cp = of_get_property(dp, "linux,part-probe", &cplen);
-+	if (cp == NULL)
-+		return NULL;
-+
-+	count = 0;
-+	for (l = 0; l != cplen; l++)
-+		if (cp[l] == 0)
-+			count++;
-+
-+	res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL);
-+	count = 0;
-+	while (cplen > 0) {
-+		res[count] = cp;
-+		l = strlen(cp) + 1;
-+		cp += l;
-+		cplen -= l;
-+		count++;
-+	}
-+	return res;
-+}
-+
-+/*
-  * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
-  * are changing this array!
-  */
-@@ -1027,6 +1062,13 @@ int parse_mtd_partitions(struct mtd_info
- {
- 	struct mtd_part_parser *parser;
- 	int ret = 0;
-+	const char *const *types_of = NULL;
-+
-+	if (data && data->of_node) {
-+		types_of = of_get_probes(data->of_node);
-+		if (types_of != NULL)
-+			types = types_of;
-+	}
- 
- 	if (!types)
- 		types = default_mtd_part_types;
-@@ -1045,6 +1087,7 @@ int parse_mtd_partitions(struct mtd_info
- 			break;
- 		}
- 	}
-+	kfree(types_of);
- 	return ret;
- }
- 
diff --git a/target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
new file mode 100644
index 0000000..bd34f96
--- /dev/null
+++ b/target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
@@ -0,0 +1,175 @@
+From 173b0add0cff6558f950c0cb1eacfb729d482711 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Sun, 17 May 2015 18:48:38 +0200
+Subject: [PATCH 4/8] mtd: part: add generic parsing of linux,part-probe
+
+This moves the linux,part-probe device tree parsing code from
+physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
+providing a reference to their device tree node in struct
+mtd_part_parser_data.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ Documentation/devicetree/bindings/mtd/nand.txt | 16 ++++++++++
+ drivers/mtd/maps/physmap_of.c                  | 40 +-----------------------
+ drivers/mtd/mtdpart.c                          | 43 ++++++++++++++++++++++++++
+ 3 files changed, 60 insertions(+), 39 deletions(-)
+
+--- a/Documentation/devicetree/bindings/mtd/nand.txt
++++ b/Documentation/devicetree/bindings/mtd/nand.txt
+@@ -12,6 +12,22 @@
+ - nand-ecc-step-size: integer representing the number of data bytes
+ 		      that are covered by a single ECC step.
+ 
++- linux,part-probe: list of name as strings of the partition parser
++		    which should be used to parse the partition table.
++		    They will be tried in the specified ordering and
++		    the next one will be used if the previous one
++		    failed.
++
++		    Example: linux,part-probe = "cmdlinepart", "ofpart";
++
++		    This is also the default value, which will be used
++		    if this attribute is not specified. It could be
++		    that the flash driver in use overwrote the default
++		    value and uses some other default.
++
++		    Possible values are: bcm47xxpart, afs, ar7part,
++		    ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart
++
+ The ECC strength and ECC step size properties define the correction capability
+ of a controller. Together, they say a controller can correct "{strength} bit
+ errors per {size} bytes".
+--- a/drivers/mtd/maps/physmap_of.c
++++ b/drivers/mtd/maps/physmap_of.c
+@@ -114,45 +114,9 @@ static struct mtd_info *obsolete_probe(s
+ static const char * const part_probe_types_def[] = {
+ 	"cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
+ 
+-static const char * const *of_get_probes(struct device_node *dp)
+-{
+-	const char *cp;
+-	int cplen;
+-	unsigned int l;
+-	unsigned int count;
+-	const char **res;
+-
+-	cp = of_get_property(dp, "linux,part-probe", &cplen);
+-	if (cp == NULL)
+-		return part_probe_types_def;
+-
+-	count = 0;
+-	for (l = 0; l != cplen; l++)
+-		if (cp[l] == 0)
+-			count++;
+-
+-	res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL);
+-	count = 0;
+-	while (cplen > 0) {
+-		res[count] = cp;
+-		l = strlen(cp) + 1;
+-		cp += l;
+-		cplen -= l;
+-		count++;
+-	}
+-	return res;
+-}
+-
+-static void of_free_probes(const char * const *probes)
+-{
+-	if (probes != part_probe_types_def)
+-		kfree(probes);
+-}
+-
+ static struct of_device_id of_flash_match[];
+ static int of_flash_probe(struct platform_device *dev)
+ {
+-	const char * const *part_probe_types;
+ 	const struct of_device_id *match;
+ 	struct device_node *dp = dev->dev.of_node;
+ 	struct resource res;
+@@ -302,10 +266,8 @@ static int of_flash_probe(struct platfor
+ 		goto err_out;
+ 
+ 	ppdata.of_node = dp;
+-	part_probe_types = of_get_probes(dp);
+-	mtd_device_parse_register(info->cmtd, part_probe_types, &ppdata,
++	mtd_device_parse_register(info->cmtd, part_probe_types_def, &ppdata,
+ 			NULL, 0);
+-	of_free_probes(part_probe_types);
+ 
+ 	kfree(mtd_list);
+ 
+--- a/drivers/mtd/mtdpart.c
++++ b/drivers/mtd/mtdpart.c
+@@ -29,6 +29,7 @@
+ #include <linux/kmod.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
++#include <linux/of.h>
+ #include <linux/err.h>
+ 
+ #include "mtdcore.h"
+@@ -702,6 +703,40 @@ void deregister_mtd_parser(struct mtd_pa
+ EXPORT_SYMBOL_GPL(deregister_mtd_parser);
+ 
+ /*
++ * Parses the linux,part-probe device tree property.
++ * When a non null value is returned it has to be freed with kfree() by
++ * the caller.
++ */
++static const char * const *of_get_probes(struct device_node *dp)
++{
++	const char *cp;
++	int cplen;
++	unsigned int l;
++	unsigned int count;
++	const char **res;
++
++	cp = of_get_property(dp, "linux,part-probe", &cplen);
++	if (cp == NULL)
++		return NULL;
++
++	count = 0;
++	for (l = 0; l != cplen; l++)
++		if (cp[l] == 0)
++			count++;
++
++	res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL);
++	count = 0;
++	while (cplen > 0) {
++		res[count] = cp;
++		l = strlen(cp) + 1;
++		cp += l;
++		cplen -= l;
++		count++;
++	}
++	return res;
++}
++
++/*
+  * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
+  * are changing this array!
+  */
+@@ -737,6 +772,13 @@ int parse_mtd_partitions(struct mtd_info
+ {
+ 	struct mtd_part_parser *parser;
+ 	int ret = 0;
++	const char *const *types_of = NULL;
++
++	if (data && data->of_node) {
++		types_of = of_get_probes(data->of_node);
++		if (types_of != NULL)
++			types = types_of;
++	}
+ 
+ 	if (!types)
+ 		types = default_mtd_part_types;
+@@ -755,6 +797,7 @@ int parse_mtd_partitions(struct mtd_info
+ 			break;
+ 		}
+ 	}
++	kfree(types_of);
+ 	return ret;
+ }
+ 
diff --git a/target/linux/generic/patches-3.18/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/patches-3.18/400-mtd-add-rootfs-split-support.patch
index bf69a35..0a6e134 100644
--- a/target/linux/generic/patches-3.18/400-mtd-add-rootfs-split-support.patch
+++ b/target/linux/generic/patches-3.18/400-mtd-add-rootfs-split-support.patch
@@ -26,10 +26,10 @@
  	depends on m
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -29,9 +29,11 @@
- #include <linux/kmod.h>
+@@ -30,9 +30,11 @@
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/partitions.h>
+ #include <linux/of.h>
 +#include <linux/magic.h>
  #include <linux/err.h>
  
@@ -38,7 +38,7 @@
  
  /* Our partition linked list */
  static LIST_HEAD(mtd_partitions);
-@@ -45,13 +47,14 @@ struct mtd_part {
+@@ -46,13 +48,14 @@ struct mtd_part {
  	struct list_head list;
  };
  
@@ -54,7 +54,7 @@
  /*
   * MTD methods which simply translate the effective address and pass through
   * to the _real_ device.
-@@ -547,8 +550,10 @@ out_register:
+@@ -548,8 +551,10 @@ out_register:
  	return slave;
  }
  
@@ -67,7 +67,7 @@
  {
  	struct mtd_partition part;
  	struct mtd_part *p, *new;
-@@ -580,21 +585,24 @@ int mtd_add_partition(struct mtd_info *m
+@@ -581,21 +586,24 @@ int mtd_add_partition(struct mtd_info *m
  	end = offset + length;
  
  	mutex_lock(&mtd_partitions_mutex);
@@ -102,7 +102,7 @@
  
  	return ret;
  err_inv:
-@@ -604,6 +612,12 @@ err_inv:
+@@ -605,6 +613,12 @@ err_inv:
  }
  EXPORT_SYMBOL_GPL(mtd_add_partition);
  
@@ -115,7 +115,7 @@
  int mtd_del_partition(struct mtd_info *master, int partno)
  {
  	struct mtd_part *slave, *next;
-@@ -627,6 +641,35 @@ int mtd_del_partition(struct mtd_info *m
+@@ -628,6 +642,35 @@ int mtd_del_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_del_partition);
  
@@ -151,7 +151,7 @@
  /*
   * This function, given a master MTD object and a partition table, creates
   * and registers slave MTD objects which are bound to the master according to
-@@ -656,6 +699,7 @@ int add_mtd_partitions(struct mtd_info *
+@@ -657,6 +700,7 @@ int add_mtd_partitions(struct mtd_info *
  		mutex_unlock(&mtd_partitions_mutex);
  
  		add_mtd_device(&slave->mtd);
diff --git a/target/linux/generic/patches-3.18/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/patches-3.18/401-mtd-add-support-for-different-partition-parser-types.patch
index 2ddcbff..6842341 100644
--- a/target/linux/generic/patches-3.18/401-mtd-add-support-for-different-partition-parser-types.patch
+++ b/target/linux/generic/patches-3.18/401-mtd-add-support-for-different-partition-parser-types.patch
@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
 
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -729,6 +729,30 @@ static struct mtd_part_parser *get_parti
+@@ -730,6 +730,30 @@ static struct mtd_part_parser *get_parti
  
  #define put_partition_parser(p) do { module_put((p)->owner); } while (0)
  
@@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
  void register_mtd_parser(struct mtd_part_parser *p)
  {
  	spin_lock(&part_parser_lock);
-@@ -802,6 +826,38 @@ int parse_mtd_partitions(struct mtd_info
+@@ -845,6 +869,38 @@ int parse_mtd_partitions(struct mtd_info
  	return ret;
  }
  
diff --git a/target/linux/generic/patches-3.18/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/patches-3.18/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
index 4d99422..dead0fb 100644
--- a/target/linux/generic/patches-3.18/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
+++ b/target/linux/generic/patches-3.18/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -641,6 +641,37 @@ int mtd_del_partition(struct mtd_info *m
+@@ -642,6 +642,37 @@ int mtd_del_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_del_partition);
  
@@ -38,7 +38,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -649,6 +680,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
+@@ -650,6 +681,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
@@ -46,7 +46,7 @@
  }
  
  void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
-@@ -663,6 +695,12 @@ static void mtd_partition_split(struct m
+@@ -664,6 +696,12 @@ static void mtd_partition_split(struct m
  	if (rootfs_found)
  		return;
  
diff --git a/target/linux/generic/patches-3.18/404-mtd-add-more-helper-functions.patch b/target/linux/generic/patches-3.18/404-mtd-add-more-helper-functions.patch
index d7c3801..b2f62c1 100644
--- a/target/linux/generic/patches-3.18/404-mtd-add-more-helper-functions.patch
+++ b/target/linux/generic/patches-3.18/404-mtd-add-more-helper-functions.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -445,14 +445,12 @@ static struct mtd_part *allocate_partiti
+@@ -446,14 +446,12 @@ static struct mtd_part *allocate_partiti
  	if (slave->offset == MTDPART_OFS_APPEND)
  		slave->offset = cur_offset;
  	if (slave->offset == MTDPART_OFS_NXTBLK) {
@@ -18,7 +18,7 @@
  	}
  	if (slave->offset == MTDPART_OFS_RETAIN) {
  		slave->offset = cur_offset;
-@@ -672,6 +670,17 @@ run_parsers_by_type(struct mtd_part *sla
+@@ -673,6 +671,17 @@ run_parsers_by_type(struct mtd_part *sla
  	return nr_parts;
  }
  
@@ -36,7 +36,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -913,6 +922,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -956,6 +965,24 @@ int mtd_is_partition(const struct mtd_in
  }
  EXPORT_SYMBOL_GPL(mtd_is_partition);
  
diff --git a/target/linux/generic/patches-3.18/405-mtd-old-firmware-uimage-splitter.patch b/target/linux/generic/patches-3.18/405-mtd-old-firmware-uimage-splitter.patch
index df1d726..7e74c4e 100644
--- a/target/linux/generic/patches-3.18/405-mtd-old-firmware-uimage-splitter.patch
+++ b/target/linux/generic/patches-3.18/405-mtd-old-firmware-uimage-splitter.patch
@@ -14,7 +14,7 @@
  endmenu
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -681,6 +681,37 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -682,6 +682,37 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  	return len;
  }
  
@@ -52,7 +52,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -689,7 +720,14 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -690,7 +721,14 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
diff --git a/target/linux/generic/patches-3.18/406-mtd-old-rootfs-squashfs-splitter.patch b/target/linux/generic/patches-3.18/406-mtd-old-rootfs-squashfs-splitter.patch
index ca81958..cc548ef 100644
--- a/target/linux/generic/patches-3.18/406-mtd-old-rootfs-squashfs-splitter.patch
+++ b/target/linux/generic/patches-3.18/406-mtd-old-rootfs-squashfs-splitter.patch
@@ -14,7 +14,7 @@
  	default y
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -681,6 +681,47 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -682,6 +682,47 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  	return len;
  }
  
@@ -62,7 +62,7 @@
  #define UBOOT_MAGIC	0x27051956
  
  static void split_uimage(struct mtd_info *master, struct mtd_part *part)
-@@ -743,7 +784,10 @@ static void mtd_partition_split(struct m
+@@ -744,7 +785,10 @@ static void mtd_partition_split(struct m
  		return;
  
  	if (!strcmp(part->mtd.name, "rootfs")) {
diff --git a/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch
index 7692d3d..5d5c6ed 100644
--- a/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch
+++ b/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -35,6 +35,8 @@
+@@ -36,6 +36,8 @@
  #include "mtdcore.h"
  #include "mtdsplit/mtdsplit.h"
  
@@ -9,7 +9,7 @@
  /* Our partition linked list */
  static LIST_HEAD(mtd_partitions);
  static DEFINE_MUTEX(mtd_partitions_mutex);
-@@ -233,13 +235,61 @@ static int part_erase(struct mtd_info *m
+@@ -234,13 +236,61 @@ static int part_erase(struct mtd_info *m
  	struct mtd_part *part = PART(mtd);
  	int ret;
  
@@ -71,7 +71,7 @@
  	return ret;
  }
  
-@@ -247,7 +297,25 @@ void mtd_erase_callback(struct erase_inf
+@@ -248,7 +298,25 @@ void mtd_erase_callback(struct erase_inf
  {
  	if (instr->mtd->_erase == part_erase) {
  		struct mtd_part *part = PART(instr->mtd);
@@ -97,7 +97,7 @@
  		if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
  			instr->fail_addr -= part->offset;
  		instr->addr -= part->offset;
-@@ -514,17 +582,20 @@ static struct mtd_part *allocate_partiti
+@@ -515,17 +583,20 @@ static struct mtd_part *allocate_partiti
  	if ((slave->mtd.flags & MTD_WRITEABLE) &&
  	    mtd_mod_by_eb(slave->offset, &slave->mtd)) {
  		/* Doesn't start on a boundary of major erase size */
diff --git a/target/linux/generic/patches-3.18/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/patches-3.18/412-mtd-partial_eraseblock_unlock.patch
index ba45acc..62f9d5b 100644
--- a/target/linux/generic/patches-3.18/412-mtd-partial_eraseblock_unlock.patch
+++ b/target/linux/generic/patches-3.18/412-mtd-partial_eraseblock_unlock.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -334,7 +334,14 @@ static int part_lock(struct mtd_info *mt
+@@ -335,7 +335,14 @@ static int part_lock(struct mtd_info *mt
  static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
  {
  	struct mtd_part *part = PART(mtd);
diff --git a/target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
new file mode 100644
index 0000000..18ec833
--- /dev/null
+++ b/target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
@@ -0,0 +1,175 @@
+From 173b0add0cff6558f950c0cb1eacfb729d482711 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Sun, 17 May 2015 18:48:38 +0200
+Subject: [PATCH 4/8] mtd: part: add generic parsing of linux,part-probe
+
+This moves the linux,part-probe device tree parsing code from
+physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
+providing a reference to their device tree node in struct
+mtd_part_parser_data.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ Documentation/devicetree/bindings/mtd/nand.txt | 16 ++++++++++
+ drivers/mtd/maps/physmap_of.c                  | 40 +-----------------------
+ drivers/mtd/mtdpart.c                          | 43 ++++++++++++++++++++++++++
+ 3 files changed, 60 insertions(+), 39 deletions(-)
+
+--- a/Documentation/devicetree/bindings/mtd/nand.txt
++++ b/Documentation/devicetree/bindings/mtd/nand.txt
+@@ -12,6 +12,22 @@
+ - nand-ecc-step-size: integer representing the number of data bytes
+ 		      that are covered by a single ECC step.
+ 
++- linux,part-probe: list of name as strings of the partition parser
++		    which should be used to parse the partition table.
++		    They will be tried in the specified ordering and
++		    the next one will be used if the previous one
++		    failed.
++
++		    Example: linux,part-probe = "cmdlinepart", "ofpart";
++
++		    This is also the default value, which will be used
++		    if this attribute is not specified. It could be
++		    that the flash driver in use overwrote the default
++		    value and uses some other default.
++
++		    Possible values are: bcm47xxpart, afs, ar7part,
++		    ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart
++
+ The ECC strength and ECC step size properties define the correction capability
+ of a controller. Together, they say a controller can correct "{strength} bit
+ errors per {size} bytes".
+--- a/drivers/mtd/maps/physmap_of.c
++++ b/drivers/mtd/maps/physmap_of.c
+@@ -112,45 +112,9 @@ static struct mtd_info *obsolete_probe(s
+ static const char * const part_probe_types_def[] = {
+ 	"cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
+ 
+-static const char * const *of_get_probes(struct device_node *dp)
+-{
+-	const char *cp;
+-	int cplen;
+-	unsigned int l;
+-	unsigned int count;
+-	const char **res;
+-
+-	cp = of_get_property(dp, "linux,part-probe", &cplen);
+-	if (cp == NULL)
+-		return part_probe_types_def;
+-
+-	count = 0;
+-	for (l = 0; l != cplen; l++)
+-		if (cp[l] == 0)
+-			count++;
+-
+-	res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL);
+-	count = 0;
+-	while (cplen > 0) {
+-		res[count] = cp;
+-		l = strlen(cp) + 1;
+-		cp += l;
+-		cplen -= l;
+-		count++;
+-	}
+-	return res;
+-}
+-
+-static void of_free_probes(const char * const *probes)
+-{
+-	if (probes != part_probe_types_def)
+-		kfree(probes);
+-}
+-
+ static struct of_device_id of_flash_match[];
+ static int of_flash_probe(struct platform_device *dev)
+ {
+-	const char * const *part_probe_types;
+ 	const struct of_device_id *match;
+ 	struct device_node *dp = dev->dev.of_node;
+ 	struct resource res;
+@@ -310,10 +274,8 @@ static int of_flash_probe(struct platfor
+ 		goto err_out;
+ 
+ 	ppdata.of_node = dp;
+-	part_probe_types = of_get_probes(dp);
+-	mtd_device_parse_register(info->cmtd, part_probe_types, &ppdata,
++	mtd_device_parse_register(info->cmtd, part_probe_types_def, &ppdata,
+ 			NULL, 0);
+-	of_free_probes(part_probe_types);
+ 
+ 	kfree(mtd_list);
+ 
+--- a/drivers/mtd/mtdpart.c
++++ b/drivers/mtd/mtdpart.c
+@@ -29,6 +29,7 @@
+ #include <linux/kmod.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
++#include <linux/of.h>
+ #include <linux/err.h>
+ #include <linux/kconfig.h>
+ 
+@@ -719,6 +720,40 @@ void deregister_mtd_parser(struct mtd_pa
+ EXPORT_SYMBOL_GPL(deregister_mtd_parser);
+ 
+ /*
++ * Parses the linux,part-probe device tree property.
++ * When a non null value is returned it has to be freed with kfree() by
++ * the caller.
++ */
++static const char * const *of_get_probes(struct device_node *dp)
++{
++	const char *cp;
++	int cplen;
++	unsigned int l;
++	unsigned int count;
++	const char **res;
++
++	cp = of_get_property(dp, "linux,part-probe", &cplen);
++	if (cp == NULL)
++		return NULL;
++
++	count = 0;
++	for (l = 0; l != cplen; l++)
++		if (cp[l] == 0)
++			count++;
++
++	res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL);
++	count = 0;
++	while (cplen > 0) {
++		res[count] = cp;
++		l = strlen(cp) + 1;
++		cp += l;
++		cplen -= l;
++		count++;
++	}
++	return res;
++}
++
++/*
+  * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
+  * are changing this array!
+  */
+@@ -754,6 +789,13 @@ int parse_mtd_partitions(struct mtd_info
+ {
+ 	struct mtd_part_parser *parser;
+ 	int ret = 0;
++	const char *const *types_of = NULL;
++
++	if (data && data->of_node) {
++		types_of = of_get_probes(data->of_node);
++		if (types_of != NULL)
++			types = types_of;
++	}
+ 
+ 	if (!types)
+ 		types = default_mtd_part_types;
+@@ -772,6 +814,7 @@ int parse_mtd_partitions(struct mtd_info
+ 			break;
+ 		}
+ 	}
++	kfree(types_of);
+ 	return ret;
+ }
+ 
diff --git a/target/linux/generic/patches-4.1/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/patches-4.1/400-mtd-add-rootfs-split-support.patch
index cbc2325..ba64e09 100644
--- a/target/linux/generic/patches-4.1/400-mtd-add-rootfs-split-support.patch
+++ b/target/linux/generic/patches-4.1/400-mtd-add-rootfs-split-support.patch
@@ -26,11 +26,12 @@
  	depends on m
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -29,10 +29,12 @@
+@@ -29,11 +29,13 @@
  #include <linux/kmod.h>
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/partitions.h>
 +#include <linux/magic.h>
+ #include <linux/of.h>
  #include <linux/err.h>
  #include <linux/kconfig.h>
  
@@ -39,7 +40,7 @@
  
  /* Our partition linked list */
  static LIST_HEAD(mtd_partitions);
-@@ -46,13 +48,14 @@ struct mtd_part {
+@@ -47,13 +49,14 @@ struct mtd_part {
  	struct list_head list;
  };
  
@@ -55,7 +56,7 @@
  /*
   * MTD methods which simply translate the effective address and pass through
   * to the _real_ device.
-@@ -578,8 +581,10 @@ static int mtd_add_partition_attrs(struc
+@@ -579,8 +582,10 @@ static int mtd_add_partition_attrs(struc
  	return ret;
  }
  
@@ -68,7 +69,7 @@
  {
  	struct mtd_partition part;
  	struct mtd_part *new;
-@@ -611,6 +616,7 @@ int mtd_add_partition(struct mtd_info *m
+@@ -612,6 +617,7 @@ int mtd_add_partition(struct mtd_info *m
  	mutex_unlock(&mtd_partitions_mutex);
  
  	add_mtd_device(&new->mtd);
@@ -76,7 +77,7 @@
  
  	mtd_add_partition_attrs(new);
  
-@@ -618,6 +624,12 @@ int mtd_add_partition(struct mtd_info *m
+@@ -619,6 +625,12 @@ int mtd_add_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_add_partition);
  
@@ -89,7 +90,7 @@
  int mtd_del_partition(struct mtd_info *master, int partno)
  {
  	struct mtd_part *slave, *next;
-@@ -643,6 +655,35 @@ int mtd_del_partition(struct mtd_info *m
+@@ -644,6 +656,35 @@ int mtd_del_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_del_partition);
  
@@ -125,7 +126,7 @@
  /*
   * This function, given a master MTD object and a partition table, creates
   * and registers slave MTD objects which are bound to the master according to
-@@ -672,6 +713,7 @@ int add_mtd_partitions(struct mtd_info *
+@@ -673,6 +714,7 @@ int add_mtd_partitions(struct mtd_info *
  		mutex_unlock(&mtd_partitions_mutex);
  
  		add_mtd_device(&slave->mtd);
diff --git a/target/linux/generic/patches-4.1/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/patches-4.1/401-mtd-add-support-for-different-partition-parser-types.patch
index 178247e..31dee98 100644
--- a/target/linux/generic/patches-4.1/401-mtd-add-support-for-different-partition-parser-types.patch
+++ b/target/linux/generic/patches-4.1/401-mtd-add-support-for-different-partition-parser-types.patch
@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
 
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -744,6 +744,30 @@ static struct mtd_part_parser *get_parti
+@@ -745,6 +745,30 @@ static struct mtd_part_parser *get_parti
  
  #define put_partition_parser(p) do { module_put((p)->owner); } while (0)
  
@@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
  void register_mtd_parser(struct mtd_part_parser *p)
  {
  	spin_lock(&part_parser_lock);
-@@ -817,6 +841,38 @@ int parse_mtd_partitions(struct mtd_info
+@@ -860,6 +884,38 @@ int parse_mtd_partitions(struct mtd_info
  	return ret;
  }
  
diff --git a/target/linux/generic/patches-4.1/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/patches-4.1/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
index 23e09c2..725dbe8 100644
--- a/target/linux/generic/patches-4.1/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
+++ b/target/linux/generic/patches-4.1/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -655,6 +655,37 @@ int mtd_del_partition(struct mtd_info *m
+@@ -656,6 +656,37 @@ int mtd_del_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_del_partition);
  
@@ -38,7 +38,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -663,6 +694,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
+@@ -664,6 +695,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
@@ -46,7 +46,7 @@
  }
  
  void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
-@@ -677,6 +709,12 @@ static void mtd_partition_split(struct m
+@@ -678,6 +710,12 @@ static void mtd_partition_split(struct m
  	if (rootfs_found)
  		return;
  
diff --git a/target/linux/generic/patches-4.1/404-mtd-add-more-helper-functions.patch b/target/linux/generic/patches-4.1/404-mtd-add-more-helper-functions.patch
index fe3a212..42e5cfd 100644
--- a/target/linux/generic/patches-4.1/404-mtd-add-more-helper-functions.patch
+++ b/target/linux/generic/patches-4.1/404-mtd-add-more-helper-functions.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -452,14 +452,12 @@ static struct mtd_part *allocate_partiti
+@@ -453,14 +453,12 @@ static struct mtd_part *allocate_partiti
  	if (slave->offset == MTDPART_OFS_APPEND)
  		slave->offset = cur_offset;
  	if (slave->offset == MTDPART_OFS_NXTBLK) {
@@ -18,7 +18,7 @@
  	}
  	if (slave->offset == MTDPART_OFS_RETAIN) {
  		slave->offset = cur_offset;
-@@ -686,6 +684,17 @@ run_parsers_by_type(struct mtd_part *sla
+@@ -687,6 +685,17 @@ run_parsers_by_type(struct mtd_part *sla
  	return nr_parts;
  }
  
@@ -36,7 +36,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -928,6 +937,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -971,6 +980,24 @@ int mtd_is_partition(const struct mtd_in
  }
  EXPORT_SYMBOL_GPL(mtd_is_partition);
  
diff --git a/target/linux/generic/patches-4.1/405-mtd-old-firmware-uimage-splitter.patch b/target/linux/generic/patches-4.1/405-mtd-old-firmware-uimage-splitter.patch
index 127d647..430fd6f 100644
--- a/target/linux/generic/patches-4.1/405-mtd-old-firmware-uimage-splitter.patch
+++ b/target/linux/generic/patches-4.1/405-mtd-old-firmware-uimage-splitter.patch
@@ -14,7 +14,7 @@
  endmenu
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -695,6 +695,37 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -696,6 +696,37 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  	return len;
  }
  
@@ -52,7 +52,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -703,7 +734,14 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -704,7 +735,14 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
diff --git a/target/linux/generic/patches-4.1/406-mtd-old-rootfs-squashfs-splitter.patch b/target/linux/generic/patches-4.1/406-mtd-old-rootfs-squashfs-splitter.patch
index 65424b0..cb1f29c 100644
--- a/target/linux/generic/patches-4.1/406-mtd-old-rootfs-squashfs-splitter.patch
+++ b/target/linux/generic/patches-4.1/406-mtd-old-rootfs-squashfs-splitter.patch
@@ -14,7 +14,7 @@
  	default y
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -695,6 +695,47 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -696,6 +696,47 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  	return len;
  }
  
@@ -62,7 +62,7 @@
  #define UBOOT_MAGIC	0x27051956
  
  static void split_uimage(struct mtd_info *master, struct mtd_part *part)
-@@ -757,7 +798,10 @@ static void mtd_partition_split(struct m
+@@ -758,7 +799,10 @@ static void mtd_partition_split(struct m
  		return;
  
  	if (!strcmp(part->mtd.name, "rootfs")) {
diff --git a/target/linux/generic/patches-4.1/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/patches-4.1/411-mtd-partial_eraseblock_write.patch
index a66507b..e6e809c 100644
--- a/target/linux/generic/patches-4.1/411-mtd-partial_eraseblock_write.patch
+++ b/target/linux/generic/patches-4.1/411-mtd-partial_eraseblock_write.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -36,6 +36,8 @@
+@@ -37,6 +37,8 @@
  #include "mtdcore.h"
  #include "mtdsplit/mtdsplit.h"
  
@@ -9,7 +9,7 @@
  /* Our partition linked list */
  static LIST_HEAD(mtd_partitions);
  static DEFINE_MUTEX(mtd_partitions_mutex);
-@@ -234,13 +236,61 @@ static int part_erase(struct mtd_info *m
+@@ -235,13 +237,61 @@ static int part_erase(struct mtd_info *m
  	struct mtd_part *part = PART(mtd);
  	int ret;
  
@@ -71,7 +71,7 @@
  	return ret;
  }
  
-@@ -248,7 +298,25 @@ void mtd_erase_callback(struct erase_inf
+@@ -249,7 +299,25 @@ void mtd_erase_callback(struct erase_inf
  {
  	if (instr->mtd->_erase == part_erase) {
  		struct mtd_part *part = PART(instr->mtd);
@@ -97,7 +97,7 @@
  		if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
  			instr->fail_addr -= part->offset;
  		instr->addr -= part->offset;
-@@ -521,17 +589,20 @@ static struct mtd_part *allocate_partiti
+@@ -522,17 +590,20 @@ static struct mtd_part *allocate_partiti
  	if ((slave->mtd.flags & MTD_WRITEABLE) &&
  	    mtd_mod_by_eb(slave->offset, &slave->mtd)) {
  		/* Doesn't start on a boundary of major erase size */
diff --git a/target/linux/generic/patches-4.1/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/patches-4.1/412-mtd-partial_eraseblock_unlock.patch
index 62f9d5b..b7964e2 100644
--- a/target/linux/generic/patches-4.1/412-mtd-partial_eraseblock_unlock.patch
+++ b/target/linux/generic/patches-4.1/412-mtd-partial_eraseblock_unlock.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -335,7 +335,14 @@ static int part_lock(struct mtd_info *mt
+@@ -336,7 +336,14 @@ static int part_lock(struct mtd_info *mt
  static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
  {
  	struct mtd_part *part = PART(mtd);
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Wed Aug 12 22:37:41 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed, 12 Aug 2015 19:37:41 -0700
Subject: [OpenWrt-Devel] [PATCH 2/5] ipq806x: add hwspinlock support
In-Reply-To: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
References: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439433464-1526-3-git-send-email-mathieu@codeaurora.org>

This change cherry-picks the following 3 changes from linux-next:
*fb7737 hwspinlock/core: add device tree support
*19a0f6 hwspinlock: qcom: Add support for Qualcomm HW Mutex block
*bd5717 hwspinlock: qcom: Correct msb in regmap_field

We're also adding a patch to add the hardware spinlock device nodes on
IPQ806x platforms (033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch).

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 +++++++++++++++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 +++++++++++++++++++++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +++
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  20 ++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   6 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch    |   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   2 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 +++++++++++++++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 +++++++++++++++++++++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +++
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  21 ++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   2 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch     |   6 +-
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |   4 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   4 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   2 +-
 21 files changed, 917 insertions(+), 22 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch

diff --git a/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch b/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
new file mode 100644
index 0000000..04f35b7
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
@@ -0,0 +1,167 @@
+From fb7737e949e31d8a71acee6bbb670f32dbd2a2c0 Mon Sep 17 00:00:00 2001
+From: Suman Anna <s-anna at ti.com>
+Date: Wed, 4 Mar 2015 20:01:14 -0600
+Subject: [PATCH] hwspinlock/core: add device tree support
+
+This patch adds a new OF-friendly API of_hwspin_lock_get_id()
+for hwspinlock clients to use/request locks from a hwspinlock
+device instantiated through a device-tree blob. This new API
+can be used by hwspinlock clients to get the id for a specific
+lock using the phandle + args specifier, so that it can be
+requested using the available hwspin_lock_request_specific()
+API.
+
+Signed-off-by: Suman Anna <s-anna at ti.com>
+Reviewed-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+[small comment clarification]
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ Documentation/hwspinlock.txt         | 10 +++++
+ drivers/hwspinlock/hwspinlock_core.c | 79 ++++++++++++++++++++++++++++++++++++
+ include/linux/hwspinlock.h           |  7 ++++
+ 3 files changed, 96 insertions(+)
+
+--- a/Documentation/hwspinlock.txt
++++ b/Documentation/hwspinlock.txt
+@@ -48,6 +48,16 @@ independent, drivers.
+      ids for predefined purposes.
+      Should be called from a process context (might sleep).
+ 
++  int of_hwspin_lock_get_id(struct device_node *np, int index);
++   - retrieve the global lock id for an OF phandle-based specific lock.
++     This function provides a means for DT users of a hwspinlock module
++     to get the global lock id of a specific hwspinlock, so that it can
++     be requested using the normal hwspin_lock_request_specific() API.
++     The function returns a lock id number on success, -EPROBE_DEFER if
++     the hwspinlock device is not yet registered with the core, or other
++     error values.
++     Should be called from a process context (might sleep).
++
+   int hwspin_lock_free(struct hwspinlock *hwlock);
+    - free a previously-assigned hwspinlock; returns 0 on success, or an
+      appropriate error code on failure (e.g. -EINVAL if the hwspinlock
+--- a/drivers/hwspinlock/hwspinlock_core.c
++++ b/drivers/hwspinlock/hwspinlock_core.c
+@@ -27,6 +27,7 @@
+ #include <linux/hwspinlock.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/mutex.h>
++#include <linux/of.h>
+ 
+ #include "hwspinlock_internal.h"
+ 
+@@ -257,6 +258,84 @@ void __hwspin_unlock(struct hwspinlock *
+ }
+ EXPORT_SYMBOL_GPL(__hwspin_unlock);
+ 
++/**
++ * of_hwspin_lock_simple_xlate - translate hwlock_spec to return a lock id
++ * @bank: the hwspinlock device bank
++ * @hwlock_spec: hwlock specifier as found in the device tree
++ *
++ * This is a simple translation function, suitable for hwspinlock platform
++ * drivers that only has a lock specifier length of 1.
++ *
++ * Returns a relative index of the lock within a specified bank on success,
++ * or -EINVAL on invalid specifier cell count.
++ */
++static inline int
++of_hwspin_lock_simple_xlate(const struct of_phandle_args *hwlock_spec)
++{
++	if (WARN_ON(hwlock_spec->args_count != 1))
++		return -EINVAL;
++
++	return hwlock_spec->args[0];
++}
++
++/**
++ * of_hwspin_lock_get_id() - get lock id for an OF phandle-based specific lock
++ * @np: device node from which to request the specific hwlock
++ * @index: index of the hwlock in the list of values
++ *
++ * This function provides a means for DT users of the hwspinlock module to
++ * get the global lock id of a specific hwspinlock using the phandle of the
++ * hwspinlock device, so that it can be requested using the normal
++ * hwspin_lock_request_specific() API.
++ *
++ * Returns the global lock id number on success, -EPROBE_DEFER if the hwspinlock
++ * device is not yet registered, -EINVAL on invalid args specifier value or an
++ * appropriate error as returned from the OF parsing of the DT client node.
++ */
++int of_hwspin_lock_get_id(struct device_node *np, int index)
++{
++	struct of_phandle_args args;
++	struct hwspinlock *hwlock;
++	struct radix_tree_iter iter;
++	void **slot;
++	int id;
++	int ret;
++
++	ret = of_parse_phandle_with_args(np, "hwlocks", "#hwlock-cells", index,
++					 &args);
++	if (ret)
++		return ret;
++
++	/* Find the hwspinlock device: we need its base_id */
++	ret = -EPROBE_DEFER;
++	rcu_read_lock();
++	radix_tree_for_each_slot(slot, &hwspinlock_tree, &iter, 0) {
++		hwlock = radix_tree_deref_slot(slot);
++		if (unlikely(!hwlock))
++			continue;
++
++		if (hwlock->bank->dev->of_node == args.np) {
++			ret = 0;
++			break;
++		}
++	}
++	rcu_read_unlock();
++	if (ret < 0)
++		goto out;
++
++	id = of_hwspin_lock_simple_xlate(&args);
++	if (id < 0 || id >= hwlock->bank->num_locks) {
++		ret = -EINVAL;
++		goto out;
++	}
++	id += hwlock->bank->base_id;
++
++out:
++	of_node_put(args.np);
++	return ret ? ret : id;
++}
++EXPORT_SYMBOL_GPL(of_hwspin_lock_get_id);
++
+ static int hwspin_lock_register_single(struct hwspinlock *hwlock, int id)
+ {
+ 	struct hwspinlock *tmp;
+--- a/include/linux/hwspinlock.h
++++ b/include/linux/hwspinlock.h
+@@ -26,6 +26,7 @@
+ #define HWLOCK_IRQ	0x02	/* Disable interrupts, don't save state */
+ 
+ struct device;
++struct device_node;
+ struct hwspinlock;
+ struct hwspinlock_device;
+ struct hwspinlock_ops;
+@@ -66,6 +67,7 @@ int hwspin_lock_unregister(struct hwspin
+ struct hwspinlock *hwspin_lock_request(void);
+ struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
+ int hwspin_lock_free(struct hwspinlock *hwlock);
++int of_hwspin_lock_get_id(struct device_node *np, int index);
+ int hwspin_lock_get_id(struct hwspinlock *hwlock);
+ int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
+ 							unsigned long *);
+@@ -120,6 +122,11 @@ void __hwspin_unlock(struct hwspinlock *
+ {
+ }
+ 
++static inline int of_hwspin_lock_get_id(struct device_node *np, int index)
++{
++	return 0;
++}
++
+ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
+ {
+ 	return 0;
diff --git a/target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch b/target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
new file mode 100644
index 0000000..581b199
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
@@ -0,0 +1,234 @@
+From 19a0f61224d2d91860fa8291ab63cb104ee86bdd Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Date: Tue, 24 Mar 2015 10:11:05 -0700
+Subject: [PATCH] hwspinlock: qcom: Add support for Qualcomm HW Mutex block
+
+Add driver for Qualcomm Hardware Mutex block found in many Qualcomm
+SoCs.
+
+Based on initial effort by Kumar Gala <galak at codeaurora.org>
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Reviewed-by: Jeffrey Hugo <jhugo at codeaurora.org>
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ drivers/hwspinlock/Kconfig           |  12 +++
+ drivers/hwspinlock/Makefile          |   1 +
+ drivers/hwspinlock/qcom_hwspinlock.c | 181 +++++++++++++++++++++++++++++++++++
+ 3 files changed, 194 insertions(+)
+ create mode 100644 drivers/hwspinlock/qcom_hwspinlock.c
+
+--- a/drivers/hwspinlock/Kconfig
++++ b/drivers/hwspinlock/Kconfig
+@@ -18,6 +18,18 @@ config HWSPINLOCK_OMAP
+ 
+ 	  If unsure, say N.
+ 
++config HWSPINLOCK_QCOM
++	tristate "Qualcomm Hardware Spinlock device"
++	depends on ARCH_QCOM
++	select HWSPINLOCK
++	select MFD_SYSCON
++	help
++	  Say y here to support the Qualcomm Hardware Mutex functionality, which
++	  provides a synchronisation mechanism for the various processors on
++	  the SoC.
++
++	  If unsure, say N.
++
+ config HSEM_U8500
+ 	tristate "STE Hardware Semaphore functionality"
+ 	depends on ARCH_U8500
+--- a/drivers/hwspinlock/Makefile
++++ b/drivers/hwspinlock/Makefile
+@@ -4,4 +4,5 @@
+ 
+ obj-$(CONFIG_HWSPINLOCK)		+= hwspinlock_core.o
+ obj-$(CONFIG_HWSPINLOCK_OMAP)		+= omap_hwspinlock.o
++obj-$(CONFIG_HWSPINLOCK_QCOM)		+= qcom_hwspinlock.o
+ obj-$(CONFIG_HSEM_U8500)		+= u8500_hsem.o
+--- /dev/null
++++ b/drivers/hwspinlock/qcom_hwspinlock.c
+@@ -0,0 +1,181 @@
++/*
++ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
++ * Copyright (c) 2015, Sony Mobile Communications AB
++ *
++ * This software is licensed under the terms of the GNU General Public
++ * License version 2, as published by the Free Software Foundation, and
++ * may be copied, distributed, and modified under those terms.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/hwspinlock.h>
++#include <linux/io.h>
++#include <linux/kernel.h>
++#include <linux/mfd/syscon.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/platform_device.h>
++#include <linux/pm_runtime.h>
++#include <linux/regmap.h>
++
++#include "hwspinlock_internal.h"
++
++#define QCOM_MUTEX_APPS_PROC_ID	1
++#define QCOM_MUTEX_NUM_LOCKS	32
++
++static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
++{
++	struct regmap_field *field = lock->priv;
++	u32 lock_owner;
++	int ret;
++
++	ret = regmap_field_write(field, QCOM_MUTEX_APPS_PROC_ID);
++	if (ret)
++		return ret;
++
++	ret = regmap_field_read(field, &lock_owner);
++	if (ret)
++		return ret;
++
++	return lock_owner == QCOM_MUTEX_APPS_PROC_ID;
++}
++
++static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
++{
++	struct regmap_field *field = lock->priv;
++	u32 lock_owner;
++	int ret;
++
++	ret = regmap_field_read(field, &lock_owner);
++	if (ret) {
++		pr_err("%s: unable to query spinlock owner\n", __func__);
++		return;
++	}
++
++	if (lock_owner != QCOM_MUTEX_APPS_PROC_ID) {
++		pr_err("%s: spinlock not owned by us (actual owner is %d)\n",
++				__func__, lock_owner);
++	}
++
++	ret = regmap_field_write(field, 0);
++	if (ret)
++		pr_err("%s: failed to unlock spinlock\n", __func__);
++}
++
++static const struct hwspinlock_ops qcom_hwspinlock_ops = {
++	.trylock	= qcom_hwspinlock_trylock,
++	.unlock		= qcom_hwspinlock_unlock,
++};
++
++static const struct of_device_id qcom_hwspinlock_of_match[] = {
++	{ .compatible = "qcom,sfpb-mutex" },
++	{ .compatible = "qcom,tcsr-mutex" },
++	{ }
++};
++MODULE_DEVICE_TABLE(of, qcom_hwspinlock_of_match);
++
++static int qcom_hwspinlock_probe(struct platform_device *pdev)
++{
++	struct hwspinlock_device *bank;
++	struct device_node *syscon;
++	struct reg_field field;
++	struct regmap *regmap;
++	size_t array_size;
++	u32 stride;
++	u32 base;
++	int ret;
++	int i;
++
++	syscon = of_parse_phandle(pdev->dev.of_node, "syscon", 0);
++	if (!syscon) {
++		dev_err(&pdev->dev, "no syscon property\n");
++		return -ENODEV;
++	}
++
++	regmap = syscon_node_to_regmap(syscon);
++	if (IS_ERR(regmap))
++		return PTR_ERR(regmap);
++
++	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, &base);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "no offset in syscon\n");
++		return -EINVAL;
++	}
++
++	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 2, &stride);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "no stride syscon\n");
++		return -EINVAL;
++	}
++
++	array_size = QCOM_MUTEX_NUM_LOCKS * sizeof(struct hwspinlock);
++	bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL);
++	if (!bank)
++		return -ENOMEM;
++
++	platform_set_drvdata(pdev, bank);
++
++	for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
++		field.reg = base + i * stride;
++		field.lsb = 0;
++		field.msb = 32;
++
++		bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
++							     regmap, field);
++	}
++
++	pm_runtime_enable(&pdev->dev);
++
++	ret = hwspin_lock_register(bank, &pdev->dev, &qcom_hwspinlock_ops,
++				   0, QCOM_MUTEX_NUM_LOCKS);
++	if (ret)
++		pm_runtime_disable(&pdev->dev);
++
++	return ret;
++}
++
++static int qcom_hwspinlock_remove(struct platform_device *pdev)
++{
++	struct hwspinlock_device *bank = platform_get_drvdata(pdev);
++	int ret;
++
++	ret = hwspin_lock_unregister(bank);
++	if (ret) {
++		dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
++		return ret;
++	}
++
++	pm_runtime_disable(&pdev->dev);
++
++	return 0;
++}
++
++static struct platform_driver qcom_hwspinlock_driver = {
++	.probe		= qcom_hwspinlock_probe,
++	.remove		= qcom_hwspinlock_remove,
++	.driver		= {
++		.name	= "qcom_hwspinlock",
++		.of_match_table = qcom_hwspinlock_of_match,
++	},
++};
++
++static int __init qcom_hwspinlock_init(void)
++{
++	return platform_driver_register(&qcom_hwspinlock_driver);
++}
++/* board init code might need to reserve hwspinlocks for predefined purposes */
++postcore_initcall(qcom_hwspinlock_init);
++
++static void __exit qcom_hwspinlock_exit(void)
++{
++	platform_driver_unregister(&qcom_hwspinlock_driver);
++}
++module_exit(qcom_hwspinlock_exit);
++
++MODULE_LICENSE("GPL v2");
++MODULE_DESCRIPTION("Hardware spinlock driver for Qualcomm SoCs");
diff --git a/target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch b/target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
new file mode 100644
index 0000000..70d5a58
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
@@ -0,0 +1,26 @@
+From bd5717a4632cdecafe82d03de7dcb3b1876e2828 Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Date: Fri, 26 Jun 2015 14:47:21 -0700
+Subject: [PATCH] hwspinlock: qcom: Correct msb in regmap_field
+
+msb of the regmap_field was mistakenly given the value 32, to set all bits
+in the regmap update mask; although incorrect this worked until 921cc294,
+where the mask calculation was corrected.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ drivers/hwspinlock/qcom_hwspinlock.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hwspinlock/qcom_hwspinlock.c
++++ b/drivers/hwspinlock/qcom_hwspinlock.c
+@@ -123,7 +123,7 @@ static int qcom_hwspinlock_probe(struct
+ 	for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
+ 		field.reg = base + i * stride;
+ 		field.lsb = 0;
+-		field.msb = 32;
++		field.msb = 31;
+ 
+ 		bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
+ 							     regmap, field);
diff --git a/target/linux/ipq806x/patches-3.18/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch b/target/linux/ipq806x/patches-3.18/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
new file mode 100644
index 0000000..0d53a73
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
@@ -0,0 +1,20 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -291,5 +291,17 @@
+ 			#clock-cells = <1>;
+ 			#reset-cells = <1>;
+ 		};
++
++		sfpb_mutex_block: syscon at 01200600 {
++			compatible = "syscon";
++			reg = <0x01200600 0x100>;
++		};
++
++		sfpb_mutex: sfpb-mutex {
++			compatible = "qcom,sfpb-mutex";
++			syscon = <&sfpb_mutex_block 4 4>;
++
++			#hwlock-cells = <1>;
++		};
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
index 5fee6ad..d430572 100644
--- a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
+++ b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -32,9 +32,9 @@
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -291,5 +291,90 @@
- 			#clock-cells = <1>;
- 			#reset-cells = <1>;
+@@ -303,5 +303,90 @@
+ 
+ 			#hwlock-cells = <1>;
  		};
 +
 +		hs_phy_1: phy at 100f8800 {
diff --git a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index ed66047..66f305e 100644
--- a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -134,8 +134,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  / {
  	model = "Qualcomm IPQ8064";
-@@ -306,6 +308,129 @@
- 			#reset-cells = <1>;
+@@ -318,6 +320,129 @@
+ 			#hwlock-cells = <1>;
  		};
  
 +		pcie0: pci at 1b500000 {
diff --git a/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
index 13ff921..99bd360 100644
--- a/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
+++ b/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -336,15 +336,21 @@
+@@ -348,15 +348,21 @@
  
  			clocks = <&gcc PCIE_A_CLK>,
  				 <&gcc PCIE_H_CLK>,
@@ -26,7 +26,7 @@
  
  			status = "disabled";
  		};
-@@ -377,15 +383,21 @@
+@@ -389,15 +395,21 @@
  
  			clocks = <&gcc PCIE_1_A_CLK>,
  				 <&gcc PCIE_1_H_CLK>,
@@ -52,7 +52,7 @@
  
  			status = "disabled";
  		};
-@@ -418,15 +430,21 @@
+@@ -430,15 +442,21 @@
  
  			clocks = <&gcc PCIE_2_A_CLK>,
  				 <&gcc PCIE_2_H_CLK>,
diff --git a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index 4d9e613..8b137d7 100644
--- a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -13,7 +13,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -657,5 +657,25 @@
+@@ -669,5 +669,25 @@
  			};
  		};
  
diff --git a/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
index a2742b7..fe8e77c 100644
--- a/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
+++ b/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -26,7 +26,7 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -677,5 +677,21 @@
+@@ -689,5 +689,21 @@
  			status = "disabled";
  		};
  
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 8cfc38b..7e7cd47 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -117,7 +117,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -693,5 +693,91 @@
+@@ -705,5 +705,91 @@
  			status = "disabled";
  		};
  
diff --git a/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch b/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
new file mode 100644
index 0000000..04f35b7
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
@@ -0,0 +1,167 @@
+From fb7737e949e31d8a71acee6bbb670f32dbd2a2c0 Mon Sep 17 00:00:00 2001
+From: Suman Anna <s-anna at ti.com>
+Date: Wed, 4 Mar 2015 20:01:14 -0600
+Subject: [PATCH] hwspinlock/core: add device tree support
+
+This patch adds a new OF-friendly API of_hwspin_lock_get_id()
+for hwspinlock clients to use/request locks from a hwspinlock
+device instantiated through a device-tree blob. This new API
+can be used by hwspinlock clients to get the id for a specific
+lock using the phandle + args specifier, so that it can be
+requested using the available hwspin_lock_request_specific()
+API.
+
+Signed-off-by: Suman Anna <s-anna at ti.com>
+Reviewed-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+[small comment clarification]
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ Documentation/hwspinlock.txt         | 10 +++++
+ drivers/hwspinlock/hwspinlock_core.c | 79 ++++++++++++++++++++++++++++++++++++
+ include/linux/hwspinlock.h           |  7 ++++
+ 3 files changed, 96 insertions(+)
+
+--- a/Documentation/hwspinlock.txt
++++ b/Documentation/hwspinlock.txt
+@@ -48,6 +48,16 @@ independent, drivers.
+      ids for predefined purposes.
+      Should be called from a process context (might sleep).
+ 
++  int of_hwspin_lock_get_id(struct device_node *np, int index);
++   - retrieve the global lock id for an OF phandle-based specific lock.
++     This function provides a means for DT users of a hwspinlock module
++     to get the global lock id of a specific hwspinlock, so that it can
++     be requested using the normal hwspin_lock_request_specific() API.
++     The function returns a lock id number on success, -EPROBE_DEFER if
++     the hwspinlock device is not yet registered with the core, or other
++     error values.
++     Should be called from a process context (might sleep).
++
+   int hwspin_lock_free(struct hwspinlock *hwlock);
+    - free a previously-assigned hwspinlock; returns 0 on success, or an
+      appropriate error code on failure (e.g. -EINVAL if the hwspinlock
+--- a/drivers/hwspinlock/hwspinlock_core.c
++++ b/drivers/hwspinlock/hwspinlock_core.c
+@@ -27,6 +27,7 @@
+ #include <linux/hwspinlock.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/mutex.h>
++#include <linux/of.h>
+ 
+ #include "hwspinlock_internal.h"
+ 
+@@ -257,6 +258,84 @@ void __hwspin_unlock(struct hwspinlock *
+ }
+ EXPORT_SYMBOL_GPL(__hwspin_unlock);
+ 
++/**
++ * of_hwspin_lock_simple_xlate - translate hwlock_spec to return a lock id
++ * @bank: the hwspinlock device bank
++ * @hwlock_spec: hwlock specifier as found in the device tree
++ *
++ * This is a simple translation function, suitable for hwspinlock platform
++ * drivers that only has a lock specifier length of 1.
++ *
++ * Returns a relative index of the lock within a specified bank on success,
++ * or -EINVAL on invalid specifier cell count.
++ */
++static inline int
++of_hwspin_lock_simple_xlate(const struct of_phandle_args *hwlock_spec)
++{
++	if (WARN_ON(hwlock_spec->args_count != 1))
++		return -EINVAL;
++
++	return hwlock_spec->args[0];
++}
++
++/**
++ * of_hwspin_lock_get_id() - get lock id for an OF phandle-based specific lock
++ * @np: device node from which to request the specific hwlock
++ * @index: index of the hwlock in the list of values
++ *
++ * This function provides a means for DT users of the hwspinlock module to
++ * get the global lock id of a specific hwspinlock using the phandle of the
++ * hwspinlock device, so that it can be requested using the normal
++ * hwspin_lock_request_specific() API.
++ *
++ * Returns the global lock id number on success, -EPROBE_DEFER if the hwspinlock
++ * device is not yet registered, -EINVAL on invalid args specifier value or an
++ * appropriate error as returned from the OF parsing of the DT client node.
++ */
++int of_hwspin_lock_get_id(struct device_node *np, int index)
++{
++	struct of_phandle_args args;
++	struct hwspinlock *hwlock;
++	struct radix_tree_iter iter;
++	void **slot;
++	int id;
++	int ret;
++
++	ret = of_parse_phandle_with_args(np, "hwlocks", "#hwlock-cells", index,
++					 &args);
++	if (ret)
++		return ret;
++
++	/* Find the hwspinlock device: we need its base_id */
++	ret = -EPROBE_DEFER;
++	rcu_read_lock();
++	radix_tree_for_each_slot(slot, &hwspinlock_tree, &iter, 0) {
++		hwlock = radix_tree_deref_slot(slot);
++		if (unlikely(!hwlock))
++			continue;
++
++		if (hwlock->bank->dev->of_node == args.np) {
++			ret = 0;
++			break;
++		}
++	}
++	rcu_read_unlock();
++	if (ret < 0)
++		goto out;
++
++	id = of_hwspin_lock_simple_xlate(&args);
++	if (id < 0 || id >= hwlock->bank->num_locks) {
++		ret = -EINVAL;
++		goto out;
++	}
++	id += hwlock->bank->base_id;
++
++out:
++	of_node_put(args.np);
++	return ret ? ret : id;
++}
++EXPORT_SYMBOL_GPL(of_hwspin_lock_get_id);
++
+ static int hwspin_lock_register_single(struct hwspinlock *hwlock, int id)
+ {
+ 	struct hwspinlock *tmp;
+--- a/include/linux/hwspinlock.h
++++ b/include/linux/hwspinlock.h
+@@ -26,6 +26,7 @@
+ #define HWLOCK_IRQ	0x02	/* Disable interrupts, don't save state */
+ 
+ struct device;
++struct device_node;
+ struct hwspinlock;
+ struct hwspinlock_device;
+ struct hwspinlock_ops;
+@@ -66,6 +67,7 @@ int hwspin_lock_unregister(struct hwspin
+ struct hwspinlock *hwspin_lock_request(void);
+ struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
+ int hwspin_lock_free(struct hwspinlock *hwlock);
++int of_hwspin_lock_get_id(struct device_node *np, int index);
+ int hwspin_lock_get_id(struct hwspinlock *hwlock);
+ int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
+ 							unsigned long *);
+@@ -120,6 +122,11 @@ void __hwspin_unlock(struct hwspinlock *
+ {
+ }
+ 
++static inline int of_hwspin_lock_get_id(struct device_node *np, int index)
++{
++	return 0;
++}
++
+ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
+ {
+ 	return 0;
diff --git a/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch b/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
new file mode 100644
index 0000000..581b199
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
@@ -0,0 +1,234 @@
+From 19a0f61224d2d91860fa8291ab63cb104ee86bdd Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Date: Tue, 24 Mar 2015 10:11:05 -0700
+Subject: [PATCH] hwspinlock: qcom: Add support for Qualcomm HW Mutex block
+
+Add driver for Qualcomm Hardware Mutex block found in many Qualcomm
+SoCs.
+
+Based on initial effort by Kumar Gala <galak at codeaurora.org>
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Reviewed-by: Jeffrey Hugo <jhugo at codeaurora.org>
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ drivers/hwspinlock/Kconfig           |  12 +++
+ drivers/hwspinlock/Makefile          |   1 +
+ drivers/hwspinlock/qcom_hwspinlock.c | 181 +++++++++++++++++++++++++++++++++++
+ 3 files changed, 194 insertions(+)
+ create mode 100644 drivers/hwspinlock/qcom_hwspinlock.c
+
+--- a/drivers/hwspinlock/Kconfig
++++ b/drivers/hwspinlock/Kconfig
+@@ -18,6 +18,18 @@ config HWSPINLOCK_OMAP
+ 
+ 	  If unsure, say N.
+ 
++config HWSPINLOCK_QCOM
++	tristate "Qualcomm Hardware Spinlock device"
++	depends on ARCH_QCOM
++	select HWSPINLOCK
++	select MFD_SYSCON
++	help
++	  Say y here to support the Qualcomm Hardware Mutex functionality, which
++	  provides a synchronisation mechanism for the various processors on
++	  the SoC.
++
++	  If unsure, say N.
++
+ config HSEM_U8500
+ 	tristate "STE Hardware Semaphore functionality"
+ 	depends on ARCH_U8500
+--- a/drivers/hwspinlock/Makefile
++++ b/drivers/hwspinlock/Makefile
+@@ -4,4 +4,5 @@
+ 
+ obj-$(CONFIG_HWSPINLOCK)		+= hwspinlock_core.o
+ obj-$(CONFIG_HWSPINLOCK_OMAP)		+= omap_hwspinlock.o
++obj-$(CONFIG_HWSPINLOCK_QCOM)		+= qcom_hwspinlock.o
+ obj-$(CONFIG_HSEM_U8500)		+= u8500_hsem.o
+--- /dev/null
++++ b/drivers/hwspinlock/qcom_hwspinlock.c
+@@ -0,0 +1,181 @@
++/*
++ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
++ * Copyright (c) 2015, Sony Mobile Communications AB
++ *
++ * This software is licensed under the terms of the GNU General Public
++ * License version 2, as published by the Free Software Foundation, and
++ * may be copied, distributed, and modified under those terms.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/hwspinlock.h>
++#include <linux/io.h>
++#include <linux/kernel.h>
++#include <linux/mfd/syscon.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/platform_device.h>
++#include <linux/pm_runtime.h>
++#include <linux/regmap.h>
++
++#include "hwspinlock_internal.h"
++
++#define QCOM_MUTEX_APPS_PROC_ID	1
++#define QCOM_MUTEX_NUM_LOCKS	32
++
++static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
++{
++	struct regmap_field *field = lock->priv;
++	u32 lock_owner;
++	int ret;
++
++	ret = regmap_field_write(field, QCOM_MUTEX_APPS_PROC_ID);
++	if (ret)
++		return ret;
++
++	ret = regmap_field_read(field, &lock_owner);
++	if (ret)
++		return ret;
++
++	return lock_owner == QCOM_MUTEX_APPS_PROC_ID;
++}
++
++static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
++{
++	struct regmap_field *field = lock->priv;
++	u32 lock_owner;
++	int ret;
++
++	ret = regmap_field_read(field, &lock_owner);
++	if (ret) {
++		pr_err("%s: unable to query spinlock owner\n", __func__);
++		return;
++	}
++
++	if (lock_owner != QCOM_MUTEX_APPS_PROC_ID) {
++		pr_err("%s: spinlock not owned by us (actual owner is %d)\n",
++				__func__, lock_owner);
++	}
++
++	ret = regmap_field_write(field, 0);
++	if (ret)
++		pr_err("%s: failed to unlock spinlock\n", __func__);
++}
++
++static const struct hwspinlock_ops qcom_hwspinlock_ops = {
++	.trylock	= qcom_hwspinlock_trylock,
++	.unlock		= qcom_hwspinlock_unlock,
++};
++
++static const struct of_device_id qcom_hwspinlock_of_match[] = {
++	{ .compatible = "qcom,sfpb-mutex" },
++	{ .compatible = "qcom,tcsr-mutex" },
++	{ }
++};
++MODULE_DEVICE_TABLE(of, qcom_hwspinlock_of_match);
++
++static int qcom_hwspinlock_probe(struct platform_device *pdev)
++{
++	struct hwspinlock_device *bank;
++	struct device_node *syscon;
++	struct reg_field field;
++	struct regmap *regmap;
++	size_t array_size;
++	u32 stride;
++	u32 base;
++	int ret;
++	int i;
++
++	syscon = of_parse_phandle(pdev->dev.of_node, "syscon", 0);
++	if (!syscon) {
++		dev_err(&pdev->dev, "no syscon property\n");
++		return -ENODEV;
++	}
++
++	regmap = syscon_node_to_regmap(syscon);
++	if (IS_ERR(regmap))
++		return PTR_ERR(regmap);
++
++	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, &base);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "no offset in syscon\n");
++		return -EINVAL;
++	}
++
++	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 2, &stride);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "no stride syscon\n");
++		return -EINVAL;
++	}
++
++	array_size = QCOM_MUTEX_NUM_LOCKS * sizeof(struct hwspinlock);
++	bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL);
++	if (!bank)
++		return -ENOMEM;
++
++	platform_set_drvdata(pdev, bank);
++
++	for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
++		field.reg = base + i * stride;
++		field.lsb = 0;
++		field.msb = 32;
++
++		bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
++							     regmap, field);
++	}
++
++	pm_runtime_enable(&pdev->dev);
++
++	ret = hwspin_lock_register(bank, &pdev->dev, &qcom_hwspinlock_ops,
++				   0, QCOM_MUTEX_NUM_LOCKS);
++	if (ret)
++		pm_runtime_disable(&pdev->dev);
++
++	return ret;
++}
++
++static int qcom_hwspinlock_remove(struct platform_device *pdev)
++{
++	struct hwspinlock_device *bank = platform_get_drvdata(pdev);
++	int ret;
++
++	ret = hwspin_lock_unregister(bank);
++	if (ret) {
++		dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
++		return ret;
++	}
++
++	pm_runtime_disable(&pdev->dev);
++
++	return 0;
++}
++
++static struct platform_driver qcom_hwspinlock_driver = {
++	.probe		= qcom_hwspinlock_probe,
++	.remove		= qcom_hwspinlock_remove,
++	.driver		= {
++		.name	= "qcom_hwspinlock",
++		.of_match_table = qcom_hwspinlock_of_match,
++	},
++};
++
++static int __init qcom_hwspinlock_init(void)
++{
++	return platform_driver_register(&qcom_hwspinlock_driver);
++}
++/* board init code might need to reserve hwspinlocks for predefined purposes */
++postcore_initcall(qcom_hwspinlock_init);
++
++static void __exit qcom_hwspinlock_exit(void)
++{
++	platform_driver_unregister(&qcom_hwspinlock_driver);
++}
++module_exit(qcom_hwspinlock_exit);
++
++MODULE_LICENSE("GPL v2");
++MODULE_DESCRIPTION("Hardware spinlock driver for Qualcomm SoCs");
diff --git a/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch b/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
new file mode 100644
index 0000000..70d5a58
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
@@ -0,0 +1,26 @@
+From bd5717a4632cdecafe82d03de7dcb3b1876e2828 Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Date: Fri, 26 Jun 2015 14:47:21 -0700
+Subject: [PATCH] hwspinlock: qcom: Correct msb in regmap_field
+
+msb of the regmap_field was mistakenly given the value 32, to set all bits
+in the regmap update mask; although incorrect this worked until 921cc294,
+where the mask calculation was corrected.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ drivers/hwspinlock/qcom_hwspinlock.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hwspinlock/qcom_hwspinlock.c
++++ b/drivers/hwspinlock/qcom_hwspinlock.c
+@@ -123,7 +123,7 @@ static int qcom_hwspinlock_probe(struct
+ 	for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
+ 		field.reg = base + i * stride;
+ 		field.lsb = 0;
+-		field.msb = 32;
++		field.msb = 31;
+ 
+ 		bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
+ 							     regmap, field);
diff --git a/target/linux/ipq806x/patches-4.1/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch b/target/linux/ipq806x/patches-4.1/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
new file mode 100644
index 0000000..027ff08
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
@@ -0,0 +1,21 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -67,6 +67,18 @@
+ 			clock-frequency = <32768>;
+ 			#clock-cells = <0>;
+ 		};
++
++		sfpb_mutex_block: syscon at 01200600 {
++			compatible = "syscon";
++			reg = <0x01200600 0x100>;
++		};
++
++		sfpb_mutex: sfpb-mutex {
++			compatible = "qcom,sfpb-mutex";
++			syscon = <&sfpb_mutex_block 4 4>;
++
++			#hwlock-cells = <1>;
++		};
+ 	};
+ 
+ 	soc: soc {
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index fc2fe0a..51a08fb 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -134,7 +134,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  / {
  	model = "Qualcomm IPQ8064";
-@@ -329,5 +331,127 @@
+@@ -341,5 +343,127 @@
  			#reset-cells = <1>;
  		};
  
diff --git a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
index 59b7fcc..40115a4 100644
--- a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
+++ b/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -359,15 +359,21 @@
+@@ -371,15 +371,21 @@
  
  			clocks = <&gcc PCIE_A_CLK>,
  				 <&gcc PCIE_H_CLK>,
@@ -26,7 +26,7 @@
  
  			status = "disabled";
  		};
-@@ -400,15 +406,21 @@
+@@ -412,15 +418,21 @@
  
  			clocks = <&gcc PCIE_1_A_CLK>,
  				 <&gcc PCIE_1_H_CLK>,
@@ -52,7 +52,7 @@
  
  			status = "disabled";
  		};
-@@ -441,15 +453,21 @@
+@@ -453,15 +465,21 @@
  
  			clocks = <&gcc PCIE_2_A_CLK>,
  				 <&gcc PCIE_2_H_CLK>,
diff --git a/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch b/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
index be80f4c..458dcd5 100644
--- a/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
+++ b/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
@@ -8,7 +8,7 @@
  #include <dt-bindings/clock/qcom,lcc-ipq806x.h>
  #include <dt-bindings/soc/qcom,gsbi.h>
  #include <dt-bindings/reset/qcom,gcc-ipq806x.h>
-@@ -92,6 +93,63 @@
+@@ -104,6 +105,63 @@
  			reg-names = "lpass-lpaif";
  		};
  
@@ -72,7 +72,7 @@
  		qcom_pinmux: pinmux at 800000 {
  			compatible = "qcom,ipq8064-pinctrl";
  			reg = <0x800000 0x4000>;
-@@ -136,6 +194,12 @@
+@@ -148,6 +206,12 @@
  			reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
  		};
  
diff --git a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
index 9435de6..b25d955 100644
--- a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
+++ b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
@@ -37,7 +37,7 @@
  		};
  	};
  
-@@ -72,6 +90,46 @@
+@@ -84,6 +102,46 @@
  		};
  	};
  
@@ -84,7 +84,7 @@
  	soc: soc {
  		#address-cells = <1>;
  		#size-cells = <1>;
-@@ -187,11 +245,13 @@
+@@ -199,11 +257,13 @@
  		acc0: clock-controller at 2088000 {
  			compatible = "qcom,kpss-acc-v1";
  			reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
diff --git a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index bb9a194..e5c57a9 100644
--- a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ b/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -26,7 +26,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
  					#address-cells = <1>;
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -595,5 +595,25 @@
+@@ -607,5 +607,25 @@
  
  			status = "disabled";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
index 27eae8f..bd9bf47 100644
--- a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
+++ b/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -26,7 +26,7 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -615,5 +615,21 @@
+@@ -627,5 +627,21 @@
  
  			status = "disabled";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 4a43ae4..c21ebcd 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -117,7 +117,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -631,5 +631,91 @@
+@@ -643,5 +643,91 @@
  
  			status = "disabled";
  		};
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Wed Aug 12 22:37:42 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed, 12 Aug 2015 19:37:42 -0700
Subject: [OpenWrt-Devel] [PATCH 3/5] ipq806x: add SMEM support
In-Reply-To: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
References: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439433464-1526-4-git-send-email-mathieu@codeaurora.org>

2 patches are cherry-picked from the following LKML thread:
*https://lkml.org/lkml/2015/4/11/208

The last patch (036-soc-qcom-add-smem-to-IPQ806x-platforms.patch) is
adding the corresponding DT nodes required for IPQ806x.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +++++++++++++++++++++
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  26 +
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   4 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch    |   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   2 +-
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +++++++++++++++++++++
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  27 +
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   2 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch     |   6 +-
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |   4 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   4 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   2 +-
 19 files changed, 1920 insertions(+), 21 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch

diff --git a/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch b/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
new file mode 100644
index 0000000..d22db22
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
@@ -0,0 +1,82 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,1/2] soc: qcom: Add device tree binding for SMEM
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+X-Patchwork-Id: 6202201
+Message-Id: <1428795178-24312-1-git-send-email-bjorn.andersson at sonymobile.com>
+To: Rob Herring <robh+dt at kernel.org>, Pawel Moll <pawel.moll at arm.com>,
+	Mark Rutland <mark.rutland at arm.com>,
+	Ian Campbell <ijc+devicetree at hellion.org.uk>,
+	Kumar Gala <galak at codeaurora.org>, Jeffrey Hugo <jhugo at codeaurora.org>, 
+	Andry Gross <agross at codeaurora.org>
+Cc: <devicetree at vger.kernel.org>,
+	linux-arm-msm <linux-arm-msm at vger.kernel.org>,
+	<linux-kernel at vger.kernel.org>
+Date: Sat, 11 Apr 2015 16:32:57 -0700
+
+Add device tree binding documentation for the Qualcom Shared Memory
+manager.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+
+---
+Changes since v1:
+- None
+
+ .../devicetree/bindings/soc/qcom/qcom,smem.txt     | 49 ++++++++++++++++++++++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+@@ -0,0 +1,49 @@
++Qualcomm Shared Memory binding
++
++This binding describes the Qualcomm Shared Memory, used to share data between
++various subsystems and OSes in Qualcomm platforms.
++
++- compatible:
++	Usage: required
++	Value type: <stringlist>
++	Definition: must be:
++		    "qcom,smem"
++
++- memory-region:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: handle to memory reservation for main smem memory region.
++
++- reg:
++	Usage: optional
++	Value type: <prop-encoded-array>
++	Definition: base address and size pair for any additional memory areas
++		    of the shared memory.
++
++- hwspinlocks:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: reference to a hwspinlock used to protect allocations from
++		    the shared memory
++
++= EXAMPLE
++
++	reserved-memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges;
++
++		smem_region: smem at fa00000 {
++			reg = <0xfa00000 0x200000>;
++			no-map;
++		};
++	};
++
++	smem at fa00000 {
++		compatible = "qcom,smem";
++
++		memory-region = <&smem_region>;
++		reg = <0xfc428000 0x4000>;
++
++		hwlocks = <&tcsr_mutex 3>;
++	};
diff --git a/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch b/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
new file mode 100644
index 0000000..c8cff1a
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
@@ -0,0 +1,841 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,2/2] soc: qcom: Add Shared Memory Manager driver
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+X-Patchwork-Id: 6202211
+Message-Id: <1428795178-24312-2-git-send-email-bjorn.andersson at sonymobile.com>
+To: Kumar Gala <galak at codeaurora.org>, Andy Gross <agross at codeaurora.org>,
+	David Brown <davidb at codeaurora.org>, Jeffrey Hugo <jhugo at codeaurora.org>
+Cc: <linux-kernel at vger.kernel.org>, <linux-arm-msm at vger.kernel.org>,
+	<linux-soc at vger.kernel.org>
+Date: Sat, 11 Apr 2015 16:32:58 -0700
+
+The Shared Memory Manager driver implements an interface for allocating
+and accessing items in the memory area shared among all of the
+processors in a Qualcomm platform.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Tested-by: Andy Gross <agross at codeaurora.org>
+
+---
+Changes since v1:
+- ioremapping the regions nocache
+- improved documentation of the two regions of partitions
+- corrected free space check in private allocator
+
+ drivers/soc/qcom/Kconfig      |   7 +
+ drivers/soc/qcom/Makefile     |   1 +
+ drivers/soc/qcom/smem.c       | 768 ++++++++++++++++++++++++++++++++++++++++++
+ include/linux/soc/qcom/smem.h |  14 +
+ 4 files changed, 790 insertions(+)
+ create mode 100644 drivers/soc/qcom/smem.c
+ create mode 100644 include/linux/soc/qcom/smem.h
+
+--- a/drivers/soc/qcom/Kconfig
++++ b/drivers/soc/qcom/Kconfig
+@@ -9,3 +9,10 @@ config QCOM_GSBI
+           functions for connecting the underlying serial UART, SPI, and I2C
+           devices to the output pins.
+ 
++config QCOM_SMEM
++	tristate "Qualcomm Shared Memory Manager (SMEM)"
++	depends on ARCH_QCOM
++	help
++	  Say y here to enable support for the Qualcomm Shared Memory Manager.
++	  The driver provides an interface to items in a heap shared among all
++	  processors in a Qualcomm platform.
+--- a/drivers/soc/qcom/Makefile
++++ b/drivers/soc/qcom/Makefile
+@@ -1 +1,2 @@
+ obj-$(CONFIG_QCOM_GSBI)	+=	qcom_gsbi.o
++obj-$(CONFIG_QCOM_SMEM) +=	smem.o
+--- /dev/null
++++ b/drivers/soc/qcom/smem.c
+@@ -0,0 +1,768 @@
++/*
++ * Copyright (c) 2015, Sony Mobile Communications AB.
++ * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/hwspinlock.h>
++#include <linux/io.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/soc/qcom/smem.h>
++
++/*
++ * The Qualcomm shared memory system is a allocate only heap structure that
++ * consists of one of more memory areas that can be accessed by the processors
++ * in the SoC.
++ *
++ * All systems contains a global heap, accessible by all processors in the SoC,
++ * with a table of contents data structure (@smem_header) at the beginning of
++ * the main shared memory block.
++ *
++ * The global header contains metadata for allocations as well as a fixed list
++ * of 512 entries (@smem_global_entry) that can be initialized to reference
++ * parts of the shared memory space.
++ *
++ *
++ * In addition to this global heap a set of "private" heaps can be set up at
++ * boot time with access restrictions so that only certain processor pairs can
++ * access the data.
++ *
++ * These partitions are referenced from an optional partition table
++ * (@smem_ptable), that is found 4kB from the end of the main smem region. The
++ * partition table entries (@smem_ptable_entry) lists the involved processors
++ * (or hosts) and their location in the main shared memory region.
++ *
++ * Each partition starts with a header (@smem_partition_header) that identifies
++ * the partition and holds properties for the two internal memory regions. The
++ * two regions are cached and non-cached memory respectively. Each region
++ * contain a link list of allocation headers (@smem_private_entry) followed by
++ * their data.
++ *
++ * Items in the non-cached region are allocated from the start of the partition
++ * while items in the cached region are allocated from the end. The free area
++ * is hence the region between the cached and non-cached offsets.
++ *
++ *
++ * To synchronize allocations in the shared memory heaps a remote spinlock must
++ * be held - currently lock number 3 of the sfpb or tcsr is used for this on all
++ * platforms.
++ *
++ */
++
++/**
++  * struct smem_proc_comm - proc_comm communication struct (legacy)
++  * @command:	current command to be executed
++  * @status:	status of the currently requested command
++  * @params:	parameters to the command
++  */
++struct smem_proc_comm {
++	u32 command;
++	u32 status;
++	u32 params[2];
++};
++
++/**
++ * struct smem_global_entry - entry to reference smem items on the heap
++ * @allocated:	boolean to indicate if this entry is used
++ * @offset:	offset to the allocated space
++ * @size:	size of the allocated space, 8 byte aligned
++ * @aux_base:	base address for the memory region used by this unit, or 0 for
++ *		the default region. bits 0,1 are reserved
++ */
++struct smem_global_entry {
++	u32 allocated;
++	u32 offset;
++	u32 size;
++	u32 aux_base; /* bits 1:0 reserved */
++};
++#define AUX_BASE_MASK		0xfffffffc
++
++/**
++ * struct smem_header - header found in beginning of primary smem region
++ * @proc_comm:		proc_comm communication interface (legacy)
++ * @version:		array of versions for the various subsystems
++ * @initialized:	boolean to indicate that smem is initialized
++ * @free_offset:	index of the first unallocated byte in smem
++ * @available:		number of bytes available for allocation
++ * @reserved:		reserved field, must be 0
++ * toc:			array of references to items
++ */
++struct smem_header {
++	struct smem_proc_comm proc_comm[4];
++	u32 version[32];
++	u32 initialized;
++	u32 free_offset;
++	u32 available;
++	u32 reserved;
++	struct smem_global_entry toc[];
++};
++
++/**
++ * struct smem_ptable_entry - one entry in the @smem_ptable list
++ * @offset:	offset, within the main shared memory region, of the partition
++ * @size:	size of the partition
++ * @flags:	flags for the partition (currently unused)
++ * @host0:	first processor/host with access to this partition
++ * @host1:	second processor/host with access to this partition
++ * @reserved:	reserved entries for later use
++ */
++struct smem_ptable_entry {
++	u32 offset;
++	u32 size;
++	u32 flags;
++	u16 host0;
++	u16 host1;
++	u32 reserved[8];
++};
++
++/**
++ * struct smem_ptable - partition table for the private partitions
++ * @magic:	magic number, must be SMEM_PTABLE_MAGIC
++ * @version:	version of the partition table
++ * @num_entries: number of partitions in the table
++ * @reserved:	for now reserved entries
++ * @entry:	list of @smem_ptable_entry for the @num_entries partitions
++ */
++struct smem_ptable {
++	u32 magic;
++	u32 version;
++	u32 num_entries;
++	u32 reserved[5];
++	struct smem_ptable_entry entry[];
++};
++#define SMEM_PTABLE_MAGIC	0x434f5424 /* "$TOC" */
++
++/**
++ * struct smem_partition_header - header of the partitions
++ * @magic:	magic number, must be SMEM_PART_MAGIC
++ * @host0:	first processor/host with access to this partition
++ * @host1:	second processor/host with access to this partition
++ * @size:	size of the partition
++ * @offset_free_uncached: offset to the first free byte of uncached memory in
++ *		this partition
++ * @offset_free_cached: offset to the first free byte of cached memory in this
++ *		partition
++ * @reserved:	for now reserved entries
++ */
++struct smem_partition_header {
++	u32 magic;
++	u16 host0;
++	u16 host1;
++	u32 size;
++	u32 offset_free_uncached;
++	u32 offset_free_cached;
++	u32 reserved[3];
++};
++#define SMEM_PART_MAGIC		0x54525024 /* "$PRT" */
++
++/**
++ * struct smem_private_entry - header of each item in the private partition
++ * @canary:	magic number, must be SMEM_PRIVATE_CANARY
++ * @item:	identifying number of the smem item
++ * @size:	size of the data, including padding bytes
++ * @padding_data: number of bytes of padding of data
++ * @padding_hdr: number of bytes of padding between the header and the data
++ * @reserved:	for now reserved entry
++ */
++struct smem_private_entry {
++	u16 canary;
++	u16 item;
++	u32 size; /* includes padding bytes */
++	u16 padding_data;
++	u16 padding_hdr;
++	u32 reserved;
++};
++#define SMEM_PRIVATE_CANARY	0xa5a5
++
++/*
++ * Item 3 of the global heap contains an array of versions for the various
++ * software components in the SoC. We verify that the boot loader version is
++ * what the expected version (SMEM_EXPECTED_VERSION) as a sanity check.
++ */
++#define SMEM_ITEM_VERSION	3
++#define  SMEM_MASTER_SBL_VERSION_INDEX	7
++#define  SMEM_EXPECTED_VERSION		11
++
++/*
++ * The first 8 items are only to be allocated by the boot loader while
++ * initializing the heap.
++ */
++#define SMEM_ITEM_LAST_FIXED	8
++
++/* Highest accepted item number, for both global and private heaps */
++#define SMEM_ITEM_LAST		512
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS		0
++
++/* Max number of processors/hosts in a system */
++#define SMEM_HOST_COUNT		7
++
++/**
++ * struct smem_region - representation of a chunk of memory used for smem
++ * @aux_base:	identifier of aux_mem base
++ * @virt_base:	virtual base address of memory with this aux_mem identifier
++ * @size:	size of the memory region
++ */
++struct smem_region {
++	u32 aux_base;
++	void __iomem *virt_base;
++	size_t size;
++};
++
++/**
++ * struct qcom_smem - device data for the smem device
++ * @dev:	device pointer
++ * @hwlock:	reference to a hwspinlock
++ * @partitions:	list of pointers to partitions affecting the current
++ *		processor/host
++ * @num_regions: number of @regions
++ * @regions:	list of the memory regions defining the shared memory
++ */
++struct qcom_smem {
++	struct device *dev;
++
++	struct hwspinlock *hwlock;
++
++	struct smem_partition_header *partitions[SMEM_HOST_COUNT];
++
++	unsigned num_regions;
++	struct smem_region regions[0];
++};
++
++/* Pointer to the one and only smem handle */
++static struct qcom_smem *__smem;
++
++/* Timeout (ms) for the trylock of remote spinlocks */
++#define HWSPINLOCK_TIMEOUT	1000
++
++static int qcom_smem_alloc_private(struct qcom_smem *smem,
++				   unsigned host,
++				   unsigned item,
++				   size_t size)
++{
++	struct smem_partition_header *phdr;
++	struct smem_private_entry *hdr;
++	size_t alloc_size;
++	void *p;
++
++	/* We're not going to find it if there's no matching partition */
++	if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
++		return -ENOENT;
++
++	phdr = smem->partitions[host];
++
++	p = (void *)phdr + sizeof(*phdr);
++	while (p < (void *)phdr + phdr->offset_free_uncached) {
++		hdr = p;
++
++		if (hdr->canary != SMEM_PRIVATE_CANARY) {
++			dev_err(smem->dev,
++				"Found invalid canary in host %d partition\n",
++				host);
++			return -EINVAL;
++		}
++
++		if (hdr->item == item)
++			return -EEXIST;
++
++		p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
++	}
++
++	/* Check that we don't grow into the cached region */
++	alloc_size = sizeof(*hdr) + ALIGN(size, 8);
++	if (p + alloc_size >= (void *)phdr + phdr->offset_free_cached) {
++		dev_err(smem->dev, "Out of memory\n");
++		return -ENOSPC;
++	}
++
++	hdr = p;
++	hdr->canary = SMEM_PRIVATE_CANARY;
++	hdr->item = item;
++	hdr->size = ALIGN(size, 8);
++	hdr->padding_data = hdr->size - size;
++	hdr->padding_hdr = 0;
++
++	/*
++	 * Ensure the header is written before we advance the free offset, so
++	 * that remote processors that does not take the remote spinlock still
++	 * gets a consistent view of the linked list.
++	 */
++	wmb();
++	phdr->offset_free_uncached += alloc_size;
++
++	return 0;
++}
++
++static int qcom_smem_alloc_global(struct qcom_smem *smem,
++				  unsigned item,
++				  size_t size)
++{
++	struct smem_header *header;
++	struct smem_global_entry *entry;
++
++	if (WARN_ON(item >= SMEM_ITEM_LAST))
++		return -EINVAL;
++
++	header = smem->regions[0].virt_base;
++	entry = &header->toc[item];
++	if (entry->allocated)
++		return -EEXIST;
++
++	size = ALIGN(size, 8);
++	if (WARN_ON(size > header->available))
++		return -ENOMEM;
++
++	entry->offset = header->free_offset;
++	entry->size = size;
++
++	/*
++	 * Ensure the header is consistent before we mark the item allocated,
++	 * so that remote processors will get a consistent view of the item
++	 * even though they do not take the spinlock on read.
++	 */
++	wmb();
++	entry->allocated = 1;
++
++	header->free_offset += size;
++	header->available -= size;
++
++	return 0;
++}
++
++/**
++ * qcom_smem_alloc - allocate space for a smem item
++ * @host:	remote processor id, or -1
++ * @item:	smem item handle
++ * @size:	number of bytes to be allocated
++ *
++ * Allocate space for a given smem item of size @size, given that the item is
++ * not yet allocated.
++ */
++int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
++{
++	unsigned long flags;
++	int ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	if (item < SMEM_ITEM_LAST_FIXED) {
++		dev_err(__smem->dev,
++			"Rejecting allocation of static entry %d\n", item);
++		return -EINVAL;
++	}
++
++	ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
++					  HWSPINLOCK_TIMEOUT,
++					  &flags);
++	if (ret)
++		return ret;
++
++	ret = qcom_smem_alloc_private(__smem, host, item, size);
++	if (ret == -ENOENT)
++		ret = qcom_smem_alloc_global(__smem, item, size);
++
++	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
++
++	return ret;
++}
++EXPORT_SYMBOL(qcom_smem_alloc);
++
++static int qcom_smem_get_global(struct qcom_smem *smem,
++				unsigned item,
++				void **ptr,
++				size_t *size)
++{
++	struct smem_header *header;
++	struct smem_region *area;
++	struct smem_global_entry *entry;
++	u32 aux_base;
++	unsigned i;
++
++	if (WARN_ON(item >= SMEM_ITEM_LAST))
++		return -EINVAL;
++
++	header = smem->regions[0].virt_base;
++	entry = &header->toc[item];
++	if (!entry->allocated)
++		return -ENXIO;
++
++	if (ptr != NULL) {
++		aux_base = entry->aux_base & AUX_BASE_MASK;
++
++		for (i = 0; i < smem->num_regions; i++) {
++			area = &smem->regions[i];
++
++			if (area->aux_base == aux_base || !aux_base) {
++				*ptr = area->virt_base + entry->offset;
++				break;
++			}
++		}
++	}
++	if (size != NULL)
++		*size = entry->size;
++
++	return 0;
++}
++
++static int qcom_smem_get_private(struct qcom_smem *smem,
++				 unsigned host,
++				 unsigned item,
++				 void **ptr,
++				 size_t *size)
++{
++	struct smem_partition_header *phdr;
++	struct smem_private_entry *hdr;
++	void *p;
++
++	/* We're not going to find it if there's no matching partition */
++	if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
++		return -ENOENT;
++
++	phdr = smem->partitions[host];
++
++	p = (void *)phdr + sizeof(*phdr);
++	while (p < (void *)phdr + phdr->offset_free_uncached) {
++		hdr = p;
++
++		if (hdr->canary != SMEM_PRIVATE_CANARY) {
++			dev_err(smem->dev,
++				"Found invalid canary in host %d partition\n",
++				host);
++			return -EINVAL;
++		}
++
++		if (hdr->item == item) {
++			if (ptr != NULL)
++				*ptr = p + sizeof(*hdr) + hdr->padding_hdr;
++
++			if (size != NULL)
++				*size = hdr->size - hdr->padding_data;
++
++			return 0;
++		}
++
++		p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
++	}
++
++	return -ENOENT;
++}
++
++/**
++ * qcom_smem_get - resolve ptr of size of a smem item
++ * @host:	the remote processor, or -1
++ * @item:	smem item handle
++ * @ptr:	pointer to be filled out with address of the item
++ * @size:	pointer to be filled out with size of the item
++ *
++ * Looks up pointer and size of a smem item.
++ */
++int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size)
++{
++	unsigned long flags;
++	int ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
++					  HWSPINLOCK_TIMEOUT,
++					  &flags);
++	if (ret)
++		return ret;
++
++	ret = qcom_smem_get_private(__smem, host, item, ptr, size);
++	if (ret == -ENOENT)
++		ret = qcom_smem_get_global(__smem, item, ptr, size);
++
++	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
++	return ret;
++
++}
++EXPORT_SYMBOL(qcom_smem_get);
++
++/**
++ * qcom_smem_get_free_space - retrieve amont of free space in a partition
++ * @host:	the remote processor identifing a partition, or -1
++ *
++ * To be used by smem clients as a quick way to determine if any new
++ * allocations has been made.
++ */
++int qcom_smem_get_free_space(unsigned host)
++{
++	struct smem_partition_header *phdr;
++	struct smem_header *header;
++	unsigned ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	if (host < SMEM_HOST_COUNT && __smem->partitions[host]) {
++		phdr = __smem->partitions[host];
++		ret = phdr->offset_free_uncached;
++	} else {
++		header = __smem->regions[0].virt_base;
++		ret = header->available;
++	}
++
++	return ret;
++}
++EXPORT_SYMBOL(qcom_smem_get_free_space);
++
++static int qcom_smem_get_sbl_version(struct qcom_smem *smem)
++{
++	unsigned *versions;
++	size_t size;
++	int ret;
++
++	ret = qcom_smem_get_global(smem, SMEM_ITEM_VERSION,
++				   (void **)&versions, &size);
++	if (ret < 0) {
++		dev_err(smem->dev, "Unable to read the version item\n");
++		return -ENOENT;
++	}
++
++	if (size < sizeof(unsigned) * SMEM_MASTER_SBL_VERSION_INDEX) {
++		dev_err(smem->dev, "Version item is too small\n");
++		return -EINVAL;
++	}
++
++	return versions[SMEM_MASTER_SBL_VERSION_INDEX];
++}
++
++static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
++					  unsigned local_host)
++{
++	struct smem_partition_header *header;
++	struct smem_ptable_entry *entry;
++	struct smem_ptable *ptable;
++	unsigned remote_host;
++	int i;
++
++	ptable = smem->regions[0].virt_base + smem->regions[0].size - 4 * 1024;
++	if (ptable->magic != SMEM_PTABLE_MAGIC)
++		return 0;
++
++	if (ptable->version != 1) {
++		dev_err(smem->dev,
++			"Unsupported partition header version %d\n",
++			ptable->version);
++		return -EINVAL;
++	}
++
++	for (i = 0; i < ptable->num_entries; i++) {
++		entry = &ptable->entry[i];
++
++		if (entry->host0 != local_host && entry->host1 != local_host)
++			continue;
++
++		if (!entry->offset)
++			continue;
++
++		if (!entry->size)
++			continue;
++
++		if (entry->host0 == local_host)
++			remote_host = entry->host1;
++		else
++			remote_host = entry->host0;
++
++		if (smem->partitions[remote_host]) {
++			dev_err(smem->dev,
++				"Already found a partition for host %d\n",
++				remote_host);
++			return -EINVAL;
++		}
++
++		header = smem->regions[0].virt_base + entry->offset;
++
++		if (header->magic != SMEM_PART_MAGIC) {
++			dev_err(smem->dev,
++				"Partition %d has invalid magic\n", i);
++			return -EINVAL;
++		}
++
++		if (header->host0 != local_host && header->host1 != local_host) {
++			dev_err(smem->dev,
++				"Partition %d hosts are invalid\n", i);
++			return -EINVAL;
++		}
++
++		if (header->host0 != remote_host && header->host1 != remote_host) {
++			dev_err(smem->dev,
++				"Partition %d hosts are invalid\n", i);
++			return -EINVAL;
++		}
++
++		if (header->size != entry->size) {
++			dev_err(smem->dev,
++				"Partition %d has invalid size\n", i);
++			return -EINVAL;
++		}
++
++		if (header->offset_free_uncached > header->size) {
++			dev_err(smem->dev,
++				"Partition %d has invalid free pointer\n", i);
++			return -EINVAL;
++		}
++
++		smem->partitions[remote_host] = header;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_count_mem_regions(struct platform_device *pdev)
++{
++	struct resource *res;
++	int num_regions = 0;
++	int i;
++
++	for (i = 0; i < pdev->num_resources; i++) {
++		res = &pdev->resource[i];
++
++		if (resource_type(res) == IORESOURCE_MEM)
++			num_regions++;
++	}
++
++	return num_regions;
++}
++
++static int qcom_smem_probe(struct platform_device *pdev)
++{
++	struct smem_header *header;
++	struct device_node *np;
++	struct qcom_smem *smem;
++	struct resource *res;
++	struct resource r;
++	size_t array_size;
++	int num_regions = 0;
++	int hwlock_id;
++	u32 version;
++	int ret;
++	int i;
++
++	num_regions = qcom_smem_count_mem_regions(pdev) + 1;
++
++	array_size = num_regions * sizeof(struct smem_region);
++	smem = devm_kzalloc(&pdev->dev, sizeof(*smem) + array_size, GFP_KERNEL);
++	if (!smem)
++		return -ENOMEM;
++
++	smem->dev = &pdev->dev;
++	smem->num_regions = num_regions;
++
++	np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
++	if (!np) {
++		dev_err(&pdev->dev, "No memory-region specified\n");
++		return -EINVAL;
++	}
++
++	ret = of_address_to_resource(np, 0, &r);
++	of_node_put(np);
++	if (ret)
++		return ret;
++
++	smem->regions[0].aux_base = (u32)r.start;
++	smem->regions[0].size = resource_size(&r);
++	smem->regions[0].virt_base = devm_ioremap_nocache(&pdev->dev,
++							  r.start,
++							  resource_size(&r));
++	if (!smem->regions[0].virt_base)
++		return -ENOMEM;
++
++	for (i = 1; i < num_regions; i++) {
++		res = platform_get_resource(pdev, IORESOURCE_MEM, i - 1);
++
++		smem->regions[i].aux_base = (u32)res->start;
++		smem->regions[i].size = resource_size(res);
++		smem->regions[i].virt_base = devm_ioremap_nocache(&pdev->dev,
++								  res->start,
++								  resource_size(res));
++		if (!smem->regions[i].virt_base)
++			return -ENOMEM;
++	}
++
++	header = smem->regions[0].virt_base;
++	if (header->initialized != 1 || header->reserved) {
++		dev_err(&pdev->dev, "SMEM is not initilized by SBL\n");
++		return -EINVAL;
++	}
++
++	version = qcom_smem_get_sbl_version(smem);
++	if (version >> 16 != SMEM_EXPECTED_VERSION) {
++		dev_err(&pdev->dev, "Unsupported smem version 0x%x\n", version);
++		return -EINVAL;
++	}
++
++	ret = qcom_smem_enumerate_partitions(smem, SMEM_HOST_APPS);
++	if (ret < 0)
++		return ret;
++
++	hwlock_id = of_hwspin_lock_get_id(pdev->dev.of_node, 0);
++	if (hwlock_id < 0) {
++		dev_err(&pdev->dev, "failed to retrieve hwlock\n");
++		return hwlock_id;
++	}
++
++	smem->hwlock = hwspin_lock_request_specific(hwlock_id);
++	if (!smem->hwlock)
++		return -ENXIO;
++
++	__smem = smem;
++
++	return 0;
++}
++
++static int qcom_smem_remove(struct platform_device *pdev)
++{
++	hwspin_lock_free(__smem->hwlock);
++	__smem = NULL;
++
++	return 0;
++}
++
++static const struct of_device_id qcom_smem_of_match[] = {
++	{ .compatible = "qcom,smem" },
++	{}
++};
++MODULE_DEVICE_TABLE(of, qcom_smem_of_match);
++
++static struct platform_driver qcom_smem_driver = {
++	.probe = qcom_smem_probe,
++	.remove = qcom_smem_remove,
++	.driver  = {
++		.name = "qcom_smem",
++		.of_match_table = qcom_smem_of_match,
++		.suppress_bind_attrs = true,
++	},
++};
++
++static int __init qcom_smem_init(void)
++{
++	return platform_driver_register(&qcom_smem_driver);
++}
++arch_initcall(qcom_smem_init);
++
++static void __exit qcom_smem_exit(void)
++{
++	platform_driver_unregister(&qcom_smem_driver);
++}
++module_exit(qcom_smem_exit)
++
++MODULE_AUTHOR("Bjorn Andersson <bjorn.andersson at sonymobile.com>");
++MODULE_DESCRIPTION("Qualcomm Shared Memory Manager");
++MODULE_LICENSE("GPLv2");
+--- /dev/null
++++ b/include/linux/soc/qcom/smem.h
+@@ -0,0 +1,14 @@
++#ifndef __QCOM_SMEM_H__
++#define __QCOM_SMEM_H__
++
++struct device_node;
++struct qcom_smem;
++
++#define QCOM_SMEM_HOST_ANY -1
++
++int qcom_smem_alloc(unsigned host, unsigned item, size_t size);
++int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size);
++
++int qcom_smem_get_free_space(unsigned host);
++
++#endif
diff --git a/target/linux/ipq806x/patches-3.18/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch b/target/linux/ipq806x/patches-3.18/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
new file mode 100644
index 0000000..9ba69dd
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
@@ -0,0 +1,26 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -54,7 +54,7 @@
+ 			no-map;
+ 		};
+ 
+-		smem at 41000000 {
++		smem: smem at 41000000 {
+ 			reg = <0x41000000 0x200000>;
+ 			no-map;
+ 		};
+@@ -303,5 +303,14 @@
+ 
+ 			#hwlock-cells = <1>;
+ 		};
++
++		smem {
++			compatible = "qcom,smem";
++
++			memory-region = <&smem>;
++			reg = <0x41000000 0x4000>;
++
++			hwlocks = <&sfpb_mutex 3>;
++		};
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
index d430572..755d0b0 100644
--- a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
+++ b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -32,9 +32,9 @@
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -303,5 +303,90 @@
+@@ -312,5 +312,90 @@
  
- 			#hwlock-cells = <1>;
+ 			hwlocks = <&sfpb_mutex 3>;
  		};
 +
 +		hs_phy_1: phy at 100f8800 {
diff --git a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 66f305e..d5b8b6f 100644
--- a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -134,8 +134,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  / {
  	model = "Qualcomm IPQ8064";
-@@ -318,6 +320,129 @@
- 			#hwlock-cells = <1>;
+@@ -327,6 +329,129 @@
+ 			hwlocks = <&sfpb_mutex 3>;
  		};
  
 +		pcie0: pci at 1b500000 {
diff --git a/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
index 99bd360..bf28446 100644
--- a/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
+++ b/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -348,15 +348,21 @@
+@@ -357,15 +357,21 @@
  
  			clocks = <&gcc PCIE_A_CLK>,
  				 <&gcc PCIE_H_CLK>,
@@ -26,7 +26,7 @@
  
  			status = "disabled";
  		};
-@@ -389,15 +395,21 @@
+@@ -398,15 +404,21 @@
  
  			clocks = <&gcc PCIE_1_A_CLK>,
  				 <&gcc PCIE_1_H_CLK>,
@@ -52,7 +52,7 @@
  
  			status = "disabled";
  		};
-@@ -430,15 +442,21 @@
+@@ -439,15 +451,21 @@
  
  			clocks = <&gcc PCIE_2_A_CLK>,
  				 <&gcc PCIE_2_H_CLK>,
diff --git a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index 8b137d7..34507de 100644
--- a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -13,7 +13,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -669,5 +669,25 @@
+@@ -678,5 +678,25 @@
  			};
  		};
  
diff --git a/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
index fe8e77c..e837bea 100644
--- a/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
+++ b/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -26,7 +26,7 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -689,5 +689,21 @@
+@@ -698,5 +698,21 @@
  			status = "disabled";
  		};
  
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 7e7cd47..52ffd6c 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -117,7 +117,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -705,5 +705,91 @@
+@@ -714,5 +714,91 @@
  			status = "disabled";
  		};
  
diff --git a/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch b/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
new file mode 100644
index 0000000..d22db22
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
@@ -0,0 +1,82 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,1/2] soc: qcom: Add device tree binding for SMEM
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+X-Patchwork-Id: 6202201
+Message-Id: <1428795178-24312-1-git-send-email-bjorn.andersson at sonymobile.com>
+To: Rob Herring <robh+dt at kernel.org>, Pawel Moll <pawel.moll at arm.com>,
+	Mark Rutland <mark.rutland at arm.com>,
+	Ian Campbell <ijc+devicetree at hellion.org.uk>,
+	Kumar Gala <galak at codeaurora.org>, Jeffrey Hugo <jhugo at codeaurora.org>, 
+	Andry Gross <agross at codeaurora.org>
+Cc: <devicetree at vger.kernel.org>,
+	linux-arm-msm <linux-arm-msm at vger.kernel.org>,
+	<linux-kernel at vger.kernel.org>
+Date: Sat, 11 Apr 2015 16:32:57 -0700
+
+Add device tree binding documentation for the Qualcom Shared Memory
+manager.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+
+---
+Changes since v1:
+- None
+
+ .../devicetree/bindings/soc/qcom/qcom,smem.txt     | 49 ++++++++++++++++++++++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+@@ -0,0 +1,49 @@
++Qualcomm Shared Memory binding
++
++This binding describes the Qualcomm Shared Memory, used to share data between
++various subsystems and OSes in Qualcomm platforms.
++
++- compatible:
++	Usage: required
++	Value type: <stringlist>
++	Definition: must be:
++		    "qcom,smem"
++
++- memory-region:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: handle to memory reservation for main smem memory region.
++
++- reg:
++	Usage: optional
++	Value type: <prop-encoded-array>
++	Definition: base address and size pair for any additional memory areas
++		    of the shared memory.
++
++- hwspinlocks:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: reference to a hwspinlock used to protect allocations from
++		    the shared memory
++
++= EXAMPLE
++
++	reserved-memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges;
++
++		smem_region: smem at fa00000 {
++			reg = <0xfa00000 0x200000>;
++			no-map;
++		};
++	};
++
++	smem at fa00000 {
++		compatible = "qcom,smem";
++
++		memory-region = <&smem_region>;
++		reg = <0xfc428000 0x4000>;
++
++		hwlocks = <&tcsr_mutex 3>;
++	};
diff --git a/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch b/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
new file mode 100644
index 0000000..5598da2
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
@@ -0,0 +1,841 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,2/2] soc: qcom: Add Shared Memory Manager driver
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+X-Patchwork-Id: 6202211
+Message-Id: <1428795178-24312-2-git-send-email-bjorn.andersson at sonymobile.com>
+To: Kumar Gala <galak at codeaurora.org>, Andy Gross <agross at codeaurora.org>,
+	David Brown <davidb at codeaurora.org>, Jeffrey Hugo <jhugo at codeaurora.org>
+Cc: <linux-kernel at vger.kernel.org>, <linux-arm-msm at vger.kernel.org>,
+	<linux-soc at vger.kernel.org>
+Date: Sat, 11 Apr 2015 16:32:58 -0700
+
+The Shared Memory Manager driver implements an interface for allocating
+and accessing items in the memory area shared among all of the
+processors in a Qualcomm platform.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Tested-by: Andy Gross <agross at codeaurora.org>
+
+---
+Changes since v1:
+- ioremapping the regions nocache
+- improved documentation of the two regions of partitions
+- corrected free space check in private allocator
+
+ drivers/soc/qcom/Kconfig      |   7 +
+ drivers/soc/qcom/Makefile     |   1 +
+ drivers/soc/qcom/smem.c       | 768 ++++++++++++++++++++++++++++++++++++++++++
+ include/linux/soc/qcom/smem.h |  14 +
+ 4 files changed, 790 insertions(+)
+ create mode 100644 drivers/soc/qcom/smem.c
+ create mode 100644 include/linux/soc/qcom/smem.h
+
+--- a/drivers/soc/qcom/Kconfig
++++ b/drivers/soc/qcom/Kconfig
+@@ -10,3 +10,10 @@ config QCOM_GSBI
+           functions for connecting the underlying serial UART, SPI, and I2C
+           devices to the output pins.
+ 
++config QCOM_SMEM
++	tristate "Qualcomm Shared Memory Manager (SMEM)"
++	depends on ARCH_QCOM
++	help
++	  Say y here to enable support for the Qualcomm Shared Memory Manager.
++	  The driver provides an interface to items in a heap shared among all
++	  processors in a Qualcomm platform.
+--- a/drivers/soc/qcom/Makefile
++++ b/drivers/soc/qcom/Makefile
+@@ -1 +1,2 @@
+ obj-$(CONFIG_QCOM_GSBI)	+=	qcom_gsbi.o
++obj-$(CONFIG_QCOM_SMEM) +=	smem.o
+--- /dev/null
++++ b/drivers/soc/qcom/smem.c
+@@ -0,0 +1,768 @@
++/*
++ * Copyright (c) 2015, Sony Mobile Communications AB.
++ * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/hwspinlock.h>
++#include <linux/io.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/soc/qcom/smem.h>
++
++/*
++ * The Qualcomm shared memory system is a allocate only heap structure that
++ * consists of one of more memory areas that can be accessed by the processors
++ * in the SoC.
++ *
++ * All systems contains a global heap, accessible by all processors in the SoC,
++ * with a table of contents data structure (@smem_header) at the beginning of
++ * the main shared memory block.
++ *
++ * The global header contains metadata for allocations as well as a fixed list
++ * of 512 entries (@smem_global_entry) that can be initialized to reference
++ * parts of the shared memory space.
++ *
++ *
++ * In addition to this global heap a set of "private" heaps can be set up at
++ * boot time with access restrictions so that only certain processor pairs can
++ * access the data.
++ *
++ * These partitions are referenced from an optional partition table
++ * (@smem_ptable), that is found 4kB from the end of the main smem region. The
++ * partition table entries (@smem_ptable_entry) lists the involved processors
++ * (or hosts) and their location in the main shared memory region.
++ *
++ * Each partition starts with a header (@smem_partition_header) that identifies
++ * the partition and holds properties for the two internal memory regions. The
++ * two regions are cached and non-cached memory respectively. Each region
++ * contain a link list of allocation headers (@smem_private_entry) followed by
++ * their data.
++ *
++ * Items in the non-cached region are allocated from the start of the partition
++ * while items in the cached region are allocated from the end. The free area
++ * is hence the region between the cached and non-cached offsets.
++ *
++ *
++ * To synchronize allocations in the shared memory heaps a remote spinlock must
++ * be held - currently lock number 3 of the sfpb or tcsr is used for this on all
++ * platforms.
++ *
++ */
++
++/**
++  * struct smem_proc_comm - proc_comm communication struct (legacy)
++  * @command:	current command to be executed
++  * @status:	status of the currently requested command
++  * @params:	parameters to the command
++  */
++struct smem_proc_comm {
++	u32 command;
++	u32 status;
++	u32 params[2];
++};
++
++/**
++ * struct smem_global_entry - entry to reference smem items on the heap
++ * @allocated:	boolean to indicate if this entry is used
++ * @offset:	offset to the allocated space
++ * @size:	size of the allocated space, 8 byte aligned
++ * @aux_base:	base address for the memory region used by this unit, or 0 for
++ *		the default region. bits 0,1 are reserved
++ */
++struct smem_global_entry {
++	u32 allocated;
++	u32 offset;
++	u32 size;
++	u32 aux_base; /* bits 1:0 reserved */
++};
++#define AUX_BASE_MASK		0xfffffffc
++
++/**
++ * struct smem_header - header found in beginning of primary smem region
++ * @proc_comm:		proc_comm communication interface (legacy)
++ * @version:		array of versions for the various subsystems
++ * @initialized:	boolean to indicate that smem is initialized
++ * @free_offset:	index of the first unallocated byte in smem
++ * @available:		number of bytes available for allocation
++ * @reserved:		reserved field, must be 0
++ * toc:			array of references to items
++ */
++struct smem_header {
++	struct smem_proc_comm proc_comm[4];
++	u32 version[32];
++	u32 initialized;
++	u32 free_offset;
++	u32 available;
++	u32 reserved;
++	struct smem_global_entry toc[];
++};
++
++/**
++ * struct smem_ptable_entry - one entry in the @smem_ptable list
++ * @offset:	offset, within the main shared memory region, of the partition
++ * @size:	size of the partition
++ * @flags:	flags for the partition (currently unused)
++ * @host0:	first processor/host with access to this partition
++ * @host1:	second processor/host with access to this partition
++ * @reserved:	reserved entries for later use
++ */
++struct smem_ptable_entry {
++	u32 offset;
++	u32 size;
++	u32 flags;
++	u16 host0;
++	u16 host1;
++	u32 reserved[8];
++};
++
++/**
++ * struct smem_ptable - partition table for the private partitions
++ * @magic:	magic number, must be SMEM_PTABLE_MAGIC
++ * @version:	version of the partition table
++ * @num_entries: number of partitions in the table
++ * @reserved:	for now reserved entries
++ * @entry:	list of @smem_ptable_entry for the @num_entries partitions
++ */
++struct smem_ptable {
++	u32 magic;
++	u32 version;
++	u32 num_entries;
++	u32 reserved[5];
++	struct smem_ptable_entry entry[];
++};
++#define SMEM_PTABLE_MAGIC	0x434f5424 /* "$TOC" */
++
++/**
++ * struct smem_partition_header - header of the partitions
++ * @magic:	magic number, must be SMEM_PART_MAGIC
++ * @host0:	first processor/host with access to this partition
++ * @host1:	second processor/host with access to this partition
++ * @size:	size of the partition
++ * @offset_free_uncached: offset to the first free byte of uncached memory in
++ *		this partition
++ * @offset_free_cached: offset to the first free byte of cached memory in this
++ *		partition
++ * @reserved:	for now reserved entries
++ */
++struct smem_partition_header {
++	u32 magic;
++	u16 host0;
++	u16 host1;
++	u32 size;
++	u32 offset_free_uncached;
++	u32 offset_free_cached;
++	u32 reserved[3];
++};
++#define SMEM_PART_MAGIC		0x54525024 /* "$PRT" */
++
++/**
++ * struct smem_private_entry - header of each item in the private partition
++ * @canary:	magic number, must be SMEM_PRIVATE_CANARY
++ * @item:	identifying number of the smem item
++ * @size:	size of the data, including padding bytes
++ * @padding_data: number of bytes of padding of data
++ * @padding_hdr: number of bytes of padding between the header and the data
++ * @reserved:	for now reserved entry
++ */
++struct smem_private_entry {
++	u16 canary;
++	u16 item;
++	u32 size; /* includes padding bytes */
++	u16 padding_data;
++	u16 padding_hdr;
++	u32 reserved;
++};
++#define SMEM_PRIVATE_CANARY	0xa5a5
++
++/*
++ * Item 3 of the global heap contains an array of versions for the various
++ * software components in the SoC. We verify that the boot loader version is
++ * what the expected version (SMEM_EXPECTED_VERSION) as a sanity check.
++ */
++#define SMEM_ITEM_VERSION	3
++#define  SMEM_MASTER_SBL_VERSION_INDEX	7
++#define  SMEM_EXPECTED_VERSION		11
++
++/*
++ * The first 8 items are only to be allocated by the boot loader while
++ * initializing the heap.
++ */
++#define SMEM_ITEM_LAST_FIXED	8
++
++/* Highest accepted item number, for both global and private heaps */
++#define SMEM_ITEM_LAST		512
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS		0
++
++/* Max number of processors/hosts in a system */
++#define SMEM_HOST_COUNT		7
++
++/**
++ * struct smem_region - representation of a chunk of memory used for smem
++ * @aux_base:	identifier of aux_mem base
++ * @virt_base:	virtual base address of memory with this aux_mem identifier
++ * @size:	size of the memory region
++ */
++struct smem_region {
++	u32 aux_base;
++	void __iomem *virt_base;
++	size_t size;
++};
++
++/**
++ * struct qcom_smem - device data for the smem device
++ * @dev:	device pointer
++ * @hwlock:	reference to a hwspinlock
++ * @partitions:	list of pointers to partitions affecting the current
++ *		processor/host
++ * @num_regions: number of @regions
++ * @regions:	list of the memory regions defining the shared memory
++ */
++struct qcom_smem {
++	struct device *dev;
++
++	struct hwspinlock *hwlock;
++
++	struct smem_partition_header *partitions[SMEM_HOST_COUNT];
++
++	unsigned num_regions;
++	struct smem_region regions[0];
++};
++
++/* Pointer to the one and only smem handle */
++static struct qcom_smem *__smem;
++
++/* Timeout (ms) for the trylock of remote spinlocks */
++#define HWSPINLOCK_TIMEOUT	1000
++
++static int qcom_smem_alloc_private(struct qcom_smem *smem,
++				   unsigned host,
++				   unsigned item,
++				   size_t size)
++{
++	struct smem_partition_header *phdr;
++	struct smem_private_entry *hdr;
++	size_t alloc_size;
++	void *p;
++
++	/* We're not going to find it if there's no matching partition */
++	if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
++		return -ENOENT;
++
++	phdr = smem->partitions[host];
++
++	p = (void *)phdr + sizeof(*phdr);
++	while (p < (void *)phdr + phdr->offset_free_uncached) {
++		hdr = p;
++
++		if (hdr->canary != SMEM_PRIVATE_CANARY) {
++			dev_err(smem->dev,
++				"Found invalid canary in host %d partition\n",
++				host);
++			return -EINVAL;
++		}
++
++		if (hdr->item == item)
++			return -EEXIST;
++
++		p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
++	}
++
++	/* Check that we don't grow into the cached region */
++	alloc_size = sizeof(*hdr) + ALIGN(size, 8);
++	if (p + alloc_size >= (void *)phdr + phdr->offset_free_cached) {
++		dev_err(smem->dev, "Out of memory\n");
++		return -ENOSPC;
++	}
++
++	hdr = p;
++	hdr->canary = SMEM_PRIVATE_CANARY;
++	hdr->item = item;
++	hdr->size = ALIGN(size, 8);
++	hdr->padding_data = hdr->size - size;
++	hdr->padding_hdr = 0;
++
++	/*
++	 * Ensure the header is written before we advance the free offset, so
++	 * that remote processors that does not take the remote spinlock still
++	 * gets a consistent view of the linked list.
++	 */
++	wmb();
++	phdr->offset_free_uncached += alloc_size;
++
++	return 0;
++}
++
++static int qcom_smem_alloc_global(struct qcom_smem *smem,
++				  unsigned item,
++				  size_t size)
++{
++	struct smem_header *header;
++	struct smem_global_entry *entry;
++
++	if (WARN_ON(item >= SMEM_ITEM_LAST))
++		return -EINVAL;
++
++	header = smem->regions[0].virt_base;
++	entry = &header->toc[item];
++	if (entry->allocated)
++		return -EEXIST;
++
++	size = ALIGN(size, 8);
++	if (WARN_ON(size > header->available))
++		return -ENOMEM;
++
++	entry->offset = header->free_offset;
++	entry->size = size;
++
++	/*
++	 * Ensure the header is consistent before we mark the item allocated,
++	 * so that remote processors will get a consistent view of the item
++	 * even though they do not take the spinlock on read.
++	 */
++	wmb();
++	entry->allocated = 1;
++
++	header->free_offset += size;
++	header->available -= size;
++
++	return 0;
++}
++
++/**
++ * qcom_smem_alloc - allocate space for a smem item
++ * @host:	remote processor id, or -1
++ * @item:	smem item handle
++ * @size:	number of bytes to be allocated
++ *
++ * Allocate space for a given smem item of size @size, given that the item is
++ * not yet allocated.
++ */
++int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
++{
++	unsigned long flags;
++	int ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	if (item < SMEM_ITEM_LAST_FIXED) {
++		dev_err(__smem->dev,
++			"Rejecting allocation of static entry %d\n", item);
++		return -EINVAL;
++	}
++
++	ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
++					  HWSPINLOCK_TIMEOUT,
++					  &flags);
++	if (ret)
++		return ret;
++
++	ret = qcom_smem_alloc_private(__smem, host, item, size);
++	if (ret == -ENOENT)
++		ret = qcom_smem_alloc_global(__smem, item, size);
++
++	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
++
++	return ret;
++}
++EXPORT_SYMBOL(qcom_smem_alloc);
++
++static int qcom_smem_get_global(struct qcom_smem *smem,
++				unsigned item,
++				void **ptr,
++				size_t *size)
++{
++	struct smem_header *header;
++	struct smem_region *area;
++	struct smem_global_entry *entry;
++	u32 aux_base;
++	unsigned i;
++
++	if (WARN_ON(item >= SMEM_ITEM_LAST))
++		return -EINVAL;
++
++	header = smem->regions[0].virt_base;
++	entry = &header->toc[item];
++	if (!entry->allocated)
++		return -ENXIO;
++
++	if (ptr != NULL) {
++		aux_base = entry->aux_base & AUX_BASE_MASK;
++
++		for (i = 0; i < smem->num_regions; i++) {
++			area = &smem->regions[i];
++
++			if (area->aux_base == aux_base || !aux_base) {
++				*ptr = area->virt_base + entry->offset;
++				break;
++			}
++		}
++	}
++	if (size != NULL)
++		*size = entry->size;
++
++	return 0;
++}
++
++static int qcom_smem_get_private(struct qcom_smem *smem,
++				 unsigned host,
++				 unsigned item,
++				 void **ptr,
++				 size_t *size)
++{
++	struct smem_partition_header *phdr;
++	struct smem_private_entry *hdr;
++	void *p;
++
++	/* We're not going to find it if there's no matching partition */
++	if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
++		return -ENOENT;
++
++	phdr = smem->partitions[host];
++
++	p = (void *)phdr + sizeof(*phdr);
++	while (p < (void *)phdr + phdr->offset_free_uncached) {
++		hdr = p;
++
++		if (hdr->canary != SMEM_PRIVATE_CANARY) {
++			dev_err(smem->dev,
++				"Found invalid canary in host %d partition\n",
++				host);
++			return -EINVAL;
++		}
++
++		if (hdr->item == item) {
++			if (ptr != NULL)
++				*ptr = p + sizeof(*hdr) + hdr->padding_hdr;
++
++			if (size != NULL)
++				*size = hdr->size - hdr->padding_data;
++
++			return 0;
++		}
++
++		p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
++	}
++
++	return -ENOENT;
++}
++
++/**
++ * qcom_smem_get - resolve ptr of size of a smem item
++ * @host:	the remote processor, or -1
++ * @item:	smem item handle
++ * @ptr:	pointer to be filled out with address of the item
++ * @size:	pointer to be filled out with size of the item
++ *
++ * Looks up pointer and size of a smem item.
++ */
++int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size)
++{
++	unsigned long flags;
++	int ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
++					  HWSPINLOCK_TIMEOUT,
++					  &flags);
++	if (ret)
++		return ret;
++
++	ret = qcom_smem_get_private(__smem, host, item, ptr, size);
++	if (ret == -ENOENT)
++		ret = qcom_smem_get_global(__smem, item, ptr, size);
++
++	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
++	return ret;
++
++}
++EXPORT_SYMBOL(qcom_smem_get);
++
++/**
++ * qcom_smem_get_free_space - retrieve amont of free space in a partition
++ * @host:	the remote processor identifing a partition, or -1
++ *
++ * To be used by smem clients as a quick way to determine if any new
++ * allocations has been made.
++ */
++int qcom_smem_get_free_space(unsigned host)
++{
++	struct smem_partition_header *phdr;
++	struct smem_header *header;
++	unsigned ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	if (host < SMEM_HOST_COUNT && __smem->partitions[host]) {
++		phdr = __smem->partitions[host];
++		ret = phdr->offset_free_uncached;
++	} else {
++		header = __smem->regions[0].virt_base;
++		ret = header->available;
++	}
++
++	return ret;
++}
++EXPORT_SYMBOL(qcom_smem_get_free_space);
++
++static int qcom_smem_get_sbl_version(struct qcom_smem *smem)
++{
++	unsigned *versions;
++	size_t size;
++	int ret;
++
++	ret = qcom_smem_get_global(smem, SMEM_ITEM_VERSION,
++				   (void **)&versions, &size);
++	if (ret < 0) {
++		dev_err(smem->dev, "Unable to read the version item\n");
++		return -ENOENT;
++	}
++
++	if (size < sizeof(unsigned) * SMEM_MASTER_SBL_VERSION_INDEX) {
++		dev_err(smem->dev, "Version item is too small\n");
++		return -EINVAL;
++	}
++
++	return versions[SMEM_MASTER_SBL_VERSION_INDEX];
++}
++
++static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
++					  unsigned local_host)
++{
++	struct smem_partition_header *header;
++	struct smem_ptable_entry *entry;
++	struct smem_ptable *ptable;
++	unsigned remote_host;
++	int i;
++
++	ptable = smem->regions[0].virt_base + smem->regions[0].size - 4 * 1024;
++	if (ptable->magic != SMEM_PTABLE_MAGIC)
++		return 0;
++
++	if (ptable->version != 1) {
++		dev_err(smem->dev,
++			"Unsupported partition header version %d\n",
++			ptable->version);
++		return -EINVAL;
++	}
++
++	for (i = 0; i < ptable->num_entries; i++) {
++		entry = &ptable->entry[i];
++
++		if (entry->host0 != local_host && entry->host1 != local_host)
++			continue;
++
++		if (!entry->offset)
++			continue;
++
++		if (!entry->size)
++			continue;
++
++		if (entry->host0 == local_host)
++			remote_host = entry->host1;
++		else
++			remote_host = entry->host0;
++
++		if (smem->partitions[remote_host]) {
++			dev_err(smem->dev,
++				"Already found a partition for host %d\n",
++				remote_host);
++			return -EINVAL;
++		}
++
++		header = smem->regions[0].virt_base + entry->offset;
++
++		if (header->magic != SMEM_PART_MAGIC) {
++			dev_err(smem->dev,
++				"Partition %d has invalid magic\n", i);
++			return -EINVAL;
++		}
++
++		if (header->host0 != local_host && header->host1 != local_host) {
++			dev_err(smem->dev,
++				"Partition %d hosts are invalid\n", i);
++			return -EINVAL;
++		}
++
++		if (header->host0 != remote_host && header->host1 != remote_host) {
++			dev_err(smem->dev,
++				"Partition %d hosts are invalid\n", i);
++			return -EINVAL;
++		}
++
++		if (header->size != entry->size) {
++			dev_err(smem->dev,
++				"Partition %d has invalid size\n", i);
++			return -EINVAL;
++		}
++
++		if (header->offset_free_uncached > header->size) {
++			dev_err(smem->dev,
++				"Partition %d has invalid free pointer\n", i);
++			return -EINVAL;
++		}
++
++		smem->partitions[remote_host] = header;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_count_mem_regions(struct platform_device *pdev)
++{
++	struct resource *res;
++	int num_regions = 0;
++	int i;
++
++	for (i = 0; i < pdev->num_resources; i++) {
++		res = &pdev->resource[i];
++
++		if (resource_type(res) == IORESOURCE_MEM)
++			num_regions++;
++	}
++
++	return num_regions;
++}
++
++static int qcom_smem_probe(struct platform_device *pdev)
++{
++	struct smem_header *header;
++	struct device_node *np;
++	struct qcom_smem *smem;
++	struct resource *res;
++	struct resource r;
++	size_t array_size;
++	int num_regions = 0;
++	int hwlock_id;
++	u32 version;
++	int ret;
++	int i;
++
++	num_regions = qcom_smem_count_mem_regions(pdev) + 1;
++
++	array_size = num_regions * sizeof(struct smem_region);
++	smem = devm_kzalloc(&pdev->dev, sizeof(*smem) + array_size, GFP_KERNEL);
++	if (!smem)
++		return -ENOMEM;
++
++	smem->dev = &pdev->dev;
++	smem->num_regions = num_regions;
++
++	np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
++	if (!np) {
++		dev_err(&pdev->dev, "No memory-region specified\n");
++		return -EINVAL;
++	}
++
++	ret = of_address_to_resource(np, 0, &r);
++	of_node_put(np);
++	if (ret)
++		return ret;
++
++	smem->regions[0].aux_base = (u32)r.start;
++	smem->regions[0].size = resource_size(&r);
++	smem->regions[0].virt_base = devm_ioremap_nocache(&pdev->dev,
++							  r.start,
++							  resource_size(&r));
++	if (!smem->regions[0].virt_base)
++		return -ENOMEM;
++
++	for (i = 1; i < num_regions; i++) {
++		res = platform_get_resource(pdev, IORESOURCE_MEM, i - 1);
++
++		smem->regions[i].aux_base = (u32)res->start;
++		smem->regions[i].size = resource_size(res);
++		smem->regions[i].virt_base = devm_ioremap_nocache(&pdev->dev,
++								  res->start,
++								  resource_size(res));
++		if (!smem->regions[i].virt_base)
++			return -ENOMEM;
++	}
++
++	header = smem->regions[0].virt_base;
++	if (header->initialized != 1 || header->reserved) {
++		dev_err(&pdev->dev, "SMEM is not initilized by SBL\n");
++		return -EINVAL;
++	}
++
++	version = qcom_smem_get_sbl_version(smem);
++	if (version >> 16 != SMEM_EXPECTED_VERSION) {
++		dev_err(&pdev->dev, "Unsupported smem version 0x%x\n", version);
++		return -EINVAL;
++	}
++
++	ret = qcom_smem_enumerate_partitions(smem, SMEM_HOST_APPS);
++	if (ret < 0)
++		return ret;
++
++	hwlock_id = of_hwspin_lock_get_id(pdev->dev.of_node, 0);
++	if (hwlock_id < 0) {
++		dev_err(&pdev->dev, "failed to retrieve hwlock\n");
++		return hwlock_id;
++	}
++
++	smem->hwlock = hwspin_lock_request_specific(hwlock_id);
++	if (!smem->hwlock)
++		return -ENXIO;
++
++	__smem = smem;
++
++	return 0;
++}
++
++static int qcom_smem_remove(struct platform_device *pdev)
++{
++	hwspin_lock_free(__smem->hwlock);
++	__smem = NULL;
++
++	return 0;
++}
++
++static const struct of_device_id qcom_smem_of_match[] = {
++	{ .compatible = "qcom,smem" },
++	{}
++};
++MODULE_DEVICE_TABLE(of, qcom_smem_of_match);
++
++static struct platform_driver qcom_smem_driver = {
++	.probe = qcom_smem_probe,
++	.remove = qcom_smem_remove,
++	.driver  = {
++		.name = "qcom_smem",
++		.of_match_table = qcom_smem_of_match,
++		.suppress_bind_attrs = true,
++	},
++};
++
++static int __init qcom_smem_init(void)
++{
++	return platform_driver_register(&qcom_smem_driver);
++}
++arch_initcall(qcom_smem_init);
++
++static void __exit qcom_smem_exit(void)
++{
++	platform_driver_unregister(&qcom_smem_driver);
++}
++module_exit(qcom_smem_exit)
++
++MODULE_AUTHOR("Bjorn Andersson <bjorn.andersson at sonymobile.com>");
++MODULE_DESCRIPTION("Qualcomm Shared Memory Manager");
++MODULE_LICENSE("GPLv2");
+--- /dev/null
++++ b/include/linux/soc/qcom/smem.h
+@@ -0,0 +1,14 @@
++#ifndef __QCOM_SMEM_H__
++#define __QCOM_SMEM_H__
++
++struct device_node;
++struct qcom_smem;
++
++#define QCOM_SMEM_HOST_ANY -1
++
++int qcom_smem_alloc(unsigned host, unsigned item, size_t size);
++int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size);
++
++int qcom_smem_get_free_space(unsigned host);
++
++#endif
diff --git a/target/linux/ipq806x/patches-4.1/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch b/target/linux/ipq806x/patches-4.1/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
new file mode 100644
index 0000000..d30cf7b
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
@@ -0,0 +1,27 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -55,7 +55,7 @@
+ 			no-map;
+ 		};
+ 
+-		smem at 41000000 {
++		smem: smem at 41000000 {
+ 			reg = <0x41000000 0x200000>;
+ 			no-map;
+ 		};
+@@ -79,6 +79,15 @@
+ 
+ 			#hwlock-cells = <1>;
+ 		};
++
++		smem {
++			compatible = "qcom,smem";
++
++			memory-region = <&smem>;
++			reg = <0x41000000 0x4000>;
++
++			hwlocks = <&sfpb_mutex 3>;
++		};
+ 	};
+ 
+ 	soc: soc {
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 51a08fb..1974bc7 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -134,7 +134,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  / {
  	model = "Qualcomm IPQ8064";
-@@ -341,5 +343,127 @@
+@@ -350,5 +352,127 @@
  			#reset-cells = <1>;
  		};
  
diff --git a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
index 40115a4..7615356 100644
--- a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
+++ b/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -371,15 +371,21 @@
+@@ -380,15 +380,21 @@
  
  			clocks = <&gcc PCIE_A_CLK>,
  				 <&gcc PCIE_H_CLK>,
@@ -26,7 +26,7 @@
  
  			status = "disabled";
  		};
-@@ -412,15 +418,21 @@
+@@ -421,15 +427,21 @@
  
  			clocks = <&gcc PCIE_1_A_CLK>,
  				 <&gcc PCIE_1_H_CLK>,
@@ -52,7 +52,7 @@
  
  			status = "disabled";
  		};
-@@ -453,15 +465,21 @@
+@@ -462,15 +474,21 @@
  
  			clocks = <&gcc PCIE_2_A_CLK>,
  				 <&gcc PCIE_2_H_CLK>,
diff --git a/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch b/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
index 458dcd5..8e88b79 100644
--- a/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
+++ b/target/linux/ipq806x/patches-4.1/126-add-rpm-to-ipq8064-dts.patch
@@ -8,7 +8,7 @@
  #include <dt-bindings/clock/qcom,lcc-ipq806x.h>
  #include <dt-bindings/soc/qcom,gsbi.h>
  #include <dt-bindings/reset/qcom,gcc-ipq806x.h>
-@@ -104,6 +105,63 @@
+@@ -113,6 +114,63 @@
  			reg-names = "lpass-lpaif";
  		};
  
@@ -72,7 +72,7 @@
  		qcom_pinmux: pinmux at 800000 {
  			compatible = "qcom,ipq8064-pinctrl";
  			reg = <0x800000 0x4000>;
-@@ -148,6 +206,12 @@
+@@ -157,6 +215,12 @@
  			reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
  		};
  
diff --git a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
index b25d955..bcab7b2 100644
--- a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
+++ b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch
@@ -37,7 +37,7 @@
  		};
  	};
  
-@@ -84,6 +102,46 @@
+@@ -93,6 +111,46 @@
  		};
  	};
  
@@ -84,7 +84,7 @@
  	soc: soc {
  		#address-cells = <1>;
  		#size-cells = <1>;
-@@ -199,11 +257,13 @@
+@@ -208,11 +266,13 @@
  		acc0: clock-controller at 2088000 {
  			compatible = "qcom,kpss-acc-v1";
  			reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
diff --git a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index e5c57a9..9129336 100644
--- a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ b/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -26,7 +26,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
  					#address-cells = <1>;
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -607,5 +607,25 @@
+@@ -616,5 +616,25 @@
  
  			status = "disabled";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
index bd9bf47..e04deb8 100644
--- a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
+++ b/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -26,7 +26,7 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -627,5 +627,21 @@
+@@ -636,5 +636,21 @@
  
  			status = "disabled";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index c21ebcd..f4f56f2 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -117,7 +117,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -643,5 +643,91 @@
+@@ -652,5 +652,91 @@
  
  			status = "disabled";
  		};
-- 
2.1.4

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Wed Aug 12 22:37:43 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed, 12 Aug 2015 19:37:43 -0700
Subject: [OpenWrt-Devel] [PATCH 4/5] ipq806x: add QCOM SMEM based MTD parser
In-Reply-To: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
References: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439433464-1526-5-git-send-email-mathieu@codeaurora.org>

This patch adds a new parser which uses the SMEM available on IPQ and
some other QCOM platforms to map the MTD partitions.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 .../037-mtd-add-qcom-smem-parser.patch             | 253 +++++++++++++++++++++
 .../patches-4.1/037-mtd-add-qcom-smem-parser.patch | 253 +++++++++++++++++++++
 2 files changed, 506 insertions(+)
 create mode 100644 target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/037-mtd-add-qcom-smem-parser.patch

diff --git a/target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch b/target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch
new file mode 100644
index 0000000..6ee3ba0
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch
@@ -0,0 +1,253 @@
+--- a/drivers/mtd/Kconfig
++++ b/drivers/mtd/Kconfig
+@@ -184,6 +184,13 @@ config MTD_BCM47XX_PARTS
+ 	  This provides partitions parser for devices based on BCM47xx
+ 	  boards.
+ 
++config MTD_QCOM_SMEM_PARTS
++	tristate "QCOM SMEM partitioning support"
++	depends on QCOM_SMEM
++	help
++	  This provides partitions parser for QCOM devices using SMEM
++	  such as IPQ806x.
++
+ config MTD_MYLOADER_PARTS
+ 	tristate "MyLoader partition parsing"
+ 	depends on ADM5120 || ATH25 || ATH79
+--- a/drivers/mtd/Makefile
++++ b/drivers/mtd/Makefile
+@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
+ obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
+ obj-$(CONFIG_MTD_BCM47XX_PARTS)	+= bcm47xxpart.o
+ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
++obj-$(CONFIG_MTD_QCOM_SMEM_PARTS) += qcom_smem_part.o
+ 
+ # 'Users' - code which presents functionality to userspace.
+ obj-$(CONFIG_MTD_BLKDEVS)	+= mtd_blkdevs.o
+--- /dev/null
++++ b/drivers/mtd/qcom_smem_part.c
+@@ -0,0 +1,224 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/device.h>
++#include <linux/slab.h>
++
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/module.h>
++
++#include <linux/soc/qcom/smem.h>
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS			0
++
++/* SMEM items index */
++#define SMEM_AARM_PARTITION_TABLE	9
++#define SMEM_BOOT_FLASH_TYPE		421
++#define SMEM_BOOT_FLASH_BLOCK_SIZE	424
++
++/* SMEM Magic values in partition table */
++#define SMEM_PTABLE_MAGIC_1		0x55ee73aa
++#define SMEM_PTABLE_MAGIC_2		0xe35ebddb
++
++/* SMEM Flash types */
++#define SMEM_FLASH_NAND			2
++#define SMEM_FLASH_SPI			6
++
++#define SMEM_PART_NAME_SZ		16
++#define SMEM_PARTS_MAX			32
++
++struct smem_partition {
++	char name[SMEM_PART_NAME_SZ];
++	uint32_t start;
++	uint32_t size;
++	uint32_t attr;
++};
++
++struct smem_partition_table {
++	uint32_t magic[2];
++	uint32_t version;
++	uint32_t len;
++	struct smem_partition parts[SMEM_PARTS_MAX];
++};
++
++static int qcom_smem_get_flash_blksz(uint64_t **smem_blksz)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_BLOCK_SIZE,
++			    (void **) smem_blksz, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read flash blksz from SMEM\n");
++		return -ENOENT;
++	}
++
++	if (size != sizeof(**smem_blksz)) {
++		pr_err("Invalid flash blksz size in SMEM\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_get_flash_type(uint64_t **smem_flash_type) {
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_TYPE,
++			    (void **) smem_flash_type, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read flash type from SMEM\n");
++		return -ENOENT;
++	}
++
++	if (size != sizeof(**smem_flash_type)) {
++		pr_err("Invalid flash type size in SMEM\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_get_flash_partitions(struct smem_partition_table **pparts)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_AARM_PARTITION_TABLE,
++			    (void **) pparts, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read partition table from SMEM\n");
++		return -ENOENT;
++	}
++
++	return 0;
++}
++
++static int of_dev_node_match(struct device *dev, void *data)
++{
++	return dev->of_node == data;
++}
++
++static bool is_spi_device(struct device_node *np)
++{
++	struct device *dev;
++
++	dev = bus_find_device(&spi_bus_type, NULL, np, of_dev_node_match);
++	return dev ? true : false;
++}
++
++static int parse_qcom_smem_partitions(struct mtd_info *master,
++				      struct mtd_partition **pparts,
++				      struct mtd_part_parser_data *data)
++{
++	struct smem_partition_table *smem_parts;
++	uint64_t *smem_flash_type, *smem_blksz;
++	struct mtd_partition *mtd_parts;
++	struct device_node *of_node = data->of_node;
++	int i, ret;
++
++	/*
++	 * SMEM will only store the partition table of the boot device.
++	 * If this is not the boot device, do not return any partition.
++	 */
++	ret = qcom_smem_get_flash_type(&smem_flash_type);
++	if (ret < 0)
++		return ret;
++
++	if ((*smem_flash_type == SMEM_FLASH_NAND && !mtd_type_is_nand(master))
++	    || (*smem_flash_type == SMEM_FLASH_SPI && !is_spi_device(of_node)))
++		return 0;
++
++	/*
++	 * Just for sanity purpose, make sure the block size in SMEM matches the
++	 * block size of the MTD device
++	 */
++	ret = qcom_smem_get_flash_blksz(&smem_blksz);
++	if (ret < 0)
++		return ret;
++
++	if (*smem_blksz != master->erasesize) {
++		pr_err("SMEM block size differs from MTD block size\n");
++		return -EINVAL;
++	}
++
++	/* Get partition pointer from SMEM */
++	ret = qcom_smem_get_flash_partitions(&smem_parts);
++	if (ret < 0)
++		return ret;
++
++	if (smem_parts->magic[0] != SMEM_PTABLE_MAGIC_1 ||
++	    smem_parts->magic[1] != SMEM_PTABLE_MAGIC_2) {
++		pr_err("SMEM partition magic invalid\n");
++		return -EINVAL;
++	}
++
++	/* Allocate and populate the mtd structures */
++	mtd_parts = kzalloc(smem_parts->len * sizeof(struct mtd_partition),
++			    GFP_KERNEL);
++	if (mtd_parts == NULL)
++		return -ENOMEM;
++
++	for (i = 0; i < smem_parts->len; i++) {
++		struct smem_partition *part = &smem_parts->parts[i];
++
++		mtd_parts[i].name = part->name;
++		mtd_parts[i].size = part->size * (*smem_blksz);
++		mtd_parts[i].offset = part->start * (*smem_blksz);
++
++		/*
++		 * The last SMEM partition may have its size marked as
++		 * something like 0xffffffff, which means "until the end of the
++		 * flash device". In this case, truncate it.
++		 */
++		if (mtd_parts[i].offset + mtd_parts[i].size > master->size) {
++			mtd_parts[i].size = master->size - mtd_parts[i].offset;
++		}
++	}
++
++	*pparts = mtd_parts;
++
++	return smem_parts->len;
++}
++
++static struct mtd_part_parser qcom_smem_parser = {
++	.owner = THIS_MODULE,
++	.parse_fn = parse_qcom_smem_partitions,
++	.name = "qcom-smem",
++};
++
++static int __init qcom_smem_parser_init(void)
++{
++	register_mtd_parser(&qcom_smem_parser);
++	return 0;
++}
++
++static void __exit qcom_smem_parser_exit(void)
++{
++	deregister_mtd_parser(&qcom_smem_parser);
++}
++
++module_init(qcom_smem_parser_init);
++module_exit(qcom_smem_parser_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Mathieu Olivari <mathieu at codeaurora.org>");
++MODULE_DESCRIPTION("Parsing code for SMEM based partition tables");
diff --git a/target/linux/ipq806x/patches-4.1/037-mtd-add-qcom-smem-parser.patch b/target/linux/ipq806x/patches-4.1/037-mtd-add-qcom-smem-parser.patch
new file mode 100644
index 0000000..6ee3ba0
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/037-mtd-add-qcom-smem-parser.patch
@@ -0,0 +1,253 @@
+--- a/drivers/mtd/Kconfig
++++ b/drivers/mtd/Kconfig
+@@ -184,6 +184,13 @@ config MTD_BCM47XX_PARTS
+ 	  This provides partitions parser for devices based on BCM47xx
+ 	  boards.
+ 
++config MTD_QCOM_SMEM_PARTS
++	tristate "QCOM SMEM partitioning support"
++	depends on QCOM_SMEM
++	help
++	  This provides partitions parser for QCOM devices using SMEM
++	  such as IPQ806x.
++
+ config MTD_MYLOADER_PARTS
+ 	tristate "MyLoader partition parsing"
+ 	depends on ADM5120 || ATH25 || ATH79
+--- a/drivers/mtd/Makefile
++++ b/drivers/mtd/Makefile
+@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
+ obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
+ obj-$(CONFIG_MTD_BCM47XX_PARTS)	+= bcm47xxpart.o
+ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
++obj-$(CONFIG_MTD_QCOM_SMEM_PARTS) += qcom_smem_part.o
+ 
+ # 'Users' - code which presents functionality to userspace.
+ obj-$(CONFIG_MTD_BLKDEVS)	+= mtd_blkdevs.o
+--- /dev/null
++++ b/drivers/mtd/qcom_smem_part.c
+@@ -0,0 +1,224 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/device.h>
++#include <linux/slab.h>
++
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/module.h>
++
++#include <linux/soc/qcom/smem.h>
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS			0
++
++/* SMEM items index */
++#define SMEM_AARM_PARTITION_TABLE	9
++#define SMEM_BOOT_FLASH_TYPE		421
++#define SMEM_BOOT_FLASH_BLOCK_SIZE	424
++
++/* SMEM Magic values in partition table */
++#define SMEM_PTABLE_MAGIC_1		0x55ee73aa
++#define SMEM_PTABLE_MAGIC_2		0xe35ebddb
++
++/* SMEM Flash types */
++#define SMEM_FLASH_NAND			2
++#define SMEM_FLASH_SPI			6
++
++#define SMEM_PART_NAME_SZ		16
++#define SMEM_PARTS_MAX			32
++
++struct smem_partition {
++	char name[SMEM_PART_NAME_SZ];
++	uint32_t start;
++	uint32_t size;
++	uint32_t attr;
++};
++
++struct smem_partition_table {
++	uint32_t magic[2];
++	uint32_t version;
++	uint32_t len;
++	struct smem_partition parts[SMEM_PARTS_MAX];
++};
++
++static int qcom_smem_get_flash_blksz(uint64_t **smem_blksz)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_BLOCK_SIZE,
++			    (void **) smem_blksz, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read flash blksz from SMEM\n");
++		return -ENOENT;
++	}
++
++	if (size != sizeof(**smem_blksz)) {
++		pr_err("Invalid flash blksz size in SMEM\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_get_flash_type(uint64_t **smem_flash_type) {
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_TYPE,
++			    (void **) smem_flash_type, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read flash type from SMEM\n");
++		return -ENOENT;
++	}
++
++	if (size != sizeof(**smem_flash_type)) {
++		pr_err("Invalid flash type size in SMEM\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_get_flash_partitions(struct smem_partition_table **pparts)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_AARM_PARTITION_TABLE,
++			    (void **) pparts, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read partition table from SMEM\n");
++		return -ENOENT;
++	}
++
++	return 0;
++}
++
++static int of_dev_node_match(struct device *dev, void *data)
++{
++	return dev->of_node == data;
++}
++
++static bool is_spi_device(struct device_node *np)
++{
++	struct device *dev;
++
++	dev = bus_find_device(&spi_bus_type, NULL, np, of_dev_node_match);
++	return dev ? true : false;
++}
++
++static int parse_qcom_smem_partitions(struct mtd_info *master,
++				      struct mtd_partition **pparts,
++				      struct mtd_part_parser_data *data)
++{
++	struct smem_partition_table *smem_parts;
++	uint64_t *smem_flash_type, *smem_blksz;
++	struct mtd_partition *mtd_parts;
++	struct device_node *of_node = data->of_node;
++	int i, ret;
++
++	/*
++	 * SMEM will only store the partition table of the boot device.
++	 * If this is not the boot device, do not return any partition.
++	 */
++	ret = qcom_smem_get_flash_type(&smem_flash_type);
++	if (ret < 0)
++		return ret;
++
++	if ((*smem_flash_type == SMEM_FLASH_NAND && !mtd_type_is_nand(master))
++	    || (*smem_flash_type == SMEM_FLASH_SPI && !is_spi_device(of_node)))
++		return 0;
++
++	/*
++	 * Just for sanity purpose, make sure the block size in SMEM matches the
++	 * block size of the MTD device
++	 */
++	ret = qcom_smem_get_flash_blksz(&smem_blksz);
++	if (ret < 0)
++		return ret;
++
++	if (*smem_blksz != master->erasesize) {
++		pr_err("SMEM block size differs from MTD block size\n");
++		return -EINVAL;
++	}
++
++	/* Get partition pointer from SMEM */
++	ret = qcom_smem_get_flash_partitions(&smem_parts);
++	if (ret < 0)
++		return ret;
++
++	if (smem_parts->magic[0] != SMEM_PTABLE_MAGIC_1 ||
++	    smem_parts->magic[1] != SMEM_PTABLE_MAGIC_2) {
++		pr_err("SMEM partition magic invalid\n");
++		return -EINVAL;
++	}
++
++	/* Allocate and populate the mtd structures */
++	mtd_parts = kzalloc(smem_parts->len * sizeof(struct mtd_partition),
++			    GFP_KERNEL);
++	if (mtd_parts == NULL)
++		return -ENOMEM;
++
++	for (i = 0; i < smem_parts->len; i++) {
++		struct smem_partition *part = &smem_parts->parts[i];
++
++		mtd_parts[i].name = part->name;
++		mtd_parts[i].size = part->size * (*smem_blksz);
++		mtd_parts[i].offset = part->start * (*smem_blksz);
++
++		/*
++		 * The last SMEM partition may have its size marked as
++		 * something like 0xffffffff, which means "until the end of the
++		 * flash device". In this case, truncate it.
++		 */
++		if (mtd_parts[i].offset + mtd_parts[i].size > master->size) {
++			mtd_parts[i].size = master->size - mtd_parts[i].offset;
++		}
++	}
++
++	*pparts = mtd_parts;
++
++	return smem_parts->len;
++}
++
++static struct mtd_part_parser qcom_smem_parser = {
++	.owner = THIS_MODULE,
++	.parse_fn = parse_qcom_smem_partitions,
++	.name = "qcom-smem",
++};
++
++static int __init qcom_smem_parser_init(void)
++{
++	register_mtd_parser(&qcom_smem_parser);
++	return 0;
++}
++
++static void __exit qcom_smem_parser_exit(void)
++{
++	deregister_mtd_parser(&qcom_smem_parser);
++}
++
++module_init(qcom_smem_parser_init);
++module_exit(qcom_smem_parser_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Mathieu Olivari <mathieu at codeaurora.org>");
++MODULE_DESCRIPTION("Parsing code for SMEM based partition tables");
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Wed Aug 12 22:37:44 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Wed, 12 Aug 2015 19:37:44 -0700
Subject: [OpenWrt-Devel] [PATCH 5/5] ipq806x: switch AP148 to using SMEM
	based MTD parser
In-Reply-To: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
References: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439433464-1526-6-git-send-email-mathieu@codeaurora.org>

*Enable SMEM MTD parser and its dependencies (SMEM & HW spinlocks) in
 the kernel config
*Replaces the MTD layout in DT by the dynamic layout provided by the
 SMEM parser for AP148

Using the OF based parser is still possible on platforms which have a
fixed MTD partition layout.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/config-3.18                   |  4 +++
 target/linux/ipq806x/config-4.1                    |  8 ++---
 .../patches-3.18/021-add-ap148-partitions.patch    | 34 ++++++----------------
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |  2 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |  4 ++-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  6 ++--
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 .../patches-4.1/021-add-ap148-partitions.patch     | 34 ++++++----------------
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |  4 ++-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  6 ++--
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 13 files changed, 43 insertions(+), 67 deletions(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 2a837f5..3d4f8bb 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -206,6 +206,8 @@ CONFIG_HIGHMEM=y
 CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HWMON=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MSM=y
 CONFIG_HZ_FIXED=0
@@ -259,6 +261,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
+CONFIG_MTD_QCOM_SMEM_PARTS=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
@@ -345,6 +348,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_WDT=y
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index f711dd5..d48943c 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -45,7 +45,6 @@ CONFIG_ARM_CCI400_PMU=y
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
-# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
 # CONFIG_ARM_LPAE is not set
@@ -214,6 +213,8 @@ CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 # CONFIG_HSU_DMA_PCI is not set
 CONFIG_HWMON=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MSM=y
 CONFIG_HZ_FIXED=0
@@ -240,7 +241,6 @@ CONFIG_KPSS_XCC=y
 CONFIG_KRAITCC=y
 CONFIG_KRAIT_CLOCKS=y
 CONFIG_KRAIT_L2_ACCESSORS=y
-# CONFIG_LEDS_REGULATOR is not set
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
@@ -268,6 +268,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
+CONFIG_MTD_QCOM_SMEM_PARTS=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
@@ -357,6 +358,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_WDT=y
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
@@ -366,9 +368,7 @@ CONFIG_RD_GZIP=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
 CONFIG_REGULATOR_QCOM_RPM=y
-# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
diff --git a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
index 34eb9c0..bfdb30f 100644
--- a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
+++ b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
@@ -1,35 +1,19 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -78,13 +78,28 @@
+@@ -77,15 +77,7 @@
+ 					spi-max-frequency = <50000000>;
  					reg = <0>;
  
- 					partition at 0 {
+-					partition at 0 {
 -						label = "rootfs";
 -						reg = <0x0 0x1000000>;
-+						label = "lowlevel_init";
-+						reg = <0x0 0x1b0000>;
- 					};
- 
- 					partition at 1 {
+-					};
+-
+-					partition at 1 {
 -						label = "scratch";
 -						reg = <0x1000000 0x1000000>;
-+						label = "u-boot";
-+						reg = <0x1b0000 0x80000>;
-+					};
-+
-+					partition at 2 {
-+						label = "u-boot-env";
-+						reg = <0x230000 0x40000>;
-+					};
-+
-+					partition at 3 {
-+						label = "caldata";
-+						reg = <0x270000 0x40000>;
-+					};
-+
-+					partition at 4 {
-+						label = "firmware";
-+						reg = <0x2b0000 0x1d50000>;
- 					};
+-					};
++					linux,part-probe = "qcom-smem";
  				};
  			};
+ 		};
diff --git a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
index 755d0b0..e997fa3 100644
--- a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
+++ b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -114,5 +114,29 @@
+@@ -91,5 +91,29 @@
  		sata at 29000000 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index d5b8b6f..ffd31fe 100644
--- a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -40,7 +40,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -138,5 +156,19 @@
+@@ -115,5 +133,19 @@
  		usb30 at 1 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
index 77be886..b5d5fa1 100644
--- a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
+++ b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -57,7 +57,7 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
  		};
  
  		gsbi at 16300000 {
-@@ -170,5 +195,19 @@
+@@ -147,5 +172,21 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
@@ -70,6 +70,8 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
 +
 +			nand-ecc-strength = <4>;
 +			nand-bus-width = <8>;
++
++			linux,part-probe = "qcom-smem";
 +		};
  	};
  };
diff --git a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index da8286a..fe28942 100644
--- a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,9 +38,9 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -205,6 +215,34 @@
- 			nand-ecc-strength = <4>;
- 			nand-bus-width = <8>;
+@@ -184,6 +194,34 @@
+ 
+ 			linux,part-probe = "qcom-smem";
  		};
 +
 +		mdio0: mdio {
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 52ffd6c..064aaba 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -243,6 +253,27 @@
+@@ -222,6 +232,27 @@
  				reg = <4>;
  			};
  		};
diff --git a/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch b/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
index 34eb9c0..bfdb30f 100644
--- a/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
+++ b/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
@@ -1,35 +1,19 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -78,13 +78,28 @@
+@@ -77,15 +77,7 @@
+ 					spi-max-frequency = <50000000>;
  					reg = <0>;
  
- 					partition at 0 {
+-					partition at 0 {
 -						label = "rootfs";
 -						reg = <0x0 0x1000000>;
-+						label = "lowlevel_init";
-+						reg = <0x0 0x1b0000>;
- 					};
- 
- 					partition at 1 {
+-					};
+-
+-					partition at 1 {
 -						label = "scratch";
 -						reg = <0x1000000 0x1000000>;
-+						label = "u-boot";
-+						reg = <0x1b0000 0x80000>;
-+					};
-+
-+					partition at 2 {
-+						label = "u-boot-env";
-+						reg = <0x230000 0x40000>;
-+					};
-+
-+					partition at 3 {
-+						label = "caldata";
-+						reg = <0x270000 0x40000>;
-+					};
-+
-+					partition at 4 {
-+						label = "firmware";
-+						reg = <0x2b0000 0x1d50000>;
- 					};
+-					};
++					linux,part-probe = "qcom-smem";
  				};
  			};
+ 		};
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 1974bc7..c1d537a 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -40,7 +40,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -114,5 +132,19 @@
+@@ -91,5 +109,19 @@
  		sata at 29000000 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch b/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
index 2231d2d..163b46c 100644
--- a/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
+++ b/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -54,7 +54,7 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
  		};
  
  		gsbi at 16300000 {
-@@ -150,5 +172,19 @@
+@@ -127,5 +149,21 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
@@ -67,6 +67,8 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
 +
 +			nand-ecc-strength = <4>;
 +			nand-bus-width = <8>;
++
++			linux,part-probe = "qcom-smem";
 +		};
  	};
  };
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index c1e267a..6d85ce8 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,9 +38,9 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -182,6 +192,34 @@
- 			nand-ecc-strength = <4>;
- 			nand-bus-width = <8>;
+@@ -161,6 +171,34 @@
+ 
+ 			linux,part-probe = "qcom-smem";
  		};
 +
 +		mdio0: mdio {
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index f4f56f2..f3d08e8 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -220,6 +230,27 @@
+@@ -199,6 +209,27 @@
  				reg = <4>;
  			};
  		};
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From zajec5 at gmail.com  Thu Aug 13 00:04:38 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Thu, 13 Aug 2015 06:04:38 +0200
Subject: [OpenWrt-Devel] [PATCH 1/5] kernel: move linux,
 part-probe dt parsing in generic code
In-Reply-To: <1439433464-1526-2-git-send-email-mathieu@codeaurora.org>
References: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>
 <1439433464-1526-2-git-send-email-mathieu@codeaurora.org>
Message-ID: <CACna6rwiYjY=K8h5XKyxhHVq5ROG7piVwL_5pfxFDU+c3eDSnQ@mail.gmail.com>

On 13 August 2015 at 04:37, Mathieu Olivari <mathieu at codeaurora.org> wrote:
> The "linux,part-probe" dts parsing is a pretty neat generic feature.
> It has been posted to kernel.org and could easily be reused by all
> targets.

Was it accepted mainline? If so, you should use 0xx prefix for this
patch. Otherwise it's OK.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From paul at topguncomputers.com  Thu Aug 13 01:27:22 2015
From: paul at topguncomputers.com (Paul C)
Date: Wed, 12 Aug 2015 22:27:22 -0700
Subject: [OpenWrt-Devel] igmpproxy not auto starting on boot
Message-ID: <55CC2ABA.1030909@topguncomputers.com>

Currently running r46586 on my GW5310 and GW2388-4.  Even with
/etc/init.d/igmpproxy enabled.  It doesn't start up on boot and I have
to go in manually after to start it by doing /etc/init.d/igmpproxy start.

Using the gateworks openwrt bsp 14.08 igmpproxy starts upon boot.

Any info that is needed let me know.

Paul.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Thu Aug 13 02:56:18 2015
From: kerry9842 at gmail.com (John kerry)
Date: Thu, 13 Aug 2015 14:56:18 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <alpine.DEB.2.02.1508122315110.15525@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <CAGUNxBFQvE+gtxPb+HWroPJzZXytjCqCGCRTjfuFMeVOYuH4Bg@mail.gmail.com>
 <CAGUNxBGzpfN1Sti-XqOLzTjY3x5cmZgHjjArGYrek2y-gbea=Q@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
 <CAGUNxBH09gzGJEA-4_jr4C=T5QgdvN4zOuzYt3QT2bNBn8zGYQ@mail.gmail.com>
 <alpine.DEB.2.02.1508111033430.8204@nftneq.ynat.uz>
 <CAGUNxBEJOvnKra7dxvVmUiqVk-VdvtdjT5SFcDOwXhCAfYbDvg@mail.gmail.com>
 <CAGUNxBHZRj7czbbYpaWFAA-KbKSmQ2SSn7khEMEsQLzsU4Q3MQ@mail.gmail.com>
 <alpine.DEB.2.02.1508122019330.27884@nftneq.ynat.uz>
 <CAGUNxBGkGimeUV3xU-8USgLTJyy=za1Gcyr6TwtEVzDt3mCwXg@mail.gmail.com>
 <alpine.DEB.2.02.1508122315110.15525@nftneq.ynat.uz>
Message-ID: <CAGUNxBGHLaudJV5R7WJqiYRRTj4FzPC=kho5YrgzaoWzQSHMCQ@mail.gmail.com>

Hi,

i will check whether this is driver issue or Luci,

I have to add " disable WPS if this feature is enabled for the WiFi module"
this in wireless. How i can handle this.

Thanks,

On Thu, Aug 13, 2015 at 2:18 PM, David Lang <david at lang.hm> wrote:

> On Thu, 13 Aug 2015, John kerry wrote:
>
> But i dont think so this driver might be the problem, Because when i am
>> doing using GUI its working so there will be not driver problem.
>>
>> Just i am not getting how to add this in build config.
>>
>> Normally what will be the wireless config for the repeater mode default.
>>
>
> the exact file that you create as a result of the GUI is what you would
> put in the build config. But you say that you don't want that file because
> you want to connect to different SSIDs on different channels, so you don't
> _have_ any one file that you want to put in the default.
>
> When you use LUCI to scan and attach to a different SSID, you say that it
> looses the config for the local systems to connect to it. This could be a
> LUCI problem, or it could be that the driver requires that this be reset
> afterwords.
>
> If it's a LUCI problem, you will have to fix that code (or go to where
> tehy develop it and convince them to fix it). If it's a driver problem you
> are out of luck.
>
> But we can't tell you a file to put in the build that will connect to any
> remote system because there isn't one file that will automatically connect
> to any of several remote systems.
>
> David Lang
>
>
> On Thu, Aug 13, 2015 at 11:40 AM, David Lang <david at lang.hm> wrote:
>>
>> If you want to have one config thaqt will talk to many different APs with
>>> different names/configs you are asking for magic. You have to change the
>>> config to talk to the different destinations.
>>>
>>> Since you are using a non-mainline driver, we don't know what the driver
>>> s
>>> able to do.
>>>
>>> It sounds as if there is a problem that could either be in the driver or
>>> in LUCI that makes it loose the rest of the config when you have it scan
>>> for networks.
>>>
>>> you can probably avoid that by just changing the info in the file to be
>>> appropriate for the new environment and restarting wifi/rebooting. If you
>>> want to do this via the existing GUI you will need to make code changes
>>> to
>>> LUCI.
>>>
>>> But at this point you are talking custom stuff.
>>>
>>> David Lang
>>>
>>>
>>> On Thu, 13 Aug 2015, John kerry wrote:
>>>
>>> Hi,
>>>
>>>>
>>>> Still i am not able to configure wireless config file. The problem i am
>>>> facing, i cannot add fixed router name and password. It should every
>>>> time
>>>> scan and connect to any router. If i used GUI one config its fixed to
>>>> that
>>>> router which i connected. So with that configuration we are not able to
>>>> scan again and connect to any other router next time.
>>>>
>>>>
>>>>
>>>> On Wed, Aug 12, 2015 at 9:29 AM, John kerry <kerry9842 at gmail.com>
>>>> wrote:
>>>>
>>>> Yes i able to config using GUI, But when i am configuring GUI i scan and
>>>>
>>>>> connect to one AP and then add one more AP mode to it. So finally i
>>>>> will
>>>>> have wireless configuration.
>>>>>
>>>>> But i cant keep this config in build option because if i load this
>>>>> configuration it will load what i connected last time, so next time i
>>>>> cant
>>>>> scan it anymore it showing the same connected to last AP.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Aug 12, 2015 at 1:36 AM, David Lang <david at lang.hm> wrote:
>>>>>
>>>>> I thought you said a couple posts ago that you were able to configure
>>>>> it
>>>>>
>>>>>> through the GUI to work the way you wanted it to, you were just
>>>>>> wanting
>>>>>> to
>>>>>> make something the default.
>>>>>>
>>>>>> So do you have it working or not?
>>>>>>
>>>>>> If you have it working, it should keep working after a reboot. What
>>>>>> are
>>>>>> you meaning when you say that you want to change the default?
>>>>>>
>>>>>> Are you meaning that you want to create an image that will behave this
>>>>>> way when you do a factory reset (or when you first flash it)? If so,
>>>>>> then
>>>>>> you need to take your working config and make it part of your image
>>>>>> via
>>>>>> the
>>>>>> files/ mechansim.
>>>>>>
>>>>>> If you are meaning something else, I'm still not understanding what
>>>>>> you
>>>>>> are trying to do.
>>>>>>
>>>>>> David Lang
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, 11 Aug 2015, John kerry wrote:
>>>>>>
>>>>>> Date: Tue, 11 Aug 2015 21:20:58 +0800
>>>>>>
>>>>>>
>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>> To: David Lang <david at lang.hm>
>>>>>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>> Multiple
>>>>>>>     Wi-Fi client/AP interfaces on one radio)
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> How to config wireless config file for repeater mode. I am not able
>>>>>>> to
>>>>>>> config.
>>>>>>>
>>>>>>> On Tue, Aug 11, 2015 at 5:34 PM, John kerry <kerry9842 at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> When i load firmware the wireless config will be like below:
>>>>>>>
>>>>>>>
>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>         option type 'qcawifi'
>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>         option hwmode '11ng'
>>>>>>>>         option txpower '16'
>>>>>>>>         option htmode 'HT20'
>>>>>>>>         option disabled '0'
>>>>>>>>         option channel '1'
>>>>>>>>
>>>>>>>> config wifi-iface
>>>>>>>>         option device 'wifi0'
>>>>>>>>         option mode 'ap'
>>>>>>>>         option ssid 'Test_ap'
>>>>>>>>         option network 'lan'
>>>>>>>>         option encryption 'psk2'
>>>>>>>>         option key 'Test_ap'
>>>>>>>>         option wds '1'
>>>>>>>>
>>>>>>>> so it works as Access point, i can connect to it any devices. When i
>>>>>>>> scan
>>>>>>>> it shows me list of devices then connect to anyone. then the
>>>>>>>> wireless
>>>>>>>> config  will becomes like below:
>>>>>>>>
>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>         option type 'qcawifi'
>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>         option hwmode '11ng'
>>>>>>>>         option txpower '16'
>>>>>>>>         option htmode 'HT20'
>>>>>>>>         option disabled '0'
>>>>>>>>         option channel '1'
>>>>>>>>
>>>>>>>> config wifi-iface
>>>>>>>>         option network 'wwan'
>>>>>>>>         option ssid 'D-link-Router'
>>>>>>>>         option encryption 'psk2'
>>>>>>>>         option device 'wifi0'
>>>>>>>>         option mode 'sta'
>>>>>>>>         option key '0010069039'
>>>>>>>>         option wds '1'
>>>>>>>>
>>>>>>>> Then i add one more ap mode so wireless config becomes,
>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>         option type 'qcawifi'
>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>         option hwmode '11ng'
>>>>>>>>         option txpower '16'
>>>>>>>>         option htmode 'HT20'
>>>>>>>>         option disabled '0'
>>>>>>>>         option channel '1'
>>>>>>>>
>>>>>>>> config wifi-iface
>>>>>>>>        option network 'wwan'
>>>>>>>>         option ssid 'D-link-Router'
>>>>>>>>         option encryption 'psk2'
>>>>>>>>         option device 'wifi0'
>>>>>>>>         option mode 'sta'
>>>>>>>>         option key '0010069039'
>>>>>>>>         option wds '1'
>>>>>>>>
>>>>>>>> config wifi-iface
>>>>>>>>         option device 'wifi0'
>>>>>>>>         option mode 'ap'
>>>>>>>>         option ssid 'Test_ap'
>>>>>>>>         option network 'lan'
>>>>>>>>         option encryption 'psk2'
>>>>>>>>         option key 'Test_ap'
>>>>>>>>         option wds '1'
>>>>>>>>
>>>>>>>> This i added manually one ap mode.
>>>>>>>>
>>>>>>>> So if i copy this config file, build and load this firmware, its
>>>>>>>> load
>>>>>>>> what
>>>>>>>> it was there so it shows one client which i was connected last time
>>>>>>>> and
>>>>>>>> one
>>>>>>>> AP which i added.
>>>>>>>>
>>>>>>>> But now i cannot scan anymore and connect to new router instead of
>>>>>>>> old
>>>>>>>> client.
>>>>>>>>
>>>>>>>> This is the problem i am facing.
>>>>>>>>
>>>>>>>> Basically i need to configure the wireless file for repeater mode.
>>>>>>>>
>>>>>>>> So after connecting to another router this SSID still should be
>>>>>>>> there
>>>>>>>> and
>>>>>>>> other device can connect to it.
>>>>>>>>
>>>>>>>> On Tue, Aug 11, 2015 at 4:30 PM, David Lang <david at lang.hm> wrote:
>>>>>>>>
>>>>>>>> you have a working config
>>>>>>>>
>>>>>>>>
>>>>>>>>> but you want to do something by default
>>>>>>>>>
>>>>>>>>> what you want to do is different at different times.
>>>>>>>>>
>>>>>>>>> what is it that you want to be the default? when do you want this
>>>>>>>>> default
>>>>>>>>> to apply? This isn't clear.
>>>>>>>>>
>>>>>>>>> David Lang
>>>>>>>>>
>>>>>>>>> On Tue, 11 Aug 2015, John kerry wrote:
>>>>>>>>>
>>>>>>>>> Date: Tue, 11 Aug 2015 15:51:38 +0800
>>>>>>>>>
>>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>>>
>>>>>>>>>> To: David Lang <david at lang.hm>
>>>>>>>>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>>>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>>>>> Multiple
>>>>>>>>>>
>>>>>>>>>>     Wi-Fi client/AP interfaces on one radio)
>>>>>>>>>>
>>>>>>>>>> Yes,
>>>>>>>>>>
>>>>>>>>>> i can copy the config and build with this configuration,
>>>>>>>>>>
>>>>>>>>>> for example now i have connected to some router, another time we
>>>>>>>>>> can
>>>>>>>>>> connect to any router. So how i can fix the settings by default.
>>>>>>>>>>
>>>>>>>>>> On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I followed the same steps and its working too. But this i want in
>>>>>>>>>>> wireless
>>>>>>>>>>>
>>>>>>>>>>> config file, Because i dont want every time to add using GUI. So
>>>>>>>>>>>
>>>>>>>>>>> When i
>>>>>>>>>>>> connect to another router also, no need to add one more. I mean
>>>>>>>>>>>> to
>>>>>>>>>>>> say
>>>>>>>>>>>> it
>>>>>>>>>>>> should be in default wireless config file.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> what do you mean by "default wireless config file"
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> Once you have set it from the GUI, it is in the config files. The
>>>>>>>>>>> next
>>>>>>>>>>> time you boot it will use that config.
>>>>>>>>>>>
>>>>>>>>>>> If you mean that you want it in the factory default config (for
>>>>>>>>>>> when
>>>>>>>>>>> you
>>>>>>>>>>> first flash the router or do a factory reset), then take the
>>>>>>>>>>> /etc/config/wireless and /etc/config/network files and add them
>>>>>>>>>>> to
>>>>>>>>>>> your
>>>>>>>>>>> build under /files
>>>>>>>>>>>
>>>>>>>>>>> David Lang
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>>>>>>>
>>>>>>>>>>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>>>>>>
>>>>>>>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>>>>>>>>> Multiple
>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>     client/AP interfaces on one radio)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Firstly i configure wireless config as below:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>>>>>        option type 'qcawifi'
>>>>>>>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>>>>>>>        option hwmode '11ng'
>>>>>>>>>>>>>>        option txpower '17'
>>>>>>>>>>>>>>        option htmode 'HT20'
>>>>>>>>>>>>>>        option disabled '0'
>>>>>>>>>>>>>>        option channel '1'
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>>>        option device 'wifi0'
>>>>>>>>>>>>>>        option mode 'ap'
>>>>>>>>>>>>>>        option ssid 'Testing_ap'
>>>>>>>>>>>>>>        option network 'lan'
>>>>>>>>>>>>>>        option encryption 'psk2'
>>>>>>>>>>>>>>        option key 'Testing_ap'
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> so its SSID was showing and able to connect any device to it.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Then i scan the device and connect to one of it. While joining
>>>>>>>>>>>>>> the
>>>>>>>>>>>>>> network
>>>>>>>>>>>>>> i selected Client(WDS) then the wireless config becomes like
>>>>>>>>>>>>>> below:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> why don't you try following the steps in the video that you
>>>>>>>>>>>>>> posted.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> first connect as a client, then add an additional interface
>>>>>>>>>>>>> and
>>>>>>>>>>>>> make
>>>>>>>>>>>>> the
>>>>>>>>>>>>> second interface the AP for things to connect to.
>>>>>>>>>>>>>
>>>>>>>>>>>>> the order may make a difference.
>>>>>>>>>>>>>
>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>>>>
>>>>>>>>>>>>>        option type 'qcawifi'
>>>>>>>>>>>>>
>>>>>>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>>>>>>
>>>>>>>>>>>>>>        option hwmode '11ng'
>>>>>>>>>>>>>>        option txpower '17'
>>>>>>>>>>>>>>        option htmode 'HT20'
>>>>>>>>>>>>>>        option disabled '0'
>>>>>>>>>>>>>>        option channel '1'
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>>>        option network 'wwan'
>>>>>>>>>>>>>>        option ssid 'D_Link_Router'
>>>>>>>>>>>>>>        option encryption 'psk2'
>>>>>>>>>>>>>>        option device 'wifi0'
>>>>>>>>>>>>>>        option mode 'sta'
>>>>>>>>>>>>>>        option key 'Dlink_Router'
>>>>>>>>>>>>>>        option wds '1'
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Then  i added one as shown in the video. Now its connected to
>>>>>>>>>>>>>> router
>>>>>>>>>>>>>> also
>>>>>>>>>>>>>> and this add one also showing so i can connect to this also.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> But i am not getting how to keep this in default wireless
>>>>>>>>>>>>>> config.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Because every time we cant add one to configure like this. It
>>>>>>>>>>>>>> should
>>>>>>>>>>>>>> be
>>>>>>>>>>>>>> like default should be in ap mode so any device we can
>>>>>>>>>>>>>> connect,
>>>>>>>>>>>>>> if
>>>>>>>>>>>>>> its
>>>>>>>>>>>>>> connected to another router also that SSID still should be
>>>>>>>>>>>>>> visible
>>>>>>>>>>>>>> and
>>>>>>>>>>>>>> able
>>>>>>>>>>>>>> to connect to this.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <
>>>>>>>>>>>>>>
>>>>>>>>>>>>> kerry9842 at gmail.com>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> When i try to configure based on video, its shows 2 one as
>>>>>>>>>>>>> client
>>>>>>>>>>>>>
>>>>>>>>>>>>>> another
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> one as Master but i am not able to enable it . I mean to say
>>>>>>>>>>>>>> wireless
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> becomes disable. If i enable it using GUI also its not
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> happening.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm>
>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> What happens when you try to follow the video?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Based on your comments, i'm guessing that things don't work
>>>>>>>>>>>>>>> when
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> you
>>>>>>>>>>>>>>>> try
>>>>>>>>>>>>>>>> and configure the second network and have it with a
>>>>>>>>>>>>>>>> different
>>>>>>>>>>>>>>>> SSID
>>>>>>>>>>>>>>>> than
>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>> first network that you put in client mode.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Is this correct?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Yes, When i am connecting to Another router its changed to
>>>>>>>>>>>>>>>> Client
>>>>>>>>>>>>>>>> mode.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Can i configure this in repeater mode like its shows in
>>>>>>>>>>>>>>>> below
>>>>>>>>>>>>>>>> link:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150813/d5d565cc/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From s.demeszko at wireless-instruments.com  Thu Aug 13 04:42:17 2015
From: s.demeszko at wireless-instruments.com (=?UTF-8?B?U8WCYXdvbWlyIERlbWVzemtv?=)
Date: Thu, 13 Aug 2015 10:42:17 +0200
Subject: [OpenWrt-Devel] i get no image for TL-WA7510
In-Reply-To: <20150812212918.592b6053@None>
References: <20150812212918.592b6053@None>
Message-ID: <55CC5869.4040106@wireless-instruments.com>

W dniu 12.08.2015 o 21:29, smilebef at gmail.com pisze:
 > I miss not only the TL-WA7510 image. I missing also several images
 > for other 4MB Flash-Router.
 >
 > Is there a Funktion in Openwrt which build images only if the image-size
 > not excite the flash-size?

I found there is. I was also wonder for half day why image for my board was not created.
I think there should be at least a warning and option to bypass this check it would be 
helpful to estimate how many bytes we need to reclaim to fit.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From david at lang.hm  Thu Aug 13 05:22:28 2015
From: david at lang.hm (David Lang)
Date: Thu, 13 Aug 2015 02:22:28 -0700 (PDT)
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <CAGUNxBGHLaudJV5R7WJqiYRRTj4FzPC=kho5YrgzaoWzQSHMCQ@mail.gmail.com>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
 <CAGUNxBH09gzGJEA-4_jr4C=T5QgdvN4zOuzYt3QT2bNBn8zGYQ@mail.gmail.com>
 <alpine.DEB.2.02.1508111033430.8204@nftneq.ynat.uz>
 <CAGUNxBEJOvnKra7dxvVmUiqVk-VdvtdjT5SFcDOwXhCAfYbDvg@mail.gmail.com>
 <CAGUNxBHZRj7czbbYpaWFAA-KbKSmQ2SSn7khEMEsQLzsU4Q3MQ@mail.gmail.com>
 <alpine.DEB.2.02.1508122019330.27884@nftneq.ynat.uz>
 <CAGUNxBGkGimeUV3xU-8USgLTJyy=za1Gcyr6TwtEVzDt3mCwXg@mail.gmail.com>
 <alpine.DEB.2.02.1508122315110.15525@nftneq.ynat.uz>
 <CAGUNxBGHLaudJV5R7WJqiYRRTj4FzPC=kho5YrgzaoWzQSHMCQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.02.1508130221200.15525@nftneq.ynat.uz>

On Thu, 13 Aug 2015, John kerry wrote:

> Hi,
>
> i will check whether this is driver issue or Luci,
>
> I have to add " disable WPS if this feature is enabled for the WiFi module"
> this in wireless. How i can handle this.

??? is this something you want to happen? something that happens that you don't 
want? we can't read your mind.

David Lang


> Thanks,
>
> On Thu, Aug 13, 2015 at 2:18 PM, David Lang <david at lang.hm> wrote:
>
>> On Thu, 13 Aug 2015, John kerry wrote:
>>
>> But i dont think so this driver might be the problem, Because when i am
>>> doing using GUI its working so there will be not driver problem.
>>>
>>> Just i am not getting how to add this in build config.
>>>
>>> Normally what will be the wireless config for the repeater mode default.
>>>
>>
>> the exact file that you create as a result of the GUI is what you would
>> put in the build config. But you say that you don't want that file because
>> you want to connect to different SSIDs on different channels, so you don't
>> _have_ any one file that you want to put in the default.
>>
>> When you use LUCI to scan and attach to a different SSID, you say that it
>> looses the config for the local systems to connect to it. This could be a
>> LUCI problem, or it could be that the driver requires that this be reset
>> afterwords.
>>
>> If it's a LUCI problem, you will have to fix that code (or go to where
>> tehy develop it and convince them to fix it). If it's a driver problem you
>> are out of luck.
>>
>> But we can't tell you a file to put in the build that will connect to any
>> remote system because there isn't one file that will automatically connect
>> to any of several remote systems.
>>
>> David Lang
>>
>>
>> On Thu, Aug 13, 2015 at 11:40 AM, David Lang <david at lang.hm> wrote:
>>>
>>> If you want to have one config thaqt will talk to many different APs with
>>>> different names/configs you are asking for magic. You have to change the
>>>> config to talk to the different destinations.
>>>>
>>>> Since you are using a non-mainline driver, we don't know what the driver
>>>> s
>>>> able to do.
>>>>
>>>> It sounds as if there is a problem that could either be in the driver or
>>>> in LUCI that makes it loose the rest of the config when you have it scan
>>>> for networks.
>>>>
>>>> you can probably avoid that by just changing the info in the file to be
>>>> appropriate for the new environment and restarting wifi/rebooting. If you
>>>> want to do this via the existing GUI you will need to make code changes
>>>> to
>>>> LUCI.
>>>>
>>>> But at this point you are talking custom stuff.
>>>>
>>>> David Lang
>>>>
>>>>
>>>> On Thu, 13 Aug 2015, John kerry wrote:
>>>>
>>>> Hi,
>>>>
>>>>>
>>>>> Still i am not able to configure wireless config file. The problem i am
>>>>> facing, i cannot add fixed router name and password. It should every
>>>>> time
>>>>> scan and connect to any router. If i used GUI one config its fixed to
>>>>> that
>>>>> router which i connected. So with that configuration we are not able to
>>>>> scan again and connect to any other router next time.
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Aug 12, 2015 at 9:29 AM, John kerry <kerry9842 at gmail.com>
>>>>> wrote:
>>>>>
>>>>> Yes i able to config using GUI, But when i am configuring GUI i scan and
>>>>>
>>>>>> connect to one AP and then add one more AP mode to it. So finally i
>>>>>> will
>>>>>> have wireless configuration.
>>>>>>
>>>>>> But i cant keep this config in build option because if i load this
>>>>>> configuration it will load what i connected last time, so next time i
>>>>>> cant
>>>>>> scan it anymore it showing the same connected to last AP.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Aug 12, 2015 at 1:36 AM, David Lang <david at lang.hm> wrote:
>>>>>>
>>>>>> I thought you said a couple posts ago that you were able to configure
>>>>>> it
>>>>>>
>>>>>>> through the GUI to work the way you wanted it to, you were just
>>>>>>> wanting
>>>>>>> to
>>>>>>> make something the default.
>>>>>>>
>>>>>>> So do you have it working or not?
>>>>>>>
>>>>>>> If you have it working, it should keep working after a reboot. What
>>>>>>> are
>>>>>>> you meaning when you say that you want to change the default?
>>>>>>>
>>>>>>> Are you meaning that you want to create an image that will behave this
>>>>>>> way when you do a factory reset (or when you first flash it)? If so,
>>>>>>> then
>>>>>>> you need to take your working config and make it part of your image
>>>>>>> via
>>>>>>> the
>>>>>>> files/ mechansim.
>>>>>>>
>>>>>>> If you are meaning something else, I'm still not understanding what
>>>>>>> you
>>>>>>> are trying to do.
>>>>>>>
>>>>>>> David Lang
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, 11 Aug 2015, John kerry wrote:
>>>>>>>
>>>>>>> Date: Tue, 11 Aug 2015 21:20:58 +0800
>>>>>>>
>>>>>>>
>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>> To: David Lang <david at lang.hm>
>>>>>>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>>> Multiple
>>>>>>>>     Wi-Fi client/AP interfaces on one radio)
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> How to config wireless config file for repeater mode. I am not able
>>>>>>>> to
>>>>>>>> config.
>>>>>>>>
>>>>>>>> On Tue, Aug 11, 2015 at 5:34 PM, John kerry <kerry9842 at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> When i load firmware the wireless config will be like below:
>>>>>>>>
>>>>>>>>
>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>         option type 'qcawifi'
>>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>>         option hwmode '11ng'
>>>>>>>>>         option txpower '16'
>>>>>>>>>         option htmode 'HT20'
>>>>>>>>>         option disabled '0'
>>>>>>>>>         option channel '1'
>>>>>>>>>
>>>>>>>>> config wifi-iface
>>>>>>>>>         option device 'wifi0'
>>>>>>>>>         option mode 'ap'
>>>>>>>>>         option ssid 'Test_ap'
>>>>>>>>>         option network 'lan'
>>>>>>>>>         option encryption 'psk2'
>>>>>>>>>         option key 'Test_ap'
>>>>>>>>>         option wds '1'
>>>>>>>>>
>>>>>>>>> so it works as Access point, i can connect to it any devices. When i
>>>>>>>>> scan
>>>>>>>>> it shows me list of devices then connect to anyone. then the
>>>>>>>>> wireless
>>>>>>>>> config  will becomes like below:
>>>>>>>>>
>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>         option type 'qcawifi'
>>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>>         option hwmode '11ng'
>>>>>>>>>         option txpower '16'
>>>>>>>>>         option htmode 'HT20'
>>>>>>>>>         option disabled '0'
>>>>>>>>>         option channel '1'
>>>>>>>>>
>>>>>>>>> config wifi-iface
>>>>>>>>>         option network 'wwan'
>>>>>>>>>         option ssid 'D-link-Router'
>>>>>>>>>         option encryption 'psk2'
>>>>>>>>>         option device 'wifi0'
>>>>>>>>>         option mode 'sta'
>>>>>>>>>         option key '0010069039'
>>>>>>>>>         option wds '1'
>>>>>>>>>
>>>>>>>>> Then i add one more ap mode so wireless config becomes,
>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>         option type 'qcawifi'
>>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>>         option hwmode '11ng'
>>>>>>>>>         option txpower '16'
>>>>>>>>>         option htmode 'HT20'
>>>>>>>>>         option disabled '0'
>>>>>>>>>         option channel '1'
>>>>>>>>>
>>>>>>>>> config wifi-iface
>>>>>>>>>        option network 'wwan'
>>>>>>>>>         option ssid 'D-link-Router'
>>>>>>>>>         option encryption 'psk2'
>>>>>>>>>         option device 'wifi0'
>>>>>>>>>         option mode 'sta'
>>>>>>>>>         option key '0010069039'
>>>>>>>>>         option wds '1'
>>>>>>>>>
>>>>>>>>> config wifi-iface
>>>>>>>>>         option device 'wifi0'
>>>>>>>>>         option mode 'ap'
>>>>>>>>>         option ssid 'Test_ap'
>>>>>>>>>         option network 'lan'
>>>>>>>>>         option encryption 'psk2'
>>>>>>>>>         option key 'Test_ap'
>>>>>>>>>         option wds '1'
>>>>>>>>>
>>>>>>>>> This i added manually one ap mode.
>>>>>>>>>
>>>>>>>>> So if i copy this config file, build and load this firmware, its
>>>>>>>>> load
>>>>>>>>> what
>>>>>>>>> it was there so it shows one client which i was connected last time
>>>>>>>>> and
>>>>>>>>> one
>>>>>>>>> AP which i added.
>>>>>>>>>
>>>>>>>>> But now i cannot scan anymore and connect to new router instead of
>>>>>>>>> old
>>>>>>>>> client.
>>>>>>>>>
>>>>>>>>> This is the problem i am facing.
>>>>>>>>>
>>>>>>>>> Basically i need to configure the wireless file for repeater mode.
>>>>>>>>>
>>>>>>>>> So after connecting to another router this SSID still should be
>>>>>>>>> there
>>>>>>>>> and
>>>>>>>>> other device can connect to it.
>>>>>>>>>
>>>>>>>>> On Tue, Aug 11, 2015 at 4:30 PM, David Lang <david at lang.hm> wrote:
>>>>>>>>>
>>>>>>>>> you have a working config
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> but you want to do something by default
>>>>>>>>>>
>>>>>>>>>> what you want to do is different at different times.
>>>>>>>>>>
>>>>>>>>>> what is it that you want to be the default? when do you want this
>>>>>>>>>> default
>>>>>>>>>> to apply? This isn't clear.
>>>>>>>>>>
>>>>>>>>>> David Lang
>>>>>>>>>>
>>>>>>>>>> On Tue, 11 Aug 2015, John kerry wrote:
>>>>>>>>>>
>>>>>>>>>> Date: Tue, 11 Aug 2015 15:51:38 +0800
>>>>>>>>>>
>>>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>>>>
>>>>>>>>>>> To: David Lang <david at lang.hm>
>>>>>>>>>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>>>>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>>>>>> Multiple
>>>>>>>>>>>
>>>>>>>>>>>     Wi-Fi client/AP interfaces on one radio)
>>>>>>>>>>>
>>>>>>>>>>> Yes,
>>>>>>>>>>>
>>>>>>>>>>> i can copy the config and build with this configuration,
>>>>>>>>>>>
>>>>>>>>>>> for example now i have connected to some router, another time we
>>>>>>>>>>> can
>>>>>>>>>>> connect to any router. So how i can fix the settings by default.
>>>>>>>>>>>
>>>>>>>>>>> On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> I followed the same steps and its working too. But this i want in
>>>>>>>>>>>> wireless
>>>>>>>>>>>>
>>>>>>>>>>>> config file, Because i dont want every time to add using GUI. So
>>>>>>>>>>>>
>>>>>>>>>>>> When i
>>>>>>>>>>>>> connect to another router also, no need to add one more. I mean
>>>>>>>>>>>>> to
>>>>>>>>>>>>> say
>>>>>>>>>>>>> it
>>>>>>>>>>>>> should be in default wireless config file.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> what do you mean by "default wireless config file"
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> Once you have set it from the GUI, it is in the config files. The
>>>>>>>>>>>> next
>>>>>>>>>>>> time you boot it will use that config.
>>>>>>>>>>>>
>>>>>>>>>>>> If you mean that you want it in the factory default config (for
>>>>>>>>>>>> when
>>>>>>>>>>>> you
>>>>>>>>>>>> first flash the router or do a factory reset), then take the
>>>>>>>>>>>> /etc/config/wireless and /etc/config/network files and add them
>>>>>>>>>>>> to
>>>>>>>>>>>> your
>>>>>>>>>>>> build under /files
>>>>>>>>>>>>
>>>>>>>>>>>> David Lang
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>>>>>>>>>> Multiple
>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>>     client/AP interfaces on one radio)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Firstly i configure wireless config as below:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>>>>>>        option type 'qcawifi'
>>>>>>>>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>>>>>>>>        option hwmode '11ng'
>>>>>>>>>>>>>>>        option txpower '17'
>>>>>>>>>>>>>>>        option htmode 'HT20'
>>>>>>>>>>>>>>>        option disabled '0'
>>>>>>>>>>>>>>>        option channel '1'
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>>>>        option device 'wifi0'
>>>>>>>>>>>>>>>        option mode 'ap'
>>>>>>>>>>>>>>>        option ssid 'Testing_ap'
>>>>>>>>>>>>>>>        option network 'lan'
>>>>>>>>>>>>>>>        option encryption 'psk2'
>>>>>>>>>>>>>>>        option key 'Testing_ap'
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> so its SSID was showing and able to connect any device to it.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Then i scan the device and connect to one of it. While joining
>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>> network
>>>>>>>>>>>>>>> i selected Client(WDS) then the wireless config becomes like
>>>>>>>>>>>>>>> below:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> why don't you try following the steps in the video that you
>>>>>>>>>>>>>>> posted.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> first connect as a client, then add an additional interface
>>>>>>>>>>>>>> and
>>>>>>>>>>>>>> make
>>>>>>>>>>>>>> the
>>>>>>>>>>>>>> second interface the AP for things to connect to.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> the order may make a difference.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>        option type 'qcawifi'
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>        option hwmode '11ng'
>>>>>>>>>>>>>>>        option txpower '17'
>>>>>>>>>>>>>>>        option htmode 'HT20'
>>>>>>>>>>>>>>>        option disabled '0'
>>>>>>>>>>>>>>>        option channel '1'
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>>>>        option network 'wwan'
>>>>>>>>>>>>>>>        option ssid 'D_Link_Router'
>>>>>>>>>>>>>>>        option encryption 'psk2'
>>>>>>>>>>>>>>>        option device 'wifi0'
>>>>>>>>>>>>>>>        option mode 'sta'
>>>>>>>>>>>>>>>        option key 'Dlink_Router'
>>>>>>>>>>>>>>>        option wds '1'
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Then  i added one as shown in the video. Now its connected to
>>>>>>>>>>>>>>> router
>>>>>>>>>>>>>>> also
>>>>>>>>>>>>>>> and this add one also showing so i can connect to this also.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> But i am not getting how to keep this in default wireless
>>>>>>>>>>>>>>> config.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Because every time we cant add one to configure like this. It
>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>> like default should be in ap mode so any device we can
>>>>>>>>>>>>>>> connect,
>>>>>>>>>>>>>>> if
>>>>>>>>>>>>>>> its
>>>>>>>>>>>>>>> connected to another router also that SSID still should be
>>>>>>>>>>>>>>> visible
>>>>>>>>>>>>>>> and
>>>>>>>>>>>>>>> able
>>>>>>>>>>>>>>> to connect to this.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> kerry9842 at gmail.com>
>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> When i try to configure based on video, its shows 2 one as
>>>>>>>>>>>>>> client
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> another
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> one as Master but i am not able to enable it . I mean to say
>>>>>>>>>>>>>>> wireless
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> becomes disable. If i enable it using GUI also its not
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> happening.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm>
>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> What happens when you try to follow the video?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Based on your comments, i'm guessing that things don't work
>>>>>>>>>>>>>>>> when
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> you
>>>>>>>>>>>>>>>>> try
>>>>>>>>>>>>>>>>> and configure the second network and have it with a
>>>>>>>>>>>>>>>>> different
>>>>>>>>>>>>>>>>> SSID
>>>>>>>>>>>>>>>>> than
>>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>> first network that you put in client mode.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Is this correct?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Yes, When i am connecting to Another router its changed to
>>>>>>>>>>>>>>>>> Client
>>>>>>>>>>>>>>>>> mode.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Can i configure this in repeater mode like its shows in
>>>>>>>>>>>>>>>>> below
>>>>>>>>>>>>>>>>> link:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>
>>>
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From stappers at stappers.it  Thu Aug 13 06:21:01 2015
From: stappers at stappers.it (Geert Stappers)
Date: Thu, 13 Aug 2015 12:21:01 +0200
Subject: [OpenWrt-Devel] `git tag` and releases
Message-ID: <20150813102101.GS18164@rosa.stappers.it>


Summary: `git tag` doesn't currently show releases

Hello,

After done

  git clone git://git.openwrt.org/openwrt.git
  cd openwrt

I did

  git tag

to see which tags are in the git repository,
but none are there. I hoped the releases where tagged.

In SVN repository I found these tags

  8.09      8.09_rc2                   kamikaze_7.06     whiterussian_rc1  whiterussian_rc5
  8.09.1    attitude_adjustment_12.09  kamikaze_7.07     whiterussian_rc2  whiterussian_rc6
  8.09.2    backfire_10.03             kamikaze_7.09     whiterussian_rc3
  8.09_rc1  backfire_10.03.1           whiterussian_0.9  whiterussian_rc4

(that I miss "chaoscalmer_rcN" _now not_ important)


Will there be tags in the OpenWRT git repository?


Cheers
Geert Stappers
--
Leven en laten leven
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bittorf at bluebottle.com  Thu Aug 13 06:31:56 2015
From: bittorf at bluebottle.com (Bastian Bittorf)
Date: Thu, 13 Aug 2015 12:31:56 +0200
Subject: [OpenWrt-Devel] [PATCH v2] busybox: lock: implement -n "Fail
 rather than wait"
In-Reply-To: <1438962003-7033-1-git-send-email-lynxis@fe80.eu>
References: <55C3CAFC.6070002@openwrt.org>
 <1438962003-7033-1-git-send-email-lynxis@fe80.eu>
Message-ID: <20150813103155.GR19496@medion.lan>

* Alexander Couzens <lynxis at fe80.eu> [07.08.2015 20:48]:
> lock -n is similiar to flock -n. If the lock was already taken,
> fail with exit code = 1 and write error message to stderr.

see: http://mywiki.wooledge.org/BashFAQ/045
internally we are using 'mkdir' which is called via a 'lock()' function:

if mkdir /tmp/lock_$reason; then
	return 0
else
	return 1
fi

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Thu Aug 13 07:03:41 2015
From: kerry9842 at gmail.com (John kerry)
Date: Thu, 13 Aug 2015 19:03:41 +0800
Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was: Multiple
 Wi-Fi client/AP interfaces on one radio)
In-Reply-To: <alpine.DEB.2.02.1508130221200.15525@nftneq.ynat.uz>
References: <CAGUNxBHgUuNdZaDc=Tw5CmSqXDwLrwdsLyU9ScobiCgUFCGfzw@mail.gmail.com>
 <alpine.DEB.2.02.1508100313560.2093@nftneq.ynat.uz>
 <CAGUNxBEvMJ0HFqck70whYHkBbFiuHtzNDA6JxTtVe_S=aqfdcQ@mail.gmail.com>
 <alpine.DEB.2.02.1508100943580.2093@nftneq.ynat.uz>
 <CAGUNxBFYADCRJbL1fErhdUh52ZKGcVgNmDbt1p=eJFp=PHUC_Q@mail.gmail.com>
 <alpine.DEB.2.02.1508110128550.2093@nftneq.ynat.uz>
 <CAGUNxBGrMvwLqUiSHdo6wPoc=R7chULH7Om4hyPiyCNBpsfy_A@mail.gmail.com>
 <CAGUNxBH09gzGJEA-4_jr4C=T5QgdvN4zOuzYt3QT2bNBn8zGYQ@mail.gmail.com>
 <alpine.DEB.2.02.1508111033430.8204@nftneq.ynat.uz>
 <CAGUNxBEJOvnKra7dxvVmUiqVk-VdvtdjT5SFcDOwXhCAfYbDvg@mail.gmail.com>
 <CAGUNxBHZRj7czbbYpaWFAA-KbKSmQ2SSn7khEMEsQLzsU4Q3MQ@mail.gmail.com>
 <alpine.DEB.2.02.1508122019330.27884@nftneq.ynat.uz>
 <CAGUNxBGkGimeUV3xU-8USgLTJyy=za1Gcyr6TwtEVzDt3mCwXg@mail.gmail.com>
 <alpine.DEB.2.02.1508122315110.15525@nftneq.ynat.uz>
 <CAGUNxBGHLaudJV5R7WJqiYRRTj4FzPC=kho5YrgzaoWzQSHMCQ@mail.gmail.com>
 <alpine.DEB.2.02.1508130221200.15525@nftneq.ynat.uz>
Message-ID: <CAGUNxBFhJmDfQjm-dX3sRvDx9w3qwmH6WA0=BoxsCeojO=5NBQ@mail.gmail.com>

Sorry i didn't mentioned fully.

I want this to happen,  " disable WPS if this feature is enabled for the
WiFi module"

On Thu, Aug 13, 2015 at 5:22 PM, David Lang <david at lang.hm> wrote:

> On Thu, 13 Aug 2015, John kerry wrote:
>
> Hi,
>>
>> i will check whether this is driver issue or Luci,
>>
>> I have to add " disable WPS if this feature is enabled for the WiFi
>> module"
>> this in wireless. How i can handle this.
>>
>
> ??? is this something you want to happen? something that happens that you
> don't want? we can't read your mind.
>
> David Lang
>
>
>
> Thanks,
>>
>> On Thu, Aug 13, 2015 at 2:18 PM, David Lang <david at lang.hm> wrote:
>>
>> On Thu, 13 Aug 2015, John kerry wrote:
>>>
>>> But i dont think so this driver might be the problem, Because when i am
>>>
>>>> doing using GUI its working so there will be not driver problem.
>>>>
>>>> Just i am not getting how to add this in build config.
>>>>
>>>> Normally what will be the wireless config for the repeater mode default.
>>>>
>>>>
>>> the exact file that you create as a result of the GUI is what you would
>>> put in the build config. But you say that you don't want that file
>>> because
>>> you want to connect to different SSIDs on different channels, so you
>>> don't
>>> _have_ any one file that you want to put in the default.
>>>
>>> When you use LUCI to scan and attach to a different SSID, you say that it
>>> looses the config for the local systems to connect to it. This could be a
>>> LUCI problem, or it could be that the driver requires that this be reset
>>> afterwords.
>>>
>>> If it's a LUCI problem, you will have to fix that code (or go to where
>>> tehy develop it and convince them to fix it). If it's a driver problem
>>> you
>>> are out of luck.
>>>
>>> But we can't tell you a file to put in the build that will connect to any
>>> remote system because there isn't one file that will automatically
>>> connect
>>> to any of several remote systems.
>>>
>>> David Lang
>>>
>>>
>>> On Thu, Aug 13, 2015 at 11:40 AM, David Lang <david at lang.hm> wrote:
>>>
>>>>
>>>> If you want to have one config thaqt will talk to many different APs
>>>> with
>>>>
>>>>> different names/configs you are asking for magic. You have to change
>>>>> the
>>>>> config to talk to the different destinations.
>>>>>
>>>>> Since you are using a non-mainline driver, we don't know what the
>>>>> driver
>>>>> s
>>>>> able to do.
>>>>>
>>>>> It sounds as if there is a problem that could either be in the driver
>>>>> or
>>>>> in LUCI that makes it loose the rest of the config when you have it
>>>>> scan
>>>>> for networks.
>>>>>
>>>>> you can probably avoid that by just changing the info in the file to be
>>>>> appropriate for the new environment and restarting wifi/rebooting. If
>>>>> you
>>>>> want to do this via the existing GUI you will need to make code changes
>>>>> to
>>>>> LUCI.
>>>>>
>>>>> But at this point you are talking custom stuff.
>>>>>
>>>>> David Lang
>>>>>
>>>>>
>>>>> On Thu, 13 Aug 2015, John kerry wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>>> Still i am not able to configure wireless config file. The problem i
>>>>>> am
>>>>>> facing, i cannot add fixed router name and password. It should every
>>>>>> time
>>>>>> scan and connect to any router. If i used GUI one config its fixed to
>>>>>> that
>>>>>> router which i connected. So with that configuration we are not able
>>>>>> to
>>>>>> scan again and connect to any other router next time.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Aug 12, 2015 at 9:29 AM, John kerry <kerry9842 at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> Yes i able to config using GUI, But when i am configuring GUI i scan
>>>>>> and
>>>>>>
>>>>>> connect to one AP and then add one more AP mode to it. So finally i
>>>>>>> will
>>>>>>> have wireless configuration.
>>>>>>>
>>>>>>> But i cant keep this config in build option because if i load this
>>>>>>> configuration it will load what i connected last time, so next time i
>>>>>>> cant
>>>>>>> scan it anymore it showing the same connected to last AP.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Aug 12, 2015 at 1:36 AM, David Lang <david at lang.hm> wrote:
>>>>>>>
>>>>>>> I thought you said a couple posts ago that you were able to configure
>>>>>>> it
>>>>>>>
>>>>>>> through the GUI to work the way you wanted it to, you were just
>>>>>>>> wanting
>>>>>>>> to
>>>>>>>> make something the default.
>>>>>>>>
>>>>>>>> So do you have it working or not?
>>>>>>>>
>>>>>>>> If you have it working, it should keep working after a reboot. What
>>>>>>>> are
>>>>>>>> you meaning when you say that you want to change the default?
>>>>>>>>
>>>>>>>> Are you meaning that you want to create an image that will behave
>>>>>>>> this
>>>>>>>> way when you do a factory reset (or when you first flash it)? If so,
>>>>>>>> then
>>>>>>>> you need to take your working config and make it part of your image
>>>>>>>> via
>>>>>>>> the
>>>>>>>> files/ mechansim.
>>>>>>>>
>>>>>>>> If you are meaning something else, I'm still not understanding what
>>>>>>>> you
>>>>>>>> are trying to do.
>>>>>>>>
>>>>>>>> David Lang
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, 11 Aug 2015, John kerry wrote:
>>>>>>>>
>>>>>>>> Date: Tue, 11 Aug 2015 21:20:58 +0800
>>>>>>>>
>>>>>>>>
>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>>> To: David Lang <david at lang.hm>
>>>>>>>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging" (was:
>>>>>>>>> Multiple
>>>>>>>>>     Wi-Fi client/AP interfaces on one radio)
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> How to config wireless config file for repeater mode. I am not able
>>>>>>>>> to
>>>>>>>>> config.
>>>>>>>>>
>>>>>>>>> On Tue, Aug 11, 2015 at 5:34 PM, John kerry <kerry9842 at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> When i load firmware the wireless config will be like below:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>         option type 'qcawifi'
>>>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>>>         option hwmode '11ng'
>>>>>>>>>>         option txpower '16'
>>>>>>>>>>         option htmode 'HT20'
>>>>>>>>>>         option disabled '0'
>>>>>>>>>>         option channel '1'
>>>>>>>>>>
>>>>>>>>>> config wifi-iface
>>>>>>>>>>         option device 'wifi0'
>>>>>>>>>>         option mode 'ap'
>>>>>>>>>>         option ssid 'Test_ap'
>>>>>>>>>>         option network 'lan'
>>>>>>>>>>         option encryption 'psk2'
>>>>>>>>>>         option key 'Test_ap'
>>>>>>>>>>         option wds '1'
>>>>>>>>>>
>>>>>>>>>> so it works as Access point, i can connect to it any devices.
>>>>>>>>>> When i
>>>>>>>>>> scan
>>>>>>>>>> it shows me list of devices then connect to anyone. then the
>>>>>>>>>> wireless
>>>>>>>>>> config  will becomes like below:
>>>>>>>>>>
>>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>         option type 'qcawifi'
>>>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>>>         option hwmode '11ng'
>>>>>>>>>>         option txpower '16'
>>>>>>>>>>         option htmode 'HT20'
>>>>>>>>>>         option disabled '0'
>>>>>>>>>>         option channel '1'
>>>>>>>>>>
>>>>>>>>>> config wifi-iface
>>>>>>>>>>         option network 'wwan'
>>>>>>>>>>         option ssid 'D-link-Router'
>>>>>>>>>>         option encryption 'psk2'
>>>>>>>>>>         option device 'wifi0'
>>>>>>>>>>         option mode 'sta'
>>>>>>>>>>         option key '0010069039'
>>>>>>>>>>         option wds '1'
>>>>>>>>>>
>>>>>>>>>> Then i add one more ap mode so wireless config becomes,
>>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>         option type 'qcawifi'
>>>>>>>>>>         option macaddr '00:26:75:bd:37:24'
>>>>>>>>>>         option hwmode '11ng'
>>>>>>>>>>         option txpower '16'
>>>>>>>>>>         option htmode 'HT20'
>>>>>>>>>>         option disabled '0'
>>>>>>>>>>         option channel '1'
>>>>>>>>>>
>>>>>>>>>> config wifi-iface
>>>>>>>>>>        option network 'wwan'
>>>>>>>>>>         option ssid 'D-link-Router'
>>>>>>>>>>         option encryption 'psk2'
>>>>>>>>>>         option device 'wifi0'
>>>>>>>>>>         option mode 'sta'
>>>>>>>>>>         option key '0010069039'
>>>>>>>>>>         option wds '1'
>>>>>>>>>>
>>>>>>>>>> config wifi-iface
>>>>>>>>>>         option device 'wifi0'
>>>>>>>>>>         option mode 'ap'
>>>>>>>>>>         option ssid 'Test_ap'
>>>>>>>>>>         option network 'lan'
>>>>>>>>>>         option encryption 'psk2'
>>>>>>>>>>         option key 'Test_ap'
>>>>>>>>>>         option wds '1'
>>>>>>>>>>
>>>>>>>>>> This i added manually one ap mode.
>>>>>>>>>>
>>>>>>>>>> So if i copy this config file, build and load this firmware, its
>>>>>>>>>> load
>>>>>>>>>> what
>>>>>>>>>> it was there so it shows one client which i was connected last
>>>>>>>>>> time
>>>>>>>>>> and
>>>>>>>>>> one
>>>>>>>>>> AP which i added.
>>>>>>>>>>
>>>>>>>>>> But now i cannot scan anymore and connect to new router instead of
>>>>>>>>>> old
>>>>>>>>>> client.
>>>>>>>>>>
>>>>>>>>>> This is the problem i am facing.
>>>>>>>>>>
>>>>>>>>>> Basically i need to configure the wireless file for repeater mode.
>>>>>>>>>>
>>>>>>>>>> So after connecting to another router this SSID still should be
>>>>>>>>>> there
>>>>>>>>>> and
>>>>>>>>>> other device can connect to it.
>>>>>>>>>>
>>>>>>>>>> On Tue, Aug 11, 2015 at 4:30 PM, David Lang <david at lang.hm>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> you have a working config
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> but you want to do something by default
>>>>>>>>>>>
>>>>>>>>>>> what you want to do is different at different times.
>>>>>>>>>>>
>>>>>>>>>>> what is it that you want to be the default? when do you want this
>>>>>>>>>>> default
>>>>>>>>>>> to apply? This isn't clear.
>>>>>>>>>>>
>>>>>>>>>>> David Lang
>>>>>>>>>>>
>>>>>>>>>>> On Tue, 11 Aug 2015, John kerry wrote:
>>>>>>>>>>>
>>>>>>>>>>> Date: Tue, 11 Aug 2015 15:51:38 +0800
>>>>>>>>>>>
>>>>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>>>>>
>>>>>>>>>>> To: David Lang <david at lang.hm>
>>>>>>>>>>>> Cc: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>>>>>     OpenWrt Development List <openwrt-devel at lists.openwrt.org>
>>>>>>>>>>>> Subject: Re: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging"
>>>>>>>>>>>> (was:
>>>>>>>>>>>> Multiple
>>>>>>>>>>>>
>>>>>>>>>>>>     Wi-Fi client/AP interfaces on one radio)
>>>>>>>>>>>>
>>>>>>>>>>>> Yes,
>>>>>>>>>>>>
>>>>>>>>>>>> i can copy the config and build with this configuration,
>>>>>>>>>>>>
>>>>>>>>>>>> for example now i have connected to some router, another time we
>>>>>>>>>>>> can
>>>>>>>>>>>> connect to any router. So how i can fix the settings by default.
>>>>>>>>>>>>
>>>>>>>>>>>> On Tue, Aug 11, 2015 at 12:45 AM, David Lang <david at lang.hm>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I followed the same steps and its working too. But this i want
>>>>>>>>>>>> in
>>>>>>>>>>>>
>>>>>>>>>>>>> wireless
>>>>>>>>>>>>>
>>>>>>>>>>>>> config file, Because i dont want every time to add using GUI.
>>>>>>>>>>>>> So
>>>>>>>>>>>>>
>>>>>>>>>>>>> When i
>>>>>>>>>>>>>
>>>>>>>>>>>>>> connect to another router also, no need to add one more. I
>>>>>>>>>>>>>> mean
>>>>>>>>>>>>>> to
>>>>>>>>>>>>>> say
>>>>>>>>>>>>>> it
>>>>>>>>>>>>>> should be in default wireless config file.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> what do you mean by "default wireless config file"
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Once you have set it from the GUI, it is in the config files.
>>>>>>>>>>>>> The
>>>>>>>>>>>>> next
>>>>>>>>>>>>> time you boot it will use that config.
>>>>>>>>>>>>>
>>>>>>>>>>>>> If you mean that you want it in the factory default config (for
>>>>>>>>>>>>> when
>>>>>>>>>>>>> you
>>>>>>>>>>>>> first flash the router or do a factory reset), then take the
>>>>>>>>>>>>> /etc/config/wireless and /etc/config/network files and add them
>>>>>>>>>>>>> to
>>>>>>>>>>>>> your
>>>>>>>>>>>>> build under /files
>>>>>>>>>>>>>
>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Mon, Aug 10, 2015 at 6:18 PM, David Lang <david at lang.hm>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Date: Mon, 10 Aug 2015 18:10:14 +0800
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> From: John kerry <kerry9842 at gmail.com>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> To: Alex Weedy <weedy2887 at gmail.com>,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>     OpenWrt Development List <
>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Subject: [OpenWrt-Devel] Fwd: "3-address Wi-Fi bridging"
>>>>>>>>>>>>>>>> (was:
>>>>>>>>>>>>>>>> Multiple
>>>>>>>>>>>>>>>> Wi-Fi
>>>>>>>>>>>>>>>>     client/AP interfaces on one radio)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Firstly i configure wireless config as below:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>>>>>>>        option type 'qcawifi'
>>>>>>>>>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>>>>>>>>>        option hwmode '11ng'
>>>>>>>>>>>>>>>>        option txpower '17'
>>>>>>>>>>>>>>>>        option htmode 'HT20'
>>>>>>>>>>>>>>>>        option disabled '0'
>>>>>>>>>>>>>>>>        option channel '1'
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>>>>>        option device 'wifi0'
>>>>>>>>>>>>>>>>        option mode 'ap'
>>>>>>>>>>>>>>>>        option ssid 'Testing_ap'
>>>>>>>>>>>>>>>>        option network 'lan'
>>>>>>>>>>>>>>>>        option encryption 'psk2'
>>>>>>>>>>>>>>>>        option key 'Testing_ap'
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> so its SSID was showing and able to connect any device to
>>>>>>>>>>>>>>>> it.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Then i scan the device and connect to one of it. While
>>>>>>>>>>>>>>>> joining
>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>> network
>>>>>>>>>>>>>>>> i selected Client(WDS) then the wireless config becomes like
>>>>>>>>>>>>>>>> below:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> why don't you try following the steps in the video that you
>>>>>>>>>>>>>>>> posted.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> first connect as a client, then add an additional interface
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> and
>>>>>>>>>>>>>>> make
>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>> second interface the AP for things to connect to.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> the order may make a difference.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> config wifi-device 'wifi0'
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>        option type 'qcawifi'
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>        option macaddr '00:01:11:00:01:00'
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>        option hwmode '11ng'
>>>>>>>>>>>>>>>>        option txpower '17'
>>>>>>>>>>>>>>>>        option htmode 'HT20'
>>>>>>>>>>>>>>>>        option disabled '0'
>>>>>>>>>>>>>>>>        option channel '1'
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> config wifi-iface
>>>>>>>>>>>>>>>>        option network 'wwan'
>>>>>>>>>>>>>>>>        option ssid 'D_Link_Router'
>>>>>>>>>>>>>>>>        option encryption 'psk2'
>>>>>>>>>>>>>>>>        option device 'wifi0'
>>>>>>>>>>>>>>>>        option mode 'sta'
>>>>>>>>>>>>>>>>        option key 'Dlink_Router'
>>>>>>>>>>>>>>>>        option wds '1'
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Then  i added one as shown in the video. Now its connected
>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>> router
>>>>>>>>>>>>>>>> also
>>>>>>>>>>>>>>>> and this add one also showing so i can connect to this also.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> But i am not getting how to keep this in default wireless
>>>>>>>>>>>>>>>> config.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Because every time we cant add one to configure like this.
>>>>>>>>>>>>>>>> It
>>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>> like default should be in ap mode so any device we can
>>>>>>>>>>>>>>>> connect,
>>>>>>>>>>>>>>>> if
>>>>>>>>>>>>>>>> its
>>>>>>>>>>>>>>>> connected to another router also that SSID still should be
>>>>>>>>>>>>>>>> visible
>>>>>>>>>>>>>>>> and
>>>>>>>>>>>>>>>> able
>>>>>>>>>>>>>>>> to connect to this.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Mon, Aug 10, 2015 at 2:57 PM, John kerry <
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> kerry9842 at gmail.com>
>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> When i try to configure based on video, its shows 2 one as
>>>>>>>>>>>>>>> client
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> another
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> one as Master but i am not able to enable it . I mean to say
>>>>>>>>>>>>>>>> wireless
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> becomes disable. If i enable it using GUI also its not
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> happening.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On Mon, Aug 10, 2015 at 2:55 PM, David Lang <david at lang.hm
>>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> What happens when you try to follow the video?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Based on your comments, i'm guessing that things don't work
>>>>>>>>>>>>>>>>> when
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> you
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> try
>>>>>>>>>>>>>>>>>> and configure the second network and have it with a
>>>>>>>>>>>>>>>>>> different
>>>>>>>>>>>>>>>>>> SSID
>>>>>>>>>>>>>>>>>> than
>>>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>>> first network that you put in client mode.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Is this correct?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> David Lang
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On Mon, 10 Aug 2015, John kerry wrote:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Yes, When i am connecting to Another router its changed to
>>>>>>>>>>>>>>>>>> Client
>>>>>>>>>>>>>>>>>> mode.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Can i configure this in repeater mode like its shows in
>>>>>>>>>>>>>>>>>> below
>>>>>>>>>>>>>>>>>> link:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> https://www.youtube.com/watch?v=3rbsh2zxPnk
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> openwrt-devel mailing list
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> openwrt-devel at lists.openwrt.org
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150813/aefe8b9e/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From kerry9842 at gmail.com  Thu Aug 13 08:17:57 2015
From: kerry9842 at gmail.com (John kerry)
Date: Thu, 13 Aug 2015 20:17:57 +0800
Subject: [OpenWrt-Devel] Separate Default SSID for 2.4GHz and 5GHz
In-Reply-To: <20150813122113.GV19496@medion.lan>
References: <CAHb30NpLnaaDo-XtCjRMHZL562uEKoqzy8WSQquDcQPqpyymPA@mail.gmail.com>
 <CAENOc+zrfK_7SVqxomzewpmby07PCizgoigWuphJAoFrbBp9xA@mail.gmail.com>
 <20150813122113.GV19496@medion.lan>
Message-ID: <CAGUNxBH4n4GpdWdWqna_FduCcJsgCUAUCvg_U0z9RYXinXLBEQ@mail.gmail.com>

Hi,

Yes exactly i have one radio which i want to switch between 2.4GHz and
5GHz. GUI side i will add one switch button, But i am not getting how
handle backend wireless config. i mean to say where i can add this when
selected 2.4GHz load 2.4GHz wireless configuration and same for 5GHz.

On Thu, Aug 13, 2015 at 8:21 PM, Bastian Bittorf <bittorf at bluebottle.com>
wrote:

> * Sami Olmari <sami at olmari.fi> [07.08.2015 15:48]:
> > In openwrt you are free to configure each and every radio as own unit, so
> > use whatever SSID you see fit for each radio. This is default basic
> OpenWrt
> > stuff :)
>
> seems that Afkar has 1 radio which must be switched between 2.4 and 5 GHz,
> Afkar?
>
> bye, bastian
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150813/ecb22beb/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From bittorf at bluebottle.com  Thu Aug 13 08:19:12 2015
From: bittorf at bluebottle.com (Bastian Bittorf)
Date: Thu, 13 Aug 2015 14:19:12 +0200
Subject: [OpenWrt-Devel] [PATCH] busybox: lock: implement -n "Fail
 rather than wait"
In-Reply-To: <1438874880-9094-1-git-send-email-lynxis@fe80.eu>
References: <1438874880-9094-1-git-send-email-lynxis@fe80.eu>
Message-ID: <20150813121912.GU19496@medion.lan>

* Alexander Couzens <lynxis at fe80.eu> [06.08.2015 19:05]:
> lock -n is similiar to flock -n. If the lock was already taken,
> fail with exit code = 1 and write error message to stderr.

sorry, forget to ask:
is this "more" atomic than 'mkdir mypath || return'?

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bittorf at bluebottle.com  Thu Aug 13 08:21:13 2015
From: bittorf at bluebottle.com (Bastian Bittorf)
Date: Thu, 13 Aug 2015 14:21:13 +0200
Subject: [OpenWrt-Devel] Separate Default SSID for 2.4GHz and 5GHz
In-Reply-To: <CAENOc+zrfK_7SVqxomzewpmby07PCizgoigWuphJAoFrbBp9xA@mail.gmail.com>
References: <CAHb30NpLnaaDo-XtCjRMHZL562uEKoqzy8WSQquDcQPqpyymPA@mail.gmail.com>
 <CAENOc+zrfK_7SVqxomzewpmby07PCizgoigWuphJAoFrbBp9xA@mail.gmail.com>
Message-ID: <20150813122113.GV19496@medion.lan>

* Sami Olmari <sami at olmari.fi> [07.08.2015 15:48]:
> In openwrt you are free to configure each and every radio as own unit, so
> use whatever SSID you see fit for each radio. This is default basic OpenWrt
> stuff :)

seems that Afkar has 1 radio which must be switched between 2.4 and 5 GHz, Afkar?

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From karlp at tweak.net.au  Thu Aug 13 09:27:46 2015
From: karlp at tweak.net.au (Karl Palsson)
Date: Thu, 13 Aug 2015 13:27:46 -0000
Subject: [OpenWrt-Devel] [PATCH] Ar71xx: Add Minibox v1.0 support
In-Reply-To: <1439404114.2716.0@smtp.autistici.org>
References: <1439404114.2716.0@smtp.autistici.org>
Message-ID: <20150813132016-31735-48960-mailpile@palmtree-beeroclock-net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stijn Segers <francesco.borromini at inventati.org> wrote:
> Hi Karl,
> 
> Thanks for your time.
> 
> I have reworked the patch and re-ordered where possible (files like 
> ar71xx.sh and diag.sh lack any alphabetical
> order). I have removed the code that set the led to status_led_off. 
> What file should I be looking at, when you talk
> about the board file? Is it the minibox-v1.mk file? I diffed from the 
> vendor's code (and added a profile by comparing
> with other devices) but that was it.

I meant target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c

> 
> I don't have the hardware myself but I have found a tester willing to 
> run the image (and see how the LED behaves with
> the default OpenWrt settings).

It's not relevant how it behaves for them on their board.  My problem
here was that you were changing the behaviour for _all_ boards.  And by
the sound of it, you were working around an active low/high
misconfiguration, which should be addressed by properly configuring the
polarity of the leds in your board file,
target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c

> 
> 
> The new patch can be found here:
> 
> https://volatilesystems.org/dl/openwrt/targets/add-minibox-target-trunk.patch
> 
> If that doesn't work, a backup: http://sprunge.us/AUbX

No-one's looking at that.  I'm being helpful by reviewing your earlier
mangled patch, but if you want this to be applied, you _will_ need to
follow https://dev.openwrt.org/wiki/SubmittingPatches 
Pay particular attention to item 6.  Yes, this is the graybeard stone
age, lowest common denominator of email behaviour, but those are the
_rules_ I recommend git-send-email to avoid the mangling that most clients will do.

I expect the problem here: https://patchwork.ozlabs.org/patch/505479/
was that you trying to use diff manually to generate the patch set (from
your .orig directory)  While I'm sure that's possible, there's a reason
most people use git or svn.

Cheers,
Karl P

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

iQIcBAEBAgAGBQJVzJtSAAoJEBmotQ/U1cr2WT4QALzDtq4XEBLaooi/Bu8qr+WI
83MRsoZHHd6GzEq+x8+2P07vPqrOHu6xbKGgx34KbAj4W6YXAUme8HYRm0/rIoYm
PnJj5xJzn/JOkQbUU21+Fj+mXFEKWAyNC0byjmzFRIeo7viMSUCuPfU6NPm+aQua
iDDj4iZTbgtPVRdBWAu6glBSLFajrS35PFbcLOfX1bvJ/ci930PWymfSWgY0bH+0
AyXzHcRbfM/apf09e3VxicfzmFCWLYMkAdStjPXKuok3hXom7E7gk6iMHE5j9B0A
JxTBlahs+yoi4A0eEEGQs+D5+hisFzXB0mbGHqTBmpGyXFzo21V4sZfb00UrGtVx
h1lcXKAU3IC4MVRm0I3/Ef0LCBeDCW1w/yNNBt/X4POGPm1ZUYl8B3z27/1AX6M9
/B4f35/A0g1X2sQLv4fZppJVbOhoxlgpxEo+Ms7TgVX/ERTUbN/n37b37UQg6frA
MIG5OWHK+9HQk7NYXFvQWoW/jBLfU2HLR9ki1AUJtEfNQpYtOxJjZcF1SMlA46/0
aPUYbu/NObBYpA2CtheJuzb8MgeeE6QQs4D8Ik6de5NeBrO93XCe2nkJg9XCLkM/
a1uCq4R+p35nAq7Vrb94V/LjQasxwIOzJpSVMmAWIjQb8H5j6iYtwJlONrJCQGq2
WtF+/zcBO3X9fFVnlM7Q
=zcDx
-----END PGP SIGNATURE-----
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From smilebef at gmail.com  Thu Aug 13 11:37:42 2015
From: smilebef at gmail.com (smilebef at gmail.com)
Date: Thu, 13 Aug 2015 17:37:42 +0200
Subject: [OpenWrt-Devel] i get no image for TL-WA7510
In-Reply-To: <55CC5869.4040106@wireless-instruments.com>
References: <20150812212918.592b6053@None>
 <55CC5869.4040106@wireless-instruments.com>
Message-ID: <20150813173742.1710228f@None>

On Thu, 13 Aug 2015 10:42:17 +0200
S?awomir Demeszko <s.demeszko at wireless-instruments.com> wrote:

> W dniu 12.08.2015 o 21:29, smilebef at gmail.com pisze:
>  > I miss not only the TL-WA7510 image. I missing also several images
>  > for other 4MB Flash-Router.
>  >
>  > Is there a Funktion in Openwrt which build images only if the
>  > image-size not excite the flash-size?
> 
> I found there is. I was also wonder for half day why image for my
> board was not created. I think there should be at least a warning and
> option to bypass this check it would be helpful to estimate how many
> bytes we need to reclaim to fit.
> _______________________________________________ openwrt-devel mailing
> list openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

It will be great.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150813/87ea93c3/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From mathieu at codeaurora.org  Thu Aug 13 12:32:44 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Thu, 13 Aug 2015 09:32:44 -0700
Subject: [OpenWrt-Devel] [PATCH 1/5] kernel: move linux,
	part-probe dt parsing in generic code
In-Reply-To: <CACna6rwiYjY=K8h5XKyxhHVq5ROG7piVwL_5pfxFDU+c3eDSnQ@mail.gmail.com>
References: <1439433464-1526-1-git-send-email-mathieu@codeaurora.org>	<1439433464-1526-2-git-send-email-mathieu@codeaurora.org>
 <CACna6rwiYjY=K8h5XKyxhHVq5ROG7piVwL_5pfxFDU+c3eDSnQ@mail.gmail.com>
Message-ID: <00ed01d0d5e5$af5ae0a0$0e10a1e0$@codeaurora.org>

No; I don't think it was. Patches weren't acked afaik and it doesn't seem to be in the next tree.
http://lists.infradead.org/pipermail/linux-mtd/2015-May/059226.html


-----Original Message-----
From: Rafa? Mi?ecki [mailto:zajec5 at gmail.com] 
Sent: Wednesday, August 12, 2015 9:05 PM
To: Mathieu Olivari
Cc: Felix Fietkau; Jonas Gorski; John Crispin; OpenWrt Development List
Subject: Re: [OpenWrt-Devel] [PATCH 1/5] kernel: move linux, part-probe dt parsing in generic code

On 13 August 2015 at 04:37, Mathieu Olivari <mathieu at codeaurora.org> wrote:
> The "linux,part-probe" dts parsing is a pretty neat generic feature.
> It has been posted to kernel.org and could easily be reused by all 
> targets.

Was it accepted mainline? If so, you should use 0xx prefix for this patch. Otherwise it's OK.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From mschiffer at universe-factory.net  Thu Aug 13 13:46:04 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu, 13 Aug 2015 19:46:04 +0200
Subject: [OpenWrt-Devel] [PATCH v4 1/4] sunxi: don't copy DTS files to
	BIN_DIR
Message-ID: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>

The DTS files aren't useful (other targets don't copy them either) and
clutter BIN_DIR with files unrelated to the chosen profile.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/sunxi/image/Makefile | 30 +++++-------------------------
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile
index 6fcd61f..b96a360 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -11,28 +11,12 @@ include $(INCLUDE_DIR)/host.mk
 FAT32_BLOCK_SIZE=1024
 FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
 
-BOARDS:= \
-	sun4i-a10-cubieboard \
-	sun4i-a10-olinuxino-lime \
-	sun4i-a10-pcduino \
-	sun5i-a13-olinuxino \
-	sun6i-a31-colombus \
-	sun6i-a31-m9 \
-	sun7i-a20-bananapi \
-	sun7i-a20-bananapro \
-	sun7i-a20-cubieboard2 \
-	sun7i-a20-cubietruck \
-	sun7i-a20-olinuxino-lime \
-	sun7i-a20-olinuxino-micro \
-	sun7i-a20-pcduino3 \
-	sun7i-a20-lamobo-r1
-
 define Image/BuildKernel
 	mkimage -A arm -O linux -T kernel -C none \
 		-a 0x40008000 -e 0x40008000 \
 		-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
 		-d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
-	
+
     ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
 	$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
 	echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
@@ -42,20 +26,16 @@ define Image/BuildKernel
 		$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
 	)
     endif
-
-	$(foreach board,$(BOARDS),
-		$(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
-	)
 endef
 
 define Image/Build/SDCard
 	rm -f $(KDIR)/boot.img
 	mkdosfs $(KDIR)/boot.img -C $(FAT32_BLOCKS)
-	
+
 	mcopy -i $(KDIR)/boot.img $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-boot.scr ::boot.scr
-	mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(2).dtb ::dtb
+	mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(2).dtb ::dtb
 	mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage
-	
+
 	./gen_sunxi_sdcard_img.sh \
 		$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \
 		$(KDIR)/boot.img \
@@ -124,7 +104,7 @@ endef
 define Image/Build
 	$(call Image/Build/$(1),$(1))
 	$(call Image/Build/Profile/$(PROFILE),$(1))
-	
+
 	dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
 endef
 
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Thu Aug 13 13:46:05 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu, 13 Aug 2015 19:46:05 +0200
Subject: [OpenWrt-Devel] [PATCH v4 2/4] sunxi: fix uboot install location
In-Reply-To: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>
References: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>
Message-ID: <afbf167dfdd11fd66261ec3365956975feae566a.1439487967.git.mschiffer@universe-factory.net>

Install uboot files to KERNEL_BUILD_DIR instead of BIN_DIR to fix
ImageBuilder. Similar fixes are necessary for many (all?) other uboot
targets.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/boot/uboot-sunxi/Makefile | 14 +++++++-------
 target/linux/sunxi/image/Makefile |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
index 1aeeceb..b08f9ed 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:= \
 
 PKG_MD5SUM:=3dac9a0b46fed77fc768ad3bd2d68c05
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_LICENSE:=GPL-2.0 GPL-2.0+
 PKG_LICENSE_FILES:=Licenses/README
@@ -138,16 +138,16 @@ define Build/Compile
 endef
 
 define Package/uboot/install/default
-	$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
 	$(CP) $(PKG_BUILD_DIR)/u-boot.bin \
-		$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
+		$(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot.bin
 	$(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
-		$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
+		$(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-spl.bin
 	$(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
-		$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
+		$(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin
 	$(CP) uEnv.txt \
-		$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
-	mkimage -C none -A arm -T script -d $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-boot.scr
+		$(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt
+	mkimage -C none -A arm -T script -d $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt \
+		$(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr
 endef
 
 define Package/uboot/install/template
diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile
index b96a360..19ab935 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -32,7 +32,7 @@ define Image/Build/SDCard
 	rm -f $(KDIR)/boot.img
 	mkdosfs $(KDIR)/boot.img -C $(FAT32_BLOCKS)
 
-	mcopy -i $(KDIR)/boot.img $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-boot.scr ::boot.scr
+	mcopy -i $(KDIR)/boot.img $(KDIR)/uboot-sunxi-$(PROFILE)-boot.scr ::boot.scr
 	mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(2).dtb ::dtb
 	mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage
 
@@ -42,7 +42,7 @@ define Image/Build/SDCard
 		$(KDIR)/root.$(1) \
 		$(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
 		$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
-		$(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-u-boot-with-spl.bin
+		$(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin
 endef
 
 define Image/Build/Profile/A10-OLinuXino-Lime
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Thu Aug 13 13:46:06 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu, 13 Aug 2015 19:46:06 +0200
Subject: [OpenWrt-Devel] [PATCH v4 3/4] sunxi: create KDIR_TMP,
	build boot.img in it
In-Reply-To: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>
References: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>
Message-ID: <ec9312a59cc935d6e7cc937fcad4b7f2f4cbb501.1439487967.git.mschiffer@universe-factory.net>

It's nice to have a distinction between files which are built during the
normal OpenWrt build process and ones that are created by the ImageBuilder
(like it already exists on some other targets).

This also gives boot.img a profile-specific prefix as it contains profile-
specific data.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/sunxi/image/Makefile | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile
index 19ab935..45e8dea 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -8,10 +8,14 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 include $(INCLUDE_DIR)/host.mk
 
+KDIR_TMP:=$(KDIR)/tmp
+
 FAT32_BLOCK_SIZE=1024
 FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
 
 define Image/BuildKernel
+	-mkdir -p $(KDIR_TMP)
+
 	mkimage -A arm -O linux -T kernel -C none \
 		-a 0x40008000 -e 0x40008000 \
 		-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
@@ -29,16 +33,16 @@ define Image/BuildKernel
 endef
 
 define Image/Build/SDCard
-	rm -f $(KDIR)/boot.img
-	mkdosfs $(KDIR)/boot.img -C $(FAT32_BLOCKS)
+	rm -f $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img
+	mkdosfs $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img -C $(FAT32_BLOCKS)
 
-	mcopy -i $(KDIR)/boot.img $(KDIR)/uboot-sunxi-$(PROFILE)-boot.scr ::boot.scr
-	mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(2).dtb ::dtb
-	mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage
+	mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(KDIR)/uboot-sunxi-$(PROFILE)-boot.scr ::boot.scr
+	mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(DTS_DIR)/$(2).dtb ::dtb
+	mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage
 
 	./gen_sunxi_sdcard_img.sh \
 		$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \
-		$(KDIR)/boot.img \
+		$(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img \
 		$(KDIR)/root.$(1) \
 		$(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
 		$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Thu Aug 13 13:46:07 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Thu, 13 Aug 2015 19:46:07 +0200
Subject: [OpenWrt-Devel] [PATCH v4 4/4] sunxi: respect
	CONFIG_TARGET_IMAGES_GZIP
In-Reply-To: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>
References: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>
Message-ID: <5da66e12941aacef148b4d6ccc00ebad0b0baeb4.1439487967.git.mschiffer@universe-factory.net>

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/sunxi/image/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile
index 45e8dea..905188b 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -47,6 +47,10 @@ define Image/Build/SDCard
 		$(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
 		$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
 		$(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin
+
+  ifneq ($(CONFIG_TARGET_IMAGES_GZIP),)
+	gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img
+  endif
 endef
 
 define Image/Build/Profile/A10-OLinuXino-Lime
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at kresin.me  Thu Aug 13 13:49:03 2015
From: openwrt at kresin.me (Mathias Kresin)
Date: Thu, 13 Aug 2015 19:49:03 +0200
Subject: [OpenWrt-Devel] TP-Link v3 header format description
Message-ID: <CABwW5nkCDRLHJhyLcC=5LFXN9wvbRz_-4tyyHDPiZY=tKdPghA@mail.gmail.com>

Hey Weijie Gao,

2015-08-05 20:07 GMT+02:00 Weijie Gao <hackpascal at gmail.com>:

> This patch adds header version 2 option for mktplinkfw.

As long as we talk about the same, the new header version is v3. The
v2 header is already covered by mktplinkfw2.c.

Currently, I'm working on the same topic. Everything that is known so
far about the new v3 header is documented in Martins repository:
https://github.com/xdarklight/mktplinkfw3/blob/master/README.md
(please take care of the not yet merged pull request). Maybe you can
confirm/deny what I figured out so far or add missing informations.

It would be nice, if you (or anyone else) can extend your v3 header
creation patch, using the provided informations. It should be possible
the write the complete verification part (-i option). For the creation
part, (only) the private key from tp-link is missing.

> The version 2 header is used for AR/QCA firmwares and is not the same as
> the header generated by mktplinkfw2.
> Instead, it is nearly the same as version 1 header except for the header
> version and the RSA signature.
>
> The header version 2 support is used for newer TP-Link routers which have
> only a 64kb bootloader part, e.g. TL-WDR6500 v2.
> ---
>  tools/firmware-utils/src/mktplinkfw.c | 25 +++++++++++++++++++++----
>  1 file changed, 21 insertions(+), 4 deletions(-)

IMHO the v3 header is an extension of the v2 header, since TP-Link
switched from v2 to v3 on already deployed devices like the
TD-W8980v1. That's why *I* would prefer to either create a
mktplinkfw3.c or add the required the changes to mktplinkfw2.c.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt.org-1 at timothyace.com  Thu Aug 13 13:58:51 2015
From: openwrt.org-1 at timothyace.com (Timothy Ace)
Date: Thu, 13 Aug 2015 13:58:51 -0400
Subject: [OpenWrt-Devel] [PATCH] [package] firewall: Adds support for IPv6
	DNAT, SNAT, and REDIRECT
Message-ID: <ED9CFA6F-B8C3-4264-A22E-DEAF62DB3320@timothyace.com>

From: Timothy Ace <openwrt.org-1 at timothyace.com>

Adds support for IPv6 DNAT, SNAT, and REDIRECT.

Signed-off-by: Timothy Ace <openwrt.org-1 at timothyace.com>
---
This is a git patch for the firewall3 git repo at git://nbd.name/firewall3.git

Note1: Luci updates still need to be made in a separate patch to support IPv6 address entry on the port forwards page, but this works using manual entries in /etc/config/firewall for now.

Note2: I changed the section in compare_addr() from this:

-	return ((a->address.v4.s_addr & a->mask.v4.s_addr) ==
-	        (b->address.v4.s_addr & a->mask.v4.s_addr));

to this:

+	return ((a->address.v4.s_addr & a->mask.v4.s_addr) ==
+	        (b->address.v4.s_addr & b->mask.v4.s_addr));

... because using "a->mask" instead of "b->mask" on the second line looked wrong to me. Please let me know if that was intentional and I'll re-submit a patch that accounts for that change for the v4 and new v6 sections.



From openwrt.org-1 at timothyace.com  Thu Aug 13 00:28:02 2015
From: openwrt.org-1 at timothyace.com (Timothy Ace)
Date: Thu, 13 Aug 2015 00:28:02 -0400
Subject: [PATCH] Adds support for IPv6 DNAT, SNAT, and REDIRECT
Message-ID: <mailman.112.1593078805.4661.openwrt-devel@lists.openwrt.org>

---
defaults.c  |  8 ++++----
redirects.c | 42 ++++++++++++++++++++++++++++++++++--------
snats.c     |  1 +
ubus.c      | 24 ++++++++++++++++++++----
utils.c     | 10 ++++++++--
zones.c     | 13 ++++++++-----
6 files changed, 75 insertions(+), 23 deletions(-)

diff --git a/defaults.c b/defaults.c
index 396cbf7..45d6de6 100644
--- a/defaults.c
+++ b/defaults.c
@@ -32,10 +32,10 @@ static const struct fw3_chain_spec default_chains[] = {
	C(ANY, FILTER, CUSTOM_CHAINS, "forwarding_rule"),
	C(ANY, FILTER, SYN_FLOOD,     "syn_flood"),

-	C(V4,  NAT,    UNSPEC,        "delegate_prerouting"),
-	C(V4,  NAT,    UNSPEC,        "delegate_postrouting"),
-	C(V4,  NAT,    CUSTOM_CHAINS, "prerouting_rule"),
-	C(V4,  NAT,    CUSTOM_CHAINS, "postrouting_rule"),
+	C(ANY, NAT,    UNSPEC,        "delegate_prerouting"),
+	C(ANY, NAT,    UNSPEC,        "delegate_postrouting"),
+	C(ANY, NAT,    CUSTOM_CHAINS, "prerouting_rule"),
+	C(ANY, NAT,    CUSTOM_CHAINS, "postrouting_rule"),

	C(ANY, MANGLE, UNSPEC,        "mssfix"),
	C(ANY, MANGLE, UNSPEC,        "fwmark"),
diff --git a/redirects.c b/redirects.c
index 5b8d7a9..0751e93 100644
--- a/redirects.c
+++ b/redirects.c
@@ -116,11 +116,26 @@ check_families(struct uci_element *e, struct fw3_redirect *r)
static bool
compare_addr(struct fw3_address *a, struct fw3_address *b)
{
-	if (a->family != FW3_FAMILY_V4 || b->family != FW3_FAMILY_V4)
+	if (a->family != b->family)
		return false;

-	return ((a->address.v4.s_addr & a->mask.v4.s_addr) ==
-	        (b->address.v4.s_addr & a->mask.v4.s_addr));
+	if (a->family == FW3_FAMILY_V4)
+	{
+		return ((a->address.v4.s_addr & a->mask.v4.s_addr) ==
+		        (b->address.v4.s_addr & b->mask.v4.s_addr));
+	}
+	else if (a->family == FW3_FAMILY_V6)
+	{
+		int i;
+		for (i = 0; i < 16; i++)
+		{
+			if ((a->address.v6.s6_addr[i] & a->mask.v6.s6_addr[i]) !=
+			    (b->address.v6.s6_addr[i] & b->mask.v6.s6_addr[i]))
+				return false;
+		}
+		return true;
+	}
+	return false;
}

static bool
@@ -278,6 +293,7 @@ fw3_load_redirects(struct fw3_state *state, struct uci_package *p)
			else
			{
				set(redir->_src->flags, FW3_FAMILY_V4, redir->target);
+				set(redir->_src->flags, FW3_FAMILY_V6, redir->target);
				redir->_src->conntrack = true;
				valid = true;

@@ -293,6 +309,9 @@ fw3_load_redirects(struct fw3_state *state, struct uci_package *p)
					set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_ACCEPT);
					set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_DNAT);
					set(redir->_dest->flags, FW3_FAMILY_V4, FW3_FLAG_SNAT);
+					set(redir->_dest->flags, FW3_FAMILY_V6, FW3_FLAG_ACCEPT);
+					set(redir->_dest->flags, FW3_FAMILY_V6, FW3_FLAG_DNAT);
+					set(redir->_dest->flags, FW3_FAMILY_V6, FW3_FLAG_SNAT);
				}
			}
		}
@@ -309,6 +328,7 @@ fw3_load_redirects(struct fw3_state *state, struct uci_package *p)
			else
			{
				set(redir->_dest->flags, FW3_FAMILY_V4, redir->target);
+				set(redir->_dest->flags, FW3_FAMILY_V6, redir->target);
				redir->_dest->conntrack = true;
				valid = true;
			}
@@ -364,13 +384,22 @@ static void
set_snat_dnat(struct fw3_ipt_rule *r, enum fw3_flag target,
             struct fw3_address *addr, struct fw3_port *port)
{
-	char buf[sizeof("255.255.255.255:65535-65535\0")];
+	char buf[INET6_ADDRSTRLEN + sizeof("[]:65535-65535\0")];

	buf[0] = '\0';

	if (addr && addr->set)
	{
-		inet_ntop(AF_INET, &addr->address.v4, buf, sizeof(buf));
+		if (addr->family == FW3_FAMILY_V4)
+		{
+			inet_ntop(AF_INET, &addr->address.v4, buf, sizeof(buf));
+		}
+		else if (addr->family == FW3_FAMILY_V6)
+		{
+			buf[0] = '[';
+			inet_ntop(AF_INET6, &addr->address.v6, buf + 1, sizeof(buf) - 2);
+			sprintf(buf + strlen(buf), "]");
+		}
	}

	if (port && port->set)
@@ -607,9 +636,6 @@ fw3_print_redirects(struct fw3_ipt_handle *handle, struct fw3_state *state)
	int num = 0;
	struct fw3_redirect *redir;

-	if (handle->family == FW3_FAMILY_V6)
-		return;
-
	if (handle->table != FW3_TABLE_FILTER && handle->table != FW3_TABLE_NAT)
		return;

diff --git a/snats.c b/snats.c
index 0f7d851..1d22e33 100644
--- a/snats.c
+++ b/snats.c
@@ -254,6 +254,7 @@ fw3_load_snats(struct fw3_state *state, struct uci_package *p, struct blob_attr
		if (snat->_src)
		{
			set(snat->_src->flags, FW3_FAMILY_V4, FW3_FLAG_SNAT);
+			set(snat->_src->flags, FW3_FAMILY_V6, FW3_FLAG_SNAT);
			snat->_src->conntrack = true;
		}
	}
diff --git a/ubus.c b/ubus.c
index 9e034c8..4ae5c8b 100644
--- a/ubus.c
+++ b/ubus.c
@@ -93,11 +93,27 @@ parse_subnet(enum fw3_family family, struct blob_attr *dict, int rem)
	__blob_for_each_attr(cur, dict, rem)
	{
		if (!strcmp(blobmsg_name(cur), "address"))
-			inet_pton(family == FW3_FAMILY_V4 ? AF_INET : AF_INET6,
-			          blobmsg_get_string(cur), &addr->address.v6);
-
+		{
+			if (family == FW3_FAMILY_V4)
+			{
+				inet_pton(AF_INET, blobmsg_get_string(cur), &addr->address.v4);
+			}
+			else
+			{
+				inet_pton(AF_INET6, blobmsg_get_string(cur), &addr->address.v6);
+			}
+		}
		else if (!strcmp(blobmsg_name(cur), "mask"))
-			fw3_bitlen2netmask(family, blobmsg_get_u32(cur), &addr->mask.v6);
+		{
+			if (family == FW3_FAMILY_V4)
+			{
+				fw3_bitlen2netmask(family, blobmsg_get_u32(cur), &addr->mask.v4);
+			}
+			else
+			{
+				fw3_bitlen2netmask(family, blobmsg_get_u32(cur), &addr->mask.v6);
+			}
+		}
	}

	return addr;
diff --git a/utils.c b/utils.c
index b2fbe02..4b8d44e 100644
--- a/utils.c
+++ b/utils.c
@@ -882,8 +882,14 @@ fw3_flush_conntrack(void *state)

			if (!found)
			{
-				inet_ntop(addr->family == FW3_FAMILY_V4 ? AF_INET : AF_INET6,
-						  &addr->address.v4, buf, sizeof(buf));
+				if (addr->family == FW3_FAMILY_V4)
+				{
+					inet_ntop(AF_INET, &addr->address.v4, buf, sizeof(buf));
+				}
+				else
+				{
+					inet_ntop(AF_INET6, &addr->address.v6, buf, sizeof(buf));
+				}

				info(" * Flushing conntrack: %s", buf);
				fprintf(ct, "%s\n", buf);
diff --git a/zones.c b/zones.c
index 2ddd7b4..ff2403f 100644
--- a/zones.c
+++ b/zones.c
@@ -36,8 +36,8 @@ static const struct fw3_chain_spec zone_chains[] = {
	C(ANY, FILTER, REJECT,        "zone_%s_dest_REJECT"),
	C(ANY, FILTER, DROP,          "zone_%s_dest_DROP"),

-	C(V4,  NAT,    SNAT,          "zone_%s_postrouting"),
-	C(V4,  NAT,    DNAT,          "zone_%s_prerouting"),
+	C(ANY, NAT,    SNAT,          "zone_%s_postrouting"),
+	C(ANY, NAT,    DNAT,          "zone_%s_prerouting"),

	C(ANY, RAW,    NOTRACK,       "zone_%s_notrack"),

@@ -45,8 +45,8 @@ static const struct fw3_chain_spec zone_chains[] = {
	C(ANY, FILTER, CUSTOM_CHAINS, "output_%s_rule"),
	C(ANY, FILTER, CUSTOM_CHAINS, "forwarding_%s_rule"),

-	C(V4,  NAT,    CUSTOM_CHAINS, "prerouting_%s_rule"),
-	C(V4,  NAT,    CUSTOM_CHAINS, "postrouting_%s_rule"),
+	C(ANY, NAT,    CUSTOM_CHAINS, "prerouting_%s_rule"),
+	C(ANY, NAT,    CUSTOM_CHAINS, "postrouting_%s_rule"),

	{ }
};
@@ -217,13 +217,16 @@ fw3_load_zones(struct fw3_state *state, struct uci_package *p)
		if (zone->masq)
		{
			setbit(zone->flags[0], FW3_FLAG_SNAT);
+			setbit(zone->flags[1], FW3_FLAG_SNAT);
			zone->conntrack = true;
		}

		if (zone->custom_chains)
		{
			setbit(zone->flags[0], FW3_FLAG_SNAT);
+			setbit(zone->flags[1], FW3_FLAG_SNAT);
			setbit(zone->flags[0], FW3_FLAG_DNAT);
+			setbit(zone->flags[1], FW3_FLAG_DNAT);
		}

		setbit(zone->flags[0], fw3_to_src_target(zone->policy_input));
@@ -540,7 +543,7 @@ print_zone_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
		break;

	case FW3_TABLE_NAT:
-		if (zone->masq && handle->family == FW3_FAMILY_V4)
+		if (zone->masq)
		{
			fw3_foreach(msrc, &zone->masq_src)
			fw3_foreach(mdest, &zone->masq_dest)
-- 
2.3.2 (Apple Git-55)
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From zajec5 at gmail.com  Thu Aug 13 14:00:58 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Thu, 13 Aug 2015 20:00:58 +0200
Subject: [OpenWrt-Devel] lighttpd 1.4.36 and file descriptors limit issue -
	OpenWrt related?
Message-ID: <CACna6ry3Z5gG6J0zxg6_CEC7KHYnMuV5aGZ6ELGfAfc9rUjftw@mail.gmail.com>

There is an issue with handling relatively big (4 MiB+) files in
lighttpd after the upgrade to the 1.4.36:
https://github.com/openwrt/packages/issues/1658
It seems lighttpd is running out of file descriptors and is replying with:
413 - Request Entity Too Large

I also reported this issue upstream:
http://article.gmane.org/gmane.comp.web.lighttpd/5370

I received following suggestion (on the IRC) pointing OpenWrt kernel:
[19:45] <sztanpet> i shall blame the openwrt kernel
[19:45] <rmilecki> sztanpet: what exactly? I can modify the config if needed
[19:45] <rmilecki> or the sources if you have anything to test
[19:45] <sztanpet> i have no idea
[19:45] <rmilecki> oh
[19:46] <sztanpet> but since the issue is such a core issue that
everyone would be seeing it and that is not the case, that tells me
its probably not lighttpd

Can you think of anything in OpenWrt kernel that could cause such a problem?

-- 
Rafa?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jogo at openwrt.org  Thu Aug 13 14:16:03 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Thu, 13 Aug 2015 20:16:03 +0200
Subject: [OpenWrt-Devel] lighttpd 1.4.36 and file descriptors limit
 issue - OpenWrt related?
In-Reply-To: <CACna6ry3Z5gG6J0zxg6_CEC7KHYnMuV5aGZ6ELGfAfc9rUjftw@mail.gmail.com>
References: <CACna6ry3Z5gG6J0zxg6_CEC7KHYnMuV5aGZ6ELGfAfc9rUjftw@mail.gmail.com>
Message-ID: <CAOiHx==W9X5CM7jhxWac5JWeh49vB5V0uM5=GiZmsrCouGCOBQ@mail.gmail.com>

On Thu, Aug 13, 2015 at 8:00 PM, Rafa? Mi?ecki <zajec5 at gmail.com> wrote:
> There is an issue with handling relatively big (4 MiB+) files in
> lighttpd after the upgrade to the 1.4.36:
> https://github.com/openwrt/packages/issues/1658
> It seems lighttpd is running out of file descriptors and is replying with:
> 413 - Request Entity Too Large
>
> I also reported this issue upstream:
> http://article.gmane.org/gmane.comp.web.lighttpd/5370
>
> I received following suggestion (on the IRC) pointing OpenWrt kernel:
> [19:45] <sztanpet> i shall blame the openwrt kernel
> [19:45] <rmilecki> sztanpet: what exactly? I can modify the config if needed
> [19:45] <rmilecki> or the sources if you have anything to test
> [19:45] <sztanpet> i have no idea
> [19:45] <rmilecki> oh
> [19:46] <sztanpet> but since the issue is such a core issue that
> everyone would be seeing it and that is not the case, that tells me
> its probably not lighttpd
>
> Can you think of anything in OpenWrt kernel that could cause such a problem?

Have you tried if changing the libc makes any difference? Might be a
bug in musl, might a not quite proper usage that glibc allows, but
musl doesn't, etc pp.


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

From zajec5 at gmail.com  Thu Aug 13 14:42:48 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Thu, 13 Aug 2015 20:42:48 +0200
Subject: [OpenWrt-Devel] lighttpd 1.4.36 and file descriptors limit
 issue - OpenWrt related?
In-Reply-To: <CAOiHx==W9X5CM7jhxWac5JWeh49vB5V0uM5=GiZmsrCouGCOBQ@mail.gmail.com>
References: <CACna6ry3Z5gG6J0zxg6_CEC7KHYnMuV5aGZ6ELGfAfc9rUjftw@mail.gmail.com>
 <CAOiHx==W9X5CM7jhxWac5JWeh49vB5V0uM5=GiZmsrCouGCOBQ@mail.gmail.com>
Message-ID: <CACna6rwVtrLYSh7w3wvm_1RBFZa+DDKr1pV5nPVkUwku8am0Qg@mail.gmail.com>

On 13 August 2015 at 20:16, Jonas Gorski <jogo at openwrt.org> wrote:
> On Thu, Aug 13, 2015 at 8:00 PM, Rafa? Mi?ecki <zajec5 at gmail.com> wrote:
>> There is an issue with handling relatively big (4 MiB+) files in
>> lighttpd after the upgrade to the 1.4.36:
>> https://github.com/openwrt/packages/issues/1658
>> It seems lighttpd is running out of file descriptors and is replying with:
>> 413 - Request Entity Too Large
>>
>> I also reported this issue upstream:
>> http://article.gmane.org/gmane.comp.web.lighttpd/5370
>>
>> I received following suggestion (on the IRC) pointing OpenWrt kernel:
>> [19:45] <sztanpet> i shall blame the openwrt kernel
>> [19:45] <rmilecki> sztanpet: what exactly? I can modify the config if needed
>> [19:45] <rmilecki> or the sources if you have anything to test
>> [19:45] <sztanpet> i have no idea
>> [19:45] <rmilecki> oh
>> [19:46] <sztanpet> but since the issue is such a core issue that
>> everyone would be seeing it and that is not the case, that tells me
>> its probably not lighttpd
>>
>> Can you think of anything in OpenWrt kernel that could cause such a problem?
>
> Have you tried if changing the libc makes any difference? Might be a
> bug in musl, might a not quite proper usage that glibc allows, but
> musl doesn't, etc pp.

I was actually using 15.05 (which uses uClibc). I tried OpenWrt's
trunk (which uses musl) and the problem exists there too.

-- 
Rafa?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From zajec5 at gmail.com  Thu Aug 13 16:23:27 2015
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Thu, 13 Aug 2015 22:23:27 +0200
Subject: [OpenWrt-Devel] [PATCH packages] lighttpd: backport a fix for
	running out of filedescriptors
Message-ID: <1439497407-15562-1-git-send-email-zajec5@gmail.com>

It was breaking uploads of files 4 MiB+. This patch fixes:
https://github.com/openwrt/packages/issues/1658

Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
---
This should be applied to both: master and 15.05 branch.
---
 ...filedescriptors-when-uploading-large-file.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 net/lighttpd/patches/001-fix-out-of-filedescriptors-when-uploading-large-file.patch

diff --git a/net/lighttpd/patches/001-fix-out-of-filedescriptors-when-uploading-large-file.patch b/net/lighttpd/patches/001-fix-out-of-filedescriptors-when-uploading-large-file.patch
new file mode 100644
index 0000000..6ef9403
--- /dev/null
+++ b/net/lighttpd/patches/001-fix-out-of-filedescriptors-when-uploading-large-file.patch
@@ -0,0 +1,26 @@
+From: =?UTF-8?q?Stefan=20B=C3=BChler?= <stbuehler at web.de>
+Date: Thu, 13 Aug 2015 18:44:27 +0000
+Subject: [PATCH] fix out-of-filedescriptors when uploading "large" files
+ (fixes #2660, thx rmilecki)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Stefan B?hler <stbuehler at web.de>
+
+git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x at 3009 152afb58-edef-0310-8abb-c4023f1b3aa9
+---
+ src/chunk.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/chunk.c
++++ b/src/chunk.c
+@@ -432,7 +432,7 @@ static int chunkqueue_append_to_tempfile
+ 	 * */
+ 
+ 	if (NULL != dest->last
+-		&& FILE_CHUNK != dest->last->type
++		&& FILE_CHUNK == dest->last->type
+ 		&& dest->last->file.is_temp
+ 		&& -1 != dest->last->file.fd
+ 		&& 0 == dest->last->offset) {
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From ben.whitten at gmail.com  Thu Aug 13 17:28:37 2015
From: ben.whitten at gmail.com (Ben Whitten)
Date: Thu, 13 Aug 2015 22:28:37 +0100
Subject: [OpenWrt-Devel] [PATCH] [kernel] at91: Backport determine_rate
	prototype fix
Message-ID: <CAF3==iuw3odn4CqBBdDnbEzZeR1XTT=ORUGDREe+aXQ92dQZTA@mail.gmail.com>

From: Ben Whitten <ben.whitten at gmail.com>

This patch is backport of a fix to a USB prototype mismatch bug found
in 3.18 kernels, originally submitted by Boris Brezillon [1].
The symptom of this bug was that devices attached to the at91 using
at91_ohci on a hub never appeared and failed to initialise.

[1] http://www.spinics.net/lists/linux-usb/msg125969.html

Signed-off-by: Ben Whitten <ben.whitten at gmail.com>
---
 .../201-ARM-at91-usb-determine_rate-backport.patch   | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644
target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch

diff --git a/target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch
b/target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch
new file mode 100644
index 0000000..d083628
--- /dev/null
+++ b/target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch
@@ -0,0 +1,20 @@
+--- a/drivers/clk/at91/clk-usb.c
++++ b/drivers/clk/at91/clk-usb.c
+@@ -59,7 +59,7 @@ static unsigned long at91sam9x5_clk_usb_
+ static long at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw,
+                           unsigned long rate,
+                           unsigned long *best_parent_rate,
+-                          struct clk_hw **best_parent_hw)
++                          struct clk **best_parent_clk)
+ {
+     struct clk *parent = NULL;
+     long best_rate = -EINVAL;
+@@ -91,7 +91,7 @@ static long at91sam9x5_clk_usb_determine
+                 best_rate = tmp_rate;
+                 best_diff = tmp_diff;
+                 *best_parent_rate = tmp_parent_rate;
+-                *best_parent_hw = __clk_get_hw(parent);
++                *best_parent_clk = parent;
+             }
+
+             if (!best_diff || tmp_rate < rate)
--
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From yszhou4tech at gmail.com  Thu Aug 13 22:39:10 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Fri, 14 Aug 2015 10:39:10 +0800
Subject: [OpenWrt-Devel] TP-Link v3 header format description
In-Reply-To: <CABwW5nkCDRLHJhyLcC=5LFXN9wvbRz_-4tyyHDPiZY=tKdPghA@mail.gmail.com>
References: <CABwW5nkCDRLHJhyLcC=5LFXN9wvbRz_-4tyyHDPiZY=tKdPghA@mail.gmail.com>
Message-ID: <CAECwjAi3Pcr7CGr_HzCyQuWiO-agsMvLy-mzUoQU6Y9OKqsEvA@mail.gmail.com>

On 14 August 2015 at 01:49, Mathias Kresin <openwrt at kresin.me> wrote:
> Hey Weijie Gao,
>
> 2015-08-05 20:07 GMT+02:00 Weijie Gao <hackpascal at gmail.com>:
>
>> This patch adds header version 2 option for mktplinkfw.
>
> As long as we talk about the same, the new header version is v3. The
> v2 header is already covered by mktplinkfw2.c.
>
> Currently, I'm working on the same topic. Everything that is known so
> far about the new v3 header is documented in Martins repository:
> https://github.com/xdarklight/mktplinkfw3/blob/master/README.md
> (please take care of the not yet merged pull request). Maybe you can
> confirm/deny what I figured out so far or add missing informations.
>
> It would be nice, if you (or anyone else) can extend your v3 header
> creation patch, using the provided informations. It should be possible
> the write the complete verification part (-i option). For the creation
> part, (only) the private key from tp-link is missing.
>

Hi,

Never played with tplink's v3 header.  But I found on other devices
that the RSA2048-SHA1 implementation there was flawed in that it used
pubkeys from firmwares to verifying signatures.  Hmm, is it possible
that this v3 header from tplink also has such vulnerability?

                yousong

>> The version 2 header is used for AR/QCA firmwares and is not the same as
>> the header generated by mktplinkfw2.
>> Instead, it is nearly the same as version 1 header except for the header
>> version and the RSA signature.
>>
>> The header version 2 support is used for newer TP-Link routers which have
>> only a 64kb bootloader part, e.g. TL-WDR6500 v2.
>> ---
>>  tools/firmware-utils/src/mktplinkfw.c | 25 +++++++++++++++++++++----
>>  1 file changed, 21 insertions(+), 4 deletions(-)
>
> IMHO the v3 header is an extension of the v2 header, since TP-Link
> switched from v2 to v3 on already deployed devices like the
> TD-W8980v1. That's why *I* would prefer to either create a
> mktplinkfw3.c or add the required the changes to mktplinkfw2.c.
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From raven at themaw.net  Fri Aug 14 00:03:07 2015
From: raven at themaw.net (Ian Kent)
Date: Fri, 14 Aug 2015 12:03:07 +0800
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <55CBA615.60308@hauke-m.de>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>
 <20150310033038.9542.63440.stgit@perseus.themaw.net>
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>
 <1435462659.17034.23.camel@perseus.themaw.net>
 <CACna6rwaqcWndm06S8kGXUYGtHsy74Lre_xEm2oy_R6mbcO7Jg@mail.gmail.com>
 <1436955076.2904.33.camel@pluto.fritz.box> <55CBA615.60308@hauke-m.de>
Message-ID: <1439524987.2762.39.camel@pluto.fritz.box>

On Wed, 2015-08-12 at 22:01 +0200, Hauke Mehrtens wrote:
> On 07/15/2015 12:11 PM, Ian Kent wrote:
> > On Tue, 2015-07-14 at 18:19 +0200, Rafa? Mi?ecki wrote:
> >> On 28 June 2015 at 05:37, Ian Kent <raven at themaw.net> wrote:
> >>> Let me rework this using the bus number as you recommend.
> >>> I'll repost my updated patch series once I've done that.
> >>
> >> Hi Ian,
> >>
> >> Is there any chance you'll find a moment for it anytime soon? It'd be
> >> awesome to get R8000 support for CC release.
> > 
> > I have reworked the patch and a broken package build problem I had is
> > gone but I didn't get time to fix build problems with a third patch I
> > have.
> > 
> > Just didn't get time last weekend and this week has been quite busy too.
> > I'll try and get onto this in the next few days.
> > 
> > Ian
> 
> Hi Ian,
> 
> you patch looks better than the hack Broadcom did in their vendor driver.

I thought so, ;)

> 
> Could you send me a lspci output or the content of /proc/bus/pci/devices
> of the original firmware or of OpenWrt with your patch applied? I would
> prefer lspci because it is easier to read but cat from
> /proc/bus/pci/devices also works. I do not have such a device and want
> to understand how this PCIe switch looks like on the software side, so
> we can fix the domain, bus, slot, function mixup.

I haven't been able to build OpenWrt for a while now and that's why I
haven't been able to test my changes to the patch.

I really wish we could avoid committing changes that don't build but I
know it isn't that simple.

I have got some other lists (around somewhere) based on output, mostly
from the Vendor firmware, and one where I went through the devices and
listed what they are along with and their pci ids so I could try and
understand what was going on.

I could try and find that and post it if it would be useful.
Note that it was just used to understand what was what so it isn't
pretty but should have quite a bit of info in it.

There's no question the current patch is wrong so I don't recommend it
be used.

I can however post my updated patch now on the understanding that it
hasn't been tested at all, which might be good for initial review
anyway.

> 
> On the hardware side this SoC has 3 PCIe controllers, but one shares a
> PHY with the USB 3.0 controller. Instead of using the 3rd PCIe
> controller they used USB 3.0 and split one of the PCIe controllers into
> 2 PCIE lanes.

Right, I didn't get that, mmm ...

Ian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From greatarbor at gmail.com  Fri Aug 14 03:07:13 2015
From: greatarbor at gmail.com (Ashok Rao)
Date: Fri, 14 Aug 2015 12:37:13 +0530
Subject: [OpenWrt-Devel] Request for Support for namespaces in uci and netifd
Message-ID: <CAEapxrXVNbzeR_3rVzjNP2HfxTcgWRaSAvuM0=1RjpMw5aEeMA@mail.gmail.com>

I've started playing around with namespaces and it is quite powerful.
Allows one to build multiple routers and connect them all inside the same
low cost router platform.

However there doesn't seem to be any support for namespace in the config
files and generally within openwrt so  developing a package which uses
namespaces requires quite a few hacks.  For example running a dhcp client
on  an interface on a different non-default namespace requires some work -
for an example see
https://forum.openwrt.org/viewtopic.php?id=53332



Ashok
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150814/619e6245/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nicholas.e.podolak at gmail.com  Fri Aug 14 11:20:34 2015
From: nicholas.e.podolak at gmail.com (Nick Podolak)
Date: Fri, 14 Aug 2015 11:20:34 -0400
Subject: [OpenWrt-Devel] GRE and multicast in netifd
Message-ID: <CABB0dw1uShY7VOEVgoJag4+Wcmks5WELRzedPmLr+1Vz-cSXaA@mail.gmail.com>

Is there a way using uci/netifd to create a GRE tunnel with the
multicast link flag enabled?

I can make a tunnel and then use #>ip link set dev gre-test multicast on
but I can't seem to find how to do it any other, preferable autoamtic, way.

Even if there is a way to make multicast=on the global default I'm
fine with that.  I have no use for GRE without multicast!

-Nick
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Fri Aug 14 13:55:02 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Fri, 14 Aug 2015 19:55:02 +0200
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <1439524987.2762.39.camel@pluto.fritz.box>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>	
 <20150310033038.9542.63440.stgit@perseus.themaw.net>	
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>	
 <1435462659.17034.23.camel@perseus.themaw.net>	
 <CACna6rwaqcWndm06S8kGXUYGtHsy74Lre_xEm2oy_R6mbcO7Jg@mail.gmail.com>	
 <1436955076.2904.33.camel@pluto.fritz.box> <55CBA615.60308@hauke-m.de>
 <1439524987.2762.39.camel@pluto.fritz.box>
Message-ID: <55CE2B76.4040306@hauke-m.de>

On 08/14/2015 06:03 AM, Ian Kent wrote:
> On Wed, 2015-08-12 at 22:01 +0200, Hauke Mehrtens wrote:
>> On 07/15/2015 12:11 PM, Ian Kent wrote:
>>> On Tue, 2015-07-14 at 18:19 +0200, Rafa? Mi?ecki wrote:
>>>> On 28 June 2015 at 05:37, Ian Kent <raven at themaw.net> wrote:
>>>>> Let me rework this using the bus number as you recommend.
>>>>> I'll repost my updated patch series once I've done that.
>>>>
>>>> Hi Ian,
>>>>
>>>> Is there any chance you'll find a moment for it anytime soon? It'd be
>>>> awesome to get R8000 support for CC release.
>>>
>>> I have reworked the patch and a broken package build problem I had is
>>> gone but I didn't get time to fix build problems with a third patch I
>>> have.
>>>
>>> Just didn't get time last weekend and this week has been quite busy too.
>>> I'll try and get onto this in the next few days.
>>>
>>> Ian
>>
>> Hi Ian,
>>
>> you patch looks better than the hack Broadcom did in their vendor driver.
> 
> I thought so, ;)
> 
>>
>> Could you send me a lspci output or the content of /proc/bus/pci/devices
>> of the original firmware or of OpenWrt with your patch applied? I would
>> prefer lspci because it is easier to read but cat from
>> /proc/bus/pci/devices also works. I do not have such a device and want
>> to understand how this PCIe switch looks like on the software side, so
>> we can fix the domain, bus, slot, function mixup.
> 
> I haven't been able to build OpenWrt for a while now and that's why I
> haven't been able to test my changes to the patch.

I haven't noticed a problem in the OpenWrt build system, do you still
have this problem? Have you tried to clean and rebuild again?

> I really wish we could avoid committing changes that don't build but I
> know it isn't that simple.
> 
> I have got some other lists (around somewhere) based on output, mostly
> from the Vendor firmware, and one where I went through the devices and
> listed what they are along with and their pci ids so I could try and
> understand what was going on.

I found some boot log of OpenWrt in the OpenWrt forum in this post, it
shows how the PCIe devices are looking without your patch.
https://forum.openwrt.org/viewtopic.php?pid=269905#p269905
I am used to search for some boot logs random people posted on the
Internet. ;-)

> I could try and find that and post it if it would be useful.
> Note that it was just used to understand what was what so it isn't
> pretty but should have quite a bit of info in it.
> 
> There's no question the current patch is wrong so I don't recommend it
> be used.
> 
> I can however post my updated patch now on the understanding that it
> hasn't been tested at all, which might be good for initial review
> anyway.
> 
>>
>> On the hardware side this SoC has 3 PCIe controllers, but one shares a
>> PHY with the USB 3.0 controller. Instead of using the 3rd PCIe
>> controller they used USB 3.0 and split one of the PCIe controllers into
>> 2 PCIE lanes.
> 
> Right, I didn't get that, mmm ...

With kernel 4.1 OpenWrt switched to a different PICe driver, which is
also in the mainline kernel and supported by Broadcom.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jogo at openwrt.org  Fri Aug 14 14:46:59 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 14 Aug 2015 20:46:59 +0200
Subject: [OpenWrt-Devel] [PATCH 1/9] CC PowerCloud CAP324 Kernel BSP
In-Reply-To: <20150811030612.013FC23A1549@danielcent.thecshore.com>
References: <20150811030612.013FC23A1549@danielcent.thecshore.com>
Message-ID: <CAOiHx==f=gprvZrEp744AM9N2wkiA1dYZX=AtOMiTN0Dx+VNOA@mail.gmail.com>

Welcome back ;)

On Sun, Aug 2, 2015 at 7:03 AM, Daniel Dickinson
<openwrt at daniel.thecshore.com> wrote:
> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>

Drop the CC from the subject; it's used for patches for the
chaos_chalmer branch, while this is for trunk.

A small description of the device would be nice to have, try not to
have an empty commit message.

> ---
>  target/linux/ar71xx/config-4.1                     |   1 +
>  .../814-MIPS-ath79-add-cap324-support.patch        | 183 +++++++++++++++++++++
>  2 files changed, 184 insertions(+)
>  create mode 100644 target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch
>
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index 1e31a01..c01ec6e 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -47,6 +47,7 @@ CONFIG_ATH79_MACH_AP96=y
>  CONFIG_ATH79_MACH_ARCHER_C7=y
>  CONFIG_ATH79_MACH_AW_NR580=y
>  CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
> +CONFIG_ATH79_MACH_CAP324=y
>  CONFIG_ATH79_MACH_CAP4200AG=y
>  CONFIG_ATH79_MACH_CARAMBOLA2=y
>  CONFIG_ATH79_MACH_CPE510=y

Please make sure the board *isn't* enabled for the nand and mikrotik subtargets.

> diff --git a/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch
> new file mode 100644
> index 0000000..62e36c5
> --- /dev/null
> +++ b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-cap324-support.patch
> @@ -0,0 +1,183 @@
> +Index: linux-4.1.3/arch/mips/ath79/Kconfig
> +===================================================================
> +--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
> ++++ linux-4.1.3/arch/mips/ath79/Kconfig

please refresh your patches so they use the standard

a/foo/bar
b/foo/bar

for the paths.

(a simple make target/linux/refresh is enough).


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


From jogo at openwrt.org  Fri Aug 14 14:51:45 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 14 Aug 2015 20:51:45 +0200
Subject: [OpenWrt-Devel] [PATCH 7/9] CC PowerCloud CR5000 Kernel BSP
In-Reply-To: <20150811030612.1C0B223A1552@danielcent.thecshore.com>
References: <20150811030612.1C0B223A1552@danielcent.thecshore.com>
Message-ID: <CAOiHx=moazowRTpUb2TNDJYpVf2rrSw6s58Xdg9Qj9+LzyJC4A@mail.gmail.com>

On Sun, Aug 2, 2015 at 9:30 AM, Daniel Dickinson
<openwrt at daniel.thecshore.com> wrote:
Eh, also replace the "BSP" with "support", at least when I hear BSP I
am thinking of a full build environment, not just a single kernel
patch.

> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
> ---
>  target/linux/ar71xx/config-4.1                     |   1 +
>  .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
>  2 files changed, 231 insertions(+)
>  create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
>
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index f42a65d..e78217b 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
>  CONFIG_ATH79_MACH_CARAMBOLA2=y
>  CONFIG_ATH79_MACH_CPE510=y
>  CONFIG_ATH79_MACH_CR3000=y
> +CONFIG_ATH79_MACH_CR5000=y
>  CONFIG_ATH79_MACH_DB120=y
>  CONFIG_ATH79_MACH_DGL_5500_A1=y
>  CONFIG_ATH79_MACH_DHP_1565_A1=y
> diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
> new file mode 100644
> index 0000000..f0fc00b
> --- /dev/null
> +++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
> @@ -0,0 +1,230 @@
> +Index: linux-4.1.3/arch/mips/ath79/Kconfig
> +===================================================================
> +--- linux-4.1.3.orig/arch/mips/ath79/Kconfig
> ++++ linux-4.1.3/arch/mips/ath79/Kconfig
> +@@ -916,6 +916,17 @@ config ATH79_MACH_CR3000
> +       select ATH79_DEV_M25P80
> +       select ATH79_DEV_WMAC
> +
> ++config ATH79_MACH_CR3000

I think this should be CR*5*000.

> ++      bool "PowerCloud Systems CR5000 support"
> ++      select SOC_AR934X
> ++      select ATH79_DEV_AP9X_PCI if PCI
> ++      select ATH79_DEV_ETH
> ++      select ATH79_DEV_GPIO_BUTTONS
> ++      select ATH79_DEV_LEDS_GPIO
> ++      select ATH79_DEV_M25P80
> ++      select ATH79_DEV_USB
> ++      select ATH79_DEV_WMAC
> ++
> + config ATH79_MACH_EAP7660D
> +       bool "Senao EAP7660D support"
> +       select SOC_AR71XX


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


From mathieu at codeaurora.org  Fri Aug 14 20:50:39 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Fri, 14 Aug 2015 17:50:39 -0700
Subject: [OpenWrt-Devel] [PATCH 0/5] ipq806x: add support for SMEM based MTD
	parser
Message-ID: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>

This patch sets intents to add a new MTD parser for QCOM parser which
makes use of the information available in SMEM to provide the flash
layout. We're also cherry-picking drivers for SMEM & HW spinlocks from
LKML as dependencies.

This has been tested on AP148, both for NOR & NAND flash. The MTD layout
was detected accurately on both boot methods.

v2:
*rebased and fix conflicts with previous patches
*renamed patch files according to their LKML names
*updated the SMEM parser with comments provided on LKML

Mathieu Olivari (5):
  kernel: move linux,part-probe dt parsing in generic code
  ipq806x: add hwspinlock support
  ipq806x: add SMEM support
  ipq806x: add QCOM SMEM based MTD parser
  ipq806x: switch AP148 to using SMEM based MTD parser

 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 -----
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++
 .../400-mtd-add-rootfs-split-support.patch         |  16 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch        |   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
 .../411-mtd-partial_eraseblock_write.patch         |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++
 .../400-mtd-add-rootfs-split-support.patch         |  15 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch        |   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
 .../411-mtd-partial_eraseblock_write.patch         |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
 target/linux/ipq806x/config-3.18                   |   4 +
 target/linux/ipq806x/config-4.1                    |   8 +-
 .../patches-3.18/021-add-ap148-partitions.patch    |  34 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 ++++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 ++++++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  20 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +++++++++++++++++++++
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  26 +
 .../037-mtd-add-qcom-smem-parser.patch             | 253 +++++++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   8 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   6 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch    |   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   4 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-4.1/021-add-ap148-partitions.patch     |  34 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 ++++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 ++++++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  21 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +++++++++++++++++++++
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  27 +
 .../patches-4.1/037-mtd-add-qcom-smem-parser.patch | 253 +++++++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch     |   6 +-
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |   4 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   4 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   4 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 56 files changed, 3765 insertions(+), 313 deletions(-)
 delete mode 100644 target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/037-mtd-add-qcom-smem-parser.patch

-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Fri Aug 14 20:50:40 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Fri, 14 Aug 2015 17:50:40 -0700
Subject: [OpenWrt-Devel] [PATCH 1/5] kernel: move linux,
	part-probe dt parsing in generic code
In-Reply-To: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
References: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439599844-4387-2-git-send-email-mathieu@codeaurora.org>

The "linux,part-probe" dts parsing is a pretty neat generic feature.
It has been posted to kernel.org and could easily be reused by all
targets.

This change moves the patch to the 3.18 and 4.1 generic folders, and
makes the feature available to all platforms who may want to use it.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 ---------------------
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++++++++++++++++++
 .../400-mtd-add-rootfs-split-support.patch         |  16 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch        |   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
 .../411-mtd-partial_eraseblock_write.patch         |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++++++++++++++++++
 .../400-mtd-add-rootfs-split-support.patch         |  15 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch        |   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
 .../411-mtd-partial_eraseblock_write.patch         |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
 19 files changed, 400 insertions(+), 224 deletions(-)
 delete mode 100644 target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch

diff --git a/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
deleted file mode 100644
index 686696e..0000000
--- a/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-From 173b0add0cff6558f950c0cb1eacfb729d482711 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke at hauke-m.de>
-Date: Sun, 17 May 2015 18:48:38 +0200
-Subject: [PATCH 4/8] mtd: part: add generic parsing of linux,part-probe
-
-This moves the linux,part-probe device tree parsing code from
-physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
-providing a reference to their device tree node in struct
-mtd_part_parser_data.
-
-Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
----
- Documentation/devicetree/bindings/mtd/nand.txt | 16 ++++++++++
- drivers/mtd/maps/physmap_of.c                  | 40 +-----------------------
- drivers/mtd/mtdpart.c                          | 43 ++++++++++++++++++++++++++
- 3 files changed, 60 insertions(+), 39 deletions(-)
-
---- a/Documentation/devicetree/bindings/mtd/nand.txt
-+++ b/Documentation/devicetree/bindings/mtd/nand.txt
-@@ -12,6 +12,22 @@
- - nand-ecc-step-size: integer representing the number of data bytes
- 		      that are covered by a single ECC step.
- 
-+- linux,part-probe: list of name as strings of the partition parser
-+		    which should be used to parse the partition table.
-+		    They will be tried in the specified ordering and
-+		    the next one will be used if the previous one
-+		    failed.
-+
-+		    Example: linux,part-probe = "cmdlinepart", "ofpart";
-+
-+		    This is also the default value, which will be used
-+		    if this attribute is not specified. It could be
-+		    that the flash driver in use overwrote the default
-+		    value and uses some other default.
-+
-+		    Possible values are: bcm47xxpart, afs, ar7part,
-+		    ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart
-+
- The ECC strength and ECC step size properties define the correction capability
- of a controller. Together, they say a controller can correct "{strength} bit
- errors per {size} bytes".
---- a/drivers/mtd/maps/physmap_of.c
-+++ b/drivers/mtd/maps/physmap_of.c
-@@ -112,45 +112,9 @@ static struct mtd_info *obsolete_probe(s
- static const char * const part_probe_types_def[] = {
- 	"cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
- 
--static const char * const *of_get_probes(struct device_node *dp)
--{
--	const char *cp;
--	int cplen;
--	unsigned int l;
--	unsigned int count;
--	const char **res;
--
--	cp = of_get_property(dp, "linux,part-probe", &cplen);
--	if (cp == NULL)
--		return part_probe_types_def;
--
--	count = 0;
--	for (l = 0; l != cplen; l++)
--		if (cp[l] == 0)
--			count++;
--
--	res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL);
--	count = 0;
--	while (cplen > 0) {
--		res[count] = cp;
--		l = strlen(cp) + 1;
--		cp += l;
--		cplen -= l;
--		count++;
--	}
--	return res;
--}
--
--static void of_free_probes(const char * const *probes)
--{
--	if (probes != part_probe_types_def)
--		kfree(probes);
--}
--
- static struct of_device_id of_flash_match[];
- static int of_flash_probe(struct platform_device *dev)
- {
--	const char * const *part_probe_types;
- 	const struct of_device_id *match;
- 	struct device_node *dp = dev->dev.of_node;
- 	struct resource res;
-@@ -310,10 +274,8 @@ static int of_flash_probe(struct platfor
- 		goto err_out;
- 
- 	ppdata.of_node = dp;
--	part_probe_types = of_get_probes(dp);
--	mtd_device_parse_register(info->cmtd, part_probe_types, &ppdata,
-+	mtd_device_parse_register(info->cmtd, part_probe_types_def, &ppdata,
- 			NULL, 0);
--	of_free_probes(part_probe_types);
- 
- 	kfree(mtd_list);
- 
---- a/drivers/mtd/mtdpart.c
-+++ b/drivers/mtd/mtdpart.c
-@@ -29,6 +29,7 @@
- #include <linux/kmod.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/partitions.h>
-+#include <linux/of.h>
- #include <linux/magic.h>
- #include <linux/err.h>
- #include <linux/kconfig.h>
-@@ -992,6 +993,40 @@ void deregister_mtd_parser(struct mtd_pa
- EXPORT_SYMBOL_GPL(deregister_mtd_parser);
- 
- /*
-+ * Parses the linux,part-probe device tree property.
-+ * When a non null value is returned it has to be freed with kfree() by
-+ * the caller.
-+ */
-+static const char * const *of_get_probes(struct device_node *dp)
-+{
-+	const char *cp;
-+	int cplen;
-+	unsigned int l;
-+	unsigned int count;
-+	const char **res;
-+
-+	cp = of_get_property(dp, "linux,part-probe", &cplen);
-+	if (cp == NULL)
-+		return NULL;
-+
-+	count = 0;
-+	for (l = 0; l != cplen; l++)
-+		if (cp[l] == 0)
-+			count++;
-+
-+	res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL);
-+	count = 0;
-+	while (cplen > 0) {
-+		res[count] = cp;
-+		l = strlen(cp) + 1;
-+		cp += l;
-+		cplen -= l;
-+		count++;
-+	}
-+	return res;
-+}
-+
-+/*
-  * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
-  * are changing this array!
-  */
-@@ -1027,6 +1062,13 @@ int parse_mtd_partitions(struct mtd_info
- {
- 	struct mtd_part_parser *parser;
- 	int ret = 0;
-+	const char *const *types_of = NULL;
-+
-+	if (data && data->of_node) {
-+		types_of = of_get_probes(data->of_node);
-+		if (types_of != NULL)
-+			types = types_of;
-+	}
- 
- 	if (!types)
- 		types = default_mtd_part_types;
-@@ -1045,6 +1087,7 @@ int parse_mtd_partitions(struct mtd_info
- 			break;
- 		}
- 	}
-+	kfree(types_of);
- 	return ret;
- }
- 
diff --git a/target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
new file mode 100644
index 0000000..bd34f96
--- /dev/null
+++ b/target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
@@ -0,0 +1,175 @@
+From 173b0add0cff6558f950c0cb1eacfb729d482711 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Sun, 17 May 2015 18:48:38 +0200
+Subject: [PATCH 4/8] mtd: part: add generic parsing of linux,part-probe
+
+This moves the linux,part-probe device tree parsing code from
+physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
+providing a reference to their device tree node in struct
+mtd_part_parser_data.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ Documentation/devicetree/bindings/mtd/nand.txt | 16 ++++++++++
+ drivers/mtd/maps/physmap_of.c                  | 40 +-----------------------
+ drivers/mtd/mtdpart.c                          | 43 ++++++++++++++++++++++++++
+ 3 files changed, 60 insertions(+), 39 deletions(-)
+
+--- a/Documentation/devicetree/bindings/mtd/nand.txt
++++ b/Documentation/devicetree/bindings/mtd/nand.txt
+@@ -12,6 +12,22 @@
+ - nand-ecc-step-size: integer representing the number of data bytes
+ 		      that are covered by a single ECC step.
+ 
++- linux,part-probe: list of name as strings of the partition parser
++		    which should be used to parse the partition table.
++		    They will be tried in the specified ordering and
++		    the next one will be used if the previous one
++		    failed.
++
++		    Example: linux,part-probe = "cmdlinepart", "ofpart";
++
++		    This is also the default value, which will be used
++		    if this attribute is not specified. It could be
++		    that the flash driver in use overwrote the default
++		    value and uses some other default.
++
++		    Possible values are: bcm47xxpart, afs, ar7part,
++		    ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart
++
+ The ECC strength and ECC step size properties define the correction capability
+ of a controller. Together, they say a controller can correct "{strength} bit
+ errors per {size} bytes".
+--- a/drivers/mtd/maps/physmap_of.c
++++ b/drivers/mtd/maps/physmap_of.c
+@@ -114,45 +114,9 @@ static struct mtd_info *obsolete_probe(s
+ static const char * const part_probe_types_def[] = {
+ 	"cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
+ 
+-static const char * const *of_get_probes(struct device_node *dp)
+-{
+-	const char *cp;
+-	int cplen;
+-	unsigned int l;
+-	unsigned int count;
+-	const char **res;
+-
+-	cp = of_get_property(dp, "linux,part-probe", &cplen);
+-	if (cp == NULL)
+-		return part_probe_types_def;
+-
+-	count = 0;
+-	for (l = 0; l != cplen; l++)
+-		if (cp[l] == 0)
+-			count++;
+-
+-	res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL);
+-	count = 0;
+-	while (cplen > 0) {
+-		res[count] = cp;
+-		l = strlen(cp) + 1;
+-		cp += l;
+-		cplen -= l;
+-		count++;
+-	}
+-	return res;
+-}
+-
+-static void of_free_probes(const char * const *probes)
+-{
+-	if (probes != part_probe_types_def)
+-		kfree(probes);
+-}
+-
+ static struct of_device_id of_flash_match[];
+ static int of_flash_probe(struct platform_device *dev)
+ {
+-	const char * const *part_probe_types;
+ 	const struct of_device_id *match;
+ 	struct device_node *dp = dev->dev.of_node;
+ 	struct resource res;
+@@ -302,10 +266,8 @@ static int of_flash_probe(struct platfor
+ 		goto err_out;
+ 
+ 	ppdata.of_node = dp;
+-	part_probe_types = of_get_probes(dp);
+-	mtd_device_parse_register(info->cmtd, part_probe_types, &ppdata,
++	mtd_device_parse_register(info->cmtd, part_probe_types_def, &ppdata,
+ 			NULL, 0);
+-	of_free_probes(part_probe_types);
+ 
+ 	kfree(mtd_list);
+ 
+--- a/drivers/mtd/mtdpart.c
++++ b/drivers/mtd/mtdpart.c
+@@ -29,6 +29,7 @@
+ #include <linux/kmod.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
++#include <linux/of.h>
+ #include <linux/err.h>
+ 
+ #include "mtdcore.h"
+@@ -702,6 +703,40 @@ void deregister_mtd_parser(struct mtd_pa
+ EXPORT_SYMBOL_GPL(deregister_mtd_parser);
+ 
+ /*
++ * Parses the linux,part-probe device tree property.
++ * When a non null value is returned it has to be freed with kfree() by
++ * the caller.
++ */
++static const char * const *of_get_probes(struct device_node *dp)
++{
++	const char *cp;
++	int cplen;
++	unsigned int l;
++	unsigned int count;
++	const char **res;
++
++	cp = of_get_property(dp, "linux,part-probe", &cplen);
++	if (cp == NULL)
++		return NULL;
++
++	count = 0;
++	for (l = 0; l != cplen; l++)
++		if (cp[l] == 0)
++			count++;
++
++	res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL);
++	count = 0;
++	while (cplen > 0) {
++		res[count] = cp;
++		l = strlen(cp) + 1;
++		cp += l;
++		cplen -= l;
++		count++;
++	}
++	return res;
++}
++
++/*
+  * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
+  * are changing this array!
+  */
+@@ -737,6 +772,13 @@ int parse_mtd_partitions(struct mtd_info
+ {
+ 	struct mtd_part_parser *parser;
+ 	int ret = 0;
++	const char *const *types_of = NULL;
++
++	if (data && data->of_node) {
++		types_of = of_get_probes(data->of_node);
++		if (types_of != NULL)
++			types = types_of;
++	}
+ 
+ 	if (!types)
+ 		types = default_mtd_part_types;
+@@ -755,6 +797,7 @@ int parse_mtd_partitions(struct mtd_info
+ 			break;
+ 		}
+ 	}
++	kfree(types_of);
+ 	return ret;
+ }
+ 
diff --git a/target/linux/generic/patches-3.18/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/patches-3.18/400-mtd-add-rootfs-split-support.patch
index bf69a35..0a6e134 100644
--- a/target/linux/generic/patches-3.18/400-mtd-add-rootfs-split-support.patch
+++ b/target/linux/generic/patches-3.18/400-mtd-add-rootfs-split-support.patch
@@ -26,10 +26,10 @@
  	depends on m
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -29,9 +29,11 @@
- #include <linux/kmod.h>
+@@ -30,9 +30,11 @@
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/partitions.h>
+ #include <linux/of.h>
 +#include <linux/magic.h>
  #include <linux/err.h>
  
@@ -38,7 +38,7 @@
  
  /* Our partition linked list */
  static LIST_HEAD(mtd_partitions);
-@@ -45,13 +47,14 @@ struct mtd_part {
+@@ -46,13 +48,14 @@ struct mtd_part {
  	struct list_head list;
  };
  
@@ -54,7 +54,7 @@
  /*
   * MTD methods which simply translate the effective address and pass through
   * to the _real_ device.
-@@ -547,8 +550,10 @@ out_register:
+@@ -548,8 +551,10 @@ out_register:
  	return slave;
  }
  
@@ -67,7 +67,7 @@
  {
  	struct mtd_partition part;
  	struct mtd_part *p, *new;
-@@ -580,21 +585,24 @@ int mtd_add_partition(struct mtd_info *m
+@@ -581,21 +586,24 @@ int mtd_add_partition(struct mtd_info *m
  	end = offset + length;
  
  	mutex_lock(&mtd_partitions_mutex);
@@ -102,7 +102,7 @@
  
  	return ret;
  err_inv:
-@@ -604,6 +612,12 @@ err_inv:
+@@ -605,6 +613,12 @@ err_inv:
  }
  EXPORT_SYMBOL_GPL(mtd_add_partition);
  
@@ -115,7 +115,7 @@
  int mtd_del_partition(struct mtd_info *master, int partno)
  {
  	struct mtd_part *slave, *next;
-@@ -627,6 +641,35 @@ int mtd_del_partition(struct mtd_info *m
+@@ -628,6 +642,35 @@ int mtd_del_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_del_partition);
  
@@ -151,7 +151,7 @@
  /*
   * This function, given a master MTD object and a partition table, creates
   * and registers slave MTD objects which are bound to the master according to
-@@ -656,6 +699,7 @@ int add_mtd_partitions(struct mtd_info *
+@@ -657,6 +700,7 @@ int add_mtd_partitions(struct mtd_info *
  		mutex_unlock(&mtd_partitions_mutex);
  
  		add_mtd_device(&slave->mtd);
diff --git a/target/linux/generic/patches-3.18/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/patches-3.18/401-mtd-add-support-for-different-partition-parser-types.patch
index 2ddcbff..6842341 100644
--- a/target/linux/generic/patches-3.18/401-mtd-add-support-for-different-partition-parser-types.patch
+++ b/target/linux/generic/patches-3.18/401-mtd-add-support-for-different-partition-parser-types.patch
@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
 
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -729,6 +729,30 @@ static struct mtd_part_parser *get_parti
+@@ -730,6 +730,30 @@ static struct mtd_part_parser *get_parti
  
  #define put_partition_parser(p) do { module_put((p)->owner); } while (0)
  
@@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
  void register_mtd_parser(struct mtd_part_parser *p)
  {
  	spin_lock(&part_parser_lock);
-@@ -802,6 +826,38 @@ int parse_mtd_partitions(struct mtd_info
+@@ -845,6 +869,38 @@ int parse_mtd_partitions(struct mtd_info
  	return ret;
  }
  
diff --git a/target/linux/generic/patches-3.18/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/patches-3.18/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
index 4d99422..dead0fb 100644
--- a/target/linux/generic/patches-3.18/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
+++ b/target/linux/generic/patches-3.18/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -641,6 +641,37 @@ int mtd_del_partition(struct mtd_info *m
+@@ -642,6 +642,37 @@ int mtd_del_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_del_partition);
  
@@ -38,7 +38,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -649,6 +680,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
+@@ -650,6 +681,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
@@ -46,7 +46,7 @@
  }
  
  void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
-@@ -663,6 +695,12 @@ static void mtd_partition_split(struct m
+@@ -664,6 +696,12 @@ static void mtd_partition_split(struct m
  	if (rootfs_found)
  		return;
  
diff --git a/target/linux/generic/patches-3.18/404-mtd-add-more-helper-functions.patch b/target/linux/generic/patches-3.18/404-mtd-add-more-helper-functions.patch
index d7c3801..b2f62c1 100644
--- a/target/linux/generic/patches-3.18/404-mtd-add-more-helper-functions.patch
+++ b/target/linux/generic/patches-3.18/404-mtd-add-more-helper-functions.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -445,14 +445,12 @@ static struct mtd_part *allocate_partiti
+@@ -446,14 +446,12 @@ static struct mtd_part *allocate_partiti
  	if (slave->offset == MTDPART_OFS_APPEND)
  		slave->offset = cur_offset;
  	if (slave->offset == MTDPART_OFS_NXTBLK) {
@@ -18,7 +18,7 @@
  	}
  	if (slave->offset == MTDPART_OFS_RETAIN) {
  		slave->offset = cur_offset;
-@@ -672,6 +670,17 @@ run_parsers_by_type(struct mtd_part *sla
+@@ -673,6 +671,17 @@ run_parsers_by_type(struct mtd_part *sla
  	return nr_parts;
  }
  
@@ -36,7 +36,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -913,6 +922,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -956,6 +965,24 @@ int mtd_is_partition(const struct mtd_in
  }
  EXPORT_SYMBOL_GPL(mtd_is_partition);
  
diff --git a/target/linux/generic/patches-3.18/405-mtd-old-firmware-uimage-splitter.patch b/target/linux/generic/patches-3.18/405-mtd-old-firmware-uimage-splitter.patch
index df1d726..7e74c4e 100644
--- a/target/linux/generic/patches-3.18/405-mtd-old-firmware-uimage-splitter.patch
+++ b/target/linux/generic/patches-3.18/405-mtd-old-firmware-uimage-splitter.patch
@@ -14,7 +14,7 @@
  endmenu
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -681,6 +681,37 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -682,6 +682,37 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  	return len;
  }
  
@@ -52,7 +52,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -689,7 +720,14 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -690,7 +721,14 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
diff --git a/target/linux/generic/patches-3.18/406-mtd-old-rootfs-squashfs-splitter.patch b/target/linux/generic/patches-3.18/406-mtd-old-rootfs-squashfs-splitter.patch
index ca81958..cc548ef 100644
--- a/target/linux/generic/patches-3.18/406-mtd-old-rootfs-squashfs-splitter.patch
+++ b/target/linux/generic/patches-3.18/406-mtd-old-rootfs-squashfs-splitter.patch
@@ -14,7 +14,7 @@
  	default y
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -681,6 +681,47 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -682,6 +682,47 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  	return len;
  }
  
@@ -62,7 +62,7 @@
  #define UBOOT_MAGIC	0x27051956
  
  static void split_uimage(struct mtd_info *master, struct mtd_part *part)
-@@ -743,7 +784,10 @@ static void mtd_partition_split(struct m
+@@ -744,7 +785,10 @@ static void mtd_partition_split(struct m
  		return;
  
  	if (!strcmp(part->mtd.name, "rootfs")) {
diff --git a/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch
index 7692d3d..5d5c6ed 100644
--- a/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch
+++ b/target/linux/generic/patches-3.18/411-mtd-partial_eraseblock_write.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -35,6 +35,8 @@
+@@ -36,6 +36,8 @@
  #include "mtdcore.h"
  #include "mtdsplit/mtdsplit.h"
  
@@ -9,7 +9,7 @@
  /* Our partition linked list */
  static LIST_HEAD(mtd_partitions);
  static DEFINE_MUTEX(mtd_partitions_mutex);
-@@ -233,13 +235,61 @@ static int part_erase(struct mtd_info *m
+@@ -234,13 +236,61 @@ static int part_erase(struct mtd_info *m
  	struct mtd_part *part = PART(mtd);
  	int ret;
  
@@ -71,7 +71,7 @@
  	return ret;
  }
  
-@@ -247,7 +297,25 @@ void mtd_erase_callback(struct erase_inf
+@@ -248,7 +298,25 @@ void mtd_erase_callback(struct erase_inf
  {
  	if (instr->mtd->_erase == part_erase) {
  		struct mtd_part *part = PART(instr->mtd);
@@ -97,7 +97,7 @@
  		if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
  			instr->fail_addr -= part->offset;
  		instr->addr -= part->offset;
-@@ -514,17 +582,20 @@ static struct mtd_part *allocate_partiti
+@@ -515,17 +583,20 @@ static struct mtd_part *allocate_partiti
  	if ((slave->mtd.flags & MTD_WRITEABLE) &&
  	    mtd_mod_by_eb(slave->offset, &slave->mtd)) {
  		/* Doesn't start on a boundary of major erase size */
diff --git a/target/linux/generic/patches-3.18/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/patches-3.18/412-mtd-partial_eraseblock_unlock.patch
index ba45acc..62f9d5b 100644
--- a/target/linux/generic/patches-3.18/412-mtd-partial_eraseblock_unlock.patch
+++ b/target/linux/generic/patches-3.18/412-mtd-partial_eraseblock_unlock.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -334,7 +334,14 @@ static int part_lock(struct mtd_info *mt
+@@ -335,7 +335,14 @@ static int part_lock(struct mtd_info *mt
  static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
  {
  	struct mtd_part *part = PART(mtd);
diff --git a/target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
new file mode 100644
index 0000000..18ec833
--- /dev/null
+++ b/target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
@@ -0,0 +1,175 @@
+From 173b0add0cff6558f950c0cb1eacfb729d482711 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Sun, 17 May 2015 18:48:38 +0200
+Subject: [PATCH 4/8] mtd: part: add generic parsing of linux,part-probe
+
+This moves the linux,part-probe device tree parsing code from
+physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
+providing a reference to their device tree node in struct
+mtd_part_parser_data.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ Documentation/devicetree/bindings/mtd/nand.txt | 16 ++++++++++
+ drivers/mtd/maps/physmap_of.c                  | 40 +-----------------------
+ drivers/mtd/mtdpart.c                          | 43 ++++++++++++++++++++++++++
+ 3 files changed, 60 insertions(+), 39 deletions(-)
+
+--- a/Documentation/devicetree/bindings/mtd/nand.txt
++++ b/Documentation/devicetree/bindings/mtd/nand.txt
+@@ -12,6 +12,22 @@
+ - nand-ecc-step-size: integer representing the number of data bytes
+ 		      that are covered by a single ECC step.
+ 
++- linux,part-probe: list of name as strings of the partition parser
++		    which should be used to parse the partition table.
++		    They will be tried in the specified ordering and
++		    the next one will be used if the previous one
++		    failed.
++
++		    Example: linux,part-probe = "cmdlinepart", "ofpart";
++
++		    This is also the default value, which will be used
++		    if this attribute is not specified. It could be
++		    that the flash driver in use overwrote the default
++		    value and uses some other default.
++
++		    Possible values are: bcm47xxpart, afs, ar7part,
++		    ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart
++
+ The ECC strength and ECC step size properties define the correction capability
+ of a controller. Together, they say a controller can correct "{strength} bit
+ errors per {size} bytes".
+--- a/drivers/mtd/maps/physmap_of.c
++++ b/drivers/mtd/maps/physmap_of.c
+@@ -112,45 +112,9 @@ static struct mtd_info *obsolete_probe(s
+ static const char * const part_probe_types_def[] = {
+ 	"cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
+ 
+-static const char * const *of_get_probes(struct device_node *dp)
+-{
+-	const char *cp;
+-	int cplen;
+-	unsigned int l;
+-	unsigned int count;
+-	const char **res;
+-
+-	cp = of_get_property(dp, "linux,part-probe", &cplen);
+-	if (cp == NULL)
+-		return part_probe_types_def;
+-
+-	count = 0;
+-	for (l = 0; l != cplen; l++)
+-		if (cp[l] == 0)
+-			count++;
+-
+-	res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL);
+-	count = 0;
+-	while (cplen > 0) {
+-		res[count] = cp;
+-		l = strlen(cp) + 1;
+-		cp += l;
+-		cplen -= l;
+-		count++;
+-	}
+-	return res;
+-}
+-
+-static void of_free_probes(const char * const *probes)
+-{
+-	if (probes != part_probe_types_def)
+-		kfree(probes);
+-}
+-
+ static struct of_device_id of_flash_match[];
+ static int of_flash_probe(struct platform_device *dev)
+ {
+-	const char * const *part_probe_types;
+ 	const struct of_device_id *match;
+ 	struct device_node *dp = dev->dev.of_node;
+ 	struct resource res;
+@@ -310,10 +274,8 @@ static int of_flash_probe(struct platfor
+ 		goto err_out;
+ 
+ 	ppdata.of_node = dp;
+-	part_probe_types = of_get_probes(dp);
+-	mtd_device_parse_register(info->cmtd, part_probe_types, &ppdata,
++	mtd_device_parse_register(info->cmtd, part_probe_types_def, &ppdata,
+ 			NULL, 0);
+-	of_free_probes(part_probe_types);
+ 
+ 	kfree(mtd_list);
+ 
+--- a/drivers/mtd/mtdpart.c
++++ b/drivers/mtd/mtdpart.c
+@@ -29,6 +29,7 @@
+ #include <linux/kmod.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
++#include <linux/of.h>
+ #include <linux/err.h>
+ #include <linux/kconfig.h>
+ 
+@@ -719,6 +720,40 @@ void deregister_mtd_parser(struct mtd_pa
+ EXPORT_SYMBOL_GPL(deregister_mtd_parser);
+ 
+ /*
++ * Parses the linux,part-probe device tree property.
++ * When a non null value is returned it has to be freed with kfree() by
++ * the caller.
++ */
++static const char * const *of_get_probes(struct device_node *dp)
++{
++	const char *cp;
++	int cplen;
++	unsigned int l;
++	unsigned int count;
++	const char **res;
++
++	cp = of_get_property(dp, "linux,part-probe", &cplen);
++	if (cp == NULL)
++		return NULL;
++
++	count = 0;
++	for (l = 0; l != cplen; l++)
++		if (cp[l] == 0)
++			count++;
++
++	res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL);
++	count = 0;
++	while (cplen > 0) {
++		res[count] = cp;
++		l = strlen(cp) + 1;
++		cp += l;
++		cplen -= l;
++		count++;
++	}
++	return res;
++}
++
++/*
+  * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
+  * are changing this array!
+  */
+@@ -754,6 +789,13 @@ int parse_mtd_partitions(struct mtd_info
+ {
+ 	struct mtd_part_parser *parser;
+ 	int ret = 0;
++	const char *const *types_of = NULL;
++
++	if (data && data->of_node) {
++		types_of = of_get_probes(data->of_node);
++		if (types_of != NULL)
++			types = types_of;
++	}
+ 
+ 	if (!types)
+ 		types = default_mtd_part_types;
+@@ -772,6 +814,7 @@ int parse_mtd_partitions(struct mtd_info
+ 			break;
+ 		}
+ 	}
++	kfree(types_of);
+ 	return ret;
+ }
+ 
diff --git a/target/linux/generic/patches-4.1/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/patches-4.1/400-mtd-add-rootfs-split-support.patch
index cbc2325..ba64e09 100644
--- a/target/linux/generic/patches-4.1/400-mtd-add-rootfs-split-support.patch
+++ b/target/linux/generic/patches-4.1/400-mtd-add-rootfs-split-support.patch
@@ -26,11 +26,12 @@
  	depends on m
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -29,10 +29,12 @@
+@@ -29,11 +29,13 @@
  #include <linux/kmod.h>
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/partitions.h>
 +#include <linux/magic.h>
+ #include <linux/of.h>
  #include <linux/err.h>
  #include <linux/kconfig.h>
  
@@ -39,7 +40,7 @@
  
  /* Our partition linked list */
  static LIST_HEAD(mtd_partitions);
-@@ -46,13 +48,14 @@ struct mtd_part {
+@@ -47,13 +49,14 @@ struct mtd_part {
  	struct list_head list;
  };
  
@@ -55,7 +56,7 @@
  /*
   * MTD methods which simply translate the effective address and pass through
   * to the _real_ device.
-@@ -578,8 +581,10 @@ static int mtd_add_partition_attrs(struc
+@@ -579,8 +582,10 @@ static int mtd_add_partition_attrs(struc
  	return ret;
  }
  
@@ -68,7 +69,7 @@
  {
  	struct mtd_partition part;
  	struct mtd_part *new;
-@@ -611,6 +616,7 @@ int mtd_add_partition(struct mtd_info *m
+@@ -612,6 +617,7 @@ int mtd_add_partition(struct mtd_info *m
  	mutex_unlock(&mtd_partitions_mutex);
  
  	add_mtd_device(&new->mtd);
@@ -76,7 +77,7 @@
  
  	mtd_add_partition_attrs(new);
  
-@@ -618,6 +624,12 @@ int mtd_add_partition(struct mtd_info *m
+@@ -619,6 +625,12 @@ int mtd_add_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_add_partition);
  
@@ -89,7 +90,7 @@
  int mtd_del_partition(struct mtd_info *master, int partno)
  {
  	struct mtd_part *slave, *next;
-@@ -643,6 +655,35 @@ int mtd_del_partition(struct mtd_info *m
+@@ -644,6 +656,35 @@ int mtd_del_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_del_partition);
  
@@ -125,7 +126,7 @@
  /*
   * This function, given a master MTD object and a partition table, creates
   * and registers slave MTD objects which are bound to the master according to
-@@ -672,6 +713,7 @@ int add_mtd_partitions(struct mtd_info *
+@@ -673,6 +714,7 @@ int add_mtd_partitions(struct mtd_info *
  		mutex_unlock(&mtd_partitions_mutex);
  
  		add_mtd_device(&slave->mtd);
diff --git a/target/linux/generic/patches-4.1/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/patches-4.1/401-mtd-add-support-for-different-partition-parser-types.patch
index 178247e..31dee98 100644
--- a/target/linux/generic/patches-4.1/401-mtd-add-support-for-different-partition-parser-types.patch
+++ b/target/linux/generic/patches-4.1/401-mtd-add-support-for-different-partition-parser-types.patch
@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
 
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -744,6 +744,30 @@ static struct mtd_part_parser *get_parti
+@@ -745,6 +745,30 @@ static struct mtd_part_parser *get_parti
  
  #define put_partition_parser(p) do { module_put((p)->owner); } while (0)
  
@@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
  void register_mtd_parser(struct mtd_part_parser *p)
  {
  	spin_lock(&part_parser_lock);
-@@ -817,6 +841,38 @@ int parse_mtd_partitions(struct mtd_info
+@@ -860,6 +884,38 @@ int parse_mtd_partitions(struct mtd_info
  	return ret;
  }
  
diff --git a/target/linux/generic/patches-4.1/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/patches-4.1/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
index 23e09c2..725dbe8 100644
--- a/target/linux/generic/patches-4.1/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
+++ b/target/linux/generic/patches-4.1/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -655,6 +655,37 @@ int mtd_del_partition(struct mtd_info *m
+@@ -656,6 +656,37 @@ int mtd_del_partition(struct mtd_info *m
  }
  EXPORT_SYMBOL_GPL(mtd_del_partition);
  
@@ -38,7 +38,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -663,6 +694,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
+@@ -664,6 +695,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
@@ -46,7 +46,7 @@
  }
  
  void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
-@@ -677,6 +709,12 @@ static void mtd_partition_split(struct m
+@@ -678,6 +710,12 @@ static void mtd_partition_split(struct m
  	if (rootfs_found)
  		return;
  
diff --git a/target/linux/generic/patches-4.1/404-mtd-add-more-helper-functions.patch b/target/linux/generic/patches-4.1/404-mtd-add-more-helper-functions.patch
index fe3a212..42e5cfd 100644
--- a/target/linux/generic/patches-4.1/404-mtd-add-more-helper-functions.patch
+++ b/target/linux/generic/patches-4.1/404-mtd-add-more-helper-functions.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -452,14 +452,12 @@ static struct mtd_part *allocate_partiti
+@@ -453,14 +453,12 @@ static struct mtd_part *allocate_partiti
  	if (slave->offset == MTDPART_OFS_APPEND)
  		slave->offset = cur_offset;
  	if (slave->offset == MTDPART_OFS_NXTBLK) {
@@ -18,7 +18,7 @@
  	}
  	if (slave->offset == MTDPART_OFS_RETAIN) {
  		slave->offset = cur_offset;
-@@ -686,6 +684,17 @@ run_parsers_by_type(struct mtd_part *sla
+@@ -687,6 +685,17 @@ run_parsers_by_type(struct mtd_part *sla
  	return nr_parts;
  }
  
@@ -36,7 +36,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -928,6 +937,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -971,6 +980,24 @@ int mtd_is_partition(const struct mtd_in
  }
  EXPORT_SYMBOL_GPL(mtd_is_partition);
  
diff --git a/target/linux/generic/patches-4.1/405-mtd-old-firmware-uimage-splitter.patch b/target/linux/generic/patches-4.1/405-mtd-old-firmware-uimage-splitter.patch
index 127d647..430fd6f 100644
--- a/target/linux/generic/patches-4.1/405-mtd-old-firmware-uimage-splitter.patch
+++ b/target/linux/generic/patches-4.1/405-mtd-old-firmware-uimage-splitter.patch
@@ -14,7 +14,7 @@
  endmenu
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -695,6 +695,37 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -696,6 +696,37 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  	return len;
  }
  
@@ -52,7 +52,7 @@
  #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #define SPLIT_FIRMWARE_NAME	CONFIG_MTD_SPLIT_FIRMWARE_NAME
  #else
-@@ -703,7 +734,14 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -704,7 +735,14 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  
  static void split_firmware(struct mtd_info *master, struct mtd_part *part)
  {
diff --git a/target/linux/generic/patches-4.1/406-mtd-old-rootfs-squashfs-splitter.patch b/target/linux/generic/patches-4.1/406-mtd-old-rootfs-squashfs-splitter.patch
index 65424b0..cb1f29c 100644
--- a/target/linux/generic/patches-4.1/406-mtd-old-rootfs-squashfs-splitter.patch
+++ b/target/linux/generic/patches-4.1/406-mtd-old-rootfs-squashfs-splitter.patch
@@ -14,7 +14,7 @@
  	default y
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -695,6 +695,47 @@ mtd_pad_erasesize(struct mtd_info *mtd,
+@@ -696,6 +696,47 @@ mtd_pad_erasesize(struct mtd_info *mtd,
  	return len;
  }
  
@@ -62,7 +62,7 @@
  #define UBOOT_MAGIC	0x27051956
  
  static void split_uimage(struct mtd_info *master, struct mtd_part *part)
-@@ -757,7 +798,10 @@ static void mtd_partition_split(struct m
+@@ -758,7 +799,10 @@ static void mtd_partition_split(struct m
  		return;
  
  	if (!strcmp(part->mtd.name, "rootfs")) {
diff --git a/target/linux/generic/patches-4.1/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/patches-4.1/411-mtd-partial_eraseblock_write.patch
index a66507b..e6e809c 100644
--- a/target/linux/generic/patches-4.1/411-mtd-partial_eraseblock_write.patch
+++ b/target/linux/generic/patches-4.1/411-mtd-partial_eraseblock_write.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -36,6 +36,8 @@
+@@ -37,6 +37,8 @@
  #include "mtdcore.h"
  #include "mtdsplit/mtdsplit.h"
  
@@ -9,7 +9,7 @@
  /* Our partition linked list */
  static LIST_HEAD(mtd_partitions);
  static DEFINE_MUTEX(mtd_partitions_mutex);
-@@ -234,13 +236,61 @@ static int part_erase(struct mtd_info *m
+@@ -235,13 +237,61 @@ static int part_erase(struct mtd_info *m
  	struct mtd_part *part = PART(mtd);
  	int ret;
  
@@ -71,7 +71,7 @@
  	return ret;
  }
  
-@@ -248,7 +298,25 @@ void mtd_erase_callback(struct erase_inf
+@@ -249,7 +299,25 @@ void mtd_erase_callback(struct erase_inf
  {
  	if (instr->mtd->_erase == part_erase) {
  		struct mtd_part *part = PART(instr->mtd);
@@ -97,7 +97,7 @@
  		if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
  			instr->fail_addr -= part->offset;
  		instr->addr -= part->offset;
-@@ -521,17 +589,20 @@ static struct mtd_part *allocate_partiti
+@@ -522,17 +590,20 @@ static struct mtd_part *allocate_partiti
  	if ((slave->mtd.flags & MTD_WRITEABLE) &&
  	    mtd_mod_by_eb(slave->offset, &slave->mtd)) {
  		/* Doesn't start on a boundary of major erase size */
diff --git a/target/linux/generic/patches-4.1/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/patches-4.1/412-mtd-partial_eraseblock_unlock.patch
index 62f9d5b..b7964e2 100644
--- a/target/linux/generic/patches-4.1/412-mtd-partial_eraseblock_unlock.patch
+++ b/target/linux/generic/patches-4.1/412-mtd-partial_eraseblock_unlock.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/mtdpart.c
 +++ b/drivers/mtd/mtdpart.c
-@@ -335,7 +335,14 @@ static int part_lock(struct mtd_info *mt
+@@ -336,7 +336,14 @@ static int part_lock(struct mtd_info *mt
  static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
  {
  	struct mtd_part *part = PART(mtd);
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Fri Aug 14 20:50:41 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Fri, 14 Aug 2015 17:50:41 -0700
Subject: [OpenWrt-Devel] [PATCH 2/5] ipq806x: add hwspinlock support
In-Reply-To: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
References: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439599844-4387-3-git-send-email-mathieu@codeaurora.org>

This change cherry-picks the following 3 changes from linux-next:
*fb7737 hwspinlock/core: add device tree support
*19a0f6 hwspinlock: qcom: Add support for Qualcomm HW Mutex block
*bd5717 hwspinlock: qcom: Correct msb in regmap_field

We're also adding a patch to add the hardware spinlock device nodes on
IPQ806x platforms (033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch).

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 +++++++++++++++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 +++++++++++++++++++++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +++
 ...33-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch |  34 +++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   9 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch    |   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   5 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   5 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   5 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 +++++++++++++++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 +++++++++++++++++++++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +++
 ...33-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch |  33 +++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  10 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch     |   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   5 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   5 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   5 +-
 19 files changed, 958 insertions(+), 28 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch

diff --git a/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch b/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
new file mode 100644
index 0000000..04f35b7
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
@@ -0,0 +1,167 @@
+From fb7737e949e31d8a71acee6bbb670f32dbd2a2c0 Mon Sep 17 00:00:00 2001
+From: Suman Anna <s-anna at ti.com>
+Date: Wed, 4 Mar 2015 20:01:14 -0600
+Subject: [PATCH] hwspinlock/core: add device tree support
+
+This patch adds a new OF-friendly API of_hwspin_lock_get_id()
+for hwspinlock clients to use/request locks from a hwspinlock
+device instantiated through a device-tree blob. This new API
+can be used by hwspinlock clients to get the id for a specific
+lock using the phandle + args specifier, so that it can be
+requested using the available hwspin_lock_request_specific()
+API.
+
+Signed-off-by: Suman Anna <s-anna at ti.com>
+Reviewed-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+[small comment clarification]
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ Documentation/hwspinlock.txt         | 10 +++++
+ drivers/hwspinlock/hwspinlock_core.c | 79 ++++++++++++++++++++++++++++++++++++
+ include/linux/hwspinlock.h           |  7 ++++
+ 3 files changed, 96 insertions(+)
+
+--- a/Documentation/hwspinlock.txt
++++ b/Documentation/hwspinlock.txt
+@@ -48,6 +48,16 @@ independent, drivers.
+      ids for predefined purposes.
+      Should be called from a process context (might sleep).
+ 
++  int of_hwspin_lock_get_id(struct device_node *np, int index);
++   - retrieve the global lock id for an OF phandle-based specific lock.
++     This function provides a means for DT users of a hwspinlock module
++     to get the global lock id of a specific hwspinlock, so that it can
++     be requested using the normal hwspin_lock_request_specific() API.
++     The function returns a lock id number on success, -EPROBE_DEFER if
++     the hwspinlock device is not yet registered with the core, or other
++     error values.
++     Should be called from a process context (might sleep).
++
+   int hwspin_lock_free(struct hwspinlock *hwlock);
+    - free a previously-assigned hwspinlock; returns 0 on success, or an
+      appropriate error code on failure (e.g. -EINVAL if the hwspinlock
+--- a/drivers/hwspinlock/hwspinlock_core.c
++++ b/drivers/hwspinlock/hwspinlock_core.c
+@@ -27,6 +27,7 @@
+ #include <linux/hwspinlock.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/mutex.h>
++#include <linux/of.h>
+ 
+ #include "hwspinlock_internal.h"
+ 
+@@ -257,6 +258,84 @@ void __hwspin_unlock(struct hwspinlock *
+ }
+ EXPORT_SYMBOL_GPL(__hwspin_unlock);
+ 
++/**
++ * of_hwspin_lock_simple_xlate - translate hwlock_spec to return a lock id
++ * @bank: the hwspinlock device bank
++ * @hwlock_spec: hwlock specifier as found in the device tree
++ *
++ * This is a simple translation function, suitable for hwspinlock platform
++ * drivers that only has a lock specifier length of 1.
++ *
++ * Returns a relative index of the lock within a specified bank on success,
++ * or -EINVAL on invalid specifier cell count.
++ */
++static inline int
++of_hwspin_lock_simple_xlate(const struct of_phandle_args *hwlock_spec)
++{
++	if (WARN_ON(hwlock_spec->args_count != 1))
++		return -EINVAL;
++
++	return hwlock_spec->args[0];
++}
++
++/**
++ * of_hwspin_lock_get_id() - get lock id for an OF phandle-based specific lock
++ * @np: device node from which to request the specific hwlock
++ * @index: index of the hwlock in the list of values
++ *
++ * This function provides a means for DT users of the hwspinlock module to
++ * get the global lock id of a specific hwspinlock using the phandle of the
++ * hwspinlock device, so that it can be requested using the normal
++ * hwspin_lock_request_specific() API.
++ *
++ * Returns the global lock id number on success, -EPROBE_DEFER if the hwspinlock
++ * device is not yet registered, -EINVAL on invalid args specifier value or an
++ * appropriate error as returned from the OF parsing of the DT client node.
++ */
++int of_hwspin_lock_get_id(struct device_node *np, int index)
++{
++	struct of_phandle_args args;
++	struct hwspinlock *hwlock;
++	struct radix_tree_iter iter;
++	void **slot;
++	int id;
++	int ret;
++
++	ret = of_parse_phandle_with_args(np, "hwlocks", "#hwlock-cells", index,
++					 &args);
++	if (ret)
++		return ret;
++
++	/* Find the hwspinlock device: we need its base_id */
++	ret = -EPROBE_DEFER;
++	rcu_read_lock();
++	radix_tree_for_each_slot(slot, &hwspinlock_tree, &iter, 0) {
++		hwlock = radix_tree_deref_slot(slot);
++		if (unlikely(!hwlock))
++			continue;
++
++		if (hwlock->bank->dev->of_node == args.np) {
++			ret = 0;
++			break;
++		}
++	}
++	rcu_read_unlock();
++	if (ret < 0)
++		goto out;
++
++	id = of_hwspin_lock_simple_xlate(&args);
++	if (id < 0 || id >= hwlock->bank->num_locks) {
++		ret = -EINVAL;
++		goto out;
++	}
++	id += hwlock->bank->base_id;
++
++out:
++	of_node_put(args.np);
++	return ret ? ret : id;
++}
++EXPORT_SYMBOL_GPL(of_hwspin_lock_get_id);
++
+ static int hwspin_lock_register_single(struct hwspinlock *hwlock, int id)
+ {
+ 	struct hwspinlock *tmp;
+--- a/include/linux/hwspinlock.h
++++ b/include/linux/hwspinlock.h
+@@ -26,6 +26,7 @@
+ #define HWLOCK_IRQ	0x02	/* Disable interrupts, don't save state */
+ 
+ struct device;
++struct device_node;
+ struct hwspinlock;
+ struct hwspinlock_device;
+ struct hwspinlock_ops;
+@@ -66,6 +67,7 @@ int hwspin_lock_unregister(struct hwspin
+ struct hwspinlock *hwspin_lock_request(void);
+ struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
+ int hwspin_lock_free(struct hwspinlock *hwlock);
++int of_hwspin_lock_get_id(struct device_node *np, int index);
+ int hwspin_lock_get_id(struct hwspinlock *hwlock);
+ int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
+ 							unsigned long *);
+@@ -120,6 +122,11 @@ void __hwspin_unlock(struct hwspinlock *
+ {
+ }
+ 
++static inline int of_hwspin_lock_get_id(struct device_node *np, int index)
++{
++	return 0;
++}
++
+ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
+ {
+ 	return 0;
diff --git a/target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch b/target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
new file mode 100644
index 0000000..581b199
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
@@ -0,0 +1,234 @@
+From 19a0f61224d2d91860fa8291ab63cb104ee86bdd Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Date: Tue, 24 Mar 2015 10:11:05 -0700
+Subject: [PATCH] hwspinlock: qcom: Add support for Qualcomm HW Mutex block
+
+Add driver for Qualcomm Hardware Mutex block found in many Qualcomm
+SoCs.
+
+Based on initial effort by Kumar Gala <galak at codeaurora.org>
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Reviewed-by: Jeffrey Hugo <jhugo at codeaurora.org>
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ drivers/hwspinlock/Kconfig           |  12 +++
+ drivers/hwspinlock/Makefile          |   1 +
+ drivers/hwspinlock/qcom_hwspinlock.c | 181 +++++++++++++++++++++++++++++++++++
+ 3 files changed, 194 insertions(+)
+ create mode 100644 drivers/hwspinlock/qcom_hwspinlock.c
+
+--- a/drivers/hwspinlock/Kconfig
++++ b/drivers/hwspinlock/Kconfig
+@@ -18,6 +18,18 @@ config HWSPINLOCK_OMAP
+ 
+ 	  If unsure, say N.
+ 
++config HWSPINLOCK_QCOM
++	tristate "Qualcomm Hardware Spinlock device"
++	depends on ARCH_QCOM
++	select HWSPINLOCK
++	select MFD_SYSCON
++	help
++	  Say y here to support the Qualcomm Hardware Mutex functionality, which
++	  provides a synchronisation mechanism for the various processors on
++	  the SoC.
++
++	  If unsure, say N.
++
+ config HSEM_U8500
+ 	tristate "STE Hardware Semaphore functionality"
+ 	depends on ARCH_U8500
+--- a/drivers/hwspinlock/Makefile
++++ b/drivers/hwspinlock/Makefile
+@@ -4,4 +4,5 @@
+ 
+ obj-$(CONFIG_HWSPINLOCK)		+= hwspinlock_core.o
+ obj-$(CONFIG_HWSPINLOCK_OMAP)		+= omap_hwspinlock.o
++obj-$(CONFIG_HWSPINLOCK_QCOM)		+= qcom_hwspinlock.o
+ obj-$(CONFIG_HSEM_U8500)		+= u8500_hsem.o
+--- /dev/null
++++ b/drivers/hwspinlock/qcom_hwspinlock.c
+@@ -0,0 +1,181 @@
++/*
++ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
++ * Copyright (c) 2015, Sony Mobile Communications AB
++ *
++ * This software is licensed under the terms of the GNU General Public
++ * License version 2, as published by the Free Software Foundation, and
++ * may be copied, distributed, and modified under those terms.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/hwspinlock.h>
++#include <linux/io.h>
++#include <linux/kernel.h>
++#include <linux/mfd/syscon.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/platform_device.h>
++#include <linux/pm_runtime.h>
++#include <linux/regmap.h>
++
++#include "hwspinlock_internal.h"
++
++#define QCOM_MUTEX_APPS_PROC_ID	1
++#define QCOM_MUTEX_NUM_LOCKS	32
++
++static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
++{
++	struct regmap_field *field = lock->priv;
++	u32 lock_owner;
++	int ret;
++
++	ret = regmap_field_write(field, QCOM_MUTEX_APPS_PROC_ID);
++	if (ret)
++		return ret;
++
++	ret = regmap_field_read(field, &lock_owner);
++	if (ret)
++		return ret;
++
++	return lock_owner == QCOM_MUTEX_APPS_PROC_ID;
++}
++
++static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
++{
++	struct regmap_field *field = lock->priv;
++	u32 lock_owner;
++	int ret;
++
++	ret = regmap_field_read(field, &lock_owner);
++	if (ret) {
++		pr_err("%s: unable to query spinlock owner\n", __func__);
++		return;
++	}
++
++	if (lock_owner != QCOM_MUTEX_APPS_PROC_ID) {
++		pr_err("%s: spinlock not owned by us (actual owner is %d)\n",
++				__func__, lock_owner);
++	}
++
++	ret = regmap_field_write(field, 0);
++	if (ret)
++		pr_err("%s: failed to unlock spinlock\n", __func__);
++}
++
++static const struct hwspinlock_ops qcom_hwspinlock_ops = {
++	.trylock	= qcom_hwspinlock_trylock,
++	.unlock		= qcom_hwspinlock_unlock,
++};
++
++static const struct of_device_id qcom_hwspinlock_of_match[] = {
++	{ .compatible = "qcom,sfpb-mutex" },
++	{ .compatible = "qcom,tcsr-mutex" },
++	{ }
++};
++MODULE_DEVICE_TABLE(of, qcom_hwspinlock_of_match);
++
++static int qcom_hwspinlock_probe(struct platform_device *pdev)
++{
++	struct hwspinlock_device *bank;
++	struct device_node *syscon;
++	struct reg_field field;
++	struct regmap *regmap;
++	size_t array_size;
++	u32 stride;
++	u32 base;
++	int ret;
++	int i;
++
++	syscon = of_parse_phandle(pdev->dev.of_node, "syscon", 0);
++	if (!syscon) {
++		dev_err(&pdev->dev, "no syscon property\n");
++		return -ENODEV;
++	}
++
++	regmap = syscon_node_to_regmap(syscon);
++	if (IS_ERR(regmap))
++		return PTR_ERR(regmap);
++
++	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, &base);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "no offset in syscon\n");
++		return -EINVAL;
++	}
++
++	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 2, &stride);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "no stride syscon\n");
++		return -EINVAL;
++	}
++
++	array_size = QCOM_MUTEX_NUM_LOCKS * sizeof(struct hwspinlock);
++	bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL);
++	if (!bank)
++		return -ENOMEM;
++
++	platform_set_drvdata(pdev, bank);
++
++	for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
++		field.reg = base + i * stride;
++		field.lsb = 0;
++		field.msb = 32;
++
++		bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
++							     regmap, field);
++	}
++
++	pm_runtime_enable(&pdev->dev);
++
++	ret = hwspin_lock_register(bank, &pdev->dev, &qcom_hwspinlock_ops,
++				   0, QCOM_MUTEX_NUM_LOCKS);
++	if (ret)
++		pm_runtime_disable(&pdev->dev);
++
++	return ret;
++}
++
++static int qcom_hwspinlock_remove(struct platform_device *pdev)
++{
++	struct hwspinlock_device *bank = platform_get_drvdata(pdev);
++	int ret;
++
++	ret = hwspin_lock_unregister(bank);
++	if (ret) {
++		dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
++		return ret;
++	}
++
++	pm_runtime_disable(&pdev->dev);
++
++	return 0;
++}
++
++static struct platform_driver qcom_hwspinlock_driver = {
++	.probe		= qcom_hwspinlock_probe,
++	.remove		= qcom_hwspinlock_remove,
++	.driver		= {
++		.name	= "qcom_hwspinlock",
++		.of_match_table = qcom_hwspinlock_of_match,
++	},
++};
++
++static int __init qcom_hwspinlock_init(void)
++{
++	return platform_driver_register(&qcom_hwspinlock_driver);
++}
++/* board init code might need to reserve hwspinlocks for predefined purposes */
++postcore_initcall(qcom_hwspinlock_init);
++
++static void __exit qcom_hwspinlock_exit(void)
++{
++	platform_driver_unregister(&qcom_hwspinlock_driver);
++}
++module_exit(qcom_hwspinlock_exit);
++
++MODULE_LICENSE("GPL v2");
++MODULE_DESCRIPTION("Hardware spinlock driver for Qualcomm SoCs");
diff --git a/target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch b/target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
new file mode 100644
index 0000000..70d5a58
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
@@ -0,0 +1,26 @@
+From bd5717a4632cdecafe82d03de7dcb3b1876e2828 Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Date: Fri, 26 Jun 2015 14:47:21 -0700
+Subject: [PATCH] hwspinlock: qcom: Correct msb in regmap_field
+
+msb of the regmap_field was mistakenly given the value 32, to set all bits
+in the regmap update mask; although incorrect this worked until 921cc294,
+where the mask calculation was corrected.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ drivers/hwspinlock/qcom_hwspinlock.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hwspinlock/qcom_hwspinlock.c
++++ b/drivers/hwspinlock/qcom_hwspinlock.c
+@@ -123,7 +123,7 @@ static int qcom_hwspinlock_probe(struct
+ 	for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
+ 		field.reg = base + i * stride;
+ 		field.lsb = 0;
+-		field.msb = 32;
++		field.msb = 31;
+ 
+ 		bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
+ 							     regmap, field);
diff --git a/target/linux/ipq806x/patches-3.18/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch b/target/linux/ipq806x/patches-3.18/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
new file mode 100644
index 0000000..4a35325
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
@@ -0,0 +1,34 @@
+From c7c482da19a5e4ba7101198c21c2434056b0b2da Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Thu, 13 Aug 2015 09:45:26 -0700
+Subject: [PATCH 1/3] ARM: qcom: add SFPB nodes to IPQ806x dts
+
+Add one new node to the ipq806x.dtsi file to declare & register the
+hardware spinlock devices. This mechanism is required to be used by
+other drivers such as SMEM.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064.dtsi | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -291,5 +291,17 @@
+ 			#clock-cells = <1>;
+ 			#reset-cells = <1>;
+ 		};
++
++		sfpb_mutex_block: syscon at 1200600 {
++			compatible = "syscon";
++			reg = <0x01200600 0x100>;
++		};
+ 	};
++
++	sfpb_mutex: sfpb-mutex {
++		compatible = "qcom,sfpb-mutex";
++		syscon = <&sfpb_mutex_block 4 4>;
++
++		#hwlock-cells = <1>;
++ 	};
+ };
diff --git a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
index 5fee6ad..c322616 100644
--- a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
+++ b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -32,9 +32,9 @@
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -291,5 +291,90 @@
- 			#clock-cells = <1>;
- 			#reset-cells = <1>;
+@@ -296,6 +296,91 @@
+ 			compatible = "syscon";
+ 			reg = <0x01200600 0x100>;
  		};
 +
 +		hs_phy_1: phy at 100f8800 {
@@ -122,4 +122,5 @@
 +		};
 +
  	};
- };
+ 
+ 	sfpb_mutex: sfpb-mutex {
diff --git a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index ed66047..4c18566 100644
--- a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -134,8 +134,8 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  / {
  	model = "Qualcomm IPQ8064";
-@@ -306,6 +308,129 @@
- 			#reset-cells = <1>;
+@@ -311,6 +313,129 @@
+ 			reg = <0x01200600 0x100>;
  		};
  
 +		pcie0: pci at 1b500000 {
diff --git a/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
index 13ff921..83c5f55 100644
--- a/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
+++ b/target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -336,15 +336,21 @@
+@@ -341,15 +341,21 @@
  
  			clocks = <&gcc PCIE_A_CLK>,
  				 <&gcc PCIE_H_CLK>,
@@ -26,7 +26,7 @@
  
  			status = "disabled";
  		};
-@@ -377,15 +383,21 @@
+@@ -382,15 +388,21 @@
  
  			clocks = <&gcc PCIE_1_A_CLK>,
  				 <&gcc PCIE_1_H_CLK>,
@@ -52,7 +52,7 @@
  
  			status = "disabled";
  		};
-@@ -418,15 +430,21 @@
+@@ -423,15 +435,21 @@
  
  			clocks = <&gcc PCIE_2_A_CLK>,
  				 <&gcc PCIE_2_H_CLK>,
diff --git a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index 4d9e613..657e36a 100644
--- a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -13,7 +13,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -657,5 +657,25 @@
+@@ -662,6 +662,26 @@
  			};
  		};
  
@@ -38,4 +38,5 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 +		};
 +
  	};
- };
+ 
+ 	sfpb_mutex: sfpb-mutex {
diff --git a/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
index a2742b7..29e1592 100644
--- a/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
+++ b/target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -26,7 +26,7 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -677,5 +677,21 @@
+@@ -682,6 +682,22 @@
  			status = "disabled";
  		};
  
@@ -47,4 +47,5 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
 +		};
 +
  	};
- };
+ 
+ 	sfpb_mutex: sfpb-mutex {
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 8cfc38b..8e66b8d 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -117,7 +117,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -693,5 +693,91 @@
+@@ -698,6 +698,92 @@
  			status = "disabled";
  		};
  
@@ -208,4 +208,5 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +		};
 +
  	};
- };
+ 
+ 	sfpb_mutex: sfpb-mutex {
diff --git a/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch b/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
new file mode 100644
index 0000000..04f35b7
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
@@ -0,0 +1,167 @@
+From fb7737e949e31d8a71acee6bbb670f32dbd2a2c0 Mon Sep 17 00:00:00 2001
+From: Suman Anna <s-anna at ti.com>
+Date: Wed, 4 Mar 2015 20:01:14 -0600
+Subject: [PATCH] hwspinlock/core: add device tree support
+
+This patch adds a new OF-friendly API of_hwspin_lock_get_id()
+for hwspinlock clients to use/request locks from a hwspinlock
+device instantiated through a device-tree blob. This new API
+can be used by hwspinlock clients to get the id for a specific
+lock using the phandle + args specifier, so that it can be
+requested using the available hwspin_lock_request_specific()
+API.
+
+Signed-off-by: Suman Anna <s-anna at ti.com>
+Reviewed-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+[small comment clarification]
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ Documentation/hwspinlock.txt         | 10 +++++
+ drivers/hwspinlock/hwspinlock_core.c | 79 ++++++++++++++++++++++++++++++++++++
+ include/linux/hwspinlock.h           |  7 ++++
+ 3 files changed, 96 insertions(+)
+
+--- a/Documentation/hwspinlock.txt
++++ b/Documentation/hwspinlock.txt
+@@ -48,6 +48,16 @@ independent, drivers.
+      ids for predefined purposes.
+      Should be called from a process context (might sleep).
+ 
++  int of_hwspin_lock_get_id(struct device_node *np, int index);
++   - retrieve the global lock id for an OF phandle-based specific lock.
++     This function provides a means for DT users of a hwspinlock module
++     to get the global lock id of a specific hwspinlock, so that it can
++     be requested using the normal hwspin_lock_request_specific() API.
++     The function returns a lock id number on success, -EPROBE_DEFER if
++     the hwspinlock device is not yet registered with the core, or other
++     error values.
++     Should be called from a process context (might sleep).
++
+   int hwspin_lock_free(struct hwspinlock *hwlock);
+    - free a previously-assigned hwspinlock; returns 0 on success, or an
+      appropriate error code on failure (e.g. -EINVAL if the hwspinlock
+--- a/drivers/hwspinlock/hwspinlock_core.c
++++ b/drivers/hwspinlock/hwspinlock_core.c
+@@ -27,6 +27,7 @@
+ #include <linux/hwspinlock.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/mutex.h>
++#include <linux/of.h>
+ 
+ #include "hwspinlock_internal.h"
+ 
+@@ -257,6 +258,84 @@ void __hwspin_unlock(struct hwspinlock *
+ }
+ EXPORT_SYMBOL_GPL(__hwspin_unlock);
+ 
++/**
++ * of_hwspin_lock_simple_xlate - translate hwlock_spec to return a lock id
++ * @bank: the hwspinlock device bank
++ * @hwlock_spec: hwlock specifier as found in the device tree
++ *
++ * This is a simple translation function, suitable for hwspinlock platform
++ * drivers that only has a lock specifier length of 1.
++ *
++ * Returns a relative index of the lock within a specified bank on success,
++ * or -EINVAL on invalid specifier cell count.
++ */
++static inline int
++of_hwspin_lock_simple_xlate(const struct of_phandle_args *hwlock_spec)
++{
++	if (WARN_ON(hwlock_spec->args_count != 1))
++		return -EINVAL;
++
++	return hwlock_spec->args[0];
++}
++
++/**
++ * of_hwspin_lock_get_id() - get lock id for an OF phandle-based specific lock
++ * @np: device node from which to request the specific hwlock
++ * @index: index of the hwlock in the list of values
++ *
++ * This function provides a means for DT users of the hwspinlock module to
++ * get the global lock id of a specific hwspinlock using the phandle of the
++ * hwspinlock device, so that it can be requested using the normal
++ * hwspin_lock_request_specific() API.
++ *
++ * Returns the global lock id number on success, -EPROBE_DEFER if the hwspinlock
++ * device is not yet registered, -EINVAL on invalid args specifier value or an
++ * appropriate error as returned from the OF parsing of the DT client node.
++ */
++int of_hwspin_lock_get_id(struct device_node *np, int index)
++{
++	struct of_phandle_args args;
++	struct hwspinlock *hwlock;
++	struct radix_tree_iter iter;
++	void **slot;
++	int id;
++	int ret;
++
++	ret = of_parse_phandle_with_args(np, "hwlocks", "#hwlock-cells", index,
++					 &args);
++	if (ret)
++		return ret;
++
++	/* Find the hwspinlock device: we need its base_id */
++	ret = -EPROBE_DEFER;
++	rcu_read_lock();
++	radix_tree_for_each_slot(slot, &hwspinlock_tree, &iter, 0) {
++		hwlock = radix_tree_deref_slot(slot);
++		if (unlikely(!hwlock))
++			continue;
++
++		if (hwlock->bank->dev->of_node == args.np) {
++			ret = 0;
++			break;
++		}
++	}
++	rcu_read_unlock();
++	if (ret < 0)
++		goto out;
++
++	id = of_hwspin_lock_simple_xlate(&args);
++	if (id < 0 || id >= hwlock->bank->num_locks) {
++		ret = -EINVAL;
++		goto out;
++	}
++	id += hwlock->bank->base_id;
++
++out:
++	of_node_put(args.np);
++	return ret ? ret : id;
++}
++EXPORT_SYMBOL_GPL(of_hwspin_lock_get_id);
++
+ static int hwspin_lock_register_single(struct hwspinlock *hwlock, int id)
+ {
+ 	struct hwspinlock *tmp;
+--- a/include/linux/hwspinlock.h
++++ b/include/linux/hwspinlock.h
+@@ -26,6 +26,7 @@
+ #define HWLOCK_IRQ	0x02	/* Disable interrupts, don't save state */
+ 
+ struct device;
++struct device_node;
+ struct hwspinlock;
+ struct hwspinlock_device;
+ struct hwspinlock_ops;
+@@ -66,6 +67,7 @@ int hwspin_lock_unregister(struct hwspin
+ struct hwspinlock *hwspin_lock_request(void);
+ struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
+ int hwspin_lock_free(struct hwspinlock *hwlock);
++int of_hwspin_lock_get_id(struct device_node *np, int index);
+ int hwspin_lock_get_id(struct hwspinlock *hwlock);
+ int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
+ 							unsigned long *);
+@@ -120,6 +122,11 @@ void __hwspin_unlock(struct hwspinlock *
+ {
+ }
+ 
++static inline int of_hwspin_lock_get_id(struct device_node *np, int index)
++{
++	return 0;
++}
++
+ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
+ {
+ 	return 0;
diff --git a/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch b/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
new file mode 100644
index 0000000..581b199
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
@@ -0,0 +1,234 @@
+From 19a0f61224d2d91860fa8291ab63cb104ee86bdd Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Date: Tue, 24 Mar 2015 10:11:05 -0700
+Subject: [PATCH] hwspinlock: qcom: Add support for Qualcomm HW Mutex block
+
+Add driver for Qualcomm Hardware Mutex block found in many Qualcomm
+SoCs.
+
+Based on initial effort by Kumar Gala <galak at codeaurora.org>
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Reviewed-by: Jeffrey Hugo <jhugo at codeaurora.org>
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ drivers/hwspinlock/Kconfig           |  12 +++
+ drivers/hwspinlock/Makefile          |   1 +
+ drivers/hwspinlock/qcom_hwspinlock.c | 181 +++++++++++++++++++++++++++++++++++
+ 3 files changed, 194 insertions(+)
+ create mode 100644 drivers/hwspinlock/qcom_hwspinlock.c
+
+--- a/drivers/hwspinlock/Kconfig
++++ b/drivers/hwspinlock/Kconfig
+@@ -18,6 +18,18 @@ config HWSPINLOCK_OMAP
+ 
+ 	  If unsure, say N.
+ 
++config HWSPINLOCK_QCOM
++	tristate "Qualcomm Hardware Spinlock device"
++	depends on ARCH_QCOM
++	select HWSPINLOCK
++	select MFD_SYSCON
++	help
++	  Say y here to support the Qualcomm Hardware Mutex functionality, which
++	  provides a synchronisation mechanism for the various processors on
++	  the SoC.
++
++	  If unsure, say N.
++
+ config HSEM_U8500
+ 	tristate "STE Hardware Semaphore functionality"
+ 	depends on ARCH_U8500
+--- a/drivers/hwspinlock/Makefile
++++ b/drivers/hwspinlock/Makefile
+@@ -4,4 +4,5 @@
+ 
+ obj-$(CONFIG_HWSPINLOCK)		+= hwspinlock_core.o
+ obj-$(CONFIG_HWSPINLOCK_OMAP)		+= omap_hwspinlock.o
++obj-$(CONFIG_HWSPINLOCK_QCOM)		+= qcom_hwspinlock.o
+ obj-$(CONFIG_HSEM_U8500)		+= u8500_hsem.o
+--- /dev/null
++++ b/drivers/hwspinlock/qcom_hwspinlock.c
+@@ -0,0 +1,181 @@
++/*
++ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
++ * Copyright (c) 2015, Sony Mobile Communications AB
++ *
++ * This software is licensed under the terms of the GNU General Public
++ * License version 2, as published by the Free Software Foundation, and
++ * may be copied, distributed, and modified under those terms.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/hwspinlock.h>
++#include <linux/io.h>
++#include <linux/kernel.h>
++#include <linux/mfd/syscon.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/platform_device.h>
++#include <linux/pm_runtime.h>
++#include <linux/regmap.h>
++
++#include "hwspinlock_internal.h"
++
++#define QCOM_MUTEX_APPS_PROC_ID	1
++#define QCOM_MUTEX_NUM_LOCKS	32
++
++static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
++{
++	struct regmap_field *field = lock->priv;
++	u32 lock_owner;
++	int ret;
++
++	ret = regmap_field_write(field, QCOM_MUTEX_APPS_PROC_ID);
++	if (ret)
++		return ret;
++
++	ret = regmap_field_read(field, &lock_owner);
++	if (ret)
++		return ret;
++
++	return lock_owner == QCOM_MUTEX_APPS_PROC_ID;
++}
++
++static void qcom_hwspinlock_unlock(struct hwspinlock *lock)
++{
++	struct regmap_field *field = lock->priv;
++	u32 lock_owner;
++	int ret;
++
++	ret = regmap_field_read(field, &lock_owner);
++	if (ret) {
++		pr_err("%s: unable to query spinlock owner\n", __func__);
++		return;
++	}
++
++	if (lock_owner != QCOM_MUTEX_APPS_PROC_ID) {
++		pr_err("%s: spinlock not owned by us (actual owner is %d)\n",
++				__func__, lock_owner);
++	}
++
++	ret = regmap_field_write(field, 0);
++	if (ret)
++		pr_err("%s: failed to unlock spinlock\n", __func__);
++}
++
++static const struct hwspinlock_ops qcom_hwspinlock_ops = {
++	.trylock	= qcom_hwspinlock_trylock,
++	.unlock		= qcom_hwspinlock_unlock,
++};
++
++static const struct of_device_id qcom_hwspinlock_of_match[] = {
++	{ .compatible = "qcom,sfpb-mutex" },
++	{ .compatible = "qcom,tcsr-mutex" },
++	{ }
++};
++MODULE_DEVICE_TABLE(of, qcom_hwspinlock_of_match);
++
++static int qcom_hwspinlock_probe(struct platform_device *pdev)
++{
++	struct hwspinlock_device *bank;
++	struct device_node *syscon;
++	struct reg_field field;
++	struct regmap *regmap;
++	size_t array_size;
++	u32 stride;
++	u32 base;
++	int ret;
++	int i;
++
++	syscon = of_parse_phandle(pdev->dev.of_node, "syscon", 0);
++	if (!syscon) {
++		dev_err(&pdev->dev, "no syscon property\n");
++		return -ENODEV;
++	}
++
++	regmap = syscon_node_to_regmap(syscon);
++	if (IS_ERR(regmap))
++		return PTR_ERR(regmap);
++
++	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, &base);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "no offset in syscon\n");
++		return -EINVAL;
++	}
++
++	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 2, &stride);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "no stride syscon\n");
++		return -EINVAL;
++	}
++
++	array_size = QCOM_MUTEX_NUM_LOCKS * sizeof(struct hwspinlock);
++	bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL);
++	if (!bank)
++		return -ENOMEM;
++
++	platform_set_drvdata(pdev, bank);
++
++	for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
++		field.reg = base + i * stride;
++		field.lsb = 0;
++		field.msb = 32;
++
++		bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
++							     regmap, field);
++	}
++
++	pm_runtime_enable(&pdev->dev);
++
++	ret = hwspin_lock_register(bank, &pdev->dev, &qcom_hwspinlock_ops,
++				   0, QCOM_MUTEX_NUM_LOCKS);
++	if (ret)
++		pm_runtime_disable(&pdev->dev);
++
++	return ret;
++}
++
++static int qcom_hwspinlock_remove(struct platform_device *pdev)
++{
++	struct hwspinlock_device *bank = platform_get_drvdata(pdev);
++	int ret;
++
++	ret = hwspin_lock_unregister(bank);
++	if (ret) {
++		dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
++		return ret;
++	}
++
++	pm_runtime_disable(&pdev->dev);
++
++	return 0;
++}
++
++static struct platform_driver qcom_hwspinlock_driver = {
++	.probe		= qcom_hwspinlock_probe,
++	.remove		= qcom_hwspinlock_remove,
++	.driver		= {
++		.name	= "qcom_hwspinlock",
++		.of_match_table = qcom_hwspinlock_of_match,
++	},
++};
++
++static int __init qcom_hwspinlock_init(void)
++{
++	return platform_driver_register(&qcom_hwspinlock_driver);
++}
++/* board init code might need to reserve hwspinlocks for predefined purposes */
++postcore_initcall(qcom_hwspinlock_init);
++
++static void __exit qcom_hwspinlock_exit(void)
++{
++	platform_driver_unregister(&qcom_hwspinlock_driver);
++}
++module_exit(qcom_hwspinlock_exit);
++
++MODULE_LICENSE("GPL v2");
++MODULE_DESCRIPTION("Hardware spinlock driver for Qualcomm SoCs");
diff --git a/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch b/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
new file mode 100644
index 0000000..70d5a58
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
@@ -0,0 +1,26 @@
+From bd5717a4632cdecafe82d03de7dcb3b1876e2828 Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Date: Fri, 26 Jun 2015 14:47:21 -0700
+Subject: [PATCH] hwspinlock: qcom: Correct msb in regmap_field
+
+msb of the regmap_field was mistakenly given the value 32, to set all bits
+in the regmap update mask; although incorrect this worked until 921cc294,
+where the mask calculation was corrected.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Signed-off-by: Ohad Ben-Cohen <ohad at wizery.com>
+---
+ drivers/hwspinlock/qcom_hwspinlock.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hwspinlock/qcom_hwspinlock.c
++++ b/drivers/hwspinlock/qcom_hwspinlock.c
+@@ -123,7 +123,7 @@ static int qcom_hwspinlock_probe(struct
+ 	for (i = 0; i < QCOM_MUTEX_NUM_LOCKS; i++) {
+ 		field.reg = base + i * stride;
+ 		field.lsb = 0;
+-		field.msb = 32;
++		field.msb = 31;
+ 
+ 		bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
+ 							     regmap, field);
diff --git a/target/linux/ipq806x/patches-4.1/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch b/target/linux/ipq806x/patches-4.1/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
new file mode 100644
index 0000000..a126d69
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
@@ -0,0 +1,33 @@
+From c7c482da19a5e4ba7101198c21c2434056b0b2da Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Thu, 13 Aug 2015 09:45:26 -0700
+Subject: [PATCH 1/3] ARM: qcom: add SFPB nodes to IPQ806x dts
+
+Add one new node to the ipq806x.dtsi file to declare & register the
+hardware spinlock devices. This mechanism is required to be used by
+other drivers such as SMEM.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064.dtsi | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -329,5 +329,16 @@
+ 			#reset-cells = <1>;
+ 		};
+ 
++		sfpb_mutex_block: syscon at 1200600 {
++			compatible = "syscon";
++			reg = <0x01200600 0x100>;
++		};
+ 	};
++
++	sfpb_mutex: sfpb-mutex {
++		compatible = "qcom,sfpb-mutex";
++		syscon = <&sfpb_mutex_block 4 4>;
++
++		#hwlock-cells = <1>;
++ 	};
+ };
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index fc2fe0a..f53b23d 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -134,10 +134,11 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  
  / {
  	model = "Qualcomm IPQ8064";
-@@ -329,5 +331,127 @@
- 			#reset-cells = <1>;
+@@ -333,6 +335,129 @@
+ 			compatible = "syscon";
+ 			reg = <0x01200600 0x100>;
  		};
- 
++
 +		pcie0: pci at 1b500000 {
 +			compatible = "qcom,pcie-v0";
 +			reg = <0x1b500000 0x1000
@@ -261,4 +262,5 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			status = "disabled";
 +		};
  	};
- };
+ 
+ 	sfpb_mutex: sfpb-mutex {
diff --git a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch b/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
index 59b7fcc..d01e5a8 100644
--- a/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
+++ b/target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -359,15 +359,21 @@
+@@ -364,15 +364,21 @@
  
  			clocks = <&gcc PCIE_A_CLK>,
  				 <&gcc PCIE_H_CLK>,
@@ -26,7 +26,7 @@
  
  			status = "disabled";
  		};
-@@ -400,15 +406,21 @@
+@@ -405,15 +411,21 @@
  
  			clocks = <&gcc PCIE_1_A_CLK>,
  				 <&gcc PCIE_1_H_CLK>,
@@ -52,7 +52,7 @@
  
  			status = "disabled";
  		};
-@@ -441,15 +453,21 @@
+@@ -446,15 +458,21 @@
  
  			clocks = <&gcc PCIE_2_A_CLK>,
  				 <&gcc PCIE_2_H_CLK>,
diff --git a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch b/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index a833280..159d912 100644
--- a/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ b/target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -13,7 +13,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -595,5 +595,25 @@
+@@ -600,6 +600,26 @@
  
  			status = "disabled";
  		};
@@ -38,4 +38,5 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 +			status = "disabled";
 +		};
  	};
- };
+ 
+ 	sfpb_mutex: sfpb-mutex {
diff --git a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch b/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
index 27eae8f..5049b60 100644
--- a/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
+++ b/target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
@@ -26,7 +26,7 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -615,5 +615,21 @@
+@@ -620,6 +620,22 @@
  
  			status = "disabled";
  		};
@@ -47,4 +47,5 @@ arch/arm/boot/dts/qcom-ipq8064.dtsi | 15 +++++++++++++++
 +			status = "disabled";
 +		};
  	};
- };
+ 
+ 	sfpb_mutex: sfpb-mutex {
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 0324e02..87a3728 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -117,7 +117,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -631,5 +631,91 @@
+@@ -636,6 +636,92 @@
  
  			status = "disabled";
  		};
@@ -208,4 +208,5 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
 +			status = "disabled";
 +		};
  	};
- };
+ 
+ 	sfpb_mutex: sfpb-mutex {
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Fri Aug 14 20:50:42 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Fri, 14 Aug 2015 17:50:42 -0700
Subject: [OpenWrt-Devel] [PATCH 3/5] ipq806x: add SMEM support
In-Reply-To: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
References: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439599844-4387-4-git-send-email-mathieu@codeaurora.org>

2 patches are cherry-picked from the following LKML thread:
*https://lkml.org/lkml/2015/4/11/208

The last patch (036-soc-qcom-add-smem-to-IPQ806x-platforms.patch) is
adding the corresponding DT nodes required for IPQ806x.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +++++++++++++++++++++
 ...-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch |  36 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +++++++++++++++++++++
 ...-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch |  36 +
 6 files changed, 1918 insertions(+)
 create mode 100644 target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch

diff --git a/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch b/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
new file mode 100644
index 0000000..d22db22
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
@@ -0,0 +1,82 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,1/2] soc: qcom: Add device tree binding for SMEM
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+X-Patchwork-Id: 6202201
+Message-Id: <1428795178-24312-1-git-send-email-bjorn.andersson at sonymobile.com>
+To: Rob Herring <robh+dt at kernel.org>, Pawel Moll <pawel.moll at arm.com>,
+	Mark Rutland <mark.rutland at arm.com>,
+	Ian Campbell <ijc+devicetree at hellion.org.uk>,
+	Kumar Gala <galak at codeaurora.org>, Jeffrey Hugo <jhugo at codeaurora.org>, 
+	Andry Gross <agross at codeaurora.org>
+Cc: <devicetree at vger.kernel.org>,
+	linux-arm-msm <linux-arm-msm at vger.kernel.org>,
+	<linux-kernel at vger.kernel.org>
+Date: Sat, 11 Apr 2015 16:32:57 -0700
+
+Add device tree binding documentation for the Qualcom Shared Memory
+manager.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+
+---
+Changes since v1:
+- None
+
+ .../devicetree/bindings/soc/qcom/qcom,smem.txt     | 49 ++++++++++++++++++++++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+@@ -0,0 +1,49 @@
++Qualcomm Shared Memory binding
++
++This binding describes the Qualcomm Shared Memory, used to share data between
++various subsystems and OSes in Qualcomm platforms.
++
++- compatible:
++	Usage: required
++	Value type: <stringlist>
++	Definition: must be:
++		    "qcom,smem"
++
++- memory-region:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: handle to memory reservation for main smem memory region.
++
++- reg:
++	Usage: optional
++	Value type: <prop-encoded-array>
++	Definition: base address and size pair for any additional memory areas
++		    of the shared memory.
++
++- hwspinlocks:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: reference to a hwspinlock used to protect allocations from
++		    the shared memory
++
++= EXAMPLE
++
++	reserved-memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges;
++
++		smem_region: smem at fa00000 {
++			reg = <0xfa00000 0x200000>;
++			no-map;
++		};
++	};
++
++	smem at fa00000 {
++		compatible = "qcom,smem";
++
++		memory-region = <&smem_region>;
++		reg = <0xfc428000 0x4000>;
++
++		hwlocks = <&tcsr_mutex 3>;
++	};
diff --git a/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch b/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
new file mode 100644
index 0000000..c8cff1a
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
@@ -0,0 +1,841 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,2/2] soc: qcom: Add Shared Memory Manager driver
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+X-Patchwork-Id: 6202211
+Message-Id: <1428795178-24312-2-git-send-email-bjorn.andersson at sonymobile.com>
+To: Kumar Gala <galak at codeaurora.org>, Andy Gross <agross at codeaurora.org>,
+	David Brown <davidb at codeaurora.org>, Jeffrey Hugo <jhugo at codeaurora.org>
+Cc: <linux-kernel at vger.kernel.org>, <linux-arm-msm at vger.kernel.org>,
+	<linux-soc at vger.kernel.org>
+Date: Sat, 11 Apr 2015 16:32:58 -0700
+
+The Shared Memory Manager driver implements an interface for allocating
+and accessing items in the memory area shared among all of the
+processors in a Qualcomm platform.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Tested-by: Andy Gross <agross at codeaurora.org>
+
+---
+Changes since v1:
+- ioremapping the regions nocache
+- improved documentation of the two regions of partitions
+- corrected free space check in private allocator
+
+ drivers/soc/qcom/Kconfig      |   7 +
+ drivers/soc/qcom/Makefile     |   1 +
+ drivers/soc/qcom/smem.c       | 768 ++++++++++++++++++++++++++++++++++++++++++
+ include/linux/soc/qcom/smem.h |  14 +
+ 4 files changed, 790 insertions(+)
+ create mode 100644 drivers/soc/qcom/smem.c
+ create mode 100644 include/linux/soc/qcom/smem.h
+
+--- a/drivers/soc/qcom/Kconfig
++++ b/drivers/soc/qcom/Kconfig
+@@ -9,3 +9,10 @@ config QCOM_GSBI
+           functions for connecting the underlying serial UART, SPI, and I2C
+           devices to the output pins.
+ 
++config QCOM_SMEM
++	tristate "Qualcomm Shared Memory Manager (SMEM)"
++	depends on ARCH_QCOM
++	help
++	  Say y here to enable support for the Qualcomm Shared Memory Manager.
++	  The driver provides an interface to items in a heap shared among all
++	  processors in a Qualcomm platform.
+--- a/drivers/soc/qcom/Makefile
++++ b/drivers/soc/qcom/Makefile
+@@ -1 +1,2 @@
+ obj-$(CONFIG_QCOM_GSBI)	+=	qcom_gsbi.o
++obj-$(CONFIG_QCOM_SMEM) +=	smem.o
+--- /dev/null
++++ b/drivers/soc/qcom/smem.c
+@@ -0,0 +1,768 @@
++/*
++ * Copyright (c) 2015, Sony Mobile Communications AB.
++ * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/hwspinlock.h>
++#include <linux/io.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/soc/qcom/smem.h>
++
++/*
++ * The Qualcomm shared memory system is a allocate only heap structure that
++ * consists of one of more memory areas that can be accessed by the processors
++ * in the SoC.
++ *
++ * All systems contains a global heap, accessible by all processors in the SoC,
++ * with a table of contents data structure (@smem_header) at the beginning of
++ * the main shared memory block.
++ *
++ * The global header contains metadata for allocations as well as a fixed list
++ * of 512 entries (@smem_global_entry) that can be initialized to reference
++ * parts of the shared memory space.
++ *
++ *
++ * In addition to this global heap a set of "private" heaps can be set up at
++ * boot time with access restrictions so that only certain processor pairs can
++ * access the data.
++ *
++ * These partitions are referenced from an optional partition table
++ * (@smem_ptable), that is found 4kB from the end of the main smem region. The
++ * partition table entries (@smem_ptable_entry) lists the involved processors
++ * (or hosts) and their location in the main shared memory region.
++ *
++ * Each partition starts with a header (@smem_partition_header) that identifies
++ * the partition and holds properties for the two internal memory regions. The
++ * two regions are cached and non-cached memory respectively. Each region
++ * contain a link list of allocation headers (@smem_private_entry) followed by
++ * their data.
++ *
++ * Items in the non-cached region are allocated from the start of the partition
++ * while items in the cached region are allocated from the end. The free area
++ * is hence the region between the cached and non-cached offsets.
++ *
++ *
++ * To synchronize allocations in the shared memory heaps a remote spinlock must
++ * be held - currently lock number 3 of the sfpb or tcsr is used for this on all
++ * platforms.
++ *
++ */
++
++/**
++  * struct smem_proc_comm - proc_comm communication struct (legacy)
++  * @command:	current command to be executed
++  * @status:	status of the currently requested command
++  * @params:	parameters to the command
++  */
++struct smem_proc_comm {
++	u32 command;
++	u32 status;
++	u32 params[2];
++};
++
++/**
++ * struct smem_global_entry - entry to reference smem items on the heap
++ * @allocated:	boolean to indicate if this entry is used
++ * @offset:	offset to the allocated space
++ * @size:	size of the allocated space, 8 byte aligned
++ * @aux_base:	base address for the memory region used by this unit, or 0 for
++ *		the default region. bits 0,1 are reserved
++ */
++struct smem_global_entry {
++	u32 allocated;
++	u32 offset;
++	u32 size;
++	u32 aux_base; /* bits 1:0 reserved */
++};
++#define AUX_BASE_MASK		0xfffffffc
++
++/**
++ * struct smem_header - header found in beginning of primary smem region
++ * @proc_comm:		proc_comm communication interface (legacy)
++ * @version:		array of versions for the various subsystems
++ * @initialized:	boolean to indicate that smem is initialized
++ * @free_offset:	index of the first unallocated byte in smem
++ * @available:		number of bytes available for allocation
++ * @reserved:		reserved field, must be 0
++ * toc:			array of references to items
++ */
++struct smem_header {
++	struct smem_proc_comm proc_comm[4];
++	u32 version[32];
++	u32 initialized;
++	u32 free_offset;
++	u32 available;
++	u32 reserved;
++	struct smem_global_entry toc[];
++};
++
++/**
++ * struct smem_ptable_entry - one entry in the @smem_ptable list
++ * @offset:	offset, within the main shared memory region, of the partition
++ * @size:	size of the partition
++ * @flags:	flags for the partition (currently unused)
++ * @host0:	first processor/host with access to this partition
++ * @host1:	second processor/host with access to this partition
++ * @reserved:	reserved entries for later use
++ */
++struct smem_ptable_entry {
++	u32 offset;
++	u32 size;
++	u32 flags;
++	u16 host0;
++	u16 host1;
++	u32 reserved[8];
++};
++
++/**
++ * struct smem_ptable - partition table for the private partitions
++ * @magic:	magic number, must be SMEM_PTABLE_MAGIC
++ * @version:	version of the partition table
++ * @num_entries: number of partitions in the table
++ * @reserved:	for now reserved entries
++ * @entry:	list of @smem_ptable_entry for the @num_entries partitions
++ */
++struct smem_ptable {
++	u32 magic;
++	u32 version;
++	u32 num_entries;
++	u32 reserved[5];
++	struct smem_ptable_entry entry[];
++};
++#define SMEM_PTABLE_MAGIC	0x434f5424 /* "$TOC" */
++
++/**
++ * struct smem_partition_header - header of the partitions
++ * @magic:	magic number, must be SMEM_PART_MAGIC
++ * @host0:	first processor/host with access to this partition
++ * @host1:	second processor/host with access to this partition
++ * @size:	size of the partition
++ * @offset_free_uncached: offset to the first free byte of uncached memory in
++ *		this partition
++ * @offset_free_cached: offset to the first free byte of cached memory in this
++ *		partition
++ * @reserved:	for now reserved entries
++ */
++struct smem_partition_header {
++	u32 magic;
++	u16 host0;
++	u16 host1;
++	u32 size;
++	u32 offset_free_uncached;
++	u32 offset_free_cached;
++	u32 reserved[3];
++};
++#define SMEM_PART_MAGIC		0x54525024 /* "$PRT" */
++
++/**
++ * struct smem_private_entry - header of each item in the private partition
++ * @canary:	magic number, must be SMEM_PRIVATE_CANARY
++ * @item:	identifying number of the smem item
++ * @size:	size of the data, including padding bytes
++ * @padding_data: number of bytes of padding of data
++ * @padding_hdr: number of bytes of padding between the header and the data
++ * @reserved:	for now reserved entry
++ */
++struct smem_private_entry {
++	u16 canary;
++	u16 item;
++	u32 size; /* includes padding bytes */
++	u16 padding_data;
++	u16 padding_hdr;
++	u32 reserved;
++};
++#define SMEM_PRIVATE_CANARY	0xa5a5
++
++/*
++ * Item 3 of the global heap contains an array of versions for the various
++ * software components in the SoC. We verify that the boot loader version is
++ * what the expected version (SMEM_EXPECTED_VERSION) as a sanity check.
++ */
++#define SMEM_ITEM_VERSION	3
++#define  SMEM_MASTER_SBL_VERSION_INDEX	7
++#define  SMEM_EXPECTED_VERSION		11
++
++/*
++ * The first 8 items are only to be allocated by the boot loader while
++ * initializing the heap.
++ */
++#define SMEM_ITEM_LAST_FIXED	8
++
++/* Highest accepted item number, for both global and private heaps */
++#define SMEM_ITEM_LAST		512
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS		0
++
++/* Max number of processors/hosts in a system */
++#define SMEM_HOST_COUNT		7
++
++/**
++ * struct smem_region - representation of a chunk of memory used for smem
++ * @aux_base:	identifier of aux_mem base
++ * @virt_base:	virtual base address of memory with this aux_mem identifier
++ * @size:	size of the memory region
++ */
++struct smem_region {
++	u32 aux_base;
++	void __iomem *virt_base;
++	size_t size;
++};
++
++/**
++ * struct qcom_smem - device data for the smem device
++ * @dev:	device pointer
++ * @hwlock:	reference to a hwspinlock
++ * @partitions:	list of pointers to partitions affecting the current
++ *		processor/host
++ * @num_regions: number of @regions
++ * @regions:	list of the memory regions defining the shared memory
++ */
++struct qcom_smem {
++	struct device *dev;
++
++	struct hwspinlock *hwlock;
++
++	struct smem_partition_header *partitions[SMEM_HOST_COUNT];
++
++	unsigned num_regions;
++	struct smem_region regions[0];
++};
++
++/* Pointer to the one and only smem handle */
++static struct qcom_smem *__smem;
++
++/* Timeout (ms) for the trylock of remote spinlocks */
++#define HWSPINLOCK_TIMEOUT	1000
++
++static int qcom_smem_alloc_private(struct qcom_smem *smem,
++				   unsigned host,
++				   unsigned item,
++				   size_t size)
++{
++	struct smem_partition_header *phdr;
++	struct smem_private_entry *hdr;
++	size_t alloc_size;
++	void *p;
++
++	/* We're not going to find it if there's no matching partition */
++	if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
++		return -ENOENT;
++
++	phdr = smem->partitions[host];
++
++	p = (void *)phdr + sizeof(*phdr);
++	while (p < (void *)phdr + phdr->offset_free_uncached) {
++		hdr = p;
++
++		if (hdr->canary != SMEM_PRIVATE_CANARY) {
++			dev_err(smem->dev,
++				"Found invalid canary in host %d partition\n",
++				host);
++			return -EINVAL;
++		}
++
++		if (hdr->item == item)
++			return -EEXIST;
++
++		p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
++	}
++
++	/* Check that we don't grow into the cached region */
++	alloc_size = sizeof(*hdr) + ALIGN(size, 8);
++	if (p + alloc_size >= (void *)phdr + phdr->offset_free_cached) {
++		dev_err(smem->dev, "Out of memory\n");
++		return -ENOSPC;
++	}
++
++	hdr = p;
++	hdr->canary = SMEM_PRIVATE_CANARY;
++	hdr->item = item;
++	hdr->size = ALIGN(size, 8);
++	hdr->padding_data = hdr->size - size;
++	hdr->padding_hdr = 0;
++
++	/*
++	 * Ensure the header is written before we advance the free offset, so
++	 * that remote processors that does not take the remote spinlock still
++	 * gets a consistent view of the linked list.
++	 */
++	wmb();
++	phdr->offset_free_uncached += alloc_size;
++
++	return 0;
++}
++
++static int qcom_smem_alloc_global(struct qcom_smem *smem,
++				  unsigned item,
++				  size_t size)
++{
++	struct smem_header *header;
++	struct smem_global_entry *entry;
++
++	if (WARN_ON(item >= SMEM_ITEM_LAST))
++		return -EINVAL;
++
++	header = smem->regions[0].virt_base;
++	entry = &header->toc[item];
++	if (entry->allocated)
++		return -EEXIST;
++
++	size = ALIGN(size, 8);
++	if (WARN_ON(size > header->available))
++		return -ENOMEM;
++
++	entry->offset = header->free_offset;
++	entry->size = size;
++
++	/*
++	 * Ensure the header is consistent before we mark the item allocated,
++	 * so that remote processors will get a consistent view of the item
++	 * even though they do not take the spinlock on read.
++	 */
++	wmb();
++	entry->allocated = 1;
++
++	header->free_offset += size;
++	header->available -= size;
++
++	return 0;
++}
++
++/**
++ * qcom_smem_alloc - allocate space for a smem item
++ * @host:	remote processor id, or -1
++ * @item:	smem item handle
++ * @size:	number of bytes to be allocated
++ *
++ * Allocate space for a given smem item of size @size, given that the item is
++ * not yet allocated.
++ */
++int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
++{
++	unsigned long flags;
++	int ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	if (item < SMEM_ITEM_LAST_FIXED) {
++		dev_err(__smem->dev,
++			"Rejecting allocation of static entry %d\n", item);
++		return -EINVAL;
++	}
++
++	ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
++					  HWSPINLOCK_TIMEOUT,
++					  &flags);
++	if (ret)
++		return ret;
++
++	ret = qcom_smem_alloc_private(__smem, host, item, size);
++	if (ret == -ENOENT)
++		ret = qcom_smem_alloc_global(__smem, item, size);
++
++	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
++
++	return ret;
++}
++EXPORT_SYMBOL(qcom_smem_alloc);
++
++static int qcom_smem_get_global(struct qcom_smem *smem,
++				unsigned item,
++				void **ptr,
++				size_t *size)
++{
++	struct smem_header *header;
++	struct smem_region *area;
++	struct smem_global_entry *entry;
++	u32 aux_base;
++	unsigned i;
++
++	if (WARN_ON(item >= SMEM_ITEM_LAST))
++		return -EINVAL;
++
++	header = smem->regions[0].virt_base;
++	entry = &header->toc[item];
++	if (!entry->allocated)
++		return -ENXIO;
++
++	if (ptr != NULL) {
++		aux_base = entry->aux_base & AUX_BASE_MASK;
++
++		for (i = 0; i < smem->num_regions; i++) {
++			area = &smem->regions[i];
++
++			if (area->aux_base == aux_base || !aux_base) {
++				*ptr = area->virt_base + entry->offset;
++				break;
++			}
++		}
++	}
++	if (size != NULL)
++		*size = entry->size;
++
++	return 0;
++}
++
++static int qcom_smem_get_private(struct qcom_smem *smem,
++				 unsigned host,
++				 unsigned item,
++				 void **ptr,
++				 size_t *size)
++{
++	struct smem_partition_header *phdr;
++	struct smem_private_entry *hdr;
++	void *p;
++
++	/* We're not going to find it if there's no matching partition */
++	if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
++		return -ENOENT;
++
++	phdr = smem->partitions[host];
++
++	p = (void *)phdr + sizeof(*phdr);
++	while (p < (void *)phdr + phdr->offset_free_uncached) {
++		hdr = p;
++
++		if (hdr->canary != SMEM_PRIVATE_CANARY) {
++			dev_err(smem->dev,
++				"Found invalid canary in host %d partition\n",
++				host);
++			return -EINVAL;
++		}
++
++		if (hdr->item == item) {
++			if (ptr != NULL)
++				*ptr = p + sizeof(*hdr) + hdr->padding_hdr;
++
++			if (size != NULL)
++				*size = hdr->size - hdr->padding_data;
++
++			return 0;
++		}
++
++		p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
++	}
++
++	return -ENOENT;
++}
++
++/**
++ * qcom_smem_get - resolve ptr of size of a smem item
++ * @host:	the remote processor, or -1
++ * @item:	smem item handle
++ * @ptr:	pointer to be filled out with address of the item
++ * @size:	pointer to be filled out with size of the item
++ *
++ * Looks up pointer and size of a smem item.
++ */
++int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size)
++{
++	unsigned long flags;
++	int ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
++					  HWSPINLOCK_TIMEOUT,
++					  &flags);
++	if (ret)
++		return ret;
++
++	ret = qcom_smem_get_private(__smem, host, item, ptr, size);
++	if (ret == -ENOENT)
++		ret = qcom_smem_get_global(__smem, item, ptr, size);
++
++	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
++	return ret;
++
++}
++EXPORT_SYMBOL(qcom_smem_get);
++
++/**
++ * qcom_smem_get_free_space - retrieve amont of free space in a partition
++ * @host:	the remote processor identifing a partition, or -1
++ *
++ * To be used by smem clients as a quick way to determine if any new
++ * allocations has been made.
++ */
++int qcom_smem_get_free_space(unsigned host)
++{
++	struct smem_partition_header *phdr;
++	struct smem_header *header;
++	unsigned ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	if (host < SMEM_HOST_COUNT && __smem->partitions[host]) {
++		phdr = __smem->partitions[host];
++		ret = phdr->offset_free_uncached;
++	} else {
++		header = __smem->regions[0].virt_base;
++		ret = header->available;
++	}
++
++	return ret;
++}
++EXPORT_SYMBOL(qcom_smem_get_free_space);
++
++static int qcom_smem_get_sbl_version(struct qcom_smem *smem)
++{
++	unsigned *versions;
++	size_t size;
++	int ret;
++
++	ret = qcom_smem_get_global(smem, SMEM_ITEM_VERSION,
++				   (void **)&versions, &size);
++	if (ret < 0) {
++		dev_err(smem->dev, "Unable to read the version item\n");
++		return -ENOENT;
++	}
++
++	if (size < sizeof(unsigned) * SMEM_MASTER_SBL_VERSION_INDEX) {
++		dev_err(smem->dev, "Version item is too small\n");
++		return -EINVAL;
++	}
++
++	return versions[SMEM_MASTER_SBL_VERSION_INDEX];
++}
++
++static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
++					  unsigned local_host)
++{
++	struct smem_partition_header *header;
++	struct smem_ptable_entry *entry;
++	struct smem_ptable *ptable;
++	unsigned remote_host;
++	int i;
++
++	ptable = smem->regions[0].virt_base + smem->regions[0].size - 4 * 1024;
++	if (ptable->magic != SMEM_PTABLE_MAGIC)
++		return 0;
++
++	if (ptable->version != 1) {
++		dev_err(smem->dev,
++			"Unsupported partition header version %d\n",
++			ptable->version);
++		return -EINVAL;
++	}
++
++	for (i = 0; i < ptable->num_entries; i++) {
++		entry = &ptable->entry[i];
++
++		if (entry->host0 != local_host && entry->host1 != local_host)
++			continue;
++
++		if (!entry->offset)
++			continue;
++
++		if (!entry->size)
++			continue;
++
++		if (entry->host0 == local_host)
++			remote_host = entry->host1;
++		else
++			remote_host = entry->host0;
++
++		if (smem->partitions[remote_host]) {
++			dev_err(smem->dev,
++				"Already found a partition for host %d\n",
++				remote_host);
++			return -EINVAL;
++		}
++
++		header = smem->regions[0].virt_base + entry->offset;
++
++		if (header->magic != SMEM_PART_MAGIC) {
++			dev_err(smem->dev,
++				"Partition %d has invalid magic\n", i);
++			return -EINVAL;
++		}
++
++		if (header->host0 != local_host && header->host1 != local_host) {
++			dev_err(smem->dev,
++				"Partition %d hosts are invalid\n", i);
++			return -EINVAL;
++		}
++
++		if (header->host0 != remote_host && header->host1 != remote_host) {
++			dev_err(smem->dev,
++				"Partition %d hosts are invalid\n", i);
++			return -EINVAL;
++		}
++
++		if (header->size != entry->size) {
++			dev_err(smem->dev,
++				"Partition %d has invalid size\n", i);
++			return -EINVAL;
++		}
++
++		if (header->offset_free_uncached > header->size) {
++			dev_err(smem->dev,
++				"Partition %d has invalid free pointer\n", i);
++			return -EINVAL;
++		}
++
++		smem->partitions[remote_host] = header;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_count_mem_regions(struct platform_device *pdev)
++{
++	struct resource *res;
++	int num_regions = 0;
++	int i;
++
++	for (i = 0; i < pdev->num_resources; i++) {
++		res = &pdev->resource[i];
++
++		if (resource_type(res) == IORESOURCE_MEM)
++			num_regions++;
++	}
++
++	return num_regions;
++}
++
++static int qcom_smem_probe(struct platform_device *pdev)
++{
++	struct smem_header *header;
++	struct device_node *np;
++	struct qcom_smem *smem;
++	struct resource *res;
++	struct resource r;
++	size_t array_size;
++	int num_regions = 0;
++	int hwlock_id;
++	u32 version;
++	int ret;
++	int i;
++
++	num_regions = qcom_smem_count_mem_regions(pdev) + 1;
++
++	array_size = num_regions * sizeof(struct smem_region);
++	smem = devm_kzalloc(&pdev->dev, sizeof(*smem) + array_size, GFP_KERNEL);
++	if (!smem)
++		return -ENOMEM;
++
++	smem->dev = &pdev->dev;
++	smem->num_regions = num_regions;
++
++	np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
++	if (!np) {
++		dev_err(&pdev->dev, "No memory-region specified\n");
++		return -EINVAL;
++	}
++
++	ret = of_address_to_resource(np, 0, &r);
++	of_node_put(np);
++	if (ret)
++		return ret;
++
++	smem->regions[0].aux_base = (u32)r.start;
++	smem->regions[0].size = resource_size(&r);
++	smem->regions[0].virt_base = devm_ioremap_nocache(&pdev->dev,
++							  r.start,
++							  resource_size(&r));
++	if (!smem->regions[0].virt_base)
++		return -ENOMEM;
++
++	for (i = 1; i < num_regions; i++) {
++		res = platform_get_resource(pdev, IORESOURCE_MEM, i - 1);
++
++		smem->regions[i].aux_base = (u32)res->start;
++		smem->regions[i].size = resource_size(res);
++		smem->regions[i].virt_base = devm_ioremap_nocache(&pdev->dev,
++								  res->start,
++								  resource_size(res));
++		if (!smem->regions[i].virt_base)
++			return -ENOMEM;
++	}
++
++	header = smem->regions[0].virt_base;
++	if (header->initialized != 1 || header->reserved) {
++		dev_err(&pdev->dev, "SMEM is not initilized by SBL\n");
++		return -EINVAL;
++	}
++
++	version = qcom_smem_get_sbl_version(smem);
++	if (version >> 16 != SMEM_EXPECTED_VERSION) {
++		dev_err(&pdev->dev, "Unsupported smem version 0x%x\n", version);
++		return -EINVAL;
++	}
++
++	ret = qcom_smem_enumerate_partitions(smem, SMEM_HOST_APPS);
++	if (ret < 0)
++		return ret;
++
++	hwlock_id = of_hwspin_lock_get_id(pdev->dev.of_node, 0);
++	if (hwlock_id < 0) {
++		dev_err(&pdev->dev, "failed to retrieve hwlock\n");
++		return hwlock_id;
++	}
++
++	smem->hwlock = hwspin_lock_request_specific(hwlock_id);
++	if (!smem->hwlock)
++		return -ENXIO;
++
++	__smem = smem;
++
++	return 0;
++}
++
++static int qcom_smem_remove(struct platform_device *pdev)
++{
++	hwspin_lock_free(__smem->hwlock);
++	__smem = NULL;
++
++	return 0;
++}
++
++static const struct of_device_id qcom_smem_of_match[] = {
++	{ .compatible = "qcom,smem" },
++	{}
++};
++MODULE_DEVICE_TABLE(of, qcom_smem_of_match);
++
++static struct platform_driver qcom_smem_driver = {
++	.probe = qcom_smem_probe,
++	.remove = qcom_smem_remove,
++	.driver  = {
++		.name = "qcom_smem",
++		.of_match_table = qcom_smem_of_match,
++		.suppress_bind_attrs = true,
++	},
++};
++
++static int __init qcom_smem_init(void)
++{
++	return platform_driver_register(&qcom_smem_driver);
++}
++arch_initcall(qcom_smem_init);
++
++static void __exit qcom_smem_exit(void)
++{
++	platform_driver_unregister(&qcom_smem_driver);
++}
++module_exit(qcom_smem_exit)
++
++MODULE_AUTHOR("Bjorn Andersson <bjorn.andersson at sonymobile.com>");
++MODULE_DESCRIPTION("Qualcomm Shared Memory Manager");
++MODULE_LICENSE("GPLv2");
+--- /dev/null
++++ b/include/linux/soc/qcom/smem.h
+@@ -0,0 +1,14 @@
++#ifndef __QCOM_SMEM_H__
++#define __QCOM_SMEM_H__
++
++struct device_node;
++struct qcom_smem;
++
++#define QCOM_SMEM_HOST_ANY -1
++
++int qcom_smem_alloc(unsigned host, unsigned item, size_t size);
++int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size);
++
++int qcom_smem_get_free_space(unsigned host);
++
++#endif
diff --git a/target/linux/ipq806x/patches-3.18/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch b/target/linux/ipq806x/patches-3.18/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
new file mode 100644
index 0000000..b2b9a74
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
@@ -0,0 +1,36 @@
+From f212be3a6134db8dd7c5f6f0987536a669401fae Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Fri, 14 Aug 2015 11:17:20 -0700
+Subject: [PATCH 2/3] ARM: qcom: add SMEM device node to IPQ806x dts
+
+SMEM is used on IPQ806x to store various board related information such
+as boot device and flash partition layout. We'll declare it as a device
+so we can make use of it thanks to the new SMEM soc driver.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064.dtsi | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -54,7 +54,7 @@
+ 			no-map;
+ 		};
+ 
+-		smem at 41000000 {
++		smem: smem at 41000000 {
+ 			reg = <0x41000000 0x200000>;
+ 			no-map;
+ 		};
+@@ -304,4 +304,10 @@
+ 
+ 		#hwlock-cells = <1>;
+  	};
++
++	smem {
++		compatible = "qcom,smem";
++		memory-region = <&smem>;
++		hwlocks = <&sfpb_mutex 3>;
++	};
+ };
diff --git a/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch b/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
new file mode 100644
index 0000000..d22db22
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
@@ -0,0 +1,82 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,1/2] soc: qcom: Add device tree binding for SMEM
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+X-Patchwork-Id: 6202201
+Message-Id: <1428795178-24312-1-git-send-email-bjorn.andersson at sonymobile.com>
+To: Rob Herring <robh+dt at kernel.org>, Pawel Moll <pawel.moll at arm.com>,
+	Mark Rutland <mark.rutland at arm.com>,
+	Ian Campbell <ijc+devicetree at hellion.org.uk>,
+	Kumar Gala <galak at codeaurora.org>, Jeffrey Hugo <jhugo at codeaurora.org>, 
+	Andry Gross <agross at codeaurora.org>
+Cc: <devicetree at vger.kernel.org>,
+	linux-arm-msm <linux-arm-msm at vger.kernel.org>,
+	<linux-kernel at vger.kernel.org>
+Date: Sat, 11 Apr 2015 16:32:57 -0700
+
+Add device tree binding documentation for the Qualcom Shared Memory
+manager.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+
+---
+Changes since v1:
+- None
+
+ .../devicetree/bindings/soc/qcom/qcom,smem.txt     | 49 ++++++++++++++++++++++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+
+--- /dev/null
++++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+@@ -0,0 +1,49 @@
++Qualcomm Shared Memory binding
++
++This binding describes the Qualcomm Shared Memory, used to share data between
++various subsystems and OSes in Qualcomm platforms.
++
++- compatible:
++	Usage: required
++	Value type: <stringlist>
++	Definition: must be:
++		    "qcom,smem"
++
++- memory-region:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: handle to memory reservation for main smem memory region.
++
++- reg:
++	Usage: optional
++	Value type: <prop-encoded-array>
++	Definition: base address and size pair for any additional memory areas
++		    of the shared memory.
++
++- hwspinlocks:
++	Usage: required
++	Value type: <prop-encoded-array>
++	Definition: reference to a hwspinlock used to protect allocations from
++		    the shared memory
++
++= EXAMPLE
++
++	reserved-memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges;
++
++		smem_region: smem at fa00000 {
++			reg = <0xfa00000 0x200000>;
++			no-map;
++		};
++	};
++
++	smem at fa00000 {
++		compatible = "qcom,smem";
++
++		memory-region = <&smem_region>;
++		reg = <0xfc428000 0x4000>;
++
++		hwlocks = <&tcsr_mutex 3>;
++	};
diff --git a/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch b/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
new file mode 100644
index 0000000..5598da2
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
@@ -0,0 +1,841 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,2/2] soc: qcom: Add Shared Memory Manager driver
+From: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+X-Patchwork-Id: 6202211
+Message-Id: <1428795178-24312-2-git-send-email-bjorn.andersson at sonymobile.com>
+To: Kumar Gala <galak at codeaurora.org>, Andy Gross <agross at codeaurora.org>,
+	David Brown <davidb at codeaurora.org>, Jeffrey Hugo <jhugo at codeaurora.org>
+Cc: <linux-kernel at vger.kernel.org>, <linux-arm-msm at vger.kernel.org>,
+	<linux-soc at vger.kernel.org>
+Date: Sat, 11 Apr 2015 16:32:58 -0700
+
+The Shared Memory Manager driver implements an interface for allocating
+and accessing items in the memory area shared among all of the
+processors in a Qualcomm platform.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson at sonymobile.com>
+Reviewed-by: Andy Gross <agross at codeaurora.org>
+Tested-by: Andy Gross <agross at codeaurora.org>
+
+---
+Changes since v1:
+- ioremapping the regions nocache
+- improved documentation of the two regions of partitions
+- corrected free space check in private allocator
+
+ drivers/soc/qcom/Kconfig      |   7 +
+ drivers/soc/qcom/Makefile     |   1 +
+ drivers/soc/qcom/smem.c       | 768 ++++++++++++++++++++++++++++++++++++++++++
+ include/linux/soc/qcom/smem.h |  14 +
+ 4 files changed, 790 insertions(+)
+ create mode 100644 drivers/soc/qcom/smem.c
+ create mode 100644 include/linux/soc/qcom/smem.h
+
+--- a/drivers/soc/qcom/Kconfig
++++ b/drivers/soc/qcom/Kconfig
+@@ -10,3 +10,10 @@ config QCOM_GSBI
+           functions for connecting the underlying serial UART, SPI, and I2C
+           devices to the output pins.
+ 
++config QCOM_SMEM
++	tristate "Qualcomm Shared Memory Manager (SMEM)"
++	depends on ARCH_QCOM
++	help
++	  Say y here to enable support for the Qualcomm Shared Memory Manager.
++	  The driver provides an interface to items in a heap shared among all
++	  processors in a Qualcomm platform.
+--- a/drivers/soc/qcom/Makefile
++++ b/drivers/soc/qcom/Makefile
+@@ -1 +1,2 @@
+ obj-$(CONFIG_QCOM_GSBI)	+=	qcom_gsbi.o
++obj-$(CONFIG_QCOM_SMEM) +=	smem.o
+--- /dev/null
++++ b/drivers/soc/qcom/smem.c
+@@ -0,0 +1,768 @@
++/*
++ * Copyright (c) 2015, Sony Mobile Communications AB.
++ * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/hwspinlock.h>
++#include <linux/io.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/soc/qcom/smem.h>
++
++/*
++ * The Qualcomm shared memory system is a allocate only heap structure that
++ * consists of one of more memory areas that can be accessed by the processors
++ * in the SoC.
++ *
++ * All systems contains a global heap, accessible by all processors in the SoC,
++ * with a table of contents data structure (@smem_header) at the beginning of
++ * the main shared memory block.
++ *
++ * The global header contains metadata for allocations as well as a fixed list
++ * of 512 entries (@smem_global_entry) that can be initialized to reference
++ * parts of the shared memory space.
++ *
++ *
++ * In addition to this global heap a set of "private" heaps can be set up at
++ * boot time with access restrictions so that only certain processor pairs can
++ * access the data.
++ *
++ * These partitions are referenced from an optional partition table
++ * (@smem_ptable), that is found 4kB from the end of the main smem region. The
++ * partition table entries (@smem_ptable_entry) lists the involved processors
++ * (or hosts) and their location in the main shared memory region.
++ *
++ * Each partition starts with a header (@smem_partition_header) that identifies
++ * the partition and holds properties for the two internal memory regions. The
++ * two regions are cached and non-cached memory respectively. Each region
++ * contain a link list of allocation headers (@smem_private_entry) followed by
++ * their data.
++ *
++ * Items in the non-cached region are allocated from the start of the partition
++ * while items in the cached region are allocated from the end. The free area
++ * is hence the region between the cached and non-cached offsets.
++ *
++ *
++ * To synchronize allocations in the shared memory heaps a remote spinlock must
++ * be held - currently lock number 3 of the sfpb or tcsr is used for this on all
++ * platforms.
++ *
++ */
++
++/**
++  * struct smem_proc_comm - proc_comm communication struct (legacy)
++  * @command:	current command to be executed
++  * @status:	status of the currently requested command
++  * @params:	parameters to the command
++  */
++struct smem_proc_comm {
++	u32 command;
++	u32 status;
++	u32 params[2];
++};
++
++/**
++ * struct smem_global_entry - entry to reference smem items on the heap
++ * @allocated:	boolean to indicate if this entry is used
++ * @offset:	offset to the allocated space
++ * @size:	size of the allocated space, 8 byte aligned
++ * @aux_base:	base address for the memory region used by this unit, or 0 for
++ *		the default region. bits 0,1 are reserved
++ */
++struct smem_global_entry {
++	u32 allocated;
++	u32 offset;
++	u32 size;
++	u32 aux_base; /* bits 1:0 reserved */
++};
++#define AUX_BASE_MASK		0xfffffffc
++
++/**
++ * struct smem_header - header found in beginning of primary smem region
++ * @proc_comm:		proc_comm communication interface (legacy)
++ * @version:		array of versions for the various subsystems
++ * @initialized:	boolean to indicate that smem is initialized
++ * @free_offset:	index of the first unallocated byte in smem
++ * @available:		number of bytes available for allocation
++ * @reserved:		reserved field, must be 0
++ * toc:			array of references to items
++ */
++struct smem_header {
++	struct smem_proc_comm proc_comm[4];
++	u32 version[32];
++	u32 initialized;
++	u32 free_offset;
++	u32 available;
++	u32 reserved;
++	struct smem_global_entry toc[];
++};
++
++/**
++ * struct smem_ptable_entry - one entry in the @smem_ptable list
++ * @offset:	offset, within the main shared memory region, of the partition
++ * @size:	size of the partition
++ * @flags:	flags for the partition (currently unused)
++ * @host0:	first processor/host with access to this partition
++ * @host1:	second processor/host with access to this partition
++ * @reserved:	reserved entries for later use
++ */
++struct smem_ptable_entry {
++	u32 offset;
++	u32 size;
++	u32 flags;
++	u16 host0;
++	u16 host1;
++	u32 reserved[8];
++};
++
++/**
++ * struct smem_ptable - partition table for the private partitions
++ * @magic:	magic number, must be SMEM_PTABLE_MAGIC
++ * @version:	version of the partition table
++ * @num_entries: number of partitions in the table
++ * @reserved:	for now reserved entries
++ * @entry:	list of @smem_ptable_entry for the @num_entries partitions
++ */
++struct smem_ptable {
++	u32 magic;
++	u32 version;
++	u32 num_entries;
++	u32 reserved[5];
++	struct smem_ptable_entry entry[];
++};
++#define SMEM_PTABLE_MAGIC	0x434f5424 /* "$TOC" */
++
++/**
++ * struct smem_partition_header - header of the partitions
++ * @magic:	magic number, must be SMEM_PART_MAGIC
++ * @host0:	first processor/host with access to this partition
++ * @host1:	second processor/host with access to this partition
++ * @size:	size of the partition
++ * @offset_free_uncached: offset to the first free byte of uncached memory in
++ *		this partition
++ * @offset_free_cached: offset to the first free byte of cached memory in this
++ *		partition
++ * @reserved:	for now reserved entries
++ */
++struct smem_partition_header {
++	u32 magic;
++	u16 host0;
++	u16 host1;
++	u32 size;
++	u32 offset_free_uncached;
++	u32 offset_free_cached;
++	u32 reserved[3];
++};
++#define SMEM_PART_MAGIC		0x54525024 /* "$PRT" */
++
++/**
++ * struct smem_private_entry - header of each item in the private partition
++ * @canary:	magic number, must be SMEM_PRIVATE_CANARY
++ * @item:	identifying number of the smem item
++ * @size:	size of the data, including padding bytes
++ * @padding_data: number of bytes of padding of data
++ * @padding_hdr: number of bytes of padding between the header and the data
++ * @reserved:	for now reserved entry
++ */
++struct smem_private_entry {
++	u16 canary;
++	u16 item;
++	u32 size; /* includes padding bytes */
++	u16 padding_data;
++	u16 padding_hdr;
++	u32 reserved;
++};
++#define SMEM_PRIVATE_CANARY	0xa5a5
++
++/*
++ * Item 3 of the global heap contains an array of versions for the various
++ * software components in the SoC. We verify that the boot loader version is
++ * what the expected version (SMEM_EXPECTED_VERSION) as a sanity check.
++ */
++#define SMEM_ITEM_VERSION	3
++#define  SMEM_MASTER_SBL_VERSION_INDEX	7
++#define  SMEM_EXPECTED_VERSION		11
++
++/*
++ * The first 8 items are only to be allocated by the boot loader while
++ * initializing the heap.
++ */
++#define SMEM_ITEM_LAST_FIXED	8
++
++/* Highest accepted item number, for both global and private heaps */
++#define SMEM_ITEM_LAST		512
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS		0
++
++/* Max number of processors/hosts in a system */
++#define SMEM_HOST_COUNT		7
++
++/**
++ * struct smem_region - representation of a chunk of memory used for smem
++ * @aux_base:	identifier of aux_mem base
++ * @virt_base:	virtual base address of memory with this aux_mem identifier
++ * @size:	size of the memory region
++ */
++struct smem_region {
++	u32 aux_base;
++	void __iomem *virt_base;
++	size_t size;
++};
++
++/**
++ * struct qcom_smem - device data for the smem device
++ * @dev:	device pointer
++ * @hwlock:	reference to a hwspinlock
++ * @partitions:	list of pointers to partitions affecting the current
++ *		processor/host
++ * @num_regions: number of @regions
++ * @regions:	list of the memory regions defining the shared memory
++ */
++struct qcom_smem {
++	struct device *dev;
++
++	struct hwspinlock *hwlock;
++
++	struct smem_partition_header *partitions[SMEM_HOST_COUNT];
++
++	unsigned num_regions;
++	struct smem_region regions[0];
++};
++
++/* Pointer to the one and only smem handle */
++static struct qcom_smem *__smem;
++
++/* Timeout (ms) for the trylock of remote spinlocks */
++#define HWSPINLOCK_TIMEOUT	1000
++
++static int qcom_smem_alloc_private(struct qcom_smem *smem,
++				   unsigned host,
++				   unsigned item,
++				   size_t size)
++{
++	struct smem_partition_header *phdr;
++	struct smem_private_entry *hdr;
++	size_t alloc_size;
++	void *p;
++
++	/* We're not going to find it if there's no matching partition */
++	if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
++		return -ENOENT;
++
++	phdr = smem->partitions[host];
++
++	p = (void *)phdr + sizeof(*phdr);
++	while (p < (void *)phdr + phdr->offset_free_uncached) {
++		hdr = p;
++
++		if (hdr->canary != SMEM_PRIVATE_CANARY) {
++			dev_err(smem->dev,
++				"Found invalid canary in host %d partition\n",
++				host);
++			return -EINVAL;
++		}
++
++		if (hdr->item == item)
++			return -EEXIST;
++
++		p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
++	}
++
++	/* Check that we don't grow into the cached region */
++	alloc_size = sizeof(*hdr) + ALIGN(size, 8);
++	if (p + alloc_size >= (void *)phdr + phdr->offset_free_cached) {
++		dev_err(smem->dev, "Out of memory\n");
++		return -ENOSPC;
++	}
++
++	hdr = p;
++	hdr->canary = SMEM_PRIVATE_CANARY;
++	hdr->item = item;
++	hdr->size = ALIGN(size, 8);
++	hdr->padding_data = hdr->size - size;
++	hdr->padding_hdr = 0;
++
++	/*
++	 * Ensure the header is written before we advance the free offset, so
++	 * that remote processors that does not take the remote spinlock still
++	 * gets a consistent view of the linked list.
++	 */
++	wmb();
++	phdr->offset_free_uncached += alloc_size;
++
++	return 0;
++}
++
++static int qcom_smem_alloc_global(struct qcom_smem *smem,
++				  unsigned item,
++				  size_t size)
++{
++	struct smem_header *header;
++	struct smem_global_entry *entry;
++
++	if (WARN_ON(item >= SMEM_ITEM_LAST))
++		return -EINVAL;
++
++	header = smem->regions[0].virt_base;
++	entry = &header->toc[item];
++	if (entry->allocated)
++		return -EEXIST;
++
++	size = ALIGN(size, 8);
++	if (WARN_ON(size > header->available))
++		return -ENOMEM;
++
++	entry->offset = header->free_offset;
++	entry->size = size;
++
++	/*
++	 * Ensure the header is consistent before we mark the item allocated,
++	 * so that remote processors will get a consistent view of the item
++	 * even though they do not take the spinlock on read.
++	 */
++	wmb();
++	entry->allocated = 1;
++
++	header->free_offset += size;
++	header->available -= size;
++
++	return 0;
++}
++
++/**
++ * qcom_smem_alloc - allocate space for a smem item
++ * @host:	remote processor id, or -1
++ * @item:	smem item handle
++ * @size:	number of bytes to be allocated
++ *
++ * Allocate space for a given smem item of size @size, given that the item is
++ * not yet allocated.
++ */
++int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
++{
++	unsigned long flags;
++	int ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	if (item < SMEM_ITEM_LAST_FIXED) {
++		dev_err(__smem->dev,
++			"Rejecting allocation of static entry %d\n", item);
++		return -EINVAL;
++	}
++
++	ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
++					  HWSPINLOCK_TIMEOUT,
++					  &flags);
++	if (ret)
++		return ret;
++
++	ret = qcom_smem_alloc_private(__smem, host, item, size);
++	if (ret == -ENOENT)
++		ret = qcom_smem_alloc_global(__smem, item, size);
++
++	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
++
++	return ret;
++}
++EXPORT_SYMBOL(qcom_smem_alloc);
++
++static int qcom_smem_get_global(struct qcom_smem *smem,
++				unsigned item,
++				void **ptr,
++				size_t *size)
++{
++	struct smem_header *header;
++	struct smem_region *area;
++	struct smem_global_entry *entry;
++	u32 aux_base;
++	unsigned i;
++
++	if (WARN_ON(item >= SMEM_ITEM_LAST))
++		return -EINVAL;
++
++	header = smem->regions[0].virt_base;
++	entry = &header->toc[item];
++	if (!entry->allocated)
++		return -ENXIO;
++
++	if (ptr != NULL) {
++		aux_base = entry->aux_base & AUX_BASE_MASK;
++
++		for (i = 0; i < smem->num_regions; i++) {
++			area = &smem->regions[i];
++
++			if (area->aux_base == aux_base || !aux_base) {
++				*ptr = area->virt_base + entry->offset;
++				break;
++			}
++		}
++	}
++	if (size != NULL)
++		*size = entry->size;
++
++	return 0;
++}
++
++static int qcom_smem_get_private(struct qcom_smem *smem,
++				 unsigned host,
++				 unsigned item,
++				 void **ptr,
++				 size_t *size)
++{
++	struct smem_partition_header *phdr;
++	struct smem_private_entry *hdr;
++	void *p;
++
++	/* We're not going to find it if there's no matching partition */
++	if (host >= SMEM_HOST_COUNT || !smem->partitions[host])
++		return -ENOENT;
++
++	phdr = smem->partitions[host];
++
++	p = (void *)phdr + sizeof(*phdr);
++	while (p < (void *)phdr + phdr->offset_free_uncached) {
++		hdr = p;
++
++		if (hdr->canary != SMEM_PRIVATE_CANARY) {
++			dev_err(smem->dev,
++				"Found invalid canary in host %d partition\n",
++				host);
++			return -EINVAL;
++		}
++
++		if (hdr->item == item) {
++			if (ptr != NULL)
++				*ptr = p + sizeof(*hdr) + hdr->padding_hdr;
++
++			if (size != NULL)
++				*size = hdr->size - hdr->padding_data;
++
++			return 0;
++		}
++
++		p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
++	}
++
++	return -ENOENT;
++}
++
++/**
++ * qcom_smem_get - resolve ptr of size of a smem item
++ * @host:	the remote processor, or -1
++ * @item:	smem item handle
++ * @ptr:	pointer to be filled out with address of the item
++ * @size:	pointer to be filled out with size of the item
++ *
++ * Looks up pointer and size of a smem item.
++ */
++int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size)
++{
++	unsigned long flags;
++	int ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
++					  HWSPINLOCK_TIMEOUT,
++					  &flags);
++	if (ret)
++		return ret;
++
++	ret = qcom_smem_get_private(__smem, host, item, ptr, size);
++	if (ret == -ENOENT)
++		ret = qcom_smem_get_global(__smem, item, ptr, size);
++
++	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
++	return ret;
++
++}
++EXPORT_SYMBOL(qcom_smem_get);
++
++/**
++ * qcom_smem_get_free_space - retrieve amont of free space in a partition
++ * @host:	the remote processor identifing a partition, or -1
++ *
++ * To be used by smem clients as a quick way to determine if any new
++ * allocations has been made.
++ */
++int qcom_smem_get_free_space(unsigned host)
++{
++	struct smem_partition_header *phdr;
++	struct smem_header *header;
++	unsigned ret;
++
++	if (!__smem)
++		return -EPROBE_DEFER;
++
++	if (host < SMEM_HOST_COUNT && __smem->partitions[host]) {
++		phdr = __smem->partitions[host];
++		ret = phdr->offset_free_uncached;
++	} else {
++		header = __smem->regions[0].virt_base;
++		ret = header->available;
++	}
++
++	return ret;
++}
++EXPORT_SYMBOL(qcom_smem_get_free_space);
++
++static int qcom_smem_get_sbl_version(struct qcom_smem *smem)
++{
++	unsigned *versions;
++	size_t size;
++	int ret;
++
++	ret = qcom_smem_get_global(smem, SMEM_ITEM_VERSION,
++				   (void **)&versions, &size);
++	if (ret < 0) {
++		dev_err(smem->dev, "Unable to read the version item\n");
++		return -ENOENT;
++	}
++
++	if (size < sizeof(unsigned) * SMEM_MASTER_SBL_VERSION_INDEX) {
++		dev_err(smem->dev, "Version item is too small\n");
++		return -EINVAL;
++	}
++
++	return versions[SMEM_MASTER_SBL_VERSION_INDEX];
++}
++
++static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
++					  unsigned local_host)
++{
++	struct smem_partition_header *header;
++	struct smem_ptable_entry *entry;
++	struct smem_ptable *ptable;
++	unsigned remote_host;
++	int i;
++
++	ptable = smem->regions[0].virt_base + smem->regions[0].size - 4 * 1024;
++	if (ptable->magic != SMEM_PTABLE_MAGIC)
++		return 0;
++
++	if (ptable->version != 1) {
++		dev_err(smem->dev,
++			"Unsupported partition header version %d\n",
++			ptable->version);
++		return -EINVAL;
++	}
++
++	for (i = 0; i < ptable->num_entries; i++) {
++		entry = &ptable->entry[i];
++
++		if (entry->host0 != local_host && entry->host1 != local_host)
++			continue;
++
++		if (!entry->offset)
++			continue;
++
++		if (!entry->size)
++			continue;
++
++		if (entry->host0 == local_host)
++			remote_host = entry->host1;
++		else
++			remote_host = entry->host0;
++
++		if (smem->partitions[remote_host]) {
++			dev_err(smem->dev,
++				"Already found a partition for host %d\n",
++				remote_host);
++			return -EINVAL;
++		}
++
++		header = smem->regions[0].virt_base + entry->offset;
++
++		if (header->magic != SMEM_PART_MAGIC) {
++			dev_err(smem->dev,
++				"Partition %d has invalid magic\n", i);
++			return -EINVAL;
++		}
++
++		if (header->host0 != local_host && header->host1 != local_host) {
++			dev_err(smem->dev,
++				"Partition %d hosts are invalid\n", i);
++			return -EINVAL;
++		}
++
++		if (header->host0 != remote_host && header->host1 != remote_host) {
++			dev_err(smem->dev,
++				"Partition %d hosts are invalid\n", i);
++			return -EINVAL;
++		}
++
++		if (header->size != entry->size) {
++			dev_err(smem->dev,
++				"Partition %d has invalid size\n", i);
++			return -EINVAL;
++		}
++
++		if (header->offset_free_uncached > header->size) {
++			dev_err(smem->dev,
++				"Partition %d has invalid free pointer\n", i);
++			return -EINVAL;
++		}
++
++		smem->partitions[remote_host] = header;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_count_mem_regions(struct platform_device *pdev)
++{
++	struct resource *res;
++	int num_regions = 0;
++	int i;
++
++	for (i = 0; i < pdev->num_resources; i++) {
++		res = &pdev->resource[i];
++
++		if (resource_type(res) == IORESOURCE_MEM)
++			num_regions++;
++	}
++
++	return num_regions;
++}
++
++static int qcom_smem_probe(struct platform_device *pdev)
++{
++	struct smem_header *header;
++	struct device_node *np;
++	struct qcom_smem *smem;
++	struct resource *res;
++	struct resource r;
++	size_t array_size;
++	int num_regions = 0;
++	int hwlock_id;
++	u32 version;
++	int ret;
++	int i;
++
++	num_regions = qcom_smem_count_mem_regions(pdev) + 1;
++
++	array_size = num_regions * sizeof(struct smem_region);
++	smem = devm_kzalloc(&pdev->dev, sizeof(*smem) + array_size, GFP_KERNEL);
++	if (!smem)
++		return -ENOMEM;
++
++	smem->dev = &pdev->dev;
++	smem->num_regions = num_regions;
++
++	np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
++	if (!np) {
++		dev_err(&pdev->dev, "No memory-region specified\n");
++		return -EINVAL;
++	}
++
++	ret = of_address_to_resource(np, 0, &r);
++	of_node_put(np);
++	if (ret)
++		return ret;
++
++	smem->regions[0].aux_base = (u32)r.start;
++	smem->regions[0].size = resource_size(&r);
++	smem->regions[0].virt_base = devm_ioremap_nocache(&pdev->dev,
++							  r.start,
++							  resource_size(&r));
++	if (!smem->regions[0].virt_base)
++		return -ENOMEM;
++
++	for (i = 1; i < num_regions; i++) {
++		res = platform_get_resource(pdev, IORESOURCE_MEM, i - 1);
++
++		smem->regions[i].aux_base = (u32)res->start;
++		smem->regions[i].size = resource_size(res);
++		smem->regions[i].virt_base = devm_ioremap_nocache(&pdev->dev,
++								  res->start,
++								  resource_size(res));
++		if (!smem->regions[i].virt_base)
++			return -ENOMEM;
++	}
++
++	header = smem->regions[0].virt_base;
++	if (header->initialized != 1 || header->reserved) {
++		dev_err(&pdev->dev, "SMEM is not initilized by SBL\n");
++		return -EINVAL;
++	}
++
++	version = qcom_smem_get_sbl_version(smem);
++	if (version >> 16 != SMEM_EXPECTED_VERSION) {
++		dev_err(&pdev->dev, "Unsupported smem version 0x%x\n", version);
++		return -EINVAL;
++	}
++
++	ret = qcom_smem_enumerate_partitions(smem, SMEM_HOST_APPS);
++	if (ret < 0)
++		return ret;
++
++	hwlock_id = of_hwspin_lock_get_id(pdev->dev.of_node, 0);
++	if (hwlock_id < 0) {
++		dev_err(&pdev->dev, "failed to retrieve hwlock\n");
++		return hwlock_id;
++	}
++
++	smem->hwlock = hwspin_lock_request_specific(hwlock_id);
++	if (!smem->hwlock)
++		return -ENXIO;
++
++	__smem = smem;
++
++	return 0;
++}
++
++static int qcom_smem_remove(struct platform_device *pdev)
++{
++	hwspin_lock_free(__smem->hwlock);
++	__smem = NULL;
++
++	return 0;
++}
++
++static const struct of_device_id qcom_smem_of_match[] = {
++	{ .compatible = "qcom,smem" },
++	{}
++};
++MODULE_DEVICE_TABLE(of, qcom_smem_of_match);
++
++static struct platform_driver qcom_smem_driver = {
++	.probe = qcom_smem_probe,
++	.remove = qcom_smem_remove,
++	.driver  = {
++		.name = "qcom_smem",
++		.of_match_table = qcom_smem_of_match,
++		.suppress_bind_attrs = true,
++	},
++};
++
++static int __init qcom_smem_init(void)
++{
++	return platform_driver_register(&qcom_smem_driver);
++}
++arch_initcall(qcom_smem_init);
++
++static void __exit qcom_smem_exit(void)
++{
++	platform_driver_unregister(&qcom_smem_driver);
++}
++module_exit(qcom_smem_exit)
++
++MODULE_AUTHOR("Bjorn Andersson <bjorn.andersson at sonymobile.com>");
++MODULE_DESCRIPTION("Qualcomm Shared Memory Manager");
++MODULE_LICENSE("GPLv2");
+--- /dev/null
++++ b/include/linux/soc/qcom/smem.h
+@@ -0,0 +1,14 @@
++#ifndef __QCOM_SMEM_H__
++#define __QCOM_SMEM_H__
++
++struct device_node;
++struct qcom_smem;
++
++#define QCOM_SMEM_HOST_ANY -1
++
++int qcom_smem_alloc(unsigned host, unsigned item, size_t size);
++int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size);
++
++int qcom_smem_get_free_space(unsigned host);
++
++#endif
diff --git a/target/linux/ipq806x/patches-4.1/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch b/target/linux/ipq806x/patches-4.1/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
new file mode 100644
index 0000000..b55f174
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
@@ -0,0 +1,36 @@
+From f212be3a6134db8dd7c5f6f0987536a669401fae Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Fri, 14 Aug 2015 11:17:20 -0700
+Subject: [PATCH 2/3] ARM: qcom: add SMEM device node to IPQ806x dts
+
+SMEM is used on IPQ806x to store various board related information such
+as boot device and flash partition layout. We'll declare it as a device
+so we can make use of it thanks to the new SMEM soc driver.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ arch/arm/boot/dts/qcom-ipq8064.dtsi | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
+@@ -55,7 +55,7 @@
+ 			no-map;
+ 		};
+ 
+-		smem at 41000000 {
++		smem: smem at 41000000 {
+ 			reg = <0x41000000 0x200000>;
+ 			no-map;
+ 		};
+@@ -341,4 +341,10 @@
+ 
+ 		#hwlock-cells = <1>;
+  	};
++
++	smem {
++		compatible = "qcom,smem";
++		memory-region = <&smem>;
++		hwlocks = <&sfpb_mutex 3>;
++	};
+ };
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Fri Aug 14 20:50:43 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Fri, 14 Aug 2015 17:50:43 -0700
Subject: [OpenWrt-Devel] [PATCH 4/5] ipq806x: add QCOM SMEM based MTD parser
In-Reply-To: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
References: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439599844-4387-5-git-send-email-mathieu@codeaurora.org>

This patch adds a new parser which uses the SMEM available on IPQ and
some other QCOM platforms to map the MTD partitions.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 ...37-mtd-add-SMEM-parser-for-QCOM-platforms.patch | 277 +++++++++++++++++++++
 ...37-mtd-add-SMEM-parser-for-QCOM-platforms.patch | 277 +++++++++++++++++++++
 2 files changed, 554 insertions(+)
 create mode 100644 target/linux/ipq806x/patches-3.18/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch

diff --git a/target/linux/ipq806x/patches-3.18/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch b/target/linux/ipq806x/patches-3.18/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
new file mode 100644
index 0000000..b2c8cd5
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
@@ -0,0 +1,277 @@
+From 0501f76b138cf1dc11a313bb7a094da524b79337 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Thu, 13 Aug 2015 09:53:14 -0700
+Subject: [PATCH 3/3] mtd: add SMEM parser for QCOM platforms
+
+On QCOM platforms using MTD devices storage (such as IPQ806x), SMEM is
+used to store partition layout. This new parser can now be used to read
+SMEM and use it to register an MTD layout according to its content.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ drivers/mtd/Kconfig          |   7 ++
+ drivers/mtd/Makefile         |   1 +
+ drivers/mtd/qcom_smem_part.c | 231 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 239 insertions(+)
+ create mode 100644 drivers/mtd/qcom_smem_part.c
+
+--- a/drivers/mtd/Kconfig
++++ b/drivers/mtd/Kconfig
+@@ -200,6 +200,13 @@ config MTD_MYLOADER_PARTS
+ 	  You will still need the parsing functions to be called by the driver
+ 	  for your particular device. It won't happen automatically.
+ 
++config MTD_QCOM_SMEM_PARTS
++	tristate "QCOM SMEM partitioning support"
++	depends on QCOM_SMEM
++	help
++	  This provides partitions parser for QCOM devices using SMEM
++	  such as IPQ806x.
++
+ comment "User Modules And Translation Layers"
+ 
+ #
+--- /dev/null
++++ b/drivers/mtd/qcom_smem_part.c
+@@ -0,0 +1,231 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/device.h>
++#include <linux/slab.h>
++
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/module.h>
++
++#include <linux/soc/qcom/smem.h>
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS			0
++
++/* SMEM items index */
++#define SMEM_AARM_PARTITION_TABLE	9
++#define SMEM_BOOT_FLASH_TYPE		421
++#define SMEM_BOOT_FLASH_BLOCK_SIZE	424
++
++/* SMEM Flash types */
++#define SMEM_FLASH_NAND			2
++#define SMEM_FLASH_SPI			6
++
++#define SMEM_PART_NAME_SZ		16
++#define SMEM_PARTS_MAX			32
++
++struct smem_partition {
++	char name[SMEM_PART_NAME_SZ];
++	__le32 start;
++	__le32 size;
++	__le32 attr;
++};
++
++struct smem_partition_table {
++	u8 magic[8];
++	__le32 version;
++	__le32 len;
++	struct smem_partition parts[SMEM_PARTS_MAX];
++};
++
++/* SMEM Magic values in partition table */
++static const u8 SMEM_PTABLE_MAGIC[] = {
++	0xaa, 0x73, 0xee, 0x55,
++	0xdb, 0xbd, 0x5e, 0xe3,
++};
++
++static int qcom_smem_get_flash_blksz(u64 **smem_blksz)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_BLOCK_SIZE,
++			    (void **) smem_blksz, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read flash blksz from SMEM\n");
++		return -ENOENT;
++	}
++
++	if (size != sizeof(**smem_blksz)) {
++		pr_err("Invalid flash blksz size in SMEM\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_get_flash_type(u64 **smem_flash_type)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_TYPE,
++			    (void **) smem_flash_type, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read flash type from SMEM\n");
++		return -ENOENT;
++	}
++
++	if (size != sizeof(**smem_flash_type)) {
++		pr_err("Invalid flash type size in SMEM\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_get_flash_partitions(struct smem_partition_table **pparts)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_AARM_PARTITION_TABLE,
++			    (void **) pparts, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read partition table from SMEM\n");
++		return -ENOENT;
++	}
++
++	return 0;
++}
++
++static int of_dev_node_match(struct device *dev, void *data)
++{
++	return dev->of_node == data;
++}
++
++static bool is_spi_device(struct device_node *np)
++{
++	struct device *dev;
++
++	dev = bus_find_device(&spi_bus_type, NULL, np, of_dev_node_match);
++	if (!dev)
++		return false;
++
++	put_device(dev);
++	return true;
++}
++
++static int parse_qcom_smem_partitions(struct mtd_info *master,
++				      struct mtd_partition **pparts,
++				      struct mtd_part_parser_data *data)
++{
++	struct smem_partition_table *smem_parts;
++	u64 *smem_flash_type, *smem_blksz;
++	struct mtd_partition *mtd_parts;
++	struct device_node *of_node = data->of_node;
++	int i, ret;
++
++	/*
++	 * SMEM will only store the partition table of the boot device.
++	 * If this is not the boot device, do not return any partition.
++	 */
++	ret = qcom_smem_get_flash_type(&smem_flash_type);
++	if (ret < 0)
++		return ret;
++
++	if ((*smem_flash_type == SMEM_FLASH_NAND && !mtd_type_is_nand(master))
++	    || (*smem_flash_type == SMEM_FLASH_SPI && !is_spi_device(of_node)))
++		return 0;
++
++	/*
++	 * Just for sanity purpose, make sure the block size in SMEM matches the
++	 * block size of the MTD device
++	 */
++	ret = qcom_smem_get_flash_blksz(&smem_blksz);
++	if (ret < 0)
++		return ret;
++
++	if (*smem_blksz != master->erasesize) {
++		pr_err("SMEM block size differs from MTD block size\n");
++		return -EINVAL;
++	}
++
++	/* Get partition pointer from SMEM */
++	ret = qcom_smem_get_flash_partitions(&smem_parts);
++	if (ret < 0)
++		return ret;
++
++	if (memcmp(SMEM_PTABLE_MAGIC, smem_parts->magic,
++		   sizeof(SMEM_PTABLE_MAGIC))) {
++		pr_err("SMEM partition magic invalid\n");
++		return -EINVAL;
++	}
++
++	/* Allocate and populate the mtd structures */
++	mtd_parts = kcalloc(le32_to_cpu(smem_parts->len), sizeof(*mtd_parts),
++			    GFP_KERNEL);
++	if (!mtd_parts)
++		return -ENOMEM;
++
++	for (i = 0; i < smem_parts->len; i++) {
++		struct smem_partition *s_part = &smem_parts->parts[i];
++		struct mtd_partition *m_part = &mtd_parts[i];
++
++		m_part->name = s_part->name;
++		m_part->size = le32_to_cpu(s_part->size) * (*smem_blksz);
++		m_part->offset = le32_to_cpu(s_part->start) * (*smem_blksz);
++
++		/*
++		 * The last SMEM partition may have its size marked as
++		 * something like 0xffffffff, which means "until the end of the
++		 * flash device". In this case, truncate it.
++		 */
++		if (m_part->offset + m_part->size > master->size)
++			m_part->size = master->size - m_part->offset;
++	}
++
++	*pparts = mtd_parts;
++
++	return smem_parts->len;
++}
++
++static struct mtd_part_parser qcom_smem_parser = {
++	.owner = THIS_MODULE,
++	.parse_fn = parse_qcom_smem_partitions,
++	.name = "qcom-smem",
++};
++
++static int __init qcom_smem_parser_init(void)
++{
++	register_mtd_parser(&qcom_smem_parser);
++	return 0;
++}
++
++static void __exit qcom_smem_parser_exit(void)
++{
++	deregister_mtd_parser(&qcom_smem_parser);
++}
++
++module_init(qcom_smem_parser_init);
++module_exit(qcom_smem_parser_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Mathieu Olivari <mathieu at codeaurora.org>");
++MODULE_DESCRIPTION("Parsing code for SMEM based partition tables");
+--- a/drivers/mtd/Makefile
++++ b/drivers/mtd/Makefile
+@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
+ obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
+ obj-$(CONFIG_MTD_BCM47XX_PARTS)	+= bcm47xxpart.o
+ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
++obj-$(CONFIG_MTD_QCOM_SMEM_PARTS) += qcom_smem_part.o
+ 
+ # 'Users' - code which presents functionality to userspace.
+ obj-$(CONFIG_MTD_BLKDEVS)	+= mtd_blkdevs.o
diff --git a/target/linux/ipq806x/patches-4.1/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch b/target/linux/ipq806x/patches-4.1/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
new file mode 100644
index 0000000..b2c8cd5
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
@@ -0,0 +1,277 @@
+From 0501f76b138cf1dc11a313bb7a094da524b79337 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu at codeaurora.org>
+Date: Thu, 13 Aug 2015 09:53:14 -0700
+Subject: [PATCH 3/3] mtd: add SMEM parser for QCOM platforms
+
+On QCOM platforms using MTD devices storage (such as IPQ806x), SMEM is
+used to store partition layout. This new parser can now be used to read
+SMEM and use it to register an MTD layout according to its content.
+
+Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
+---
+ drivers/mtd/Kconfig          |   7 ++
+ drivers/mtd/Makefile         |   1 +
+ drivers/mtd/qcom_smem_part.c | 231 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 239 insertions(+)
+ create mode 100644 drivers/mtd/qcom_smem_part.c
+
+--- a/drivers/mtd/Kconfig
++++ b/drivers/mtd/Kconfig
+@@ -200,6 +200,13 @@ config MTD_MYLOADER_PARTS
+ 	  You will still need the parsing functions to be called by the driver
+ 	  for your particular device. It won't happen automatically.
+ 
++config MTD_QCOM_SMEM_PARTS
++	tristate "QCOM SMEM partitioning support"
++	depends on QCOM_SMEM
++	help
++	  This provides partitions parser for QCOM devices using SMEM
++	  such as IPQ806x.
++
+ comment "User Modules And Translation Layers"
+ 
+ #
+--- /dev/null
++++ b/drivers/mtd/qcom_smem_part.c
+@@ -0,0 +1,231 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/device.h>
++#include <linux/slab.h>
++
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/module.h>
++
++#include <linux/soc/qcom/smem.h>
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS			0
++
++/* SMEM items index */
++#define SMEM_AARM_PARTITION_TABLE	9
++#define SMEM_BOOT_FLASH_TYPE		421
++#define SMEM_BOOT_FLASH_BLOCK_SIZE	424
++
++/* SMEM Flash types */
++#define SMEM_FLASH_NAND			2
++#define SMEM_FLASH_SPI			6
++
++#define SMEM_PART_NAME_SZ		16
++#define SMEM_PARTS_MAX			32
++
++struct smem_partition {
++	char name[SMEM_PART_NAME_SZ];
++	__le32 start;
++	__le32 size;
++	__le32 attr;
++};
++
++struct smem_partition_table {
++	u8 magic[8];
++	__le32 version;
++	__le32 len;
++	struct smem_partition parts[SMEM_PARTS_MAX];
++};
++
++/* SMEM Magic values in partition table */
++static const u8 SMEM_PTABLE_MAGIC[] = {
++	0xaa, 0x73, 0xee, 0x55,
++	0xdb, 0xbd, 0x5e, 0xe3,
++};
++
++static int qcom_smem_get_flash_blksz(u64 **smem_blksz)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_BLOCK_SIZE,
++			    (void **) smem_blksz, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read flash blksz from SMEM\n");
++		return -ENOENT;
++	}
++
++	if (size != sizeof(**smem_blksz)) {
++		pr_err("Invalid flash blksz size in SMEM\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_get_flash_type(u64 **smem_flash_type)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_TYPE,
++			    (void **) smem_flash_type, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read flash type from SMEM\n");
++		return -ENOENT;
++	}
++
++	if (size != sizeof(**smem_flash_type)) {
++		pr_err("Invalid flash type size in SMEM\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int qcom_smem_get_flash_partitions(struct smem_partition_table **pparts)
++{
++	int ret;
++	size_t size;
++
++	ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_AARM_PARTITION_TABLE,
++			    (void **) pparts, &size);
++
++	if (ret < 0) {
++		pr_err("Unable to read partition table from SMEM\n");
++		return -ENOENT;
++	}
++
++	return 0;
++}
++
++static int of_dev_node_match(struct device *dev, void *data)
++{
++	return dev->of_node == data;
++}
++
++static bool is_spi_device(struct device_node *np)
++{
++	struct device *dev;
++
++	dev = bus_find_device(&spi_bus_type, NULL, np, of_dev_node_match);
++	if (!dev)
++		return false;
++
++	put_device(dev);
++	return true;
++}
++
++static int parse_qcom_smem_partitions(struct mtd_info *master,
++				      struct mtd_partition **pparts,
++				      struct mtd_part_parser_data *data)
++{
++	struct smem_partition_table *smem_parts;
++	u64 *smem_flash_type, *smem_blksz;
++	struct mtd_partition *mtd_parts;
++	struct device_node *of_node = data->of_node;
++	int i, ret;
++
++	/*
++	 * SMEM will only store the partition table of the boot device.
++	 * If this is not the boot device, do not return any partition.
++	 */
++	ret = qcom_smem_get_flash_type(&smem_flash_type);
++	if (ret < 0)
++		return ret;
++
++	if ((*smem_flash_type == SMEM_FLASH_NAND && !mtd_type_is_nand(master))
++	    || (*smem_flash_type == SMEM_FLASH_SPI && !is_spi_device(of_node)))
++		return 0;
++
++	/*
++	 * Just for sanity purpose, make sure the block size in SMEM matches the
++	 * block size of the MTD device
++	 */
++	ret = qcom_smem_get_flash_blksz(&smem_blksz);
++	if (ret < 0)
++		return ret;
++
++	if (*smem_blksz != master->erasesize) {
++		pr_err("SMEM block size differs from MTD block size\n");
++		return -EINVAL;
++	}
++
++	/* Get partition pointer from SMEM */
++	ret = qcom_smem_get_flash_partitions(&smem_parts);
++	if (ret < 0)
++		return ret;
++
++	if (memcmp(SMEM_PTABLE_MAGIC, smem_parts->magic,
++		   sizeof(SMEM_PTABLE_MAGIC))) {
++		pr_err("SMEM partition magic invalid\n");
++		return -EINVAL;
++	}
++
++	/* Allocate and populate the mtd structures */
++	mtd_parts = kcalloc(le32_to_cpu(smem_parts->len), sizeof(*mtd_parts),
++			    GFP_KERNEL);
++	if (!mtd_parts)
++		return -ENOMEM;
++
++	for (i = 0; i < smem_parts->len; i++) {
++		struct smem_partition *s_part = &smem_parts->parts[i];
++		struct mtd_partition *m_part = &mtd_parts[i];
++
++		m_part->name = s_part->name;
++		m_part->size = le32_to_cpu(s_part->size) * (*smem_blksz);
++		m_part->offset = le32_to_cpu(s_part->start) * (*smem_blksz);
++
++		/*
++		 * The last SMEM partition may have its size marked as
++		 * something like 0xffffffff, which means "until the end of the
++		 * flash device". In this case, truncate it.
++		 */
++		if (m_part->offset + m_part->size > master->size)
++			m_part->size = master->size - m_part->offset;
++	}
++
++	*pparts = mtd_parts;
++
++	return smem_parts->len;
++}
++
++static struct mtd_part_parser qcom_smem_parser = {
++	.owner = THIS_MODULE,
++	.parse_fn = parse_qcom_smem_partitions,
++	.name = "qcom-smem",
++};
++
++static int __init qcom_smem_parser_init(void)
++{
++	register_mtd_parser(&qcom_smem_parser);
++	return 0;
++}
++
++static void __exit qcom_smem_parser_exit(void)
++{
++	deregister_mtd_parser(&qcom_smem_parser);
++}
++
++module_init(qcom_smem_parser_init);
++module_exit(qcom_smem_parser_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Mathieu Olivari <mathieu at codeaurora.org>");
++MODULE_DESCRIPTION("Parsing code for SMEM based partition tables");
+--- a/drivers/mtd/Makefile
++++ b/drivers/mtd/Makefile
+@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
+ obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
+ obj-$(CONFIG_MTD_BCM47XX_PARTS)	+= bcm47xxpart.o
+ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
++obj-$(CONFIG_MTD_QCOM_SMEM_PARTS) += qcom_smem_part.o
+ 
+ # 'Users' - code which presents functionality to userspace.
+ obj-$(CONFIG_MTD_BLKDEVS)	+= mtd_blkdevs.o
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Fri Aug 14 20:50:44 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Fri, 14 Aug 2015 17:50:44 -0700
Subject: [OpenWrt-Devel] [PATCH 5/5] ipq806x: switch AP148 to using SMEM
	based MTD parser
In-Reply-To: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
References: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1439599844-4387-6-git-send-email-mathieu@codeaurora.org>

*Enable SMEM MTD parser and its dependencies (SMEM & HW spinlocks) in
 the kernel config
*Replaces the MTD layout in DT by the dynamic layout provided by the
 SMEM parser for AP148

Using the OF based parser is still possible on platforms which have a
fixed MTD partition layout.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/config-3.18                   |  4 +++
 target/linux/ipq806x/config-4.1                    |  8 ++---
 .../patches-3.18/021-add-ap148-partitions.patch    | 34 ++++++----------------
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |  2 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |  2 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 .../patches-4.1/021-add-ap148-partitions.patch     | 34 ++++++----------------
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |  2 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 13 files changed, 35 insertions(+), 63 deletions(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 2a837f5..3d4f8bb 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -206,6 +206,8 @@ CONFIG_HIGHMEM=y
 CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HWMON=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MSM=y
 CONFIG_HZ_FIXED=0
@@ -259,6 +261,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
+CONFIG_MTD_QCOM_SMEM_PARTS=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
@@ -345,6 +348,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_WDT=y
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index f711dd5..d48943c 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -45,7 +45,6 @@ CONFIG_ARM_CCI400_PMU=y
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
-# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
 # CONFIG_ARM_LPAE is not set
@@ -214,6 +213,8 @@ CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 # CONFIG_HSU_DMA_PCI is not set
 CONFIG_HWMON=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MSM=y
 CONFIG_HZ_FIXED=0
@@ -240,7 +241,6 @@ CONFIG_KPSS_XCC=y
 CONFIG_KRAITCC=y
 CONFIG_KRAIT_CLOCKS=y
 CONFIG_KRAIT_L2_ACCESSORS=y
-# CONFIG_LEDS_REGULATOR is not set
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
@@ -268,6 +268,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
+CONFIG_MTD_QCOM_SMEM_PARTS=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
@@ -357,6 +358,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_WDT=y
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
@@ -366,9 +368,7 @@ CONFIG_RD_GZIP=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
 CONFIG_REGULATOR_QCOM_RPM=y
-# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
diff --git a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
index 34eb9c0..bfdb30f 100644
--- a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
+++ b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
@@ -1,35 +1,19 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -78,13 +78,28 @@
+@@ -77,15 +77,7 @@
+ 					spi-max-frequency = <50000000>;
  					reg = <0>;
  
- 					partition at 0 {
+-					partition at 0 {
 -						label = "rootfs";
 -						reg = <0x0 0x1000000>;
-+						label = "lowlevel_init";
-+						reg = <0x0 0x1b0000>;
- 					};
- 
- 					partition at 1 {
+-					};
+-
+-					partition at 1 {
 -						label = "scratch";
 -						reg = <0x1000000 0x1000000>;
-+						label = "u-boot";
-+						reg = <0x1b0000 0x80000>;
-+					};
-+
-+					partition at 2 {
-+						label = "u-boot-env";
-+						reg = <0x230000 0x40000>;
-+					};
-+
-+					partition at 3 {
-+						label = "caldata";
-+						reg = <0x270000 0x40000>;
-+					};
-+
-+					partition at 4 {
-+						label = "firmware";
-+						reg = <0x2b0000 0x1d50000>;
- 					};
+-					};
++					linux,part-probe = "qcom-smem";
  				};
  			};
+ 		};
diff --git a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
index c322616..e2d03d4 100644
--- a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
+++ b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -114,5 +114,29 @@
+@@ -91,5 +91,29 @@
  		sata at 29000000 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 4c18566..d15f0ac 100644
--- a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -40,7 +40,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -138,5 +156,19 @@
+@@ -115,5 +133,19 @@
  		usb30 at 1 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
index 77be886..d62564c 100644
--- a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
+++ b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -57,7 +57,7 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
  		};
  
  		gsbi at 16300000 {
-@@ -170,5 +195,19 @@
+@@ -147,5 +172,19 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
diff --git a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index da8286a..a4a6a60 100644
--- a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -205,6 +215,34 @@
+@@ -182,6 +192,34 @@
  			nand-ecc-strength = <4>;
  			nand-bus-width = <8>;
  		};
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 8e66b8d..fda1b86 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -243,6 +253,27 @@
+@@ -220,6 +230,27 @@
  				reg = <4>;
  			};
  		};
diff --git a/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch b/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
index 34eb9c0..bfdb30f 100644
--- a/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
+++ b/target/linux/ipq806x/patches-4.1/021-add-ap148-partitions.patch
@@ -1,35 +1,19 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -78,13 +78,28 @@
+@@ -77,15 +77,7 @@
+ 					spi-max-frequency = <50000000>;
  					reg = <0>;
  
- 					partition at 0 {
+-					partition at 0 {
 -						label = "rootfs";
 -						reg = <0x0 0x1000000>;
-+						label = "lowlevel_init";
-+						reg = <0x0 0x1b0000>;
- 					};
- 
- 					partition at 1 {
+-					};
+-
+-					partition at 1 {
 -						label = "scratch";
 -						reg = <0x1000000 0x1000000>;
-+						label = "u-boot";
-+						reg = <0x1b0000 0x80000>;
-+					};
-+
-+					partition at 2 {
-+						label = "u-boot-env";
-+						reg = <0x230000 0x40000>;
-+					};
-+
-+					partition at 3 {
-+						label = "caldata";
-+						reg = <0x270000 0x40000>;
-+					};
-+
-+					partition at 4 {
-+						label = "firmware";
-+						reg = <0x2b0000 0x1d50000>;
- 					};
+-					};
++					linux,part-probe = "qcom-smem";
  				};
  			};
+ 		};
diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index f53b23d..77cf3c3 100644
--- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -40,7 +40,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -114,5 +132,19 @@
+@@ -91,5 +109,19 @@
  		sata at 29000000 {
  			status = "ok";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch b/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
index 8832756..415bf30 100644
--- a/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
+++ b/target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -54,7 +54,7 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 ++++++++++++++++++++++++++++++++
  		};
  
  		gsbi at 16300000 {
-@@ -146,5 +168,19 @@
+@@ -123,5 +145,19 @@
  			pinctrl-0 = <&pcie1_pins>;
  			pinctrl-names = "default";
  		};
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 940f031..394f378 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -178,6 +188,34 @@
+@@ -155,6 +165,34 @@
  			nand-ecc-strength = <4>;
  			nand-bus-width = <8>;
  		};
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 87a3728..9b7eacb 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -216,6 +226,27 @@
+@@ -193,6 +203,27 @@
  				reg = <4>;
  			};
  		};
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nicholas.e.podolak at gmail.com  Fri Aug 14 21:09:14 2015
From: nicholas.e.podolak at gmail.com (Nick Podolak)
Date: Fri, 14 Aug 2015 21:09:14 -0400
Subject: [OpenWrt-Devel] [PATCH] [netifd] enable MULTICAST on GRE
Message-ID: <CABB0dw2QZZ3P0fxTBY6ssk9vBZAh8ZDpbEF9Fc0uPefzU2jb=A@mail.gmail.com>

This patch enables multicast by for gre tunnels.  I've only ever used
GRE to enable routing algorithms and other multicast applications over
otherwise non-multicast capable links (wan, ipsec) so this default
behavior makes more sense to me.

Signed-off-by: Nicholas Podolak <nicholas.e.podolak at gmail.com>

Index: netifd-2015-06-08/system-linux.c
===================================================================
--- netifd-2015-06-08.orig/system-linux.c
+++ netifd-2015-06-08/system-linux.c
@@ -2063,8 +2063,11 @@ static int system_add_gre_tunnel(const c
  nla_nest_end(nlm, infodata);
  nla_nest_end(nlm, linkinfo);

- return system_rtnl_call(nlm);
+ ret = system_rtnl_call(nlm);

+ system_if_flags(name, IFF_MULTICAST, 0);
+
+ return ret;
 failure:
  nlmsg_free(nlm);
  return ret;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From raven at themaw.net  Fri Aug 14 21:55:07 2015
From: raven at themaw.net (Ian Kent)
Date: Sat, 15 Aug 2015 09:55:07 +0800
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <55CE2B76.4040306@hauke-m.de>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>
 <20150310033038.9542.63440.stgit@perseus.themaw.net>
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>
 <1435462659.17034.23.camel@perseus.themaw.net>
 <CACna6rwaqcWndm06S8kGXUYGtHsy74Lre_xEm2oy_R6mbcO7Jg@mail.gmail.com>
 <1436955076.2904.33.camel@pluto.fritz.box> <55CBA615.60308@hauke-m.de>
 <1439524987.2762.39.camel@pluto.fritz.box> <55CE2B76.4040306@hauke-m.de>
Message-ID: <1439603707.2672.4.camel@pluto.fritz.box>

On Fri, 2015-08-14 at 19:55 +0200, Hauke Mehrtens wrote:
> On 08/14/2015 06:03 AM, Ian Kent wrote:
> > On Wed, 2015-08-12 at 22:01 +0200, Hauke Mehrtens wrote:
> >> On 07/15/2015 12:11 PM, Ian Kent wrote:
> >>> On Tue, 2015-07-14 at 18:19 +0200, Rafa? Mi?ecki wrote:
> >>>> On 28 June 2015 at 05:37, Ian Kent <raven at themaw.net> wrote:
> >>>>> Let me rework this using the bus number as you recommend.
> >>>>> I'll repost my updated patch series once I've done that.
> >>>>
> >>>> Hi Ian,
> >>>>
> >>>> Is there any chance you'll find a moment for it anytime soon? It'd be
> >>>> awesome to get R8000 support for CC release.
> >>>
> >>> I have reworked the patch and a broken package build problem I had is
> >>> gone but I didn't get time to fix build problems with a third patch I
> >>> have.
> >>>
> >>> Just didn't get time last weekend and this week has been quite busy too.
> >>> I'll try and get onto this in the next few days.
> >>>
> >>> Ian
> >>
> >> Hi Ian,
> >>
> >> you patch looks better than the hack Broadcom did in their vendor driver.
> > 
> > I thought so, ;)
> > 
> >>
> >> Could you send me a lspci output or the content of /proc/bus/pci/devices
> >> of the original firmware or of OpenWrt with your patch applied? I would
> >> prefer lspci because it is easier to read but cat from
> >> /proc/bus/pci/devices also works. I do not have such a device and want
> >> to understand how this PCIe switch looks like on the software side, so
> >> we can fix the domain, bus, slot, function mixup.
> > 
> > I haven't been able to build OpenWrt for a while now and that's why I
> > haven't been able to test my changes to the patch.
> 
> I haven't noticed a problem in the OpenWrt build system, do you still
> have this problem? Have you tried to clean and rebuild again?

The problem I have now is with mkimage.

It started after a distclean and reconfigure to ensure I was getting a
fully up to date repo.

> 
> > I really wish we could avoid committing changes that don't build but I
> > know it isn't that simple.
> > 
> > I have got some other lists (around somewhere) based on output, mostly
> > from the Vendor firmware, and one where I went through the devices and
> > listed what they are along with and their pci ids so I could try and
> > understand what was going on.
> 
> I found some boot log of OpenWrt in the OpenWrt forum in this post, it
> shows how the PCIe devices are looking without your patch.
> https://forum.openwrt.org/viewtopic.php?pid=269905#p269905
> I am used to search for some boot logs random people posted on the
> Internet. ;-)

Yes, I'm pretty sure the broken PEX8603 patch was applied to the build I
used that produced that dmesg output.

Is that sufficient?

> 
> > I could try and find that and post it if it would be useful.
> > Note that it was just used to understand what was what so it isn't
> > pretty but should have quite a bit of info in it.
> > 
> > There's no question the current patch is wrong so I don't recommend it
> > be used.
> > 
> > I can however post my updated patch now on the understanding that it
> > hasn't been tested at all, which might be good for initial review
> > anyway.
> > 
> >>
> >> On the hardware side this SoC has 3 PCIe controllers, but one shares a
> >> PHY with the USB 3.0 controller. Instead of using the 3rd PCIe
> >> controller they used USB 3.0 and split one of the PCIe controllers into
> >> 2 PCIE lanes.
> > 
> > Right, I didn't get that, mmm ...
> 
> With kernel 4.1 OpenWrt switched to a different PICe driver, which is
> also in the mainline kernel and supported by Broadcom.
> 
> Hauke
> 
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From raven at themaw.net  Fri Aug 14 22:03:36 2015
From: raven at themaw.net (Ian Kent)
Date: Sat, 15 Aug 2015 10:03:36 +0800
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <1439603707.2672.4.camel@pluto.fritz.box>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>
 <20150310033038.9542.63440.stgit@perseus.themaw.net>
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>
 <1435462659.17034.23.camel@perseus.themaw.net>
 <CACna6rwaqcWndm06S8kGXUYGtHsy74Lre_xEm2oy_R6mbcO7Jg@mail.gmail.com>
 <1436955076.2904.33.camel@pluto.fritz.box> <55CBA615.60308@hauke-m.de>
 <1439524987.2762.39.camel@pluto.fritz.box> <55CE2B76.4040306@hauke-m.de>
 <1439603707.2672.4.camel@pluto.fritz.box>
Message-ID: <1439604216.2672.8.camel@pluto.fritz.box>

On Sat, 2015-08-15 at 09:55 +0800, Ian Kent wrote:
> On Fri, 2015-08-14 at 19:55 +0200, Hauke Mehrtens wrote:
> > On 08/14/2015 06:03 AM, Ian Kent wrote:
> > > On Wed, 2015-08-12 at 22:01 +0200, Hauke Mehrtens wrote:
> > >> On 07/15/2015 12:11 PM, Ian Kent wrote:
> > >>> On Tue, 2015-07-14 at 18:19 +0200, Rafa? Mi?ecki wrote:
> > >>>> On 28 June 2015 at 05:37, Ian Kent <raven at themaw.net> wrote:
> > >>>>> Let me rework this using the bus number as you recommend.
> > >>>>> I'll repost my updated patch series once I've done that.
> > >>>>
> > >>>> Hi Ian,
> > >>>>
> > >>>> Is there any chance you'll find a moment for it anytime soon? It'd be
> > >>>> awesome to get R8000 support for CC release.
> > >>>
> > >>> I have reworked the patch and a broken package build problem I had is
> > >>> gone but I didn't get time to fix build problems with a third patch I
> > >>> have.
> > >>>
> > >>> Just didn't get time last weekend and this week has been quite busy too.
> > >>> I'll try and get onto this in the next few days.
> > >>>
> > >>> Ian
> > >>
> > >> Hi Ian,
> > >>
> > >> you patch looks better than the hack Broadcom did in their vendor driver.
> > > 
> > > I thought so, ;)
> > > 
> > >>
> > >> Could you send me a lspci output or the content of /proc/bus/pci/devices
> > >> of the original firmware or of OpenWrt with your patch applied? I would
> > >> prefer lspci because it is easier to read but cat from
> > >> /proc/bus/pci/devices also works. I do not have such a device and want
> > >> to understand how this PCIe switch looks like on the software side, so
> > >> we can fix the domain, bus, slot, function mixup.
> > > 
> > > I haven't been able to build OpenWrt for a while now and that's why I
> > > haven't been able to test my changes to the patch.
> > 
> > I haven't noticed a problem in the OpenWrt build system, do you still
> > have this problem? Have you tried to clean and rebuild again?
> 
> The problem I have now is with mkimage.
> 
> It started after a distclean and reconfigure to ensure I was getting a
> fully up to date repo.
> 
> > 
> > > I really wish we could avoid committing changes that don't build but I
> > > know it isn't that simple.
> > > 
> > > I have got some other lists (around somewhere) based on output, mostly
> > > from the Vendor firmware, and one where I went through the devices and
> > > listed what they are along with and their pci ids so I could try and
> > > understand what was going on.
> > 
> > I found some boot log of OpenWrt in the OpenWrt forum in this post, it
> > shows how the PCIe devices are looking without your patch.
> > https://forum.openwrt.org/viewtopic.php?pid=269905#p269905
> > I am used to search for some boot logs random people posted on the
> > Internet. ;-)
> 
> Yes, I'm pretty sure the broken PEX8603 patch was applied to the build I
> used that produced that dmesg output.

I looked at that output again and it does must the broken patch applied.
If it didn't you would see a message about a broken device class device,
hence the fixup, and lots of non-existent pci devices during discovery.

Ian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From fhfrediani at gmail.com  Fri Aug 14 22:22:08 2015
From: fhfrediani at gmail.com (Fernando Frediani)
Date: Fri, 14 Aug 2015 23:22:08 -0300
Subject: [OpenWrt-Devel] Change realtime graphs interval
Message-ID: <55CEA250.5000003@gmail.com>

Guys,

Have been searching and couldn?t find anything in the configuration.

How can I change the Realtime Graphs update time from 3 seconds to 1 
second ? Do I need to recompile or is it something changeable in the 
configuration ?

Thanks
Fernando
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Fri Aug 14 22:49:46 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Fri, 14 Aug 2015 22:49:46 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [polarssl] Fix build failures due
 to PKG_NAME != dir name
In-Reply-To: <CAECwjAh+0A48bJ5FWgSP2J2O20_m26ov-gzMME6k8Up8vCi9kA@mail.gmail.com>
References: <20150810153015.371DF23A1534@danielcent.thecshore.com>
 <CAECwjAi4xEsDpQns65uMs0oO4woKrPHG6UOxwTnuhq4L2zDuqQ@mail.gmail.com>
 <CAECwjAh+0A48bJ5FWgSP2J2O20_m26ov-gzMME6k8Up8vCi9kA@mail.gmail.com>
Message-ID: <55CEA8CA.3050001@daniel.thecshore.com>

On 2015-08-12 12:21 AM, Yousong Zhou wrote:
> On 11 August 2015 at 10:00, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>> On 2 August 2015 at 19:46, Daniel Dickinson
>> <openwrt at daniel.thecshore.com> wrote:
>>> Packages that depend on PolarSSL fail to build because polarssl's InstallDev
>>> section never actually gets executed because (prior to this patch) the package
>>> name does not match the subdir the package is in (presumably due to upstream
>>> name change).  As a workaround I have changed the package name back to
>>> polarssl and used a new variable SRC_PKG_NAME for the purposes of downloading
>>> the upstream tarball and creating PKG_BUILD_DIR.
>>>
>>
>> Nice catch, but only setting PKG_BUILD_DIR should be enough to fix
>> this.  No need to introduce a new variable.
>>
>
> Hello, Daniel
>
> After a second look on the code, I didn't get why there was a problem.
> Anyway, openvpn-polarssl built and run fine in my environment.
>

It occurred for me on trunk (build failure of curl with ca-certficates 
package enabled; when I checked staging_dir/usr/include the polarssl 
header was missing and make package/polarssl/{clean,compile,install} 
failed to add it to staging_dir).

Have said that, my current build of the Chaos Calmer branch without the 
patch has not had an issue, so at this point I don't know if there was 
some local issue or there has been a problem introduced in trunk.

Also note that simply not getting an error message during build is 
insufficient to verify the issue since the issue only occurs if there 
happens to be a configure option (like ca-certificates) that cannot work 
without ssl actually compiled in because non-ssl versions of curl and 
openvpn are valid build configurations and it may be configure will 
silently build the non-ssl version if it can't find the ssl library.

To be sure you need to get ldd onto the router, or otherwise verify that 
the build actually linked against polarssl.

Regards,

Daniel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From raven at themaw.net  Fri Aug 14 23:05:33 2015
From: raven at themaw.net (Ian Kent)
Date: Sat, 15 Aug 2015 11:05:33 +0800
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <1439603707.2672.4.camel@pluto.fritz.box>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>
 <20150310033038.9542.63440.stgit@perseus.themaw.net>
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>
 <1435462659.17034.23.camel@perseus.themaw.net>
 <CACna6rwaqcWndm06S8kGXUYGtHsy74Lre_xEm2oy_R6mbcO7Jg@mail.gmail.com>
 <1436955076.2904.33.camel@pluto.fritz.box> <55CBA615.60308@hauke-m.de>
 <1439524987.2762.39.camel@pluto.fritz.box> <55CE2B76.4040306@hauke-m.de>
 <1439603707.2672.4.camel@pluto.fritz.box>
Message-ID: <1439607933.4729.2.camel@perseus.themaw.net>

On Sat, 2015-08-15 at 09:55 +0800, Ian Kent wrote:
> On Fri, 2015-08-14 at 19:55 +0200, Hauke Mehrtens wrote:
> > On 08/14/2015 06:03 AM, Ian Kent wrote:
> > > On Wed, 2015-08-12 at 22:01 +0200, Hauke Mehrtens wrote:
> > >> On 07/15/2015 12:11 PM, Ian Kent wrote:
> > >>> On Tue, 2015-07-14 at 18:19 +0200, Rafa? Mi?ecki wrote:
> > >>>> On 28 June 2015 at 05:37, Ian Kent <raven at themaw.net> wrote:
> > >>>>> Let me rework this using the bus number as you recommend.
> > >>>>> I'll repost my updated patch series once I've done that.
> > >>>>
> > >>>> Hi Ian,
> > >>>>
> > >>>> Is there any chance you'll find a moment for it anytime soon? It'd be
> > >>>> awesome to get R8000 support for CC release.
> > >>>
> > >>> I have reworked the patch and a broken package build problem I had is
> > >>> gone but I didn't get time to fix build problems with a third patch I
> > >>> have.
> > >>>
> > >>> Just didn't get time last weekend and this week has been quite busy too.
> > >>> I'll try and get onto this in the next few days.
> > >>>
> > >>> Ian
> > >>
> > >> Hi Ian,
> > >>
> > >> you patch looks better than the hack Broadcom did in their vendor driver.
> > > 
> > > I thought so, ;)
> > > 
> > >>
> > >> Could you send me a lspci output or the content of /proc/bus/pci/devices
> > >> of the original firmware or of OpenWrt with your patch applied? I would
> > >> prefer lspci because it is easier to read but cat from
> > >> /proc/bus/pci/devices also works. I do not have such a device and want
> > >> to understand how this PCIe switch looks like on the software side, so
> > >> we can fix the domain, bus, slot, function mixup.
> > > 
> > > I haven't been able to build OpenWrt for a while now and that's why I
> > > haven't been able to test my changes to the patch.
> > 
> > I haven't noticed a problem in the OpenWrt build system, do you still
> > have this problem? Have you tried to clean and rebuild again?
> 
> The problem I have now is with mkimage.
> 
> It started after a distclean and reconfigure to ensure I was getting a
> fully up to date repo.

OK, I had a quick look around for this problem and, much to my surprise,
I found this (I hadn't found anything previously).

https://dev.openwrt.org/ticket/20134#comment:10

I'll try reverting the commit and see if I can make some progress over
the weekend.

Ian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Fri Aug 14 23:36:55 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Fri, 14 Aug 2015 23:36:55 -0400
Subject: [OpenWrt-Devel] Please ignore until rework (was Re: [PATCH 0/9]
 Resolved email/series creation issues: PowerCloud device support)
In-Reply-To: <20150811030611.F266A23A1542@danielcent.thecshore.com>
References: <20150811030611.F266A23A1542@danielcent.thecshore.com>
Message-ID: <55CEB3D7.4010608@daniel.thecshore.com>

Hi all,

I tried to rush the patch series out the door and even though it was 
supposed to be simple port from patches I had done (but not released) 
for BB, I did a bunch of typos I didn't detect until I actually flashed 
to a device.

I am reworking and will resubmit once I have tested on actual hardware. 
  I was trying to get things done too quickly because at the present 
time I only have parts of weekends to work on this and I was hoping to 
get the changes into Chaos Calmer.

Oh well, I guess that won't happen, but I will be doing Chaos Calmer 
patches first anyway because I want to run it on these devices even if 
not on an official release.

Regards,

Daniel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dedeckeh at gmail.com  Sat Aug 15 03:25:24 2015
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Sat, 15 Aug 2015 09:25:24 +0200
Subject: [OpenWrt-Devel] [PATCH] [netifd] enable MULTICAST on GRE
In-Reply-To: <CABB0dw2QZZ3P0fxTBY6ssk9vBZAh8ZDpbEF9Fc0uPefzU2jb=A@mail.gmail.com>
References: <CABB0dw2QZZ3P0fxTBY6ssk9vBZAh8ZDpbEF9Fc0uPefzU2jb=A@mail.gmail.com>
Message-ID: <CAJLcKsHoHtFRUpX46JtkgMLwjSaw_TxxHykAxySeJ9SX7+PWHg@mail.gmail.com>

On Sat, Aug 15, 2015 at 3:09 AM, Nick Podolak <nicholas.e.podolak at gmail.com>
wrote:

> This patch enables multicast by for gre tunnels.  I've only ever used
> GRE to enable routing algorithms and other multicast applications over
> otherwise non-multicast capable links (wan, ipsec) so this default
> behavior makes more sense to me.
>
> Signed-off-by: Nicholas Podolak <nicholas.e.podolak at gmail.com>
>
> Index: netifd-2015-06-08/system-linux.c
> ===================================================================
> --- netifd-2015-06-08.orig/system-linux.c
> +++ netifd-2015-06-08/system-linux.c
> @@ -2063,8 +2063,11 @@ static int system_add_gre_tunnel(const c
>   nla_nest_end(nlm, infodata);
>   nla_nest_end(nlm, linkinfo);
>
> - return system_rtnl_call(nlm);
> + ret = system_rtnl_call(nlm);
>
> + system_if_flags(name, IFF_MULTICAST, 0);
> +
> + return ret;
>  failure:
>   nlmsg_free(nlm);
>   return ret;
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
It would be better to make this a device setting like promiscuous
mode,macaddr, etc ... so it can be configured via UCI for every device and
thus not only restricted for GRE

Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150815/eb737f9e/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From tw at wiznet.eu  Sat Aug 15 04:08:37 2015
From: tw at wiznet.eu (Tobias Welz)
Date: Sat, 15 Aug 2015 10:08:37 +0200
Subject: [OpenWrt-Devel] [PATCH] Added WIZnet WizFi630A Platform based on
	Ralink RT5350
Message-ID: <55CEF385.2010008@wiznet.eu>

Hello OpenWrt Developers,

I added the WIZnet WizFi630A Platform to the trunk. The board is based 
on Ralink RT5350 in MiniPci Express Form Factor.

Kind regards
Tobias Welz



From tw at wiznet.eu  Fri Aug 14 20:30:34 2015
From: tw at wiznet.eu (Tobias Welz)
Date: Sat, 15 Aug 2015 02:30:34 +0200
Subject: [PATCH] Added WIZnet WizFi630A Platform based on Ralink RT5350
Message-ID: <mailman.113.1593078805.4661.openwrt-devel@lists.openwrt.org>


Signed-off-by: Tobias Welz <tw at wiznet.eu>
---
  .../linux/ramips/base-files/etc/board.d/02_network |    6 +
  target/linux/ramips/base-files/etc/diag.sh         |    3 +
  target/linux/ramips/base-files/lib/ramips.sh       |    3 +
  .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
  target/linux/ramips/dts/WIZFI630A.dts              |  304 
++++++++++++++++++++
  target/linux/ramips/image/Makefile                 |    3 +
  target/linux/ramips/rt305x/profiles/wizfi630a.mk   |   18 ++
  7 files changed, 338 insertions(+)
  create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
  create mode 100644 target/linux/ramips/rt305x/profiles/wizfi630a.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index da1854a..c211ab9 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -235,6 +235,7 @@ ramips_setup_interfaces()
          ucidef_add_switch_vlan "switch0" "2" "4 6t"
          ;;

+    wizfi630a | \
      y1s)
          ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
          ucidef_add_switch "switch0" "1" "1"
@@ -297,6 +298,11 @@ ramips_setup_macs()
          wan_mac=$(mtd_get_mac_binary factory 46)
          ;;

+    wizfi630a)
+        lan_mac=$(mtd_get_mac_binary factory 4)
+        wan_mac=$(mtd_get_mac_binary factory 40)
+        ;;
+
      w306r-v20)
          lan_mac=$(cat /sys/class/net/eth0/address)
          wan_mac=$(macaddr_add "$lan_mac" 5)
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index e63f0df..3ffcc22 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -252,6 +252,9 @@ get_status_led() {
      zte-q7)
          status_led="zte:red:status"
          ;;
+    wizfi630a)
+        status_led="wizfi630a::run"
+        ;;
      mzk-dp150n)
          status_led="mzkdp150n:green:power"
          ;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 7db6d37..474fdb8 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -430,6 +430,9 @@ ramips_board_detect() {
      *"Planex MZK-DP150N")
          name="mzk-dp150n"
          ;;
+     *"WIZnet WizFi630A")
+                name="wizfi630a"
+                ;;
      *)
          name="generic"
          ;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 8221997..bdc6be9 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -105,6 +105,7 @@ platform_check_image() {
      whr-300hp2 |\
      whr-600d |\
      whr-1166d |\
+    wizfi630a |\
      wsr-600 |\
      wl-330n | \
      wl-330n3g | \
diff --git a/target/linux/ramips/dts/WIZFI630A.dts 
b/target/linux/ramips/dts/WIZFI630A.dts
new file mode 100644
index 0000000..b3f655d
--- /dev/null
+++ b/target/linux/ramips/dts/WIZFI630A.dts
@@ -0,0 +1,304 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+    compatible = "wizfi630a", "ralink,rt5350-soc";
+    model = "WIZnet WizFi630A";
+
+        chosen {
+                bootargs = "console=ttyS1,115200";
+        };
+
+    palmbus at 10000000 {
+        gpio1: gpio at 660 {
+                        status = "okay";
+                };
+
+        spi at b00 {
+            status = "okay";
+
+            m25p80 at 0 {
+                #address-cells = <1>;
+                #size-cells = <1>;
+                compatible = "w25q128";
+                reg = <0>;
+                linux,modalias = "m25p80", "w25q128";
+                spi-max-frequency = <10000000>;
+
+                partition at 0 {
+                    label = "uboot";
+                    reg = <0x0 0x30000>;
+                    read-only;
+                };
+
+                partition at 30000 {
+                    label = "uboot-env";
+                    reg = <0x30000 0x10000>;
+                    read-only;
+                };
+
+                factory: partition at 40000 {
+                    label = "factory";
+                    reg = <0x40000 0x10000>;
+                    read-only;
+                };
+
+                partition at 50000 {
+                    label = "firmware";
+                    reg = <0x50000 0xfb0000>;
+                };
+            };
+        };
+
+                uart at 500 {
+                        compatible = "ralink,mt7620a-uart", 
"ralink,rt2880-uart", "ns16550a";
+                        reg = <0x500 0x100>;
+
+                        resets = <&rstctrl 12>;
+                        reset-names = "uart";
+
+                        interrupt-parent = <&intc>;
+                        interrupts = <5>;
+
+                        reg-shift = <2>;
+
+                        status = "okay";
+                };
+
+
+                uartlite at c00 {
+                        compatible = "ralink,mt7620a-uart", 
"ralink,rt2880-uart", "ns16550a";
+                        reg = <0xc00 0x100>;
+
+                        resets = <&rstctrl 19>;
+                        reset-names = "uartl";
+
+                        interrupt-parent = <&intc>;
+                        interrupts = <12>;
+
+                        reg-shift = <2>;
+
+                        pinctrl-names = "default";
+                        pinctrl-0 = <&uartlite_pins>;
+                };
+    };
+
+    pinctrl {
+        state_default: pinctrl0 {
+            gpio {
+                ralink,group = "i2c", "jtag" ;
+                ralink,function = "gpio";
+            };
+        };
+
+                uartf_gpio_pins: uartf_gpio {
+                        uartf_gpio {
+                                ralink,group = "uartf";
+                                //ralink,function = "gpio uartf";
+                                ralink,function = "uartf";
+                        };
+                };
+
+                uartlite_pins: uartlite {
+                        uart {
+                                ralink,group = "uartlite";
+                                ralink,function = "uartlite";
+                        };
+                };
+    };
+
+    ethernet at 10100000 {
+        mtd-mac-address = <&factory 0x4>;
+    };
+
+    esw at 10110000 {
+                ralink,portmap = <0x17>;
+        };
+
+    wmac at 10180000 {
+        ralink,mtd-eeprom = <&factory 0>;
+    };
+
+    ehci at 101c0000 {
+        status = "okay";
+    };
+
+    ohci at 101c1000 {
+        status = "okay";
+    };
+
+
+    gpio-export {
+        compatible = "gpio-export";
+        #size-cells = <0>;
+/*
+        gpio22 {
+            // WAN
+            gpio-export,name = "gpio22";
+            gpio-export,direction_may_change = <1>;
+            gpios = <&gpio1 0 0>; // path lfd dir
+        };
+        gpio23 {
+            // LAN1
+            gpio-export,name = "gpio23";
+            gpio-export,direction_may_change = <1>;
+            gpios = <&gpio1 1 0>;
+        };
+        gpio24 {
+            // LAN2
+            gpio-export,name = "gpio24";
+            gpio-export,direction_may_change = <1>;
+            gpios = <&gpio1 2 0>;
+        };
+
+                // UARTF - UART1
+                gpio7 {
+                        // UARTF_RTS_N - HW Pin 6
+                        gpio-export,name = "gpio7";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 7 0>;
+                };
+                gpio8 {
+                        // UARTF_TXD - HW Pin 10
+                        gpio-export,name = "gpio8";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 8 0>;
+                };
+                gpio9 {
+                        // UARTF_CTS_N - HW Pin 5
+                        gpio-export,name = "gpio9";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 9 0>;
+                };
+                gpio10 {
+                        // UARTF_RXD - HW Pin 9
+                        gpio-export,name = "gpio10";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 10 0>;
+                };
+                gpio11 {
+                        // UARTF_DTR_N - HW Pin 8
+                        gpio-export,name = "gpio11";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 11 0>;
+                };
+                gpio12 {
+                        // UARTF_DCD_N - HW Pin 12
+                        gpio-export,name = "gpio12";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 12 0>;
+                };
+                gpio13 {
+                        // UARTF_DSR_N - HW Pin 11
+                        gpio-export,name = "gpio13";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 13 0>;
+                };
+                gpio14 {
+                        // UARTF_RIN - HW Pin 7
+                        gpio-export,name = "gpio14";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 14 0>;
+                };
+
+        // UARTLITE - UART2
+                gpio15 {
+                        // UART2_TXD  - HW Pin 20
+                        gpio-export,name = "gpio15";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 15 0>;
+                };
+                gpio16 {
+                        // UART2_RXD  - HW Pin 18
+                        gpio-export,name = "gpio16";
+                        gpio-export,direction_may_change = <1>;
+                        gpios = <&gpio0 16 0>;
+                };
+
+*/
+/*
+        // If you want to use this comment out the corrosponding 
gpio-keys-polled
+        gpio0 {
+            // wps btn
+            gpio-export,name = "gpio0";
+            gpio-export,direction_may_change = <1>;
+            gpios = <&gpio0 0 1>;
+        };
+*/
+
+        gpio19 {
+            // SCM1
+            gpio-export,name = "gpio19";
+            gpio-export,direction_may_change = <1>;
+            gpios = <&gpio0 19 1>;
+        };
+        gpio2 {
+            // SCM2
+            gpio-export,name = "gpio2";
+            gpio-export,direction_may_change = <1>;
+            gpios = <&gpio0 2 1>;
+        };
+
+    };
+
+
+
+
+
+    gpio-leds {
+        compatible = "gpio-leds";
+        run {
+            label = "wizfi630a::run";
+            gpios = <&gpio0 1 1>;
+        };
+        uart1 {
+            label = "wizfi630a::uart1";
+            gpios = <&gpio0 18 1>;
+        };
+        uart2 {
+            label = "wizfi630a::uart2";
+            gpios = <&gpio0 21 1>;
+        };
+        wps {
+            label = "wizfi630a::wps";
+            gpios = <&gpio0 20 1>;
+        };
+    };
+
+
+        gpio-keys-polled {
+                compatible = "gpio-keys-polled";
+                #address-cells = <1>;
+                #size-cells = <0>;
+                poll-interval = <20>;
+                reset {
+                        label = "reset";
+                        gpios = <&gpio0 17 1>;
+                        linux,code = <0x198>;
+                };
+
+                wps {
+                        label = "wps";
+                        gpios = <&gpio0 0 1>;
+                        linux,code = <0x211>;
+                };
+/*
+        // If you want to use this comment out the corrosponding export
+                scm1 {
+                        label = "SCM1";
+                        gpios = <&gpio0 19 1>;
+                        linux,code = <0x100>;
+                };
+
+                scm2 {
+                        label = "SCM2";
+                        gpios = <&gpio0 2 1>;
+                        linux,code = <0x101>;
+                };
+*/
+
+        };
+
+
+};
diff --git a/target/linux/ramips/image/Makefile 
b/target/linux/ramips/image/Makefile
index 409ff26..fbc6775 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -673,6 +673,8 @@ Image/Build/Profile/WNCE2001=$(call 
BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WN

  Image/Build/Profile/WR512-3GN=$(call 
BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)

+Image/Build/Profile/WIZFI630A=$(call 
BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
+
  Image/Build/Profile/WT1520=$(call 
BuildFirmware/PorayDualSize/$(1),$(1),wt1520,WT1520)

  Image/Build/Profile/UR-326N4G=$(call 
BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)
@@ -761,6 +763,7 @@ define Image/Build/Profile/Default
      $(call Image/Build/Profile/W306R_V20,$(1))
      $(call Image/Build/Profile/W502U,$(1))
      $(call Image/Build/Profile/WCR150GN,$(1))
+    $(call Image/Build/Profile/WIZFI630A,$(1))
      $(call Image/Build/Profile/WHRG300N,$(1))
      $(call Image/Build/Profile/WIZARD8800,$(1))
      $(call Image/Build/Profile/WL_330N,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/wizfi630a.mk 
b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
new file mode 100644
index 0000000..22136b9
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/WIZFI630A
+    NAME:=WIZnet WizFi630A
+    PACKAGES:=\
+        kmod-usb-core kmod-usb-ohci kmod-usb2
+endef
+
+define Profile/WIZFI630A/Description
+    Package set for WIZnet WizFi630A board
+endef
+
+$(eval $(call Profile,WIZFI630A))
-- 
1.7.10.4


--------------000200080801050901010603
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <link href="chrome://translator/skin/floatingPanel.css"
      type="text/css" rel="stylesheet">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello OpenWrt Developers,<br>
    <br>
    I added the WIZnet WizFi630A Platform to the trunk. The board is
    based on Ralink RT5350 in MiniPci Express Form Factor.<br>
    <br>
    Kind regards <br>
    Tobias Welz<br>
    <br>
    <br>
    <br>
    <small><font face="Courier New, Courier, monospace">From
        bd69bb513e36abda43e86f0eb64caf004260e415 Mon Sep 17 00:00:00
        2001<br>
        From: Tobias Welz <a class="moz-txt-link-rfc2396E"
          href="mailto:tw at wiznet.eu">&lt;tw at wiznet.eu&gt;</a><br>
        Date: Sat, 15 Aug 2015 02:30:34 +0200<br>
        Subject: [PATCH] Added WIZnet WizFi630A Platform based on Ralink
        RT5350<br>
        <br>
        <br>
        Signed-off-by: Tobias Welz <a class="moz-txt-link-rfc2396E"
          href="mailto:tw at wiznet.eu">&lt;tw at wiznet.eu&gt;</a><br>
        ---<br>
        ??.../linux/ramips/base-files/etc/board.d/02_network |?????? 6 +<br>
        ??target/linux/ramips/base-files/etc/diag.sh???????????????? |?????? 3 +<br>
        ??target/linux/ramips/base-files/lib/ramips.sh???????????? |?????? 3 +<br>
        ??.../ramips/base-files/lib/upgrade/platform.sh?????????? |?????? 1 +<br>
        ??target/linux/ramips/dts/WIZFI630A.dts?????????????????????????? |?? 304
        ++++++++++++++++++++<br>
        ??target/linux/ramips/image/Makefile???????????????????????????????? |?????? 3 +<br>
        ??target/linux/ramips/rt305x/profiles/wizfi630a.mk???? |???? 18 ++<br>
        ??7 files changed, 338 insertions(+)<br>
        ??create mode 100644 target/linux/ramips/dts/WIZFI630A.dts<br>
        ??create mode 100644
        target/linux/ramips/rt305x/profiles/wizfi630a.mk<br>
        <br>
        diff --git
        a/target/linux/ramips/base-files/etc/board.d/02_network
        b/target/linux/ramips/base-files/etc/board.d/02_network<br>
        index da1854a..c211ab9 100755<br>
        --- a/target/linux/ramips/base-files/etc/board.d/02_network<br>
        +++ b/target/linux/ramips/base-files/etc/board.d/02_network<br>
        @@ -235,6 +235,7 @@ ramips_setup_interfaces()<br>
        ???????? ?????? ucidef_add_switch_vlan "switch0" "2" "4 6t"<br>
        ???????? ?????? ;;<br>
        ??<br>
        +?????? wizfi630a | \<br>
        ???????? y1s)<br>
        ???????? ?????? ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"<br>
        ???????? ?????? ucidef_add_switch "switch0" "1" "1"<br>
        @@ -297,6 +298,11 @@ ramips_setup_macs()<br>
        ???????? ?????? wan_mac=$(mtd_get_mac_binary factory 46)<br>
        ???????? ?????? ;;<br>
        ??<br>
        +?????? wizfi630a)<br>
        +?????? ?????? lan_mac=$(mtd_get_mac_binary factory 4)<br>
        +?????? ?????? wan_mac=$(mtd_get_mac_binary factory 40)<br>
        +?????? ?????? ;;<br>
        +<br>
        ???????? w306r-v20)<br>
        ???????? ?????? lan_mac=$(cat /sys/class/net/eth0/address)<br>
        ???????? ?????? wan_mac=$(macaddr_add "$lan_mac" 5)<br>
        diff --git a/target/linux/ramips/base-files/etc/diag.sh
        b/target/linux/ramips/base-files/etc/diag.sh<br>
        index e63f0df..3ffcc22 100644<br>
        --- a/target/linux/ramips/base-files/etc/diag.sh<br>
        +++ b/target/linux/ramips/base-files/etc/diag.sh<br>
        @@ -252,6 +252,9 @@ get_status_led() {<br>
        ???????? zte-q7)<br>
        ???????? ?????? status_led="zte:red:status"<br>
        ???????? ?????? ;;<br>
        +?????? wizfi630a)<br>
        +?????? ?????? status_led="wizfi630a::run"<br>
        +?????? ?????? ;;<br>
        ???????? mzk-dp150n)<br>
        ???????? ?????? status_led="mzkdp150n:green:power"<br>
        ???????? ?????? ;;<br>
        diff --git a/target/linux/ramips/base-files/lib/ramips.sh
        b/target/linux/ramips/base-files/lib/ramips.sh<br>
        index 7db6d37..474fdb8 100755<br>
        --- a/target/linux/ramips/base-files/lib/ramips.sh<br>
        +++ b/target/linux/ramips/base-files/lib/ramips.sh<br>
        @@ -430,6 +430,9 @@ ramips_board_detect() {<br>
        ???????? *"Planex MZK-DP150N")<br>
        ???????? ?????? name="mzk-dp150n"<br>
        ???????? ?????? ;;<br>
        + ?????? *"WIZnet WizFi630A")<br>
        +?????????????????????????????? name="wizfi630a"<br>
        +?????????????????????????????? ;;<br>
        ???????? *)<br>
        ???????? ?????? name="generic"<br>
        ???????? ?????? ;;<br>
        diff --git
        a/target/linux/ramips/base-files/lib/upgrade/platform.sh
        b/target/linux/ramips/base-files/lib/upgrade/platform.sh<br>
        index 8221997..bdc6be9 100755<br>
        --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh<br>
        +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh<br>
        @@ -105,6 +105,7 @@ platform_check_image() {<br>
        ???????? whr-300hp2 |\<br>
        ???????? whr-600d |\<br>
        ???????? whr-1166d |\<br>
        +?????? wizfi630a |\<br>
        ???????? wsr-600 |\<br>
        ???????? wl-330n | \<br>
        ???????? wl-330n3g | \<br>
        diff --git a/target/linux/ramips/dts/WIZFI630A.dts
        b/target/linux/ramips/dts/WIZFI630A.dts<br>
        new file mode 100644<br>
        index 0000000..b3f655d<br>
        --- /dev/null<br>
        +++ b/target/linux/ramips/dts/WIZFI630A.dts<br>
        @@ -0,0 +1,304 @@<br>
        +/dts-v1/;<br>
        +<br>
        +/include/ "rt5350.dtsi"<br>
        +<br>
        +/ {<br>
        +?????? compatible = "wizfi630a", "ralink,rt5350-soc";<br>
        +?????? model = "WIZnet WizFi630A";<br>
        +<br>
        +?????????????? chosen {<br>
        +?????????????????????????????? bootargs = "console=ttyS1,115200";<br>
        +?????????????? };<br>
        +<br>
        +?????? palmbus at 10000000 {<br>
        +?????? ?????? gpio1: gpio at 660 {<br>
        +?????????????????????????????????????????????? status = "okay";<br>
        +?????????????????????????????? };<br>
        +<br>
        +?????? ?????? spi at b00 {<br>
        +?????? ?????? ?????? status = "okay";<br>
        +<br>
        +?????? ?????? ?????? m25p80 at 0 {<br>
        +?????? ?????? ?????? ?????? #address-cells = &lt;1&gt;;<br>
        +?????? ?????? ?????? ?????? #size-cells = &lt;1&gt;;<br>
        +?????? ?????? ?????? ?????? compatible = "w25q128";<br>
        +?????? ?????? ?????? ?????? reg = &lt;0&gt;;<br>
        +?????? ?????? ?????? ?????? linux,modalias = "m25p80", "w25q128";<br>
        +?????? ?????? ?????? ?????? spi-max-frequency = &lt;10000000&gt;;<br>
        +<br>
        +?????? ?????? ?????? ?????? partition at 0 {<br>
        +?????? ?????? ?????? ?????? ?????? label = "uboot";<br>
        +?????? ?????? ?????? ?????? ?????? reg = &lt;0x0 0x30000&gt;;<br>
        +?????? ?????? ?????? ?????? ?????? read-only;<br>
        +?????? ?????? ?????? ?????? };<br>
        +<br>
        +?????? ?????? ?????? ?????? partition at 30000 {<br>
        +?????? ?????? ?????? ?????? ?????? label = "uboot-env";<br>
        +?????? ?????? ?????? ?????? ?????? reg = &lt;0x30000 0x10000&gt;;<br>
        +?????? ?????? ?????? ?????? ?????? read-only;<br>
        +?????? ?????? ?????? ?????? };<br>
        +<br>
        +?????? ?????? ?????? ?????? factory: partition at 40000 {<br>
        +?????? ?????? ?????? ?????? ?????? label = "factory";<br>
        +?????? ?????? ?????? ?????? ?????? reg = &lt;0x40000 0x10000&gt;;<br>
        +?????? ?????? ?????? ?????? ?????? read-only;<br>
        +?????? ?????? ?????? ?????? };<br>
        +<br>
        +?????? ?????? ?????? ?????? partition at 50000 {<br>
        +?????? ?????? ?????? ?????? ?????? label = "firmware";<br>
        +?????? ?????? ?????? ?????? ?????? reg = &lt;0x50000 0xfb0000&gt;;<br>
        +?????? ?????? ?????? ?????? };<br>
        +?????? ?????? ?????? };<br>
        +?????? ?????? };<br>
        +<br>
        +?????????????????????????????? uart at 500 {<br>
        +?????????????????????????????????????????????? compatible = "ralink,mt7620a-uart",
        "ralink,rt2880-uart", "ns16550a";<br>
        +?????????????????????????????????????????????? reg = &lt;0x500 0x100&gt;;<br>
        +<br>
        +?????????????????????????????????????????????? resets = &lt;&amp;rstctrl 12&gt;;<br>
        +?????????????????????????????????????????????? reset-names = "uart";<br>
        +<br>
        +?????????????????????????????????????????????? interrupt-parent = &lt;&amp;intc&gt;;<br>
        +?????????????????????????????????????????????? interrupts = &lt;5&gt;;<br>
        +<br>
        +?????????????????????????????????????????????? reg-shift = &lt;2&gt;;<br>
        +<br>
        +?????????????????????????????????????????????? status = "okay";<br>
        +?????????????????????????????? };<br>
        +<br>
        +<br>
        +?????????????????????????????? uartlite at c00 {<br>
        +?????????????????????????????????????????????? compatible = "ralink,mt7620a-uart",
        "ralink,rt2880-uart", "ns16550a";<br>
        +?????????????????????????????????????????????? reg = &lt;0xc00 0x100&gt;;<br>
        +<br>
        +?????????????????????????????????????????????? resets = &lt;&amp;rstctrl 19&gt;;<br>
        +?????????????????????????????????????????????? reset-names = "uartl";<br>
        +<br>
        +?????????????????????????????????????????????? interrupt-parent = &lt;&amp;intc&gt;;<br>
        +?????????????????????????????????????????????? interrupts = &lt;12&gt;;<br>
        +<br>
        +?????????????????????????????????????????????? reg-shift = &lt;2&gt;;<br>
        +<br>
        +?????????????????????????????????????????????? pinctrl-names = "default";<br>
        +?????????????????????????????????????????????? pinctrl-0 = &lt;&amp;uartlite_pins&gt;;<br>
        +?????????????????????????????? };<br>
        +?????? };<br>
        +<br>
        +?????? pinctrl {<br>
        +?????? ?????? state_default: pinctrl0 {<br>
        +?????? ?????? ?????? gpio {<br>
        +?????? ?????? ?????? ?????? ralink,group = "i2c", "jtag" ;<br>
        +?????? ?????? ?????? ?????? ralink,function = "gpio";<br>
        +?????? ?????? ?????? };<br>
        +?????? ?????? };<br>
        +<br>
        +?????????????????????????????? uartf_gpio_pins: uartf_gpio {<br>
        +?????????????????????????????????????????????? uartf_gpio {<br>
        +?????????????????????????????????????????????????????????????? ralink,group = "uartf";<br>
        +?????????????????????????????????????????????????????????????? //ralink,function = "gpio
        uartf";<br>
        +?????????????????????????????????????????????????????????????? ralink,function = "uartf";<br>
        +?????????????????????????????????????????????? };<br>
        +?????????????????????????????? };<br>
        +<br>
        +?????????????????????????????? uartlite_pins: uartlite {<br>
        +?????????????????????????????????????????????? uart {<br>
        +?????????????????????????????????????????????????????????????? ralink,group = "uartlite";<br>
        +?????????????????????????????????????????????????????????????? ralink,function = "uartlite";<br>
        +?????????????????????????????????????????????? };<br>
        +?????????????????????????????? };<br>
        +?????? };<br>
        +<br>
        +?????? ethernet at 10100000 {<br>
        +?????? ?????? mtd-mac-address = &lt;&amp;factory 0x4&gt;;<br>
        +?????? };<br>
        +<br>
        +?????? esw at 10110000 {<br>
        +?????????????????????????????? ralink,portmap = &lt;0x17&gt;;<br>
        +?????????????? };<br>
        +<br>
        +?????? wmac at 10180000 {<br>
        +?????? ?????? ralink,mtd-eeprom = &lt;&amp;factory 0&gt;;<br>
        +?????? };<br>
        +<br>
        +?????? ehci at 101c0000 {<br>
        +?????? ?????? status = "okay";<br>
        +?????? };<br>
        +<br>
        +?????? ohci at 101c1000 {<br>
        +?????? ?????? status = "okay";<br>
        +?????? };<br>
        +<br>
        +<br>
        +?????? gpio-export {<br>
        +?????? ?????? compatible = "gpio-export";<br>
        +?????? ?????? #size-cells = &lt;0&gt;;<br>
        +/*<br>
        +?????? ?????? gpio22 {<br>
        +?????? ?????? ?????? // WAN <br>
        +?????? ?????? ?????? gpio-export,name = "gpio22";<br>
        +?????? ?????? ?????? gpio-export,direction_may_change = &lt;1&gt;;<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio1 0 0&gt;; // path lfd dir<br>
        +?????? ?????? };<br>
        +?????? ?????? gpio23 {<br>
        +?????? ?????? ?????? // LAN1 <br>
        +?????? ?????? ?????? gpio-export,name = "gpio23";<br>
        +?????? ?????? ?????? gpio-export,direction_may_change = &lt;1&gt;;<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio1 1 0&gt;;<br>
        +?????? ?????? };<br>
        +?????? ?????? gpio24 {<br>
        +?????? ?????? ?????? // LAN2 <br>
        +?????? ?????? ?????? gpio-export,name = "gpio24";<br>
        +?????? ?????? ?????? gpio-export,direction_may_change = &lt;1&gt;;<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio1 2 0&gt;;<br>
        +?????? ?????? };<br>
        +<br>
        +?????????????????????????????? // UARTF - UART1 <br>
        +?????????????????????????????? gpio7 {<br>
        +?????????????????????????????????????????????? // UARTF_RTS_N - HW Pin 6<br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio7";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 7 0&gt;;<br>
        +?????????????????????????????? };<br>
        +?????????????????????????????? gpio8 {<br>
        +?????????????????????????????????????????????? // UARTF_TXD - HW Pin 10 <br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio8";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 8 0&gt;;<br>
        +?????????????????????????????? };<br>
        +?????????????????????????????? gpio9 {<br>
        +?????????????????????????????????????????????? // UARTF_CTS_N - HW Pin 5<br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio9";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 9 0&gt;;<br>
        +?????????????????????????????? };<br>
        +?????????????????????????????? gpio10 {<br>
        +?????????????????????????????????????????????? // UARTF_RXD - HW Pin 9<br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio10";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 10 0&gt;;<br>
        +?????????????????????????????? };<br>
        +?????????????????????????????? gpio11 {<br>
        +?????????????????????????????????????????????? // UARTF_DTR_N - HW Pin 8<br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio11";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 11 0&gt;;<br>
        +?????????????????????????????? };<br>
        +?????????????????????????????? gpio12 {<br>
        +?????????????????????????????????????????????? // UARTF_DCD_N - HW Pin 12 <br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio12";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 12 0&gt;;<br>
        +?????????????????????????????? };<br>
        +?????????????????????????????? gpio13 {<br>
        +?????????????????????????????????????????????? // UARTF_DSR_N - HW Pin 11<br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio13";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 13 0&gt;;<br>
        +?????????????????????????????? };<br>
        +?????????????????????????????? gpio14 {<br>
        +?????????????????????????????????????????????? // UARTF_RIN - HW Pin 7 <br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio14";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 14 0&gt;;<br>
        +?????????????????????????????? };<br>
        +<br>
        +?????? ?????? // UARTLITE - UART2 <br>
        +?????????????????????????????? gpio15 {<br>
        +?????????????????????????????????????????????? // UART2_TXD?? - HW Pin 20 <br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio15";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 15 0&gt;;<br>
        +?????????????????????????????? };<br>
        +?????????????????????????????? gpio16 {<br>
        +?????????????????????????????????????????????? // UART2_RXD?? - HW Pin 18 <br>
        +?????????????????????????????????????????????? gpio-export,name = "gpio16";<br>
        +?????????????????????????????????????????????? gpio-export,direction_may_change =
        &lt;1&gt;;<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 16 0&gt;;<br>
        +?????????????????????????????? };<br>
        +<br>
        +*/<br>
        +/*<br>
        +?????? ?????? // If you want to use this comment out the
        corrosponding gpio-keys-polled<br>
        +?????? ?????? gpio0 {<br>
        +?????? ?????? ?????? // wps btn<br>
        +?????? ?????? ?????? gpio-export,name = "gpio0";<br>
        +?????? ?????? ?????? gpio-export,direction_may_change = &lt;1&gt;;<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio0 0 1&gt;;<br>
        +?????? ?????? };<br>
        +*/<br>
        +<br>
        +?????? ?????? gpio19 {<br>
        +?????? ?????? ?????? // SCM1<br>
        +?????? ?????? ?????? gpio-export,name = "gpio19";<br>
        +?????? ?????? ?????? gpio-export,direction_may_change = &lt;1&gt;;<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio0 19 1&gt;;<br>
        +?????? ?????? };<br>
        +?????? ?????? gpio2 {<br>
        +?????? ?????? ?????? // SCM2<br>
        +?????? ?????? ?????? gpio-export,name = "gpio2";<br>
        +?????? ?????? ?????? gpio-export,direction_may_change = &lt;1&gt;;<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio0 2 1&gt;;<br>
        +?????? ?????? };<br>
        +<br>
        +?????? };<br>
        +<br>
        +<br>
        +<br>
        +<br>
        +<br>
        +?????? gpio-leds {<br>
        +?????? ?????? compatible = "gpio-leds";<br>
        +?????? ?????? run {<br>
        +?????? ?????? ?????? label = "wizfi630a::run";<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio0 1 1&gt;;<br>
        +?????? ?????? };<br>
        +?????? ?????? uart1 {<br>
        +?????? ?????? ?????? label = "wizfi630a::uart1";<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio0 18 1&gt;;<br>
        +?????? ?????? };<br>
        +?????? ?????? uart2 {<br>
        +?????? ?????? ?????? label = "wizfi630a::uart2";<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio0 21 1&gt;;<br>
        +?????? ?????? };<br>
        +?????? ?????? wps {<br>
        +?????? ?????? ?????? label = "wizfi630a::wps";<br>
        +?????? ?????? ?????? gpios = &lt;&amp;gpio0 20 1&gt;;<br>
        +?????? ?????? };<br>
        +?????? };<br>
        +<br>
        +<br>
        +?????????????? gpio-keys-polled {<br>
        +?????????????????????????????? compatible = "gpio-keys-polled";<br>
        +?????????????????????????????? #address-cells = &lt;1&gt;;<br>
        +?????????????????????????????? #size-cells = &lt;0&gt;;<br>
        +?????????????????????????????? poll-interval = &lt;20&gt;;<br>
        +?????????????????????????????? reset {<br>
        +?????????????????????????????????????????????? label = "reset";<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 17 1&gt;;<br>
        +?????????????????????????????????????????????? linux,code = &lt;0x198&gt;;<br>
        +?????????????????????????????? };<br>
        +<br>
        +?????????????????????????????? wps {<br>
        +?????????????????????????????????????????????? label = "wps";<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 0 1&gt;;<br>
        +?????????????????????????????????????????????? linux,code = &lt;0x211&gt;;<br>
        +?????????????????????????????? };<br>
        +/*<br>
        +?????? ?????? // If you want to use this comment out the
        corrosponding export<br>
        +?????????????????????????????? scm1 {<br>
        +?????????????????????????????????????????????? label = "SCM1";<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 19 1&gt;;<br>
        +?????????????????????????????????????????????? linux,code = &lt;0x100&gt;;<br>
        +?????????????????????????????? };<br>
        +<br>
        +?????????????????????????????? scm2 {<br>
        +?????????????????????????????????????????????? label = "SCM2";<br>
        +?????????????????????????????????????????????? gpios = &lt;&amp;gpio0 2 1&gt;;<br>
        +?????????????????????????????????????????????? linux,code = &lt;0x101&gt;;<br>
        +?????????????????????????????? };<br>
        +*/<br>
        +<br>
        +?????????????? };<br>
        +<br>
        +<br>
        +};<br>
        diff --git a/target/linux/ramips/image/Makefile
        b/target/linux/ramips/image/Makefile<br>
        index 409ff26..fbc6775 100644<br>
        --- a/target/linux/ramips/image/Makefile<br>
        +++ b/target/linux/ramips/image/Makefile<br>
        @@ -673,6 +673,8 @@ Image/Build/Profile/WNCE2001=$(call
        BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WN<br>
        ??<br>
        ??Image/Build/Profile/WR512-3GN=$(call
        BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)<br>
        ??<br>
        +Image/Build/Profile/WIZFI630A=$(call
        BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)<br>
        +<br>
        ??Image/Build/Profile/WT1520=$(call
        BuildFirmware/PorayDualSize/$(1),$(1),wt1520,WT1520)<br>
        ??<br>
        ??Image/Build/Profile/UR-326N4G=$(call
        BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)<br>
        @@ -761,6 +763,7 @@ define Image/Build/Profile/Default<br>
        ???????? $(call Image/Build/Profile/W306R_V20,$(1))<br>
        ???????? $(call Image/Build/Profile/W502U,$(1))<br>
        ???????? $(call Image/Build/Profile/WCR150GN,$(1))<br>
        +?????? $(call Image/Build/Profile/WIZFI630A,$(1))<br>
        ???????? $(call Image/Build/Profile/WHRG300N,$(1))<br>
        ???????? $(call Image/Build/Profile/WIZARD8800,$(1))<br>
        ???????? $(call Image/Build/Profile/WL_330N,$(1))<br>
        diff --git a/target/linux/ramips/rt305x/profiles/wizfi630a.mk
        b/target/linux/ramips/rt305x/profiles/wizfi630a.mk<br>
        new file mode 100644<br>
        index 0000000..22136b9<br>
        --- /dev/null<br>
        +++ b/target/linux/ramips/rt305x/profiles/wizfi630a.mk<br>
        @@ -0,0 +1,18 @@<br>
        +#<br>
        +# Copyright (C) 2014 OpenWrt.org<br>
        +#<br>
        +# This is free software, licensed under the GNU General Public
        License v2.<br>
        +# See /LICENSE for more information.<br>
        +#<br>
        +<br>
        +define Profile/WIZFI630A<br>
        +?????? NAME:=WIZnet WizFi630A<br>
        +?????? PACKAGES:=\<br>
        +?????? ?????? kmod-usb-core kmod-usb-ohci kmod-usb2 <br>
        +endef<br>
        +<br>
        +define Profile/WIZFI630A/Description<br>
        +?????? Package set for WIZnet WizFi630A board<br>
        +endef<br>
        +<br>
        +$(eval $(call Profile,WIZFI630A))<br>
        -- <br>
        1.7.10.4</font></small><br>
    <br>
    <div style="bottom: auto; left: 2px; right: auto; top: 204px;
      display: none;" class="translator-theme-default"
      id="translator-floating-panel"> </div>
  </body>
</html>

--------------000200080801050901010603--

--===============8119253233902668224==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

--===============8119253233902668224==--


From openwrt at kresin.me  Sat Aug 15 05:58:01 2015
From: openwrt at kresin.me (Mathias Kresin)
Date: Sat, 15 Aug 2015 11:58:01 +0200
Subject: [OpenWrt-Devel] TP-Link v3 header format description
In-Reply-To: <CAECwjAi3Pcr7CGr_HzCyQuWiO-agsMvLy-mzUoQU6Y9OKqsEvA@mail.gmail.com>
References: <CABwW5nkCDRLHJhyLcC=5LFXN9wvbRz_-4tyyHDPiZY=tKdPghA@mail.gmail.com>
 <CAECwjAi3Pcr7CGr_HzCyQuWiO-agsMvLy-mzUoQU6Y9OKqsEvA@mail.gmail.com>
Message-ID: <55CF0D29.7070004@kresin.me>

Am 14.08.2015 um 04:39 schrieb Yousong Zhou:
>
> Never played with tplink's v3 header.  But I found on other devices
> that the RSA2048-SHA1 implementation there was flawed in that it used
> pubkeys from firmwares to verifying signatures.  Hmm, is it possible
> that this v3 header from tplink also has such vulnerability?
>
Unfortunately, the pubkey isn't stored along with the signature in the 
firmware update file. The pubkey is read from the file lib/libcmm.so of 
the running firmware during image validation.

Mathias
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From cb at shoutrlabs.com  Sat Aug 15 07:08:44 2015
From: cb at shoutrlabs.com (Christian Beier)
Date: Sat, 15 Aug 2015 13:08:44 +0200
Subject: [OpenWrt-Devel] [PATCH] CC: ar71xx: Enable ath10k calibration
 data loading for EnGenius ESR1750 and EPG500.
In-Reply-To: <1438692024-4142-1-git-send-email-cb@shoutrlabs.com>
References: <1438692024-4142-1-git-send-email-cb@shoutrlabs.com>
Message-ID: <20150815130844.7a02de54@bunker2>

Am Tue,  4 Aug 2015 14:40:24 +0200
schrieb Christian Beier <cb at shoutrlabs.com>:

> Kinda-backport of r46415, though this patch uses the old-style
> calibration data loading.
> 
> Signed-off-by: Christian Beier <cb at shoutrlabs.com>
> ---
>  .../linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> | 4 ++++ 1 file changed, 4 insertions(+)
> 
> 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 c827e31..dd3f546 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
> @@ -39,6 +39,10 @@ case "$FIRMWARE" in dlan-pro-1200-ac)
> ath10kcal_from_file $(find_mtd_part "art") 20480 $ath10kcal_tmp ;;
> +	esr1750 | \
> +	epg5000)
> +		ath10kcal_from_file $(find_mtd_part "caldata") 20480
> $ath10kcal_tmp
> +		;;
>  	esac
>  	;;
>  

Would be really nice to have this in CC as without, the boxxes are not
really up to par 5ghz wise...

Thanks,
-- 
Christian Beier, CTO.

W 	shoutrlabs.com
E 	cb at shoutrlabs.com
L 	https://www.linkedin.com/in/christianbeier
P 	+49 (0)30 12076581
T 	https://twitter.com/shoutrlabs

what is, is; what is not is possible.

shoutr labs UG (haftungsbeschr?nkt), 
Wolfener Stra?e 32-34 Haus K, 12681 Berlin, DE
HRB 154532 B, AG Charlottenburg
Managing directors: Christian Beier, Benjamin Werner, Sebastian Winkler
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jmpoure at gooze.eu  Sat Aug 15 07:41:59 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Sat, 15 Aug 2015 13:41:59 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
Message-ID: <1439638919.8622.9.camel@gooze.eu>

Dear all,

I currently writting a HOWTO for French Freebox users.
http://wiki.openwrt.org/doc/howto/freebox

We can obtain IPv6 address delegation an configure clients IPv6
staticly. We are using OpenWRT staging (latest dev).

What is the recommended way to serve ipv6 IPs to clients? I need to
serve at least IPv6 and gateway. I would like the lest intrusive
configuration, so we don't have to install additional packages.

My guess was to use dnsmasq, but according to documentation, it needs
to be uninstalled first, with installation of dnsmasq-dhcp6.

In the wiki example, my /64 delegation is 2a01:e35:87d8:xxxx (/64)
I would like to serve 2a01:e35:87d8::3 to my host called sony-vaio with
MAC 54:42:49:87:4f:74

So what would you recommend to serve IPv6s to clients? 

Kind regards,
Jean-Michel

P.S. This post is a duplicate of:
https://forum.openwrt.org/viewtopic.php?id=59043
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150815/a0690551/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From hauke at hauke-m.de  Sat Aug 15 10:34:32 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 15 Aug 2015 16:34:32 +0200
Subject: [OpenWrt-Devel] [PATCH 1/1] [kernel] Fix kmod-v4l2 modules have
 missing symbols due to lack of clk support
In-Reply-To: <20150810153018.6240123A1534@danielcent.thecshore.com>
References: <20150810153018.6240123A1534@danielcent.thecshore.com>
Message-ID: <55CF4DF8.4070207@hauke-m.de>

On 08/02/2015 04:34 PM, Daniel Dickinson wrote:
> The v4l kernel modules fail to compile on latest kernels due to a new
> dependency on a clock source.  Since most routers won't have a suitable
> clock source, I have added a kernel config option that omits the functionality
> that requires the clock source.  
> 
> That means v4l modules in OpenWrt can't support DV devices (DV requires
> the clock source support) but unless clock source support was addded to
> OpenWrt the other alternative is to drop v4l altogether).
> 
> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
> ---
>  package/kernel/linux/modules/video.mk              |   3 +-
>  ...avoid-clk-for-devices-that-do-not-need-it.patch | 348 +++++++++++++++++++++
>  2 files changed, 350 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch
> 

The build problem of ar71xx was fixed here:
https://dev.openwrt.org/changeset/46572

The arch code did not export all the clk functions needed, but claimed
to do so. Is your patch needed with r46572 any more? When an arch really
does not support clocks it a driver would use the static inline
functions doing nothing instead.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Sat Aug 15 10:36:34 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 15 Aug 2015 16:36:34 +0200
Subject: [OpenWrt-Devel] [PATCH] kmod-crypto-manager: autoload aead
	module
In-Reply-To: <1438781404-1995-1-git-send-email-cardoe@cardoe.com>
References: <1438781404-1995-1-git-send-email-cardoe@cardoe.com>
Message-ID: <55CF4E72.1090802@hauke-m.de>

On 08/05/2015 03:30 PM, Doug Goldstein wrote:
> This package provides the aead module which other modules need loaded
> when they depend on this package.
> 
> Signed-off-by: Doug Goldstein <cardoe at cardoe.com>
> ---
>  package/kernel/linux/modules/crypto.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
> index efa69b7..7295b98 100644
> --- a/package/kernel/linux/modules/crypto.mk
> +++ b/package/kernel/linux/modules/crypto.mk
> @@ -58,6 +58,7 @@ define KernelPackage/crypto-manager
>  	CONFIG_CRYPTO_MANAGER \
>  	$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_confvar,$(mod)))
>    FILES:=$(foreach mod,$(CRYPTOMGR_MODULES),$(call crypto_file,$(mod)))
> +  AUTOLOAD:=$(call AutoLoad,08,aead)
>    $(call AddDepends/crypto)
>  endef
>  

I think https://dev.openwrt.org/changeset/46574 fixes your problem in trunk.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Sat Aug 15 10:37:30 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 15 Aug 2015 16:37:30 +0200
Subject: [OpenWrt-Devel] [PATCH 1/1] [buildroot] Fix for liblzma breaks
 redhat-like systems
In-Reply-To: <20150810153021.796FC23A1534@danielcent.thecshore.com>
References: <20150810153021.796FC23A1534@danielcent.thecshore.com>
Message-ID: <55CF4EAA.9070603@hauke-m.de>

On 08/09/2015 05:50 AM, Daniel Dickinson wrote:
> On RedHat/Fedora and derivatives we must use the system liblzma
> from xz-devel because the liblzma in tools/xz breaks these
> systems due to system tools (which use liblzma) having
> missing symbols when staging_dir/host/lib has liblzma
> (because buildroot puts staging_dir/host/lib first in
> library load path and therefore all binaries not just
> buildroot's binaries use liblzma from staging_dir/host/lib, at
> least while building OpenWrt).
> 
> Closes: 20134
> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
> ---
>  include/host.mk          |  7 ++++++-
>  include/prereq-build.mk  |  7 +++++++
>  tools/Makefile           | 11 ++++++++---
>  tools/squashfs4/Makefile |  2 +-
>  4 files changed, 22 insertions(+), 5 deletions(-)
> 
Please check if your patch is still needed with r46603
https://dev.openwrt.org/changeset/46603

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Sat Aug 15 10:40:00 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 15 Aug 2015 16:40:00 +0200
Subject: [OpenWrt-Devel] [PATCH 1/5] kernel: move linux,
 part-probe dt parsing in generic code
In-Reply-To: <1439599844-4387-2-git-send-email-mathieu@codeaurora.org>
References: <1439599844-4387-1-git-send-email-mathieu@codeaurora.org>
 <1439599844-4387-2-git-send-email-mathieu@codeaurora.org>
Message-ID: <55CF4F40.9060100@hauke-m.de>

On 08/15/2015 02:50 AM, Mathieu Olivari wrote:
> The "linux,part-probe" dts parsing is a pretty neat generic feature.
> It has been posted to kernel.org and could easily be reused by all
> targets.
> 
> This change moves the patch to the 3.18 and 4.1 generic folders, and
> makes the feature available to all platforms who may want to use it.
> 
> Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
> ---
>  ...t-add-generic-parsing-of-linux-part-probe.patch | 175 ---------------------
>  ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++++++++++++++++++
>  .../400-mtd-add-rootfs-split-support.patch         |  16 +-
>  ...port-for-different-partition-parser-types.patch |   4 +-
>  ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
>  .../404-mtd-add-more-helper-functions.patch        |   6 +-
>  .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
>  .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
>  .../411-mtd-partial_eraseblock_write.patch         |   8 +-
>  .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
>  ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +++++++++++++++++++++
>  .../400-mtd-add-rootfs-split-support.patch         |  15 +-
>  ...port-for-different-partition-parser-types.patch |   4 +-
>  ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
>  .../404-mtd-add-more-helper-functions.patch        |   6 +-
>  .../405-mtd-old-firmware-uimage-splitter.patch     |   4 +-
>  .../406-mtd-old-rootfs-squashfs-splitter.patch     |   4 +-
>  .../411-mtd-partial_eraseblock_write.patch         |   8 +-
>  .../412-mtd-partial_eraseblock_unlock.patch        |   2 +-
>  19 files changed, 400 insertions(+), 224 deletions(-)
>  delete mode 100644 target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
>  create mode 100644 target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
>  create mode 100644 target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch

Acked-by: Hauke Mehrtens <hauke at hauke-m.de>

We should still find a way to get this or an other patch doing similar
stuff into mainline Linux kernel.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Sat Aug 15 11:10:53 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 15 Aug 2015 17:10:53 +0200
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <1439607933.4729.2.camel@perseus.themaw.net>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>	
 <20150310033038.9542.63440.stgit@perseus.themaw.net>	
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>	
 <1435462659.17034.23.camel@perseus.themaw.net>	
 <CACna6rwaqcWndm06S8kGXUYGtHsy74Lre_xEm2oy_R6mbcO7Jg@mail.gmail.com>	
 <1436955076.2904.33.camel@pluto.fritz.box> <55CBA615.60308@hauke-m.de>	
 <1439524987.2762.39.camel@pluto.fritz.box> <55CE2B76.4040306@hauke-m.de>	
 <1439603707.2672.4.camel@pluto.fritz.box>
 <1439607933.4729.2.camel@perseus.themaw.net>
Message-ID: <55CF567D.40401@hauke-m.de>

On 08/15/2015 05:05 AM, Ian Kent wrote:
> On Sat, 2015-08-15 at 09:55 +0800, Ian Kent wrote:
>> On Fri, 2015-08-14 at 19:55 +0200, Hauke Mehrtens wrote:
>>> On 08/14/2015 06:03 AM, Ian Kent wrote:
>>>> On Wed, 2015-08-12 at 22:01 +0200, Hauke Mehrtens wrote:
>>>>> On 07/15/2015 12:11 PM, Ian Kent wrote:
>>>>>> On Tue, 2015-07-14 at 18:19 +0200, Rafa? Mi?ecki wrote:
>>>>>>> On 28 June 2015 at 05:37, Ian Kent <raven at themaw.net> wrote:
>>>>>>>> Let me rework this using the bus number as you recommend.
>>>>>>>> I'll repost my updated patch series once I've done that.
>>>>>>>
>>>>>>> Hi Ian,
>>>>>>>
>>>>>>> Is there any chance you'll find a moment for it anytime soon? It'd be
>>>>>>> awesome to get R8000 support for CC release.
>>>>>>
>>>>>> I have reworked the patch and a broken package build problem I had is
>>>>>> gone but I didn't get time to fix build problems with a third patch I
>>>>>> have.
>>>>>>
>>>>>> Just didn't get time last weekend and this week has been quite busy too.
>>>>>> I'll try and get onto this in the next few days.
>>>>>>
>>>>>> Ian
>>>>>
>>>>> Hi Ian,
>>>>>
>>>>> you patch looks better than the hack Broadcom did in their vendor driver.
>>>>
>>>> I thought so, ;)
>>>>
>>>>>
>>>>> Could you send me a lspci output or the content of /proc/bus/pci/devices
>>>>> of the original firmware or of OpenWrt with your patch applied? I would
>>>>> prefer lspci because it is easier to read but cat from
>>>>> /proc/bus/pci/devices also works. I do not have such a device and want
>>>>> to understand how this PCIe switch looks like on the software side, so
>>>>> we can fix the domain, bus, slot, function mixup.
>>>>
>>>> I haven't been able to build OpenWrt for a while now and that's why I
>>>> haven't been able to test my changes to the patch.
>>>
>>> I haven't noticed a problem in the OpenWrt build system, do you still
>>> have this problem? Have you tried to clean and rebuild again?
>>
>> The problem I have now is with mkimage.
>>
>> It started after a distclean and reconfigure to ensure I was getting a
>> fully up to date repo.
> 
> OK, I had a quick look around for this problem and, much to my surprise,
> I found this (I hadn't found anything previously).
> 
> https://dev.openwrt.org/ticket/20134#comment:10
> 
> I'll try reverting the commit and see if I can make some progress over
> the weekend.
> 
> Ian
> 

I hopefully fixed the problem reported in that ticket, I am able to
build on CentOS 7 without problems. If the problem still exists for you
could you please send me the error message you get.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From hauke at hauke-m.de  Sat Aug 15 12:17:33 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sat, 15 Aug 2015 18:17:33 +0200
Subject: [OpenWrt-Devel] [PATCH][procd] fix generating syscall-names.h
Message-ID: <1439655453-20400-1-git-send-email-hauke@hauke-m.de>

Sometimes the syscall number is not defined with a number but with an
offset to an other syscall and then make_syscall_h.sh created some
broken header file.

For example the bit/syscall.h from musl for i386 has this:

  #define __NR_timer_create     259
  #define __NR_timer_settime    (__NR_timer_create+1)

With this patch the resulting array looks like this:

 [259] = "timer_create",
 [(__NR_timer_create+1)] = "timer_settime",

This fixes this bug from OpenWrt:
https://dev.openwrt.org/ticket/20195

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 make_syscall_h.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/make_syscall_h.sh b/make_syscall_h.sh
index 57333fd..3363bc7 100755
--- a/make_syscall_h.sh
+++ b/make_syscall_h.sh
@@ -14,5 +14,5 @@ CC=$1
 echo "#include <asm/unistd.h>"
 echo "static const char *syscall_names[] = {"
 echo "#include <sys/syscall.h>" | ${CC} -E -dM - | grep '^#define __NR_' | \
-	LC_ALL=C sed -r -n -e 's/^\#define[ \t]+__NR_([a-z0-9_]+)[ \t]+([ ()+0-9NR_Linux]+)(.*)/ [\2] = "\1",/p'
+	LC_ALL=C sed -r -n -e 's/^\#define[ \t]+__NR_([a-z0-9_]+)[ \t]+([ ()+0-9a-zNR_Linux]+)(.*)/ [\2] = "\1",/p'
 echo "};"
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From stefan at the2masters.de  Sat Aug 15 12:30:42 2015
From: stefan at the2masters.de (Stefan Hellermann)
Date: Sat, 15 Aug 2015 18:30:42 +0200
Subject: [OpenWrt-Devel] [PATCH] base-files: rework reset button script
 to indicate factory reset
In-Reply-To: <20150812131924.GO19496@medion.lan>
References: <1439251044-15693-1-git-send-email-zajec5@gmail.com>
 <20150812073256.GE19496@medion.lan>
 <CACna6rw52ChV_QSpHKE_PW=Aip+B6Pf8qv6mvxB3L6TknbXH3g@mail.gmail.com>
 <20150812131924.GO19496@medion.lan>
Message-ID: <CAANYUdAwus8Mj+ZQd0uJQM+7aGNbARv12dJCebinNu_b5bVMBg@mail.gmail.com>

hi,

it's not needed, you can remove it.

Stefan

2015-08-12 15:19 GMT+02:00 Bastian Bittorf <bittorf at bluebottle.com>:

> * Rafa? Mi?ecki <zajec5 at gmail.com> [12.08.2015 15:10]:
> > I think you're commenting on a wrong patch.
>
> sorry, yes - the comment applies to:
> a643de25/r40909 and i just stumpled upon this
> while reading the affected sources of your patch.
>
> @stefan: why is this 'exec' needed?
>
> bye, bastian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150815/48796c31/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at kresin.me  Sat Aug 15 17:38:37 2015
From: openwrt at kresin.me (Mathias Kresin)
Date: Sat, 15 Aug 2015 23:38:37 +0200
Subject: [OpenWrt-Devel] lantiq DSL drivers / firmware info
In-Reply-To: <CAFBinCB0OO6o+8HQbiS1t4Tqkw2w9AeZ=nf=1rzHGgx2T_EEdg@mail.gmail.com>
References: <1430320363.2279.3.camel@sipsolutions.net>
 <CAFBinCDZ2oz4BGMOLiKVx9zGuS3hL95EdqFnDpnQ=XX-SLHwuw@mail.gmail.com>
 <CAONAcYPuxYG9LAApLZdO2QNtw_N7v7Dvt1fjMZVARGAKkkpqBg@mail.gmail.com>
 <55714F60.6040402@gmail.com>
 <CAONAcYP30ZdjgQ=fkK2fX5KNgdqctSJ00COQdW0D-aPK4v6pCA@mail.gmail.com>
 <5572F43B.1080509@gmail.com>
 <CAFBinCAC+AVpfQ-1xCQ_mfW95Cm4VvsixcoSD4hBiT62bA8Nbg@mail.gmail.com>
 <CAONAcYMnkRxKdfNyDfn_QPjUrA=pA-O=hbMjxdiV_LhFvtp0RQ@mail.gmail.com>
 <55A0C816.3050703@gmail.com>
 <CAFBinCDO8koQ7ZGj=0PNpqCUqkVq=iU7FrTpj3E+2zyeN0unug@mail.gmail.com>
 <CAHsu+b-j8dZ+GWG6QgGTKL_xqQyqOaieo9=c5bDVfW5i=-EzqA@mail.gmail.com>
 <CAFBinCCtrCt73rkh3jqVzYnCL5+Ajic0aCmZw8cEoy2KPpSDNQ@mail.gmail.com>
 <20150724000306.11ac27b4@lazus.yip>
 <CAONAcYNPJPCPaYx70vqFbfy3fcObZzoXQGZ-5YYg75B8A2UmXw@mail.gmail.com>
 <CAONAcYMnNmzWTm=sUSL8eQU=aDMs55Pvs0PBE2J5JOMREZCEPQ@mail.gmail.com>
 <CAFBinCB0OO6o+8HQbiS1t4Tqkw2w9AeZ=nf=1rzHGgx2T_EEdg@mail.gmail.com>
Message-ID: <55CFB15D.3040106@kresin.me>

Am 24.07.2015 um 01:20 schrieb Martin Blumenstingl:
> On Fri, Jul 24, 2015 at 1:00 AM, Aleksander Wa??ski <olewales at gmail.com> wrote:
>> Actually, it just dawned on me that they can be doing just that. In
>> the bootloader. This is the only part of firmware we are not changing.
>> If PCBs turn out to be identical we might want to check this.
> That was my first guess, but I am using the open source u-boot version
> on the BT Home Hub 5A (= Annex A device) and it still refuses to
> connect to Annex B (at least back when I tried last, I switched to
> VDSL like two months ago).

I can confirm that it is unrelated to the bootloader. I crossflashed my 
Annex A W8980v1 with the W9980B (Annex B) firmware. During crossflash, 
the bootloader is updated as well. Afterwards, I do get exactly the same 
error message as Andre:

xDSL Leave SHOWTIME!!
DSL_CPE: Wrong combination of DSL PHY Firmware and hybrid type used! 
Please change one of it.
nReturn=0 nData="E843 0003 0001 0009 "
nReturn=0 nData="5048 0000 0001 "
nReturn=0 nData="1762 0000 0001 "

I did not connected the device to an Annex B ADSL line yet, but I guess 
the result will be the same.

Furthermore, I replaced the content of mtd4 at f200 (@f100 is the device 
mac address stored) and mtd5 with a bunch of 0x11, to test for a magic 
value, that is read from there. U-boot replaces the content of mtd5 with 
the ddr params right after reboot and neither the error message changes 
if a W9980B firmware is booted, nor an error message appears if a W9980 
firmware is booted. The content of mtd6 seams to be unrelated to me, 
since it contains the ath calibration data.

I share Daniels guess, that there could be a resistor, which locks the 
VRX208 to Annex A/Annex B ADSL mode. As already mentioned, it's 
unrelated to VDSL. My Annex B VDSL line works with the W9980B (and 
properly W9980) firmware out of the box.

> If you can figure out where the boot_sel pins are (similar to [0] or
> [1]) to get it into CFG04 mode (= boot via UART) then I can add a
> patch for Daniel Schwierzeck's open source lantiq u-boot. But be
> aware: you need to pull some of them HIGH (= 3.3V, *NOT* 5V) - you
> could damage your device by pulling the wrong pin HIGH.

I found the location of the boot_sel pin and have updated the W8980v1 
wiki page.

Mathias
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From zajec5 at gmail.com  Sat Aug 15 20:44:17 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Sun, 16 Aug 2015 02:44:17 +0200
Subject: [OpenWrt-Devel] [PATCH packages] lighttpd: backport a fix for
	running out of filedescriptors
In-Reply-To: <1439497407-15562-1-git-send-email-zajec5@gmail.com>
References: <1439497407-15562-1-git-send-email-zajec5@gmail.com>
Message-ID: <CACna6rxAmaTop+UKYmOqKt8iDe6wFmdjuk-_8m-tZS0FA5UdBw@mail.gmail.com>

On 13 August 2015 at 22:23, Rafa? Mi?ecki <zajec5 at gmail.com> wrote:
> It was breaking uploads of files 4 MiB+. This patch fixes:
> https://github.com/openwrt/packages/issues/1658
>
> Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
> ---
> This should be applied to both: master and 15.05 branch.

Can you push this?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From raven at themaw.net  Sun Aug 16 00:19:09 2015
From: raven at themaw.net (Ian Kent)
Date: Sun, 16 Aug 2015 12:19:09 +0800
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <1435017535.2653.6.camel@pluto.fritz.box>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>
 <20150310033038.9542.63440.stgit@perseus.themaw.net>
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>
Message-ID: <1439698749.2972.17.camel@perseus.themaw.net>

On Tue, 2015-06-23 at 07:58 +0800, Ian Kent wrote:
> On Mon, 2015-06-22 at 18:42 +0200, Hauke Mehrtens wrote:
> > 
> > On 03/10/2015 04:30 AM, Ian Kent wrote:
> > > The Netgear R8000 has a PEX8603 connected to the BCM53012 and if
> > > it isn't configured during the bus scan the PCI layer goes crazy
> > > trying to configure phantom devices.
> > 
> > Could you provide some diagram how this is connected?
> 
> I could try, when I get a chance, ascii art isn't my strong suit.
> 
> > 
> > My current assumption is that on one of the 3 PCIe ports is this switch,
> > so the scan will find this switch as a PCIe device, bu how does it go
> > from there?
> 
> I can only infer from looking at sysfs, which is what I have done.
> 
> Perhaps I'm not correct but it looks to me that there are is a BCM53012
> connected with two legs, one has one wireless device, and the other has
> a PEX8603 bridge which has two legs, each with a wireless device.
> 
> > From the vendor driver I would assume that that the two devices behind
> > the switch are device function 0x08 and 0x10 on the switch device.
> 
> I'll have to reacquaint myself with the code before I respond to the
> comments below, its been a while.
>  
> > 
> > Can you also post the output of lspci on your device?
> 
> Don't think I have lspci in the build I was using, I'll need to add it
> and rebuild. That probably won't be until the weekend.

OK, I've been able get a build.

My updated patch doesn't yet function so I've used the driver we're
discussing here to get info.

TBH, looking at this, I'm not so sure the patch is wrong now.

lspci gives:
0000:00:00.0 PCI bridge: Broadcom Corporation Device 8012 (rev 01)
0000:01:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
0001:00:00.0 PCI bridge: Broadcom Corporation Device 8012 (rev 01)
0001:01:00.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
0001:02:01.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
0001:02:02.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
0001:03:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
0001:04:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)

and a list of /sys/bus/pci/devices on a Vendor firmware install gives:
0000:00:00.0  0000:00:06.0  0000:00:0b.1  0000:00:11.0  0002:01:00.0
0000:00:01.0  0000:00:07.0  0000:00:0c.0  0000:00:12.0  0002:02:01.0
0000:00:02.0  0000:00:08.0  0000:00:0d.0  0000:00:13.0  0002:02:02.0
0000:00:03.0  0000:00:09.0  0000:00:0e.0  0001:00:00.0  0002:03:00.0
0000:00:04.0  0000:00:0a.0  0000:00:0f.0  0001:01:00.0  0002:04:00.0
0000:00:05.0  0000:00:0b.0  0000:00:10.0  0002:00:00.0

which looks like the topology is the same.

So, possibly, my description of how I believe the devices are connected
is accurate.

	    bcm8012
	 ------------
	 |	    |
	aa52	 pex8603
		 -------
		 |     |
		aa52  aa52

> 
> > 
> > > 
> > > Signed-off-by: Ian Kent <raven at themaw.net>
> > > ---
> > >  .../172-bcm5301x-R8000-handle-PEX8603-switch.patch |  225 ++++++++++++++++++++
> > >  .../172-bcm5301x-R8000-handle-PEX8603-switch.patch |  225 ++++++++++++++++++++
> > >  2 files changed, 450 insertions(+)
> > >  create mode 100644 target/linux/bcm53xx/patches-3.14/172-bcm5301x-R8000-handle-PEX8603-switch.patch
> > >  create mode 100644 target/linux/bcm53xx/patches-3.18/172-bcm5301x-R8000-handle-PEX8603-switch.patch
> > > 
> > 
> > 
> > ......
> > 
> > 
> > > diff --git a/target/linux/bcm53xx/patches-3.18/172-bcm5301x-R8000-handle-PEX8603-switch.patch b/target/linux/bcm53xx/patches-3.18/172-bcm5301x-R8000-handle-PEX8603-switch.patch
> > > new file mode 100644
> > > index 0000000..fc606b4
> > > --- /dev/null
> > > +++ b/target/linux/bcm53xx/patches-3.18/172-bcm5301x-R8000-handle-PEX8603-switch.patch
> > > @@ -0,0 +1,225 @@
> > > +bcm53xx: R8000 handle PEX8603 switch
> > > +
> > > +The Netgear R8000 has a PEX8603 which, if not configured at
> > > +bus probe results in quite a few phantom devices as it doesn't
> > > +respond properly to configuration requests. The device needs
> > > +to be configured when seen.
> > > +
> > > +Signed-off-by: Ian Kent <raven at themaw.net>
> > > +
> > > +--- a/drivers/pci/host/pci-host-bcm5301x.c
> > > ++++ b/drivers/pci/host/pci-host-bcm5301x.c
> > > +@@ -29,6 +29,21 @@
> > > + #define PCI_TARGET_LINK_SPEED_GEN2    0x2
> > > + #define PCI_TARGET_LINK_SPEED_GEN1    0x1
> > > + 
> > > ++#define PCI_MAX_BUS			4
> > > ++#define PLX_PRIM_SEC_BUS_NUM		(0x00000201 | (PCI_MAX_BUS << 16))
> > > ++
> > > ++#ifndef SZ_48M
> > > ++#define SZ_48M	(SZ_32M + SZ_16M)
> > > ++#endif
> > 
> > Please remove the ifndef, it should fail if this gets added.
> > 
> > 
> > > ++
> > > ++struct pex86xx_info {
> > > ++	u8 busno;	/* Upstream bus PEX is on */
> > > ++	u8 slot;	/* Upstream slot PEX is at */
> > > ++	u16 active;	/* Active port count */
> > > ++	u16 ports;	/* Active port bit map */
> > > ++};
> > > ++struct pex86xx_info pex8603;
> > > ++
> > > + static int bcma_pcie2_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
> > > + {
> > > + 	struct pci_sys_data *sys = pdev->sysdata;
> > > +@@ -115,6 +130,39 @@ static int bcma_pcie2_read_config_pci(st
> > > + 	struct pci_sys_data *sys = bus->sysdata;
> > > + 	struct bcma_device *bdev = sys->private_data;
> > > + 
> > > ++	/* The PEX8603 won't return sensible values to the PCI layer so
> > > ++	 * we have to do that ourselves.
> > > ++	 */
> > > ++	if (pex8603.busno) {
> > > ++		u16 slot = PCI_SLOT(devfn);
> > > ++
> > > ++		/* Not the PEX upstream slot */
> > > ++		if (pex8603.busno == bus->number && pex8603.slot != slot)
> > > ++			goto done;
> > > ++
> > > ++		/* Not the PEX downstream bus? */
> > > ++		if (bus->number < pex8603.busno ||
> > > ++		    bus->number > pex8603.busno + 1)
> > > ++			goto done;
> > > ++
> > > ++		switch (bus->number - pex8603.busno) {
> > > ++		case 0:
> > > ++			/* Upstream port */
> > > ++			break;
> > > ++
> > > ++		case 1:
> > > ++			/* PEX8603, not present for slots other than 1 or 2 */
> > > ++			if (!(slot == 1 || slot == 2)) {
> > > ++				*val = 0xffffffff;
> > > ++				return PCIBIOS_SUCCESSFUL;
> > > ++			}
> > > ++			break;
> > > ++
> > > ++		default:
> > > ++			break;
> > > ++		}
> > > ++	}
> > > ++done:
> > > + 	*val = bcma_pcie2_read_config(bdev, bus->number, devfn, where, size);
> > > + 
> > > + 	return PCIBIOS_SUCCESSFUL;
> > > +@@ -126,6 +174,37 @@ static int bcma_pcie2_write_config_pci(s
> > > + 	struct pci_sys_data *sys = bus->sysdata;
> > > + 	struct bcma_device *bdev = sys->private_data;
> > > + 
> > > ++	/* Don't try and set anything on the PEX8603 if it isn't
> > > ++	 * valid.
> > > ++	 */
> > > ++	if (pex8603.busno) {
> > > ++		u16 slot = PCI_SLOT(devfn);
> > > ++
> > > ++		/* Not the PEX upstream slot */
> > > ++		if (pex8603.busno == bus->number && pex8603.slot != slot)
> > > ++			goto done;
> > > ++
> > > ++		/* Not the PEX downstream bus? */
> > > ++		if (bus->number < pex8603.busno ||
> > > ++		    bus->number > pex8603.busno + 1)
> > > ++			goto done;
> > > ++
> > > ++		switch (bus->number - pex8603.busno) {
> > > ++		case 0:
> > > ++			/* Upstream port */
> > > ++			break;
> > > ++
> > > ++		case 1:
> > > ++			/* PEX8603 slots only slots 1 and 2 present */
> > > ++			if (!(slot == 1 || slot == 2))
> > > ++				return PCIBIOS_SUCCESSFUL;
> > > ++			break;
> > > ++
> > > ++		default:
> > > ++			break;
> > > ++		}
> > > ++	}
> > > ++done:
> > > + 	bcma_pcie2_write_config(bdev, bus->number, devfn, where, size, val);
> > > + 
> > > + 	return PCIBIOS_SUCCESSFUL;
> > > +@@ -147,6 +226,113 @@ static void bcma_pcie2_fixup_class(struc
> > > + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x8011, bcma_pcie2_fixup_class);
> > > + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x8012, bcma_pcie2_fixup_class);
> > > + 
> > > ++static void bcma_pcie2_pex_switch_setup(struct pci_dev *dev)
> > > ++{
> > > ++	struct pci_sys_data *sys = dev->sysdata;
> > > ++	struct bcma_device *bdev = sys->private_data;
> > > ++	unsigned char busno = dev->bus->number;
> > > ++	unsigned int devfn = dev->devfn;
> > > ++	unsigned int slot = PCI_SLOT(devfn);
> > > ++	u32 addr = bdev->addr_s[0];
> > > ++	u32 tmp32;
> > > ++	u16 tmp16;
> > > ++
> > > ++	tmp32 = bcma_pcie2_read_config(bdev, busno, devfn, 0x100, 4);
> > > ++	if (!tmp32) {
> > > ++		dev_info(&bdev->dev, "failed to read PEX switch\n");
> > > ++		return;
> > > ++	}
> > > ++
> > > ++	/* Debug control register. */
> > > ++	tmp32 = bcma_pcie2_read_config(bdev, busno, devfn, 0x1dc, 4);
> > > ++	tmp32 &= ~(1<<22);
> > > ++	bcma_pcie2_write_config(bdev, busno, devfn, 0x1dc, 4, tmp32);
> > > ++
> > > ++	/* Set GPIO enable. */
> > > ++	tmp32 = bcma_pcie2_read_config(bdev, busno, devfn, 0x62c, 4);
> > > ++	tmp32 &= ~((1 << 0) | (1 << 1) | (1 << 3));
> > > ++	tmp32 |= ((1 << 4) | (1 << 5) | (1 << 7));
> > > ++	bcma_pcie2_write_config(bdev, busno, devfn, 0x62c, 4, tmp32);
> > > ++
> > > ++	mdelay(50);
> > 
> > You should use msleep(50) here.
> > 
> > > ++
> > > ++	tmp32 |= ((1<<0)|(1<<1));
> > > ++	bcma_pcie2_write_config(bdev, busno, devfn, 0x62c, 4, tmp32);
> > > ++
> > > ++	/* Bus master */
> > > ++	tmp16 = bcma_pcie2_read_config(bdev, busno, devfn, 0x4, 2);
> > > ++	tmp16 |= 0x06;
> > > ++	bcma_pcie2_write_config(bdev, busno, devfn, 0x4, 2, tmp16);
> > > ++
> > > ++	switch (slot) {
> > 
> > Are you sure this is correct?
> > 
> > Why does the vendor driver use the bus number and afterwards the device
> > function for the last two spaces and you are using only the slot number?
> > 
> > > ++	case 0:
> > > ++		/* Upstream port busno and slot */
> > > ++		pex8603.busno = busno;
> > > ++		pex8603.slot = slot;
> > > ++
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, 0x18, 4, PLX_PRIM_SEC_BUS_NUM);
> > > ++
> > > ++		/* TODO: We need to scan all outgoing windows,
> > > ++		 * to look for a base limit pair for this register.
> > > ++		 */
> > > ++		/* MEM_BASE, MEM_LIM require 1MB alignment */
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, PCI_MEMORY_BASE, 2,
> > > ++					addr >> 16);
> > > ++		BUG_ON(((addr + SZ_32M) >> 16) & 0xf);
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, PCI_MEMORY_LIMIT, 2,
> > > ++					(addr + SZ_32M) >> 16);
> > > ++		break;
> > > ++
> > > ++	case 1:
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, 0x18, 4,
> > > ++					(((busno + slot) << 16) |
> > > ++					 ((busno + slot) << 8) | busno));
> > > ++		BUG_ON(((addr + SZ_48M) >> 16) & 0xf);
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, PCI_MEMORY_BASE, 4,
> > > ++					(addr + SZ_48M) >> 16);
> > > ++		BUG_ON(((addr + SZ_48M + SZ_32M) >> 16) & 0xf);
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, PCI_MEMORY_LIMIT, 4,
> > > ++					(addr + SZ_48M + SZ_32M) >> 16);
> > > ++
> > > ++		/* Mark port bit number as active if successful */
> > > ++		tmp16 = bcma_pcie2_read_config(bdev, busno, devfn, 0x7A, 2);
> > > ++		if (tmp16 & PCI_EXP_LNKSTA_DLLLA) {
> > > ++			pex8603.ports |= ((1 << (slot - 1)) & 0xffff);
> > > ++			pex8603.active++;
> > > ++		}
> > > ++		break;
> > > ++
> > > ++	case 2:
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, 0x18, 4,
> > > ++					(((busno + slot) << 16) |
> > > ++					 ((busno + slot) << 8) | busno));
> > > ++		BUG_ON(((addr + (SZ_48M * 2)) >> 16) & 0xf);
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, PCI_MEMORY_BASE, 4,
> > > ++					(addr + (SZ_48M * 2)) >> 16);
> > > ++		BUG_ON(((addr + (SZ_48M * 2) + SZ_32M) >> 16) & 0xf);
> > > ++		bcma_pcie2_write_config(bdev, busno,
> > > ++					devfn, PCI_MEMORY_LIMIT, 4,
> > > ++					(addr + (SZ_48M * 2) + SZ_32M) >> 16);
> > > ++
> > > ++		/* Mark port bit number as active if successful */
> > > ++		tmp16 = bcma_pcie2_read_config(bdev, busno, devfn, 0x7A, 2);
> > > ++		if (tmp16 & PCI_EXP_LNKSTA_DLLLA) {
> > > ++			pex8603.ports |= ((1 << (slot - 1)) & 0xffff);
> > > ++			pex8603.active++;
> > > ++		}
> > > ++		break;
> > > ++	}
> > > ++}
> > > ++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8603, bcma_pcie2_pex_switch_setup);
> > > ++
> > > + /*
> > > +  * Check link status, return 0 if link is up in RC mode,
> > > +  * otherwise return non-zero
> > > _______________________________________________
> > > openwrt-devel mailing list
> > > openwrt-devel at lists.openwrt.org
> > > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> > > 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 16 03:43:55 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 16 Aug 2015 09:43:55 +0200
Subject: [OpenWrt-Devel] [PATCH] mac80211: add mt7601u driver
Message-ID: <1439711035-26779-1-git-send-email-dirkneukirchen@web.de>

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/kernel/mac80211/Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 40b08c0..874ff9f 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -31,7 +31,7 @@ PKG_DRIVERS = \
 	mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \
 	iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \
 	rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \
-	rtl8192de rtl8192cu
+	rtl8192de rtl8192cu mt7601u
 
 PKG_CONFIG_DEPENDS:= \
 	CONFIG_PACKAGE_kmod-mac80211 \
@@ -695,6 +695,14 @@ define KernelPackage/mac80211-hwsim
   AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
 endef
 
+define KernelPackage/mt7601u
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=mac80211 HW simulation device
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
+  AUTOLOAD:=$(call AutoProbe,mt7601)
+endef
+
 define KernelPackage/net-libipw
   $(call KernelPackage/mac80211/Default)
   TITLE:=libipw for ipw2100 and ipw2200
@@ -1593,6 +1601,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE
 config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG
 
 config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
+config-$(call config_package,mt7601u) += MT7601U
+config-y += WL_MEDIATEK
 
 config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB
 config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI
@@ -2052,6 +2062,7 @@ $(eval $(call KernelPackage,rtl8192de))
 $(eval $(call KernelPackage,rtl8192cu))
 $(eval $(call KernelPackage,zd1211rw))
 $(eval $(call KernelPackage,mac80211-hwsim))
+$(eval $(call KernelPackage,mt7601u))
 $(eval $(call KernelPackage,ath9k-common))
 $(eval $(call KernelPackage,ath9k))
 $(eval $(call KernelPackage,ath9k-htc))
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 16 03:54:09 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 16 Aug 2015 09:54:09 +0200
Subject: [OpenWrt-Devel] [PATCH v2] mac80211: add mt7601u driver
Message-ID: <1439711649-27853-1-git-send-email-dirkneukirchen@web.de>

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
v2: fix TITLE c/p error

 package/kernel/mac80211/Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 40b08c0..debb292 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -31,7 +31,7 @@ PKG_DRIVERS = \
 	mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \
 	iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \
 	rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \
-	rtl8192de rtl8192cu
+	rtl8192de rtl8192cu mt7601u
 
 PKG_CONFIG_DEPENDS:= \
 	CONFIG_PACKAGE_kmod-mac80211 \
@@ -695,6 +695,14 @@ define KernelPackage/mac80211-hwsim
   AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
 endef
 
+define KernelPackage/mt7601u
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=MT7601U-based USB dongles Wireless Driver
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
+  AUTOLOAD:=$(call AutoProbe,mt7601)
+endef
+
 define KernelPackage/net-libipw
   $(call KernelPackage/mac80211/Default)
   TITLE:=libipw for ipw2100 and ipw2200
@@ -1593,6 +1601,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE
 config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG
 
 config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
+config-$(call config_package,mt7601u) += MT7601U
+config-y += WL_MEDIATEK
 
 config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB
 config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI
@@ -2052,6 +2062,7 @@ $(eval $(call KernelPackage,rtl8192de))
 $(eval $(call KernelPackage,rtl8192cu))
 $(eval $(call KernelPackage,zd1211rw))
 $(eval $(call KernelPackage,mac80211-hwsim))
+$(eval $(call KernelPackage,mt7601u))
 $(eval $(call KernelPackage,ath9k-common))
 $(eval $(call KernelPackage,ath9k))
 $(eval $(call KernelPackage,ath9k-htc))
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Sun Aug 16 06:00:34 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 16 Aug 2015 12:00:34 +0200
Subject: [OpenWrt-Devel] [PATCH v2] mac80211: add mt7601u driver
In-Reply-To: <1439711649-27853-1-git-send-email-dirkneukirchen@web.de>
References: <1439711649-27853-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <55D05F42.80405@hauke-m.de>

On 08/16/2015 09:54 AM, Dirk Neukirchen wrote:
> Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
> ---
> v2: fix TITLE c/p error
> 
>  package/kernel/mac80211/Makefile | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)

Doesn't this need some firmware? I see that this driver loads mt7601u.bin

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sakib at meta.ua  Sun Aug 16 07:08:51 2015
From: sakib at meta.ua (Sergiy Kibrik)
Date: Sun, 16 Aug 2015 14:08:51 +0300
Subject: [OpenWrt-Devel] [PATCH] [libubox] ulog: check if /dev/kmsg is
	special file
Message-ID: <1439723331-31367-1-git-send-email-sakib@meta.ua>

Race is possible in ulog_kmsg: if no /dev/kmsg exists
(e.g. while /dev gets re-mounted) regular file created instead.

From dirkneukirchen at web.de  Sun Aug 16 09:19:33 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 16 Aug 2015 15:19:33 +0200
Subject: [OpenWrt-Devel] [PATCH v3] mac80211: add mt7601u driver
In-Reply-To: <1439711649-27853-1-git-send-email-dirkneukirchen@web.de>
References: <1439711649-27853-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <1439731173-2587-1-git-send-email-dirkneukirchen@web.de>

firmware is not available in linux-firmware yet
so use official driver source

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
v2: fix TITLE c/p error
v3: add missing firmware

 package/kernel/mac80211/Makefile | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 40b08c0..6afef10 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -31,7 +31,7 @@ PKG_DRIVERS = \
 	mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \
 	iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \
 	rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \
-	rtl8192de rtl8192cu
+	rtl8192de rtl8192cu mt7601u
 
 PKG_CONFIG_DEPENDS:= \
 	CONFIG_PACKAGE_kmod-mac80211 \
@@ -695,6 +695,27 @@ define KernelPackage/mac80211-hwsim
   AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
 endef
 
+PKG_MT7601U_FW_NAME:=DPO_MT7601U_LinuxSTA
+PKG_MT7601U_FW_VERSION:=3.0.0.4_20130913
+PKG_MT7601U_FW_MD5SUM:=5f440dccc8bc952745a191994fc34699
+PKG_MT7601U_FW_SOURCE:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION).tar.bz2
+PKG_MT7601U_FW_SOURCE_URL:=http://www.mediatek.com/AmazonS3/Downloads/linux/
+define Download/mt7601u-firmware
+  FILE:=$(PKG_MT7601U_FW_SOURCE)
+  URL:=$(PKG_MT7601U_FW_SOURCE_URL)
+  MD5SUM:=$(PKG_MT7601U_FW_MD5SUM)
+  SUBDIR:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)
+endef
+$(eval $(call Download,mt7601u-firmware))
+
+define KernelPackage/mt7601u
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=MT7601U-based USB dongles Wireless Driver
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
+  AUTOLOAD:=$(call AutoProbe,mt7601)
+endef
+
 define KernelPackage/net-libipw
   $(call KernelPackage/mac80211/Default)
   TITLE:=libipw for ipw2100 and ipw2200
@@ -1593,6 +1614,8 @@ config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE
 config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG
 
 config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
+config-$(call config_package,mt7601u) += MT7601U
+config-y += WL_MEDIATEK
 
 config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB
 config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI
@@ -1695,6 +1718,7 @@ define Build/Prepare
 	$(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
 	$(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_LINUX_FIRMWARE_SOURCE)
 	$(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE)
+	$(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_MT7601U_FW_SOURCE)
 	rm -rf \
 		$(PKG_BUILD_DIR)/include/linux/ssb \
 		$(PKG_BUILD_DIR)/include/linux/bcma \
@@ -1868,6 +1892,13 @@ else
 endif
 endef
 
+define KernelPackage/mt7601u/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)/mcu/bin/MT7601.bin \
+		$(1)/lib/firmware/mt7601u.bin
+endef
+
 define KernelPackage/mwl8k/install
 	$(INSTALL_DIR) $(1)/lib/firmware/mwl8k
 	$(INSTALL_DATA) \
@@ -2052,6 +2083,7 @@ $(eval $(call KernelPackage,rtl8192de))
 $(eval $(call KernelPackage,rtl8192cu))
 $(eval $(call KernelPackage,zd1211rw))
 $(eval $(call KernelPackage,mac80211-hwsim))
+$(eval $(call KernelPackage,mt7601u))
 $(eval $(call KernelPackage,ath9k-common))
 $(eval $(call KernelPackage,ath9k))
 $(eval $(call KernelPackage,ath9k-htc))
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Sun Aug 16 11:44:48 2015
From: blogic at openwrt.org (John Crispin)
Date: Sun, 16 Aug 2015 17:44:48 +0200
Subject: [OpenWrt-Devel] [PATCH 1/1] [buildroot] Fix for liblzma breaks
 redhat-like systems
In-Reply-To: <55CF4EAA.9070603@hauke-m.de>
References: <20150810153021.796FC23A1534@danielcent.thecshore.com>
 <55CF4EAA.9070603@hauke-m.de>
Message-ID: <55D0AFF0.3050003@openwrt.org>



On 15/08/2015 16:37, Hauke Mehrtens wrote:
> On 08/09/2015 05:50 AM, Daniel Dickinson wrote:
>> On RedHat/Fedora and derivatives we must use the system liblzma
>> from xz-devel because the liblzma in tools/xz breaks these
>> systems due to system tools (which use liblzma) having
>> missing symbols when staging_dir/host/lib has liblzma
>> (because buildroot puts staging_dir/host/lib first in
>> library load path and therefore all binaries not just
>> buildroot's binaries use liblzma from staging_dir/host/lib, at
>> least while building OpenWrt).
>>
>> Closes: 20134
>> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
>> ---
>>  include/host.mk          |  7 ++++++-
>>  include/prereq-build.mk  |  7 +++++++
>>  tools/Makefile           | 11 ++++++++---
>>  tools/squashfs4/Makefile |  2 +-
>>  4 files changed, 22 insertions(+), 5 deletions(-)
>>
> Please check if your patch is still needed with r46603
> https://dev.openwrt.org/changeset/46603
> 


Daniel,

did you test the rev hauke named ?

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


From openwrt at daniel.thecshore.com  Sun Aug 16 22:44:33 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 16 Aug 2015 22:44:33 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [buildroot] Fix for liblzma breaks
 redhat-like systems
In-Reply-To: <55D0AFF0.3050003@openwrt.org>
References: <20150810153021.796FC23A1534@danielcent.thecshore.com>
 <55CF4EAA.9070603@hauke-m.de> <55D0AFF0.3050003@openwrt.org>
Message-ID: <55D14A91.1080803@daniel.thecshore.com>

I'll be doing a build shortly.  I haven't had much time this weekend, so 
hopefully I'll have an answer before the busy week starts.

Regards,

Daniel

On 2015-08-16 11:44 AM, John Crispin wrote:
>
>
> On 15/08/2015 16:37, Hauke Mehrtens wrote:
>> On 08/09/2015 05:50 AM, Daniel Dickinson wrote:
>>> On RedHat/Fedora and derivatives we must use the system liblzma
>>> from xz-devel because the liblzma in tools/xz breaks these
>>> systems due to system tools (which use liblzma) having
>>> missing symbols when staging_dir/host/lib has liblzma
>>> (because buildroot puts staging_dir/host/lib first in
>>> library load path and therefore all binaries not just
>>> buildroot's binaries use liblzma from staging_dir/host/lib, at
>>> least while building OpenWrt).
>>>
>>> Closes: 20134
>>> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
>>> ---
>>>   include/host.mk          |  7 ++++++-
>>>   include/prereq-build.mk  |  7 +++++++
>>>   tools/Makefile           | 11 ++++++++---
>>>   tools/squashfs4/Makefile |  2 +-
>>>   4 files changed, 22 insertions(+), 5 deletions(-)
>>>
>> Please check if your patch is still needed with r46603
>> https://dev.openwrt.org/changeset/46603
>>
>
>
> Daniel,
>
> did you test the rev hauke named ?
>
> 	John
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 17 01:07:11 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 17 Aug 2015 07:07:11 +0200
Subject: [OpenWrt-Devel] [PATCH] enable strong SSP / Stackprotector on gcc5
Message-ID: <1439788031-28970-1-git-send-email-dirkneukirchen@web.de>

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 config/Config-build.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index f2d292e..e2defaa 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -232,7 +232,7 @@ menu "Global build settings"
 		config PKG_CC_STACKPROTECTOR_STRONG
 			bool "Strong"
 			select SSP_SUPPORT if !USE_MUSL
-			depends on GCC_VERSION_4_9_LINARO
+			depends on GCC_VERSION_4_9_LINARO || GCC_VERSION_5
 			depends on KERNEL_CC_STACKPROTECTOR_STRONG
 	endchoice
 
@@ -247,7 +247,7 @@ menu "Global build settings"
 		config KERNEL_CC_STACKPROTECTOR_REGULAR
 			bool "Regular"
 		config KERNEL_CC_STACKPROTECTOR_STRONG
-			depends on GCC_VERSION_4_9_LINARO
+			depends on GCC_VERSION_4_9_LINARO || GCC_VERSION_5
 			bool "Strong"
 	endchoice
 
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Mon Aug 17 02:27:08 2015
From: blogic at openwrt.org (John Crispin)
Date: Mon, 17 Aug 2015 08:27:08 +0200
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
 Systems devices
In-Reply-To: <20150810154128.2DE0923A1534@danielcent.thecshore.com>
References: <20150810154128.2DE0923A1534@danielcent.thecshore.com>
Message-ID: <55D17EBC.9090103@openwrt.org>

Hi,

the series is in patchwork several times. some mails are duplicated 8
times. others exist twice, have identical content but 2 different
subjects. i marked all 25 patches as invalid. can you please work out
what we should merge and just resend it as a clean series against trunk
please.

	John

On 09/08/2015 06:12, Daniel Dickinson wrote:
> Sorry, one last time; this series got concatenated into one big email.
> 
> Hi all,
> 
> I have added suport for three PowerCloud Systems devices based on
> the patches posted in 
> https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
> updated board support in the OpenWrt tree, and some tweaks of my own.
> 
> These patches are against trunk.
> 
> Daniel Dickinson (8):
>   CC PowerCloud CAP324 Image generation
>   CC PowerCloud CAP324 OpenWrt configuration
>   CC PowerCloud CR3000 Kernel BSP
>   CC PowerCloud CR3000 image generation
>   CC PowerCloud CR3000 OpenWrt configuration
>   CC PowerCloud CR5000 Kernel BSP
>   CC PowerCloud CR5000 image generation
>   CC PowerCloud CR5000 OpenWrt configuration
> 
>  package/boot/uboot-envtools/files/ar71xx           |   3 +
>  target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
>  .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
>  .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
>  target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
>  .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
>  target/linux/ar71xx/config-4.1                     |   2 +
>  target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
>  target/linux/ar71xx/image/Makefile                 |  12 ++
>  .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
>  .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
>  11 files changed, 587 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
>  create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Mon Aug 17 02:28:19 2015
From: blogic at openwrt.org (John Crispin)
Date: Mon, 17 Aug 2015 08:28:19 +0200
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
In-Reply-To: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
Message-ID: <55D17F03.5080101@openwrt.org>

Hi,

just merged the whole lot. thanks a lot. what do you want to do next
lantiq or ar71xx ? :) personally i would prefer ar71xx ;)

	John

On 05/08/2015 20:30, Piotr Dymacz wrote:
> The following changes fix different mistakes in ramips target and try to make the code more clean and consistent.
> 
> The patches affect:
>  * dts{,i} files
>  * base-files/* scripts
>  * image Makefile
>  * subtargets *.mk profile files
> 
> Changes in v2 of the series:
>  * rebased to r46566
>  * use the upstream convention for LED naming
>  * more fixes in dts{,i} files
>  * patches are now ordered more logically
>  * patches are now better described
>  * additional fixes related with devices names
>  * big patches related with particular devices are not combined together, for easy review
> 
> Piotr Dymacz (25):
>   ramips: fix indentation and other mistakes in .dts{,i} files
>   ramips: fix Zbtlink ZBT-WR8305RT board name
>   ramips: fix Asus WL-330N{,3G} boards names
>   ramips: fix Asus RP-N53 and Lenovo Y1{,S} image names
>   ramips: fix Xiaomi MiWiFi Mini board, image and profile names
>   ramips: fix UPVEL model names
>   ramips: fix Asus RT-N56U dts filename
>   ramips: fix Belkin F7C027 image name
>   ramips: fix Argus ATP-52B board and image names
>   ramips: fix Sitecom WL-341v3 board and image names
>   ramips: fix Olimex models, images and profiles names
>   ramips: fix Aigale Ai-BR100 dts and profile names
>   ramips: fix Tenda W150M model name
>   ramips: fix Edimax BR-6425 board name
>   ramips: fix Omnima models, images and profiles names
>   ramips: fix Buffalo WMR-300 dts, board, image and profile names
>   ramips: fix 7Links PX-4885 dts{,i}, board, image and profile names
>   ramips: remove old code for Edimax BR-6524N
>   ramips: fix various mistakes in subtargets *.mk profiles
>   ramips: remove leading spaces, sort boards and optimize
>     base-files/lib/ramips.sh
>   ramips: be consistent with case statement in
>     base-files/lib/upgrade/platform.sh
>   ramips: fix indentation, case statements structure and optimize
>     base-files/etc/board.d/02_network
>   ramips: remove unnecessary LED declaration for WT1520 in diag.sh
>   ramips: use consistent naming scheme for LEDs
>   ramips: base-files: optimize etc/diag.sh and etc/board.d/01_leds
>     scripts
> 
>  target/linux/ramips/base-files/etc/board.d/01_leds | 480 ++++++++++-----------
>  .../linux/ramips/base-files/etc/board.d/02_network | 391 ++++++++---------
>  target/linux/ramips/base-files/etc/diag.sh         | 338 ++++++---------
>  target/linux/ramips/base-files/lib/ramips.sh       | 436 +++++++++----------
>  .../ramips/base-files/lib/upgrade/platform.sh      | 234 +++++-----
>  target/linux/ramips/dts/3G-6200N.dts               |  12 +-
>  target/linux/ramips/dts/3G-6200NL.dts              |   5 +-
>  target/linux/ramips/dts/3G150B.dts                 |  10 +-
>  target/linux/ramips/dts/3G300M.dts                 |  21 +-
>  target/linux/ramips/dts/A5-V11.dts                 |   6 +
>  target/linux/ramips/dts/AI-BR100.dts               | 109 +++++
>  target/linux/ramips/dts/AIBR100.dts                | 106 -----
>  target/linux/ramips/dts/AIR3GII.dts                |   8 +-
>  target/linux/ramips/dts/ALL0239-3G.dts             |  16 +-
>  target/linux/ramips/dts/ALL0256N-4M.dts            |   5 +
>  target/linux/ramips/dts/ALL0256N-8M.dts            |   5 +
>  target/linux/ramips/dts/ALL5002.dts                |   8 +-
>  target/linux/ramips/dts/ALL5003.dts                |   8 +-
>  target/linux/ramips/dts/AR670W.dts                 |   4 +-
>  target/linux/ramips/dts/AR725W.dts                 |   4 +-
>  target/linux/ramips/dts/ARGUS_ATP52B.dts           |  93 ----
>  target/linux/ramips/dts/ASL26555-16M.dts           |  17 +
>  target/linux/ramips/dts/ASL26555-8M.dts            |  16 +
>  target/linux/ramips/dts/ATP-52B.dts                |  96 +++++
>  target/linux/ramips/dts/AWAPN2403.dts              |   7 +-
>  target/linux/ramips/dts/AWM002-EVB-4M.dts          |   5 +
>  target/linux/ramips/dts/AWM002-EVB-8M.dts          |   5 +
>  target/linux/ramips/dts/AWM002.dtsi                |   7 +-
>  target/linux/ramips/dts/AWM003-EVB.dts             |  11 +-
>  target/linux/ramips/dts/ArcherC20i.dts             |   1 -
>  target/linux/ramips/dts/BC2.dts                    |   3 +-
>  target/linux/ramips/dts/BR-6425.dts                |   9 +-
>  target/linux/ramips/dts/BR-6475ND.dts              |  15 +-
>  target/linux/ramips/dts/BROADWAY.dts               |   8 +-
>  target/linux/ramips/dts/CARAMBOLA.dts              |   2 -
>  target/linux/ramips/dts/CF-WR800N.dts              |  31 +-
>  target/linux/ramips/dts/CY-SWR1100.dts             |  17 +-
>  target/linux/ramips/dts/D105.dts                   |   4 +-
>  target/linux/ramips/dts/DAP-1350.dts               |  14 +-
>  target/linux/ramips/dts/DCS-930.dts                |  11 +-
>  target/linux/ramips/dts/DCS-930L-B1.dts            |  11 +-
>  target/linux/ramips/dts/DIR-300-B1.dts             |  18 +-
>  target/linux/ramips/dts/DIR-300-B7.dts             |  74 ++--
>  target/linux/ramips/dts/DIR-320-B1.dts             |  32 +-
>  target/linux/ramips/dts/DIR-600-B1.dts             |  18 +-
>  target/linux/ramips/dts/DIR-600-B2.dts             |  18 +-
>  target/linux/ramips/dts/DIR-610-A1.dts             |  29 +-
>  target/linux/ramips/dts/DIR-615-D.dts              |  18 +-
>  target/linux/ramips/dts/DIR-615-H1.dts             |  20 +-
>  target/linux/ramips/dts/DIR-620-A1.dts             |  21 +-
>  target/linux/ramips/dts/DIR-620-D1.dts             |  10 +-
>  target/linux/ramips/dts/DIR-645.dts                |  15 +-
>  target/linux/ramips/dts/DIR-810L.dts               |  12 +-
>  target/linux/ramips/dts/DIR-860L-B1.dts            |   1 +
>  target/linux/ramips/dts/E1700.dts                  |  15 +-
>  target/linux/ramips/dts/ESR-9753.dts               |   5 +-
>  target/linux/ramips/dts/F5D8235_V1.dts             |   9 +-
>  target/linux/ramips/dts/F5D8235_V2.dts             |  28 +-
>  target/linux/ramips/dts/F7C027.dts                 |  17 +-
>  target/linux/ramips/dts/FIREWRT.dts                |   5 +-
>  target/linux/ramips/dts/FONERA20N.dts              |  10 +-
>  target/linux/ramips/dts/FREESTATION5.dts           |  11 +-
>  target/linux/ramips/dts/HG255D.dts                 |  22 +-
>  target/linux/ramips/dts/HLKRM04.dts                |   3 +
>  target/linux/ramips/dts/HPM.dts                    | 149 +++++++
>  target/linux/ramips/dts/HT-TM02.dts                |  11 +-
>  target/linux/ramips/dts/HW550-3G.dts               |   8 +-
>  target/linux/ramips/dts/IP2202.dts                 |   4 +-
>  target/linux/ramips/dts/M2M.dts                    |   5 +
>  target/linux/ramips/dts/M3.dts                     |   4 +
>  target/linux/ramips/dts/M4-4M.dts                  |   3 +
>  target/linux/ramips/dts/M4-8M.dts                  |   3 +
>  target/linux/ramips/dts/MINIEMBPLUG.dts            | 120 ++++++
>  target/linux/ramips/dts/MINIEMBWIFI.dts            |  92 ++++
>  target/linux/ramips/dts/MIWIFI-MINI.dts            | 150 +++++++
>  target/linux/ramips/dts/MLW221.dts                 |   9 +-
>  target/linux/ramips/dts/MLWG2.dts                  |   8 +-
>  target/linux/ramips/dts/MOFI3500-3GN.dts           |   8 +-
>  target/linux/ramips/dts/MPRA1.dts                  |  10 +-
>  target/linux/ramips/dts/MPRA2.dts                  |   9 +-
>  target/linux/ramips/dts/MR-102N.dts                |   6 +-
>  target/linux/ramips/dts/MT7620a.dts                |   4 +-
>  target/linux/ramips/dts/MT7620a_MT7530.dts         |   7 +-
>  target/linux/ramips/dts/MT7620a_MT7610e.dts        |   4 +-
>  target/linux/ramips/dts/MT7620a_V22SG.dts          |  11 +-
>  target/linux/ramips/dts/MZK-750DHP.dts             |   9 +-
>  target/linux/ramips/dts/MZK-DP150N.dts             |   4 +-
>  target/linux/ramips/dts/MZK-W300NH2.dts            |  13 +-
>  target/linux/ramips/dts/MicroWRT.dts               |   4 +-
>  target/linux/ramips/dts/NA930.dts                  |  14 +-
>  target/linux/ramips/dts/NBG-419N.dts               |   5 +-
>  target/linux/ramips/dts/NCS601W.dts                |  41 +-
>  target/linux/ramips/dts/NW718.dts                  |   6 +
>  target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts  | 101 -----
>  target/linux/ramips/dts/OLINUXINO-RT5350F.dts      |  79 ----
>  target/linux/ramips/dts/OMNI-EMB-HPM.dts           | 142 ------
>  target/linux/ramips/dts/OMNI-EMB.dts               |  90 ----
>  target/linux/ramips/dts/OMNI-PLUG.dts              | 113 -----
>  target/linux/ramips/dts/OY-0001.dts                |  14 +-
>  target/linux/ramips/dts/PBR-M1.dts                 |  12 +-
>  target/linux/ramips/dts/PSR-680W.dts               |   3 +-
>  target/linux/ramips/dts/PWH2004.dts                |   4 +-
>  target/linux/ramips/dts/PX-4885-4M.dts             |  43 ++
>  target/linux/ramips/dts/PX-4885-8M.dts             |  43 ++
>  target/linux/ramips/dts/PX-4885.dtsi               |  54 +++
>  target/linux/ramips/dts/PX4885-4M.dts              |  42 --
>  target/linux/ramips/dts/PX4885-8M.dts              |  42 --
>  target/linux/ramips/dts/PX4885.dtsi                |  51 ---
>  target/linux/ramips/dts/RE6500.dts                 |   8 +-
>  target/linux/ramips/dts/RP-N53.dts                 |  30 +-
>  target/linux/ramips/dts/RT-G32-B1.dts              |   3 +
>  target/linux/ramips/dts/RT-N10-PLUS.dts            |   6 +-
>  target/linux/ramips/dts/RT-N13U.dts                |   9 +-
>  target/linux/ramips/dts/RT-N14U.dts                |  17 +-
>  target/linux/ramips/dts/RT-N15.dts                 |   9 +-
>  target/linux/ramips/dts/RT-N56U.dts                | 151 +++++++
>  target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts  | 102 +++++
>  target/linux/ramips/dts/RT5350F-OLINUXINO.dts      |  80 ++++
>  target/linux/ramips/dts/RTN56U.dts                 | 146 -------
>  target/linux/ramips/dts/RUT5XX.dts                 |   9 +-
>  target/linux/ramips/dts/SAP-G3200U3.dts            |   4 +-
>  target/linux/ramips/dts/SL-R7205.dts               |   4 +-
>  target/linux/ramips/dts/TEW-691GR.dts              |   9 +-
>  target/linux/ramips/dts/TEW-692GR.dts              |  13 +-
>  target/linux/ramips/dts/UR-326N4G.dts              |  20 +-
>  target/linux/ramips/dts/UR-336UN.dts               |  20 +-
>  target/linux/ramips/dts/V11STFE.dts                |   2 +-
>  target/linux/ramips/dts/V22RW-2X2.dts              |   5 +-
>  target/linux/ramips/dts/VOCORE.dts                 |  15 +
>  target/linux/ramips/dts/W150M.dts                  |  25 +-
>  target/linux/ramips/dts/W306R_V20.dts              |   4 +-
>  target/linux/ramips/dts/W502U.dts                  |   9 +-
>  target/linux/ramips/dts/WCR150GN.dts               |   9 +-
>  target/linux/ramips/dts/WHR-1166D.dts              |  27 +-
>  target/linux/ramips/dts/WHR-300HP2.dts             |  27 +-
>  target/linux/ramips/dts/WHR-600D.dts               |  28 +-
>  target/linux/ramips/dts/WHR-G300N.dts              |   8 +-
>  target/linux/ramips/dts/WIZARD8800.dts             |   1 +
>  target/linux/ramips/dts/WL-330N.dts                | 100 +++++
>  target/linux/ramips/dts/WL-330N3G.dts              | 109 +++++
>  target/linux/ramips/dts/WL-341V3.dts               | 123 ++++++
>  target/linux/ramips/dts/WL-351.dts                 |   6 +-
>  target/linux/ramips/dts/WL341V3.dts                | 115 -----
>  target/linux/ramips/dts/WLI-TX4-AG300N.dts         |  17 +-
>  target/linux/ramips/dts/WL_330N.dts                |  95 ----
>  target/linux/ramips/dts/WL_330N3G.dts              | 103 -----
>  target/linux/ramips/dts/WMR-300.dts                | 106 +++++
>  target/linux/ramips/dts/WMR300.dts                 | 101 -----
>  target/linux/ramips/dts/WNCE2001.dts               |  17 +-
>  target/linux/ramips/dts/WR512-3GN-4M.dts           |  18 +-
>  target/linux/ramips/dts/WR512-3GN-8M.dts           |  18 +-
>  target/linux/ramips/dts/WR6202.dts                 |   5 +-
>  target/linux/ramips/dts/WR8305RT.dts               | 112 -----
>  target/linux/ramips/dts/WRTNODE.dts                |   1 +
>  target/linux/ramips/dts/WSR-1166.dts               |  30 +-
>  target/linux/ramips/dts/WSR-600.dts                |  31 +-
>  target/linux/ramips/dts/WT1520-4M.dts              |   1 +
>  target/linux/ramips/dts/WT1520-8M.dts              |   1 +
>  target/linux/ramips/dts/WT3020-4M.dts              |  28 +-
>  target/linux/ramips/dts/WT3020-8M.dts              |  28 +-
>  target/linux/ramips/dts/WZR-AGL300NH.dts           |  22 +-
>  target/linux/ramips/dts/X5.dts                     |   9 +
>  target/linux/ramips/dts/X8.dts                     |   3 +
>  target/linux/ramips/dts/XDXRN502J.dts              |   4 +-
>  target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts     | 149 -------
>  target/linux/ramips/dts/Y1.dts                     |  20 +-
>  target/linux/ramips/dts/Y1.dtsi                    |   2 +
>  target/linux/ramips/dts/Y1S.dts                    |  22 +-
>  target/linux/ramips/dts/ZBT-WA05.dts               |  10 +-
>  target/linux/ramips/dts/ZBT-WR8305RT.dts           | 117 +++++
>  target/linux/ramips/dts/ZTE-Q7.dts                 |   8 +-
>  target/linux/ramips/dts/mt7620a.dtsi               |  14 +-
>  target/linux/ramips/dts/mt7620n.dtsi               |   5 +-
>  target/linux/ramips/dts/mt7621.dtsi                |  20 +-
>  target/linux/ramips/dts/mt7628an.dtsi              |   9 +-
>  target/linux/ramips/dts/rt2880.dtsi                |   3 +-
>  target/linux/ramips/dts/rt3050.dtsi                |   2 +-
>  target/linux/ramips/dts/rt3352.dtsi                |   1 +
>  target/linux/ramips/dts/rt3883.dtsi                |   1 +
>  target/linux/ramips/dts/rt5350.dtsi                |   5 +
>  target/linux/ramips/image/Makefile                 |  80 ++--
>  target/linux/ramips/mt7620/profiles/aigale.mk      |   6 +-
>  target/linux/ramips/mt7620/profiles/mediatek.mk    |   2 +-
>  target/linux/ramips/mt7620/profiles/microduino.mk  |  16 +
>  target/linux/ramips/mt7620/profiles/microwrt.mk    |   9 -
>  .../ramips/mt7620/profiles/xiaomi-miwifi-mini.mk   |  18 -
>  target/linux/ramips/mt7620/profiles/xiaomi.mk      |  18 +
>  target/linux/ramips/mt7621/profiles/firefly.mk     |  12 +-
>  target/linux/ramips/mt7621/profiles/misc.mk        |  20 +
>  target/linux/ramips/mt7621/profiles/pbr-m1.mk      |  22 -
>  target/linux/ramips/mt7621/profiles/sap-g3200u3.mk |  18 -
>  target/linux/ramips/mt7621/profiles/storylink.mk   |  18 +
>  target/linux/ramips/rt288x/profiles/asus.mk        |   8 +-
>  target/linux/ramips/rt288x/profiles/belkin.mk      |  10 +-
>  target/linux/ramips/rt288x/profiles/edimax.mk      |  18 -
>  target/linux/ramips/rt305x/profiles/allnet.mk      |   7 +-
>  target/linux/ramips/rt305x/profiles/alpha.mk       |   1 -
>  target/linux/ramips/rt305x/profiles/arcwireless.mk |  17 +
>  target/linux/ramips/rt305x/profiles/asiarf.mk      |  23 +-
>  target/linux/ramips/rt305x/profiles/asus.mk        |   8 +-
>  target/linux/ramips/rt305x/profiles/aximcom.mk     |   1 -
>  target/linux/ramips/rt305x/profiles/aztech.mk      |   1 -
>  target/linux/ramips/rt305x/profiles/belkin.mk      |  10 +-
>  target/linux/ramips/rt305x/profiles/broadway.mk    |   1 -
>  target/linux/ramips/rt305x/profiles/d-link.mk      |  68 +++
>  target/linux/ramips/rt305x/profiles/dlink.mk       |  69 ---
>  target/linux/ramips/rt305x/profiles/easyacc.mk     |   1 -
>  target/linux/ramips/rt305x/profiles/engenius.mk    |  10 +-
>  target/linux/ramips/rt305x/profiles/fon.mk         |   1 -
>  .../linux/ramips/rt305x/profiles/freestation5.mk   |  18 -
>  target/linux/ramips/rt305x/profiles/hame.mk        |   4 +-
>  target/linux/ramips/rt305x/profiles/hg255d.mk      |  17 -
>  target/linux/ramips/rt305x/profiles/hilink.mk      |   2 -
>  target/linux/ramips/rt305x/profiles/hootoo.mk      |   2 -
>  target/linux/ramips/rt305x/profiles/huawei.mk      |  16 +
>  target/linux/ramips/rt305x/profiles/intenso.mk     |  19 +
>  target/linux/ramips/rt305x/profiles/m2m.mk         |  20 -
>  target/linux/ramips/rt305x/profiles/misc.mk        |   1 -
>  target/linux/ramips/rt305x/profiles/nexx.mk        |   1 -
>  target/linux/ramips/rt305x/profiles/olimex.mk      |  33 ++
>  .../rt305x/profiles/olinuxino-rt5350f-evb.mk       |  21 -
>  .../ramips/rt305x/profiles/olinuxino-rt5350f.mk    |  20 -
>  target/linux/ramips/rt305x/profiles/planex.mk      |   1 -
>  target/linux/ramips/rt305x/profiles/poray.mk       |  12 +-
>  target/linux/ramips/rt305x/profiles/sevenlinks.mk  |   8 +-
>  target/linux/ramips/rt305x/profiles/tenda.mk       |   5 +-
>  target/linux/ramips/rt305x/profiles/upvel.mk       |  17 +-
>  target/linux/ramips/rt305x/profiles/vocore.mk      |   1 -
>  target/linux/ramips/rt305x/profiles/wansview.mk    |   3 +-
>  target/linux/ramips/rt3883/profiles/omnima.mk      |  10 +-
>  target/linux/ramips/rt3883/profiles/trendnet.mk    |   1 +
>  231 files changed, 4070 insertions(+), 3600 deletions(-)
>  create mode 100644 target/linux/ramips/dts/AI-BR100.dts
>  delete mode 100644 target/linux/ramips/dts/AIBR100.dts
>  delete mode 100644 target/linux/ramips/dts/ARGUS_ATP52B.dts
>  create mode 100644 target/linux/ramips/dts/ATP-52B.dts
>  create mode 100644 target/linux/ramips/dts/HPM.dts
>  create mode 100644 target/linux/ramips/dts/MINIEMBPLUG.dts
>  create mode 100644 target/linux/ramips/dts/MINIEMBWIFI.dts
>  create mode 100644 target/linux/ramips/dts/MIWIFI-MINI.dts
>  delete mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F-EVB.dts
>  delete mode 100644 target/linux/ramips/dts/OLINUXINO-RT5350F.dts
>  delete mode 100644 target/linux/ramips/dts/OMNI-EMB-HPM.dts
>  delete mode 100644 target/linux/ramips/dts/OMNI-EMB.dts
>  delete mode 100644 target/linux/ramips/dts/OMNI-PLUG.dts
>  create mode 100644 target/linux/ramips/dts/PX-4885-4M.dts
>  create mode 100644 target/linux/ramips/dts/PX-4885-8M.dts
>  create mode 100644 target/linux/ramips/dts/PX-4885.dtsi
>  delete mode 100644 target/linux/ramips/dts/PX4885-4M.dts
>  delete mode 100644 target/linux/ramips/dts/PX4885-8M.dts
>  delete mode 100644 target/linux/ramips/dts/PX4885.dtsi
>  create mode 100644 target/linux/ramips/dts/RT-N56U.dts
>  create mode 100644 target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts
>  create mode 100644 target/linux/ramips/dts/RT5350F-OLINUXINO.dts
>  delete mode 100644 target/linux/ramips/dts/RTN56U.dts
>  create mode 100644 target/linux/ramips/dts/WL-330N.dts
>  create mode 100644 target/linux/ramips/dts/WL-330N3G.dts
>  create mode 100644 target/linux/ramips/dts/WL-341V3.dts
>  delete mode 100644 target/linux/ramips/dts/WL341V3.dts
>  delete mode 100644 target/linux/ramips/dts/WL_330N.dts
>  delete mode 100644 target/linux/ramips/dts/WL_330N3G.dts
>  create mode 100644 target/linux/ramips/dts/WMR-300.dts
>  delete mode 100644 target/linux/ramips/dts/WMR300.dts
>  delete mode 100644 target/linux/ramips/dts/WR8305RT.dts
>  delete mode 100644 target/linux/ramips/dts/XIAOMI-MIWIFI-MINI.dts
>  create mode 100644 target/linux/ramips/dts/ZBT-WR8305RT.dts
>  create mode 100644 target/linux/ramips/mt7620/profiles/microduino.mk
>  delete mode 100644 target/linux/ramips/mt7620/profiles/microwrt.mk
>  delete mode 100644 target/linux/ramips/mt7620/profiles/xiaomi-miwifi-mini.mk
>  create mode 100644 target/linux/ramips/mt7620/profiles/xiaomi.mk
>  create mode 100644 target/linux/ramips/mt7621/profiles/misc.mk
>  delete mode 100644 target/linux/ramips/mt7621/profiles/pbr-m1.mk
>  delete mode 100644 target/linux/ramips/mt7621/profiles/sap-g3200u3.mk
>  create mode 100644 target/linux/ramips/mt7621/profiles/storylink.mk
>  delete mode 100644 target/linux/ramips/rt288x/profiles/edimax.mk
>  create mode 100644 target/linux/ramips/rt305x/profiles/arcwireless.mk
>  create mode 100644 target/linux/ramips/rt305x/profiles/d-link.mk
>  delete mode 100644 target/linux/ramips/rt305x/profiles/dlink.mk
>  delete mode 100644 target/linux/ramips/rt305x/profiles/freestation5.mk
>  delete mode 100644 target/linux/ramips/rt305x/profiles/hg255d.mk
>  create mode 100644 target/linux/ramips/rt305x/profiles/huawei.mk
>  create mode 100644 target/linux/ramips/rt305x/profiles/intenso.mk
>  delete mode 100644 target/linux/ramips/rt305x/profiles/m2m.mk
>  create mode 100644 target/linux/ramips/rt305x/profiles/olimex.mk
>  delete mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f-evb.mk
>  delete mode 100644 target/linux/ramips/rt305x/profiles/olinuxino-rt5350f.mk
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 17 02:32:37 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 17 Aug 2015 02:32:37 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [polarssl] Fix build failures due
 to PKG_NAME != dir name
In-Reply-To: <CAECwjAh+0A48bJ5FWgSP2J2O20_m26ov-gzMME6k8Up8vCi9kA@mail.gmail.com>
References: <20150810153015.371DF23A1534@danielcent.thecshore.com>
 <CAECwjAi4xEsDpQns65uMs0oO4woKrPHG6UOxwTnuhq4L2zDuqQ@mail.gmail.com>
 <CAECwjAh+0A48bJ5FWgSP2J2O20_m26ov-gzMME6k8Up8vCi9kA@mail.gmail.com>
Message-ID: <55D18005.7000509@daniel.thecshore.com>

I have confirmed this issue exists in trunk (although I had no issue 
with CC) and have filed the patch in ticket #20340 
(https://dev.openwrt.org/ticket/20340)

On 2015-08-12 12:21 AM, Yousong Zhou wrote:
> On 11 August 2015 at 10:00, Yousong Zhou <yszhou4tech at gmail.com> wrote:
>> On 2 August 2015 at 19:46, Daniel Dickinson
>> <openwrt at daniel.thecshore.com> wrote:
>>> Packages that depend on PolarSSL fail to build because polarssl's InstallDev
>>> section never actually gets executed because (prior to this patch) the package
>>> name does not match the subdir the package is in (presumably due to upstream
>>> name change).  As a workaround I have changed the package name back to
>>> polarssl and used a new variable SRC_PKG_NAME for the purposes of downloading
>>> the upstream tarball and creating PKG_BUILD_DIR.
>>>
>>
>> Nice catch, but only setting PKG_BUILD_DIR should be enough to fix
>> this.  No need to introduce a new variable.
>>
>
> Hello, Daniel
>
> After a second look on the code, I didn't get why there was a problem.
> Anyway, openvpn-polarssl built and run fine in my environment.
>
>                  yousong
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Mon Aug 17 04:43:27 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Mon, 17 Aug 2015 08:43:27 +0000
Subject: [OpenWrt-Devel] Linux kernel config options handling in OpenWRT
Message-ID: <1439801007.3667.23.camel@synopsys.com>

Hello,

I'm playing with OpenWRT for a new platform and have a question on
how OpenWRT handles KCONFIG kernel options.

For example I select "KernelPackage/crypto-core" in OpenWRT's menuconfig
then KCONFIG is populated with:
------------------>8--------------------
CONFIG_CRYPTO=y
CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_BLKCIPHER
CONFIG_CRYPTO_ALGAPI
------------------>8--------------------


From daniel at makrotopia.org  Mon Aug 17 06:14:11 2015
From: daniel at makrotopia.org (Daniel Golle)
Date: Mon, 17 Aug 2015 12:14:11 +0200
Subject: [OpenWrt-Devel] [PATCH] oxnas: remove support for kernel 3.18 and
	4.0
Message-ID: <20150817101401.GA4180@makrotopia.org>

Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 target/linux/oxnas/config-3.18                     | 357 --------------------
 target/linux/oxnas/config-4.0                      | 374 ---------------------
 .../010-arm_introduce-dma-fiq-irq-broadcast.patch  |  56 ---
 .../250-add-plxtech-vendor-prefix.patch            |  10 -
 .../300-introduce-oxnas-platform.patch             |  69 ----
 .../oxnas/patches-3.18/310-oxnas-clocksource.patch |  25 --
 .../oxnas/patches-3.18/320-oxnas-irqchip.patch     |  34 --
 .../oxnas/patches-3.18/330-oxnas-pinctrl.patch     |  28 --
 .../linux/oxnas/patches-3.18/340-oxnas-pcie.patch  |  22 --
 .../linux/oxnas/patches-3.18/350-oxnas-reset.patch |  20 --
 .../linux/oxnas/patches-3.18/400-oxnas-nand.patch  |  24 --
 .../linux/oxnas/patches-3.18/500-oxnas-sata.patch  |  26 --
 .../linux/oxnas/patches-3.18/800-oxnas-ehci.patch  |  26 --
 .../linux/oxnas/patches-3.18/900-more-boards.patch |  14 -
 .../oxnas/patches-3.18/999-libata-hacks.patch      |  57 ----
 .../010-arm_introduce-dma-fiq-irq-broadcast.patch  |  56 ---
 .../250-add-plxtech-vendor-prefix.patch            |  10 -
 .../patches-4.0/300-introduce-oxnas-platform.patch |  69 ----
 .../oxnas/patches-4.0/310-oxnas-clocksource.patch  |  25 --
 .../oxnas/patches-4.0/320-oxnas-irqchip.patch      |  34 --
 .../oxnas/patches-4.0/330-oxnas-pinctrl.patch      |  28 --
 .../linux/oxnas/patches-4.0/340-oxnas-pcie.patch   |  22 --
 .../linux/oxnas/patches-4.0/350-oxnas-reset.patch  |  20 --
 .../linux/oxnas/patches-4.0/400-oxnas-nand.patch   |  25 --
 .../linux/oxnas/patches-4.0/500-oxnas-sata.patch   |  26 --
 .../linux/oxnas/patches-4.0/800-oxnas-ehci.patch   |  26 --
 .../linux/oxnas/patches-4.0/900-more-boards.patch  |  14 -
 .../linux/oxnas/patches-4.0/999-libata-hacks.patch |  57 ----
 28 files changed, 1554 deletions(-)
 delete mode 100644 target/linux/oxnas/config-3.18
 delete mode 100644 target/linux/oxnas/config-4.0
 delete mode 100644 target/linux/oxnas/patches-3.18/010-arm_introduce-dma-fiq-irq-broadcast.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/250-add-plxtech-vendor-prefix.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/300-introduce-oxnas-platform.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/310-oxnas-clocksource.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/320-oxnas-irqchip.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/330-oxnas-pinctrl.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/340-oxnas-pcie.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/350-oxnas-reset.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/400-oxnas-nand.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/500-oxnas-sata.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/800-oxnas-ehci.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/900-more-boards.patch
 delete mode 100644 target/linux/oxnas/patches-3.18/999-libata-hacks.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/010-arm_introduce-dma-fiq-irq-broadcast.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/250-add-plxtech-vendor-prefix.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/300-introduce-oxnas-platform.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/310-oxnas-clocksource.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/320-oxnas-irqchip.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/330-oxnas-pinctrl.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/340-oxnas-pcie.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/350-oxnas-reset.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/400-oxnas-nand.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/500-oxnas-sata.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/800-oxnas-ehci.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/900-more-boards.patch
 delete mode 100644 target/linux/oxnas/patches-4.0/999-libata-hacks.patch

diff --git a/target/linux/oxnas/config-3.18 b/target/linux/oxnas/config-3.18
deleted file mode 100644
index 379b2b0..0000000
--- a/target/linux/oxnas/config-3.18
+++ /dev/null
@@ -1,357 +0,0 @@
-CONFIG_ALIGNMENT_TRAP=y
-# CONFIG_APM_EMULATION is not set
-CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
-CONFIG_ARCH_HAS_RESET_CONTROLLER=y
-# CONFIG_ARCH_HAS_SG_CHAIN is not set
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_NR_GPIO=0
-CONFIG_ARCH_OXNAS=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_ARCH_WANT_LIBATA_LEDS=y
-CONFIG_ARM=y
-# CONFIG_ARM_CPU_SUSPEND is not set
-CONFIG_ARM_GIC=y
-CONFIG_ARM_L1_CACHE_SHIFT=5
-CONFIG_ARM_PATCH_PHYS_VIRT=y
-CONFIG_ARM_THUMB=y
-CONFIG_ARM_UNWIND=y
-CONFIG_ATA_LEDS=y
-CONFIG_AUTO_ZRELADDR=y
-# CONFIG_BLK_DEV_INITRD is not set
-CONFIG_BLK_DEV_SD=y
-CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
-CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=1
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=1
-# CONFIG_CACHE_L2X0 is not set
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLKSRC_MMIO=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_RPS_TIMER=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CMDLINE="console=ttyS0,115200n8 earlyprintk=serial"
-CONFIG_COMMON_CLK=y
-CONFIG_COMPACTION=y
-CONFIG_CONSOLE_POLL=y
-CONFIG_COREDUMP=y
-CONFIG_CPU_32v6=y
-CONFIG_CPU_32v6K=y
-CONFIG_CPU_ABRT_EV6=y
-# CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_CPU_CACHE_V6=y
-CONFIG_CPU_CACHE_VIPT=y
-CONFIG_CPU_COPY_V6=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-CONFIG_CPU_HAS_ASID=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-CONFIG_CPU_IDLE=y
-CONFIG_CPU_IDLE_GOV_LADDER=y
-CONFIG_CPU_IDLE_GOV_MENU=y
-CONFIG_CPU_PABRT_V6=y
-CONFIG_CPU_PM=y
-CONFIG_CPU_RMAP=y
-CONFIG_CPU_TLB_V6=y
-CONFIG_CPU_V6K=y
-CONFIG_CRC16=y
-# CONFIG_CRC32_SARWATE is not set
-CONFIG_CRC32_SLICEBY8=y
-CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_LZO=y
-CONFIG_CRYPTO_XZ=y
-CONFIG_DCACHE_WORD_ACCESS=y
-CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
-CONFIG_DEBUG_LL_UART_NONE=y
-# CONFIG_DEBUG_UART_8250 is not set
-# CONFIG_DEBUG_UART_PL01X is not set
-# CONFIG_DEBUG_USER is not set
-CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=8
-CONFIG_DETECT_HUNG_TASK=y
-CONFIG_DIRECT_IO=y
-CONFIG_DMADEVICES=y
-CONFIG_DMA_CACHE_FIQ_BROADCAST=y
-# CONFIG_DMA_CACHE_RWFO is not set
-CONFIG_DMA_ENGINE=y
-CONFIG_DMA_OF=y
-CONFIG_DNOTIFY=y
-CONFIG_DTC=y
-# CONFIG_DW_DMAC_CORE is not set
-# CONFIG_DW_DMAC_PCI is not set
-CONFIG_EARLY_PRINTK=y
-CONFIG_FIQ=y
-CONFIG_GENERIC_ALLOCATOR=y
-CONFIG_GENERIC_BUG=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_IDLE_POLL_SETUP=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_PINCONF=y
-CONFIG_GENERIC_SCHED_CLOCK=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GENERIC_STRNCPY_FROM_USER=y
-CONFIG_GENERIC_STRNLEN_USER=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_DEVRES=y
-CONFIG_GPIO_GENERIC=y
-CONFIG_GPIO_GENERIC_PLATFORM=y
-# CONFIG_GPIO_SYSCON is not set
-CONFIG_GPIO_SYSFS=y
-CONFIG_HANDLE_DOMAIN_IRQ=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-CONFIG_HAVE_ARCH_AUDITSYSCALL=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_PFN_VALID=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ARM_SCU=y
-CONFIG_HAVE_ARM_TWD=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PERF_REGS=y
-CONFIG_HAVE_PERF_USER_STACK_DUMP=y
-CONFIG_HAVE_PROC_CPU=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_SMP=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_UID16=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
-CONFIG_HOTPLUG_CPU=y
-CONFIG_HZ_FIXED=0
-CONFIG_I2C=y
-CONFIG_I2C_ALGOBIT=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_ICPLUS_PHY=y
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-CONFIG_INET_UDP_DIAG=y
-CONFIG_INPUT=y
-# CONFIG_INPUT_MISC is not set
-# CONFIG_INTEL_SOC_PMIC is not set
-CONFIG_IOMMU_HELPER=y
-CONFIG_IOMMU_SUPPORT=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-# CONFIG_IP_MULTICAST is not set
-CONFIG_IP_PNP=y
-# CONFIG_IP_PNP_BOOTP is not set
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_IP_PNP_RARP is not set
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_TIME_ACCOUNTING=y
-CONFIG_IRQ_WORK=y
-# CONFIG_ISDN is not set
-# CONFIG_JFFS2_FS is not set
-CONFIG_JUMP_LABEL=y
-CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_KGDB=y
-# CONFIG_KGDB_KDB is not set
-CONFIG_KGDB_SERIAL_CONSOLE=y
-# CONFIG_KGDB_TESTS is not set
-# CONFIG_LDM_DEBUG is not set
-CONFIG_LDM_PARTITION=y
-# CONFIG_LEDS_SYSCON is not set
-# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
-# CONFIG_LEDS_TRIGGER_NETDEV is not set
-# CONFIG_LEDS_TRIGGER_TIMER is not set
-CONFIG_LIBFDT=y
-CONFIG_LOCKUP_DETECTOR=y
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_MACH_OX820=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_MAILBOX=y
-CONFIG_MDIO_BOARDINFO=y
-CONFIG_MFD_SYSCON=y
-CONFIG_MIGHT_HAVE_PCI=y
-CONFIG_MIGRATION=y
-CONFIG_MODULES_USE_ELF_REL=y
-# CONFIG_MODULE_STRIPPED is not set
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_ECC=y
-CONFIG_MTD_NAND_OXNAS=y
-CONFIG_MTD_NAND_PLATFORM=y
-CONFIG_MTD_SPLIT_FIRMWARE=y
-CONFIG_MTD_UBI=y
-CONFIG_MTD_UBI_BEB_LIMIT=20
-CONFIG_MTD_UBI_BLOCK=y
-# CONFIG_MTD_UBI_FASTMAP is not set
-# CONFIG_MTD_UBI_GLUEBI is not set
-CONFIG_MTD_UBI_WL_THRESHOLD=4096
-CONFIG_MTD_UIMAGE_SPLIT=y
-CONFIG_MULTI_IRQ_HANDLER=y
-CONFIG_MUTEX_SPIN_ON_OWNER=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NET_FLOW_LIMIT=y
-CONFIG_NET_PTP_CLASSIFY=y
-CONFIG_NLS=y
-CONFIG_NO_BOOTMEM=y
-CONFIG_NO_HZ_COMMON=y
-CONFIG_NO_HZ_IDLE=y
-CONFIG_NR_CPUS=2
-CONFIG_OF=y
-CONFIG_OF_ADDRESS=y
-CONFIG_OF_ADDRESS_PCI=y
-CONFIG_OF_EARLY_FLATTREE=y
-CONFIG_OF_FLATTREE=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_IOMMU=y
-CONFIG_OF_IRQ=y
-CONFIG_OF_MDIO=y
-CONFIG_OF_MTD=y
-CONFIG_OF_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_OF_RESERVED_MEM=y
-CONFIG_OLD_SIGACTION=y
-CONFIG_OLD_SIGSUSPEND3=y
-CONFIG_PACKET_DIAG=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_PAGE_OFFSET=0xC0000000
-CONFIG_PCI=y
-CONFIG_PCIEAER=y
-CONFIG_PCIEASPM=y
-# CONFIG_PCIEASPM_DEBUG is not set
-CONFIG_PCIEASPM_DEFAULT=y
-# CONFIG_PCIEASPM_PERFORMANCE is not set
-# CONFIG_PCIEASPM_POWERSAVE is not set
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_PME=y
-CONFIG_PCI_OXNAS=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PHYLIB=y
-CONFIG_PINCTRL=y
-CONFIG_PINCTRL_OXNAS=y
-CONFIG_PLXTECH_RPS=y
-CONFIG_PM=y
-CONFIG_PM_CLK=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_RUNTIME=y
-CONFIG_POWER_RESET=y
-# CONFIG_POWER_RESET_BRCMSTB is not set
-CONFIG_POWER_RESET_GPIO=y
-# CONFIG_POWER_RESET_GPIO_RESTART is not set
-# CONFIG_POWER_RESET_LTC2952 is not set
-# CONFIG_POWER_RESET_SYSCON is not set
-# CONFIG_POWER_RESET_VERSATILE is not set
-CONFIG_POWER_SUPPLY=y
-CONFIG_PPS=y
-# CONFIG_PREEMPT_RCU is not set
-CONFIG_PRINTK_TIME=y
-CONFIG_PTP_1588_CLOCK=y
-CONFIG_PWM=y
-# CONFIG_PWM_FSL_FTM is not set
-CONFIG_PWM_SYSFS=y
-CONFIG_RAS=y
-CONFIG_RCU_CPU_STALL_TIMEOUT=21
-CONFIG_RCU_STALL_COMMON=y
-CONFIG_REALTEK_PHY=y
-CONFIG_REGMAP=y
-CONFIG_REGMAP_MMIO=y
-CONFIG_RELAY=y
-CONFIG_RESET_CONTROLLER=y
-CONFIG_RESET_CONTROLLER_OXNAS=y
-CONFIG_RFS_ACCEL=y
-CONFIG_RPS=y
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_DRV_CMOS is not set
-CONFIG_RWSEM_SPIN_ON_OWNER=y
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-CONFIG_SCHED_HRTICK=y
-CONFIG_SCSI=y
-CONFIG_SERIAL_8250_NR_UARTS=1
-CONFIG_SERIAL_8250_PCI=y
-CONFIG_SERIAL_8250_RUNTIME_UARTS=1
-# CONFIG_SERIAL_KGDB_NMI is not set
-CONFIG_SERIAL_OF_PLATFORM=y
-CONFIG_SMP=y
-CONFIG_SMP_ON_UP=y
-CONFIG_SOCK_DIAG=y
-CONFIG_STMMAC_DA=y
-CONFIG_STMMAC_DEBUG_FS=y
-CONFIG_STMMAC_ETH=y
-# CONFIG_STMMAC_PCI is not set
-CONFIG_STMMAC_PLATFORM=y
-CONFIG_STOP_MACHINE=y
-# CONFIG_STRIP_ASM_SYMS is not set
-CONFIG_SWIOTLB=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_TREE_RCU=y
-CONFIG_UBIFS_FS=y
-# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
-CONFIG_UBIFS_FS_LZO=y
-CONFIG_UBIFS_FS_XZ=y
-CONFIG_UBIFS_FS_ZLIB=y
-CONFIG_UID16=y
-CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h"
-CONFIG_USB=y
-CONFIG_USB_COMMON=y
-# CONFIG_USB_EHCI_HCD is not set
-CONFIG_USB_SUPPORT=y
-# CONFIG_USB_UHCI_HCD is not set
-CONFIG_USE_OF=y
-CONFIG_VECTORS_BASE=0xffff0000
-# CONFIG_VFP is not set
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_WATCHDOG_CORE=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-CONFIG_XPS=y
-CONFIG_XZ_DEC_ARM=y
-CONFIG_XZ_DEC_BCJ=y
-CONFIG_ZBOOT_ROM_BSS=0
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/oxnas/config-4.0 b/target/linux/oxnas/config-4.0
deleted file mode 100644
index b0bb7ea..0000000
--- a/target/linux/oxnas/config-4.0
+++ /dev/null
@@ -1,374 +0,0 @@
-CONFIG_ALIGNMENT_TRAP=y
-# CONFIG_ALTERA_MBOX is not set
-# CONFIG_APM_EMULATION is not set
-CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
-CONFIG_ARCH_HAS_RESET_CONTROLLER=y
-CONFIG_ARCH_HAS_SG_CHAIN=y
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_NR_GPIO=0
-CONFIG_ARCH_OXNAS=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_ARCH_WANT_LIBATA_LEDS=y
-CONFIG_ARM=y
-# CONFIG_ARM_CPU_SUSPEND is not set
-CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
-CONFIG_ARM_DMA_USE_IOMMU=y
-CONFIG_ARM_GIC=y
-CONFIG_ARM_HAS_SG_CHAIN=y
-CONFIG_ARM_L1_CACHE_SHIFT=5
-CONFIG_ARM_PATCH_PHYS_VIRT=y
-CONFIG_ARM_SMMU=y
-CONFIG_ARM_THUMB=y
-CONFIG_ARM_UNWIND=y
-CONFIG_ATA_LEDS=y
-CONFIG_AUTO_ZRELADDR=y
-# CONFIG_BATTERY_GAUGE_LTC2941 is not set
-# CONFIG_BLK_DEV_INITRD is not set
-CONFIG_BLK_DEV_SD=y
-CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
-CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=1
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=1
-# CONFIG_CACHE_L2X0 is not set
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLKSRC_MMIO=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_RPS_TIMER=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CMDLINE="console=ttyS0,115200n8 earlyprintk=serial"
-CONFIG_COMMON_CLK=y
-CONFIG_COMPACTION=y
-CONFIG_CONSOLE_POLL=y
-CONFIG_COREDUMP=y
-CONFIG_CPU_32v6=y
-CONFIG_CPU_32v6K=y
-CONFIG_CPU_ABRT_EV6=y
-# CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_CPU_CACHE_V6=y
-CONFIG_CPU_CACHE_VIPT=y
-CONFIG_CPU_COPY_V6=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-CONFIG_CPU_HAS_ASID=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-CONFIG_CPU_IDLE=y
-CONFIG_CPU_IDLE_GOV_LADDER=y
-CONFIG_CPU_IDLE_GOV_MENU=y
-CONFIG_CPU_PABRT_V6=y
-CONFIG_CPU_PM=y
-CONFIG_CPU_RMAP=y
-CONFIG_CPU_TLB_V6=y
-CONFIG_CPU_V6K=y
-CONFIG_CRC16=y
-# CONFIG_CRC32_SARWATE is not set
-CONFIG_CRC32_SLICEBY8=y
-CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_LZO=y
-CONFIG_CRYPTO_XZ=y
-CONFIG_DCACHE_WORD_ACCESS=y
-CONFIG_DEBUG_ICEDCC=y
-CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="debug/icedcc.S"
-# CONFIG_DEBUG_UART_8250 is not set
-# CONFIG_DEBUG_USER is not set
-CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=8
-CONFIG_DETECT_HUNG_TASK=y
-CONFIG_DIRECT_IO=y
-CONFIG_DMADEVICES=y
-CONFIG_DMA_CACHE_FIQ_BROADCAST=y
-# CONFIG_DMA_CACHE_RWFO is not set
-CONFIG_DMA_ENGINE=y
-CONFIG_DMA_OF=y
-CONFIG_DNOTIFY=y
-CONFIG_DTC=y
-# CONFIG_DW_DMAC_CORE is not set
-# CONFIG_DW_DMAC_PCI is not set
-CONFIG_EARLY_PRINTK=y
-CONFIG_FIQ=y
-CONFIG_GENERIC_ALLOCATOR=y
-CONFIG_GENERIC_BUG=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_IDLE_POLL_SETUP=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_PINCONF=y
-CONFIG_GENERIC_SCHED_CLOCK=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GENERIC_STRNCPY_FROM_USER=y
-CONFIG_GENERIC_STRNLEN_USER=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_DEVRES=y
-CONFIG_GPIO_GENERIC=y
-CONFIG_GPIO_GENERIC_PLATFORM=y
-# CONFIG_GPIO_SYSCON is not set
-CONFIG_GPIO_SYSFS=y
-CONFIG_HANDLE_DOMAIN_IRQ=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-CONFIG_HAVE_ARCH_AUDITSYSCALL=y
-# CONFIG_HAVE_ARCH_BITREVERSE is not set
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_PFN_VALID=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ARM_SCU=y
-CONFIG_HAVE_ARM_TWD=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_OPTPROBES=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PERF_REGS=y
-CONFIG_HAVE_PERF_USER_STACK_DUMP=y
-CONFIG_HAVE_PROC_CPU=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_SMP=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_UID16=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
-CONFIG_HOTPLUG_CPU=y
-CONFIG_HZ_FIXED=0
-CONFIG_I2C=y
-CONFIG_I2C_ALGOBIT=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_ICPLUS_PHY=y
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-CONFIG_INET_UDP_DIAG=y
-CONFIG_INPUT=y
-# CONFIG_INPUT_MISC is not set
-CONFIG_IOMMU_API=y
-CONFIG_IOMMU_HELPER=y
-CONFIG_IOMMU_IO_PGTABLE=y
-CONFIG_IOMMU_IO_PGTABLE_LPAE=y
-# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
-CONFIG_IOMMU_SUPPORT=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-# CONFIG_IP_MULTICAST is not set
-CONFIG_IP_PNP=y
-# CONFIG_IP_PNP_BOOTP is not set
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_IP_PNP_RARP is not set
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_DOMAIN_HIERARCHY=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_TIME_ACCOUNTING=y
-CONFIG_IRQ_WORK=y
-# CONFIG_ISDN is not set
-# CONFIG_JFFS2_FS is not set
-CONFIG_JUMP_LABEL=y
-CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_KGDB=y
-# CONFIG_KGDB_KDB is not set
-CONFIG_KGDB_SERIAL_CONSOLE=y
-# CONFIG_KGDB_TESTS is not set
-# CONFIG_LDM_DEBUG is not set
-CONFIG_LDM_PARTITION=y
-# CONFIG_LEDS_SYSCON is not set
-# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
-# CONFIG_LEDS_TRIGGER_NETDEV is not set
-# CONFIG_LEDS_TRIGGER_TIMER is not set
-CONFIG_LIBFDT=y
-CONFIG_LOCKUP_DETECTOR=y
-CONFIG_LOCK_SPIN_ON_OWNER=y
-CONFIG_LZ4_COMPRESS=y
-CONFIG_LZ4_DECOMPRESS=y
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_MACH_OX820=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_MAILBOX=y
-CONFIG_MDIO_BOARDINFO=y
-# CONFIG_MFD_DA9150 is not set
-# CONFIG_MFD_RT5033 is not set
-CONFIG_MFD_SYSCON=y
-CONFIG_MIGHT_HAVE_PCI=y
-CONFIG_MIGRATION=y
-CONFIG_MODULES_USE_ELF_REL=y
-# CONFIG_MODULE_STRIPPED is not set
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_ECC=y
-CONFIG_MTD_NAND_OXNAS=y
-CONFIG_MTD_NAND_PLATFORM=y
-CONFIG_MTD_SPLIT_FIRMWARE=y
-CONFIG_MTD_UBI=y
-CONFIG_MTD_UBI_BEB_LIMIT=20
-CONFIG_MTD_UBI_BLOCK=y
-# CONFIG_MTD_UBI_FASTMAP is not set
-# CONFIG_MTD_UBI_GLUEBI is not set
-CONFIG_MTD_UBI_WL_THRESHOLD=4096
-CONFIG_MTD_UIMAGE_SPLIT=y
-CONFIG_MULTI_IRQ_HANDLER=y
-CONFIG_MUTEX_SPIN_ON_OWNER=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEED_SG_DMA_LENGTH=y
-CONFIG_NET_FLOW_LIMIT=y
-CONFIG_NET_PTP_CLASSIFY=y
-CONFIG_NLS=y
-CONFIG_NO_BOOTMEM=y
-CONFIG_NO_HZ_COMMON=y
-CONFIG_NO_HZ_IDLE=y
-CONFIG_NR_CPUS=2
-CONFIG_OF=y
-CONFIG_OF_ADDRESS=y
-CONFIG_OF_ADDRESS_PCI=y
-CONFIG_OF_EARLY_FLATTREE=y
-CONFIG_OF_FLATTREE=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_IOMMU=y
-CONFIG_OF_IRQ=y
-CONFIG_OF_MDIO=y
-CONFIG_OF_MTD=y
-CONFIG_OF_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_OF_RESERVED_MEM=y
-CONFIG_OLD_SIGACTION=y
-CONFIG_OLD_SIGSUSPEND3=y
-CONFIG_PACKET_DIAG=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_PAGE_OFFSET=0xC0000000
-CONFIG_PCI=y
-CONFIG_PCIEAER=y
-CONFIG_PCIEASPM=y
-# CONFIG_PCIEASPM_DEBUG is not set
-CONFIG_PCIEASPM_DEFAULT=y
-# CONFIG_PCIEASPM_PERFORMANCE is not set
-# CONFIG_PCIEASPM_POWERSAVE is not set
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_PME=y
-# CONFIG_PCI_DOMAINS_GENERIC is not set
-CONFIG_PCI_OXNAS=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PHYLIB=y
-CONFIG_PINCTRL=y
-CONFIG_PINCTRL_OXNAS=y
-CONFIG_PLXTECH_RPS=y
-CONFIG_PM=y
-CONFIG_PM_CLK=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_POWER_RESET=y
-# CONFIG_POWER_RESET_BRCMSTB is not set
-CONFIG_POWER_RESET_GPIO=y
-# CONFIG_POWER_RESET_GPIO_RESTART is not set
-# CONFIG_POWER_RESET_LTC2952 is not set
-# CONFIG_POWER_RESET_SYSCON is not set
-# CONFIG_POWER_RESET_VERSATILE is not set
-CONFIG_POWER_SUPPLY=y
-CONFIG_PPS=y
-CONFIG_PRINTK_TIME=y
-CONFIG_PTP_1588_CLOCK=y
-CONFIG_PWM=y
-# CONFIG_PWM_FSL_FTM is not set
-CONFIG_PWM_SYSFS=y
-CONFIG_RAS=y
-CONFIG_RCU_CPU_STALL_TIMEOUT=21
-CONFIG_RCU_STALL_COMMON=y
-CONFIG_REALTEK_PHY=y
-CONFIG_REGMAP=y
-CONFIG_REGMAP_MMIO=y
-CONFIG_RELAY=y
-CONFIG_RESET_CONTROLLER=y
-CONFIG_RESET_CONTROLLER_OXNAS=y
-CONFIG_RFS_ACCEL=y
-CONFIG_RPS=y
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_DRV_CMOS is not set
-CONFIG_RWSEM_SPIN_ON_OWNER=y
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-CONFIG_SCHED_HRTICK=y
-CONFIG_SCSI=y
-CONFIG_SERIAL_8250_NR_UARTS=1
-CONFIG_SERIAL_8250_PCI=y
-CONFIG_SERIAL_8250_RUNTIME_UARTS=1
-# CONFIG_SERIAL_KGDB_NMI is not set
-CONFIG_SERIAL_OF_PLATFORM=y
-CONFIG_SMP=y
-CONFIG_SMP_ON_UP=y
-CONFIG_SOCK_DIAG=y
-CONFIG_SRCU=y
-CONFIG_STMMAC_ETH=y
-# CONFIG_STMMAC_PCI is not set
-CONFIG_STMMAC_PLATFORM=y
-CONFIG_STOP_MACHINE=y
-# CONFIG_STRIP_ASM_SYMS is not set
-CONFIG_SWIOTLB=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_TREE_RCU=y
-CONFIG_UBIFS_FS=y
-# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
-CONFIG_UBIFS_FS_LZO=y
-CONFIG_UBIFS_FS_XZ=y
-CONFIG_UBIFS_FS_ZLIB=y
-CONFIG_UID16=y
-CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h"
-CONFIG_USB=y
-CONFIG_USB_COMMON=y
-# CONFIG_USB_EHCI_HCD is not set
-CONFIG_USB_SUPPORT=y
-# CONFIG_USB_UHCI_HCD is not set
-CONFIG_USE_OF=y
-CONFIG_VECTORS_BASE=0xffff0000
-# CONFIG_VFIO is not set
-# CONFIG_VFP is not set
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_WATCHDOG_CORE=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-CONFIG_XPS=y
-CONFIG_XZ_DEC_ARM=y
-CONFIG_XZ_DEC_BCJ=y
-CONFIG_ZBOOT_ROM_BSS=0
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/oxnas/patches-3.18/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/oxnas/patches-3.18/010-arm_introduce-dma-fiq-irq-broadcast.patch
deleted file mode 100644
index 1ce68e8..0000000
--- a/target/linux/oxnas/patches-3.18/010-arm_introduce-dma-fiq-irq-broadcast.patch
+++ /dev/null
@@ -1,56 +0,0 @@
---- a/arch/arm/include/asm/glue-cache.h
-+++ b/arch/arm/include/asm/glue-cache.h
-@@ -156,11 +156,19 @@ static inline void nop_dma_unmap_area(co
- #define __cpuc_flush_user_range		__glue(_CACHE,_flush_user_cache_range)
- #define __cpuc_coherent_kern_range	__glue(_CACHE,_coherent_kern_range)
- #define __cpuc_coherent_user_range	__glue(_CACHE,_coherent_user_range)
-+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
- #define __cpuc_flush_dcache_area	__glue(_CACHE,_flush_kern_dcache_area)
- 
- #define dmac_map_area			__glue(_CACHE,_dma_map_area)
- #define dmac_unmap_area			__glue(_CACHE,_dma_unmap_area)
- #define dmac_flush_range		__glue(_CACHE,_dma_flush_range)
-+#else
-+#define __cpuc_flush_dcache_area	__glue(fiq,_flush_kern_dcache_area)
-+
-+#define dmac_map_area			__glue(fiq,_dma_map_area)
-+#define dmac_unmap_area			__glue(fiq,_dma_unmap_area)
-+#define dmac_flush_range		__glue(fiq,_dma_flush_range)
-+#endif /* CONFIG_DMA_CACHE_FIQ_BROADCAST */
- #endif
- 
- #endif
---- a/arch/arm/mm/Kconfig
-+++ b/arch/arm/mm/Kconfig
-@@ -844,6 +844,17 @@ config DMA_CACHE_RWFO
- 	  in hardware, other workarounds are needed (e.g. cache
- 	  maintenance broadcasting in software via FIQ).
- 
-+config DMA_CACHE_FIQ_BROADCAST
-+	bool "Enable fiq broadcast DMA cache maintenance"
-+	depends on CPU_V6K && SMP
-+	select FIQ
-+	help
-+	  The Snoop Control Unit on ARM11MPCore does not detect the
-+	  cache maintenance operations and the dma_{map,unmap}_area()
-+	  functions may leave stale cache entries on other CPUs. By
-+	  enabling this option, fiq broadcast in the ARMv6
-+	  DMA cache maintenance functions is performed.
-+
- config OUTER_CACHE
- 	bool
- 
---- a/arch/arm/mm/flush.c
-+++ b/arch/arm/mm/flush.c
-@@ -314,7 +314,11 @@ void flush_dcache_page(struct page *page
- 
- 	mapping = page_mapping(page);
- 
-+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
- 	if (!cache_ops_need_broadcast() &&
-+#else
-+	if (
-+#endif
- 	    mapping && !page_mapped(page))
- 		clear_bit(PG_dcache_clean, &page->flags);
- 	else {
diff --git a/target/linux/oxnas/patches-3.18/250-add-plxtech-vendor-prefix.patch b/target/linux/oxnas/patches-3.18/250-add-plxtech-vendor-prefix.patch
deleted file mode 100644
index 1645c88..0000000
--- a/target/linux/oxnas/patches-3.18/250-add-plxtech-vendor-prefix.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/Documentation/devicetree/bindings/vendor-prefixes.txt
-+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
-@@ -115,6 +115,7 @@ panasonic	Panasonic Corporation
- phytec	PHYTEC Messtechnik GmbH
- picochip	Picochip Ltd
- plathome	Plat'Home Co., Ltd.
-+plxtech	PLX Technology, Inc.
- pixcir  PIXCIR MICROELECTRONICS Co., Ltd
- powervr	PowerVR (deprecated, use img)
- qca	Qualcomm Atheros, Inc.
diff --git a/target/linux/oxnas/patches-3.18/300-introduce-oxnas-platform.patch b/target/linux/oxnas/patches-3.18/300-introduce-oxnas-platform.patch
deleted file mode 100644
index 5724263..0000000
--- a/target/linux/oxnas/patches-3.18/300-introduce-oxnas-platform.patch
+++ /dev/null
@@ -1,69 +0,0 @@
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -369,6 +369,17 @@ config ARCH_VERSATILE
- 	help
- 	  This enables support for ARM Ltd Versatile board.
- 
-+config ARCH_OXNAS
-+	bool "Oxford Semiconductor 815/820/825 NAS SoC"
-+	select ARCH_REQUIRE_GPIOLIB
-+	select CLKDEV_LOOKUP
-+	select GENERIC_CLOCKEVENTS
-+	select COMMON_CLK
-+	select MIGHT_HAVE_PCI
-+	select ARCH_HAS_RESET_CONTROLLER
-+	help
-+		This enables support for Oxsemi 815/820/825 NAS SoC
-+
- config ARCH_AT91
- 	bool "Atmel AT91"
- 	select ARCH_REQUIRE_GPIOLIB
-@@ -922,6 +933,8 @@ source "arch/arm/mach-omap2/Kconfig"
- 
- source "arch/arm/mach-orion5x/Kconfig"
- 
-+source "arch/arm/mach-oxnas/Kconfig"
-+
- source "arch/arm/mach-picoxcell/Kconfig"
- 
- source "arch/arm/mach-pxa/Kconfig"
---- a/arch/arm/Makefile
-+++ b/arch/arm/Makefile
-@@ -187,6 +187,7 @@ machine-$(CONFIG_ARCH_NSPIRE)		+= nspire
- machine-$(CONFIG_ARCH_OMAP1)		+= omap1
- machine-$(CONFIG_ARCH_OMAP2PLUS)	+= omap2
- machine-$(CONFIG_ARCH_ORION5X)		+= orion5x
-+machine-$(CONFIG_ARCH_OXNAS)		+= oxnas
- machine-$(CONFIG_ARCH_PICOXCELL)	+= picoxcell
- machine-$(CONFIG_ARCH_PXA)		+= pxa
- machine-$(CONFIG_ARCH_QCOM)		+= qcom
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -352,6 +352,7 @@ dtb-$(CONFIG_ARCH_ORION5X) += orion5x-la
- 	orion5x-lacie-ethernet-disk-mini-v2.dtb \
- 	orion5x-maxtor-shared-storage-2.dtb \
- 	orion5x-rd88f5182-nas.dtb
-+dtb-$(CONFIG_ARCH_OXNAS) += ox820-pogoplug-pro.dtb
- dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
- dtb-$(CONFIG_ARCH_QCOM) += \
- 	qcom-apq8064-cm-qs600.dtb \
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -228,6 +228,7 @@ edb9302a		MACH_EDB9302A		EDB9302A		1127
- edb9307a		MACH_EDB9307A		EDB9307A		1128
- omap_3430sdp		MACH_OMAP_3430SDP	OMAP_3430SDP		1138
- vstms			MACH_VSTMS		VSTMS			1140
-+ox820			MACH_OX820		OX820			1152
- micro9m			MACH_MICRO9M		MICRO9M			1169
- bug			MACH_BUG		BUG			1179
- at91sam9263ek		MACH_AT91SAM9263EK	AT91SAM9263EK		1202
---- a/drivers/clk/Makefile
-+++ b/drivers/clk/Makefile
-@@ -29,6 +29,7 @@ obj-$(CONFIG_COMMON_CLK_MAX77802)	+= clk
- obj-$(CONFIG_ARCH_MOXART)		+= clk-moxart.o
- obj-$(CONFIG_ARCH_NOMADIK)		+= clk-nomadik.o
- obj-$(CONFIG_ARCH_NSPIRE)		+= clk-nspire.o
-+obj-$(CONFIG_ARCH_OXNAS)		+= clk-oxnas.o
- obj-$(CONFIG_COMMON_CLK_PALMAS)		+= clk-palmas.o
- obj-$(CONFIG_CLK_PPC_CORENET)		+= clk-ppc-corenet.o
- obj-$(CONFIG_COMMON_CLK_RK808)		+= clk-rk808.o
diff --git a/target/linux/oxnas/patches-3.18/310-oxnas-clocksource.patch b/target/linux/oxnas/patches-3.18/310-oxnas-clocksource.patch
deleted file mode 100644
index e10b38c..0000000
--- a/target/linux/oxnas/patches-3.18/310-oxnas-clocksource.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/drivers/clocksource/Kconfig
-+++ b/drivers/clocksource/Kconfig
-@@ -156,6 +156,12 @@ config VF_PIT_TIMER
- 	help
- 	  Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
- 
-+config CLKSRC_RPS_TIMER
-+	def_bool y if ARCH_OXNAS
-+	select CLKSRC_MMIO
-+	help
-+	  This option enables support for the oxnas rps timers.
-+
- config SYS_SUPPORTS_SH_CMT
-         bool
- 
---- a/drivers/clocksource/Makefile
-+++ b/drivers/clocksource/Makefile
-@@ -36,6 +36,7 @@ obj-$(CONFIG_CLKSRC_EFM32)	+= time-efm32
- obj-$(CONFIG_CLKSRC_EXYNOS_MCT)	+= exynos_mct.o
- obj-$(CONFIG_CLKSRC_SAMSUNG_PWM)	+= samsung_pwm_timer.o
- obj-$(CONFIG_FSL_FTM_TIMER)	+= fsl_ftm_timer.o
-+obj-$(CONFIG_CLKSRC_RPS_TIMER)	+= oxnas_rps_timer.o
- obj-$(CONFIG_VF_PIT_TIMER)	+= vf_pit_timer.o
- obj-$(CONFIG_CLKSRC_QCOM)	+= qcom-timer.o
- obj-$(CONFIG_MTK_TIMER)		+= mtk_timer.o
diff --git a/target/linux/oxnas/patches-3.18/320-oxnas-irqchip.patch b/target/linux/oxnas/patches-3.18/320-oxnas-irqchip.patch
deleted file mode 100644
index 5e130be..0000000
--- a/target/linux/oxnas/patches-3.18/320-oxnas-irqchip.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- a/drivers/irqchip/Kconfig
-+++ b/drivers/irqchip/Kconfig
-@@ -15,6 +15,11 @@ config ARM_GIC_V3
- 	select IRQ_DOMAIN
- 	select MULTI_IRQ_HANDLER
- 
-+config PLXTECH_RPS
-+	def_bool y if ARHC_OXNAS
-+	depends on ARCH_OXNAS
-+	select IRQ_DOMAIN
-+
- config ARM_NVIC
- 	bool
- 	select IRQ_DOMAIN
---- a/drivers/irqchip/Makefile
-+++ b/drivers/irqchip/Makefile
-@@ -28,6 +28,7 @@ obj-$(CONFIG_IMGPDC_IRQ)		+= irq-imgpdc.
- obj-$(CONFIG_SIRF_IRQ)			+= irq-sirfsoc.o
- obj-$(CONFIG_RENESAS_INTC_IRQPIN)	+= irq-renesas-intc-irqpin.o
- obj-$(CONFIG_RENESAS_IRQC)		+= irq-renesas-irqc.o
-+obj-$(CONFIG_PLXTECH_RPS)		+= irq-rps.o
- obj-$(CONFIG_VERSATILE_FPGA_IRQ)	+= irq-versatile-fpga.o
- obj-$(CONFIG_ARCH_NSPIRE)		+= irq-zevio.o
- obj-$(CONFIG_ARCH_VT8500)		+= irq-vt8500.o
---- a/drivers/irqchip/irq-gic.c
-+++ b/drivers/irqchip/irq-gic.c
-@@ -1044,6 +1044,7 @@ IRQCHIP_DECLARE(gic_400, "arm,gic-400",
- IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init);
- IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init);
- IRQCHIP_DECLARE(cortex_a7_gic, "arm,cortex-a7-gic", gic_of_init);
-+IRQCHIP_DECLARE(arm11_mpcore_gic, "arm,arm11mp-gic", gic_of_init);
- IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init);
- IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
- 
diff --git a/target/linux/oxnas/patches-3.18/330-oxnas-pinctrl.patch b/target/linux/oxnas/patches-3.18/330-oxnas-pinctrl.patch
deleted file mode 100644
index 1bca799..0000000
--- a/target/linux/oxnas/patches-3.18/330-oxnas-pinctrl.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/drivers/pinctrl/Kconfig
-+++ b/drivers/pinctrl/Kconfig
-@@ -67,6 +67,15 @@ config PINCTRL_AT91
- 	help
- 	  Say Y here to enable the at91 pinctrl driver
- 
-+config PINCTRL_OXNAS
-+	bool "OXNAS pinctrl driver"
-+	depends on OF
-+	depends on ARCH_OXNAS
-+	select PINMUX
-+	select PINCONF
-+	help
-+	  Say Y here to enable the oxnas pinctrl driver
-+
- config PINCTRL_BAYTRAIL
- 	bool "Intel Baytrail GPIO pin control"
- 	depends on GPIOLIB && ACPI && X86
---- a/drivers/pinctrl/Makefile
-+++ b/drivers/pinctrl/Makefile
-@@ -18,6 +18,7 @@ obj-$(CONFIG_PINCTRL_BCM2835)	+= pinctrl
- obj-$(CONFIG_PINCTRL_BAYTRAIL)	+= pinctrl-baytrail.o
- obj-$(CONFIG_PINCTRL_BCM281XX)	+= pinctrl-bcm281xx.o
- obj-$(CONFIG_PINCTRL_FALCON)	+= pinctrl-falcon.o
-+obj-$(CONFIG_PINCTRL_OXNAS)	+= pinctrl-oxnas.o
- obj-$(CONFIG_PINCTRL_PALMAS)	+= pinctrl-palmas.o
- obj-$(CONFIG_PINCTRL_ROCKCHIP)	+= pinctrl-rockchip.o
- obj-$(CONFIG_PINCTRL_SINGLE)	+= pinctrl-single.o
diff --git a/target/linux/oxnas/patches-3.18/340-oxnas-pcie.patch b/target/linux/oxnas/patches-3.18/340-oxnas-pcie.patch
deleted file mode 100644
index b54f00e..0000000
--- a/target/linux/oxnas/patches-3.18/340-oxnas-pcie.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/drivers/pci/host/Kconfig
-+++ b/drivers/pci/host/Kconfig
-@@ -91,4 +91,9 @@ config PCI_XGENE
- 	  There are 5 internal PCIe ports available. Each port is GEN3 capable
- 	  and have varied lanes from x1 to x8.
- 
-+config PCI_OXNAS
-+	bool "PLX Oxnas PCIe controller"
-+	depends on ARCH_OXNAS
-+	select PCIEPORTBUS
-+
- endmenu
---- a/drivers/pci/host/Makefile
-+++ b/drivers/pci/host/Makefile
-@@ -3,6 +3,7 @@ obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o
- obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
- obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
- obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
-+obj-$(CONFIG_PCI_OXNAS) += pcie-oxnas.o
- obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
- obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
- obj-$(CONFIG_PCI_RCAR_GEN2_PCIE) += pcie-rcar.o
diff --git a/target/linux/oxnas/patches-3.18/350-oxnas-reset.patch b/target/linux/oxnas/patches-3.18/350-oxnas-reset.patch
deleted file mode 100644
index c294237..0000000
--- a/target/linux/oxnas/patches-3.18/350-oxnas-reset.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/drivers/reset/Kconfig
-+++ b/drivers/reset/Kconfig
-@@ -12,4 +12,9 @@ menuconfig RESET_CONTROLLER
- 
- 	  If unsure, say no.
- 
-+config RESET_CONTROLLER_OXNAS
-+	bool
-+	select RESET_CONTROLLER
-+
- source "drivers/reset/sti/Kconfig"
-+
---- a/drivers/reset/Makefile
-+++ b/drivers/reset/Makefile
-@@ -1,4 +1,5 @@
- obj-$(CONFIG_RESET_CONTROLLER) += core.o
-+obj-$(CONFIG_RESET_CONTROLLER_OXNAS) += reset-ox820.o
- obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
- obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
- obj-$(CONFIG_ARCH_STI) += sti/
diff --git a/target/linux/oxnas/patches-3.18/400-oxnas-nand.patch b/target/linux/oxnas/patches-3.18/400-oxnas-nand.patch
deleted file mode 100644
index 779e74b..0000000
--- a/target/linux/oxnas/patches-3.18/400-oxnas-nand.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/drivers/mtd/nand/Kconfig
-+++ b/drivers/mtd/nand/Kconfig
-@@ -516,4 +516,12 @@ config MTD_NAND_XWAY
- 	  Enables support for NAND Flash chips on Lantiq XWAY SoCs. NAND is attached
- 	  to the External Bus Unit (EBU).
- 
-+config MTD_NAND_OXNAS
-+	tristate "Support for NAND on Plxtech NAS782X SoC"
-+	depends on ARCH_OXNAS
-+	select MTD_NAND_PLATFORM
-+	help
-+	  Enables support for NAND Flash chips on Plxtech NAS782X SoCs. NAND is attached
-+	  to the STATIC Unit.
-+
- endif # MTD_NAND
---- a/drivers/mtd/nand/Makefile
-+++ b/drivers/mtd/nand/Makefile
-@@ -50,5 +50,6 @@ obj-$(CONFIG_MTD_NAND_JZ4740)		+= jz4740
- obj-$(CONFIG_MTD_NAND_GPMI_NAND)	+= gpmi-nand/
- obj-$(CONFIG_MTD_NAND_XWAY)		+= xway_nand.o
- obj-$(CONFIG_MTD_NAND_BCM47XXNFLASH)	+= bcm47xxnflash/
-+obj-$(CONFIG_MTD_NAND_OXNAS)		+= oxnas_nand.o
- 
- nand-objs := nand_base.o nand_bbt.o nand_timings.o
diff --git a/target/linux/oxnas/patches-3.18/500-oxnas-sata.patch b/target/linux/oxnas/patches-3.18/500-oxnas-sata.patch
deleted file mode 100644
index af5e66f..0000000
--- a/target/linux/oxnas/patches-3.18/500-oxnas-sata.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/drivers/ata/Kconfig
-+++ b/drivers/ata/Kconfig
-@@ -401,6 +401,13 @@ config SATA_VITESSE
- 
- 	  If unsure, say N.
- 
-+config SATA_OXNAS
-+	tristate "PLXTECH NAS782X SATA support"
-+	help
-+	  This option enables support for Nas782x Serial ATA controller.
-+
-+	  If unsure, say N.
-+
- comment "PATA SFF controllers with BMDMA"
- 
- config PATA_ALI
---- a/drivers/ata/Makefile
-+++ b/drivers/ata/Makefile
-@@ -37,6 +37,7 @@ obj-$(CONFIG_SATA_SVW)		+= sata_svw.o
- obj-$(CONFIG_SATA_ULI)		+= sata_uli.o
- obj-$(CONFIG_SATA_VIA)		+= sata_via.o
- obj-$(CONFIG_SATA_VITESSE)	+= sata_vsc.o
-+obj-$(CONFIG_SATA_OXNAS)	+= sata_oxnas.o
- 
- # SFF PATA w/ BMDMA
- obj-$(CONFIG_PATA_ALI)		+= pata_ali.o
diff --git a/target/linux/oxnas/patches-3.18/800-oxnas-ehci.patch b/target/linux/oxnas/patches-3.18/800-oxnas-ehci.patch
deleted file mode 100644
index e22a2e0..0000000
--- a/target/linux/oxnas/patches-3.18/800-oxnas-ehci.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/drivers/usb/host/Kconfig
-+++ b/drivers/usb/host/Kconfig
-@@ -309,6 +309,13 @@ config USB_OCTEON_EHCI
- 	  USB 2.0 device support.  All CN6XXX based chips with USB are
- 	  supported.
- 
-+config USB_EHCI_OXNAS
-+	tristate "OXNAS EHCI Module"
-+	depends on USB_EHCI_HCD && ARCH_OXNAS
-+	select USB_EHCI_ROOT_HUB_TT
-+	---help---
-+	  Enable support for the OX820 SOC's on-chip EHCI controller.
-+
- endif # USB_EHCI_HCD
- 
- config USB_OXU210HP_HCD
---- a/drivers/usb/host/Makefile
-+++ b/drivers/usb/host/Makefile
-@@ -44,6 +44,7 @@ obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-
- obj-$(CONFIG_USB_EHCI_MSM)	+= ehci-msm.o
- obj-$(CONFIG_USB_EHCI_TEGRA)	+= ehci-tegra.o
- obj-$(CONFIG_USB_W90X900_EHCI)	+= ehci-w90x900.o
-+obj-$(CONFIG_USB_EHCI_OXNAS)	+= ehci-oxnas.o
- 
- obj-$(CONFIG_USB_OXU210HP_HCD)	+= oxu210hp-hcd.o
- obj-$(CONFIG_USB_ISP116X_HCD)	+= isp116x-hcd.o
diff --git a/target/linux/oxnas/patches-3.18/900-more-boards.patch b/target/linux/oxnas/patches-3.18/900-more-boards.patch
deleted file mode 100644
index fab6936..0000000
--- a/target/linux/oxnas/patches-3.18/900-more-boards.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -352,7 +352,10 @@ dtb-$(CONFIG_ARCH_ORION5X) += orion5x-la
- 	orion5x-lacie-ethernet-disk-mini-v2.dtb \
- 	orion5x-maxtor-shared-storage-2.dtb \
- 	orion5x-rd88f5182-nas.dtb
--dtb-$(CONFIG_ARCH_OXNAS) += ox820-pogoplug-pro.dtb
-+dtb-$(CONFIG_ARCH_OXNAS) += ox820-pogoplug-pro.dtb \
-+	ox820-pogoplug-v3.dtb \
-+	ox820-stg212.dtb \
-+	ox820-kd20.dtb
- dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
- dtb-$(CONFIG_ARCH_QCOM) += \
- 	qcom-apq8064-cm-qs600.dtb \
diff --git a/target/linux/oxnas/patches-3.18/999-libata-hacks.patch b/target/linux/oxnas/patches-3.18/999-libata-hacks.patch
deleted file mode 100644
index b3ff7fa..0000000
--- a/target/linux/oxnas/patches-3.18/999-libata-hacks.patch
+++ /dev/null
@@ -1,57 +0,0 @@
---- a/drivers/ata/libata-core.c
-+++ b/drivers/ata/libata-core.c
-@@ -1581,6 +1581,14 @@ unsigned ata_exec_internal_sg(struct ata
- 		return AC_ERR_SYSTEM;
- 	}
- 
-+	if (ap->ops->acquire_hw && !ap->ops->acquire_hw(ap, 0, 0)) {
-+		spin_unlock_irqrestore(ap->lock, flags);
-+		if (!ap->ops->acquire_hw(ap, 1, (2*HZ))) {
-+			return AC_ERR_TIMEOUT;
-+		}
-+		spin_lock_irqsave(ap->lock, flags);
-+	}
-+
- 	/* initialize internal qc */
- 
- 	/* XXX: Tag 0 is used for drivers with legacy EH as some
-@@ -4757,6 +4765,9 @@ static struct ata_queued_cmd *ata_qc_new
- 	if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
- 		return NULL;
- 
-+	if (ap->ops->qc_new && ap->ops->qc_new(ap))
-+		return NULL;
-+
- 	for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) {
- 		if (ap->flags & ATA_FLAG_LOWTAG)
- 			tag = i;
-@@ -4829,6 +4840,8 @@ void ata_qc_free(struct ata_queued_cmd *
- 	if (likely(ata_tag_valid(tag))) {
- 		qc->tag = ATA_TAG_POISON;
- 		clear_bit(tag, &ap->qc_allocated);
-+		if (ap->ops->qc_free)
-+			ap->ops->qc_free(qc);
- 	}
- }
- 
---- a/include/linux/libata.h
-+++ b/include/linux/libata.h
-@@ -901,6 +901,8 @@ struct ata_port_operations {
- 	void (*qc_prep)(struct ata_queued_cmd *qc);
- 	unsigned int (*qc_issue)(struct ata_queued_cmd *qc);
- 	bool (*qc_fill_rtf)(struct ata_queued_cmd *qc);
-+	int (*qc_new)(struct ata_port *ap);
-+	void (*qc_free)(struct ata_queued_cmd *qc);
- 
- 	/*
- 	 * Configuration and exception handling
-@@ -991,6 +993,9 @@ struct ata_port_operations {
- 	void (*phy_reset)(struct ata_port *ap);
- 	void (*eng_timeout)(struct ata_port *ap);
- 
-+	int (*acquire_hw)(struct ata_port *ap, int may_sleep,
-+			  int timeout_jiffies);
-+
- 	/*
- 	 * ->inherits must be the last field and all the preceding
- 	 * fields must be pointers.
diff --git a/target/linux/oxnas/patches-4.0/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/oxnas/patches-4.0/010-arm_introduce-dma-fiq-irq-broadcast.patch
deleted file mode 100644
index 1ce68e8..0000000
--- a/target/linux/oxnas/patches-4.0/010-arm_introduce-dma-fiq-irq-broadcast.patch
+++ /dev/null
@@ -1,56 +0,0 @@
---- a/arch/arm/include/asm/glue-cache.h
-+++ b/arch/arm/include/asm/glue-cache.h
-@@ -156,11 +156,19 @@ static inline void nop_dma_unmap_area(co
- #define __cpuc_flush_user_range		__glue(_CACHE,_flush_user_cache_range)
- #define __cpuc_coherent_kern_range	__glue(_CACHE,_coherent_kern_range)
- #define __cpuc_coherent_user_range	__glue(_CACHE,_coherent_user_range)
-+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
- #define __cpuc_flush_dcache_area	__glue(_CACHE,_flush_kern_dcache_area)
- 
- #define dmac_map_area			__glue(_CACHE,_dma_map_area)
- #define dmac_unmap_area			__glue(_CACHE,_dma_unmap_area)
- #define dmac_flush_range		__glue(_CACHE,_dma_flush_range)
-+#else
-+#define __cpuc_flush_dcache_area	__glue(fiq,_flush_kern_dcache_area)
-+
-+#define dmac_map_area			__glue(fiq,_dma_map_area)
-+#define dmac_unmap_area			__glue(fiq,_dma_unmap_area)
-+#define dmac_flush_range		__glue(fiq,_dma_flush_range)
-+#endif /* CONFIG_DMA_CACHE_FIQ_BROADCAST */
- #endif
- 
- #endif
---- a/arch/arm/mm/Kconfig
-+++ b/arch/arm/mm/Kconfig
-@@ -844,6 +844,17 @@ config DMA_CACHE_RWFO
- 	  in hardware, other workarounds are needed (e.g. cache
- 	  maintenance broadcasting in software via FIQ).
- 
-+config DMA_CACHE_FIQ_BROADCAST
-+	bool "Enable fiq broadcast DMA cache maintenance"
-+	depends on CPU_V6K && SMP
-+	select FIQ
-+	help
-+	  The Snoop Control Unit on ARM11MPCore does not detect the
-+	  cache maintenance operations and the dma_{map,unmap}_area()
-+	  functions may leave stale cache entries on other CPUs. By
-+	  enabling this option, fiq broadcast in the ARMv6
-+	  DMA cache maintenance functions is performed.
-+
- config OUTER_CACHE
- 	bool
- 
---- a/arch/arm/mm/flush.c
-+++ b/arch/arm/mm/flush.c
-@@ -314,7 +314,11 @@ void flush_dcache_page(struct page *page
- 
- 	mapping = page_mapping(page);
- 
-+#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
- 	if (!cache_ops_need_broadcast() &&
-+#else
-+	if (
-+#endif
- 	    mapping && !page_mapped(page))
- 		clear_bit(PG_dcache_clean, &page->flags);
- 	else {
diff --git a/target/linux/oxnas/patches-4.0/250-add-plxtech-vendor-prefix.patch b/target/linux/oxnas/patches-4.0/250-add-plxtech-vendor-prefix.patch
deleted file mode 100644
index 8eead43..0000000
--- a/target/linux/oxnas/patches-4.0/250-add-plxtech-vendor-prefix.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/Documentation/devicetree/bindings/vendor-prefixes.txt
-+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
-@@ -139,6 +139,7 @@ pericom	Pericom Technology Inc.
- phytec	PHYTEC Messtechnik GmbH
- picochip	Picochip Ltd
- plathome	Plat'Home Co., Ltd.
-+plxtech	PLX Technology, Inc.
- pixcir  PIXCIR MICROELECTRONICS Co., Ltd
- powervr	PowerVR (deprecated, use img)
- qca	Qualcomm Atheros, Inc.
diff --git a/target/linux/oxnas/patches-4.0/300-introduce-oxnas-platform.patch b/target/linux/oxnas/patches-4.0/300-introduce-oxnas-platform.patch
deleted file mode 100644
index 078eddc..0000000
--- a/target/linux/oxnas/patches-4.0/300-introduce-oxnas-platform.patch
+++ /dev/null
@@ -1,69 +0,0 @@
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -356,6 +356,17 @@ config ARCH_VERSATILE
- 	help
- 	  This enables support for ARM Ltd Versatile board.
- 
-+config ARCH_OXNAS
-+	bool "Oxford Semiconductor 815/820/825 NAS SoC"
-+	select ARCH_REQUIRE_GPIOLIB
-+	select CLKDEV_LOOKUP
-+	select GENERIC_CLOCKEVENTS
-+	select COMMON_CLK
-+	select MIGHT_HAVE_PCI
-+	select ARCH_HAS_RESET_CONTROLLER
-+	help
-+		This enables support for Oxsemi 815/820/825 NAS SoC
-+
- config ARCH_AT91
- 	bool "Atmel AT91"
- 	select ARCH_REQUIRE_GPIOLIB
-@@ -917,6 +928,8 @@ source "arch/arm/mach-omap2/Kconfig"
- 
- source "arch/arm/mach-orion5x/Kconfig"
- 
-+source "arch/arm/mach-oxnas/Kconfig"
-+
- source "arch/arm/mach-picoxcell/Kconfig"
- 
- source "arch/arm/mach-pxa/Kconfig"
---- a/arch/arm/Makefile
-+++ b/arch/arm/Makefile
-@@ -188,6 +188,7 @@ machine-$(CONFIG_ARCH_NSPIRE)		+= nspire
- machine-$(CONFIG_ARCH_OMAP1)		+= omap1
- machine-$(CONFIG_ARCH_OMAP2PLUS)	+= omap2
- machine-$(CONFIG_ARCH_ORION5X)		+= orion5x
-+machine-$(CONFIG_ARCH_OXNAS)		+= oxnas
- machine-$(CONFIG_ARCH_PICOXCELL)	+= picoxcell
- machine-$(CONFIG_ARCH_PXA)		+= pxa
- machine-$(CONFIG_ARCH_QCOM)		+= qcom
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -429,6 +429,7 @@ dtb-$(CONFIG_ARCH_ORION5X) += \
- 	orion5x-lacie-ethernet-disk-mini-v2.dtb \
- 	orion5x-maxtor-shared-storage-2.dtb \
- 	orion5x-rd88f5182-nas.dtb
-+dtb-$(CONFIG_ARCH_OXNAS) += ox820-pogoplug-pro.dtb
- dtb-$(CONFIG_ARCH_PRIMA2) += \
- 	prima2-evb.dtb
- dtb-$(CONFIG_ARCH_QCOM) += \
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -228,6 +228,7 @@ edb9302a		MACH_EDB9302A		EDB9302A		1127
- edb9307a		MACH_EDB9307A		EDB9307A		1128
- omap_3430sdp		MACH_OMAP_3430SDP	OMAP_3430SDP		1138
- vstms			MACH_VSTMS		VSTMS			1140
-+ox820			MACH_OX820		OX820			1152
- micro9m			MACH_MICRO9M		MICRO9M			1169
- bug			MACH_BUG		BUG			1179
- at91sam9263ek		MACH_AT91SAM9263EK	AT91SAM9263EK		1202
---- a/drivers/clk/Makefile
-+++ b/drivers/clk/Makefile
-@@ -31,6 +31,7 @@ obj-$(CONFIG_COMMON_CLK_MAX77802)	+= clk
- obj-$(CONFIG_ARCH_MOXART)		+= clk-moxart.o
- obj-$(CONFIG_ARCH_NOMADIK)		+= clk-nomadik.o
- obj-$(CONFIG_ARCH_NSPIRE)		+= clk-nspire.o
-+obj-$(CONFIG_ARCH_OXNAS)		+= clk-oxnas.o
- obj-$(CONFIG_COMMON_CLK_PALMAS)		+= clk-palmas.o
- obj-$(CONFIG_CLK_QORIQ)			+= clk-qoriq.o
- obj-$(CONFIG_COMMON_CLK_RK808)		+= clk-rk808.o
diff --git a/target/linux/oxnas/patches-4.0/310-oxnas-clocksource.patch b/target/linux/oxnas/patches-4.0/310-oxnas-clocksource.patch
deleted file mode 100644
index e7bc603..0000000
--- a/target/linux/oxnas/patches-4.0/310-oxnas-clocksource.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/drivers/clocksource/Kconfig
-+++ b/drivers/clocksource/Kconfig
-@@ -172,6 +172,12 @@ config VF_PIT_TIMER
- 	help
- 	  Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
- 
-+config CLKSRC_RPS_TIMER
-+	def_bool y if ARCH_OXNAS
-+	select CLKSRC_MMIO
-+	help
-+	  This option enables support for the oxnas rps timers.
-+
- config SYS_SUPPORTS_SH_CMT
-         bool
- 
---- a/drivers/clocksource/Makefile
-+++ b/drivers/clocksource/Makefile
-@@ -38,6 +38,7 @@ obj-$(CONFIG_CLKSRC_EFM32)	+= time-efm32
- obj-$(CONFIG_CLKSRC_EXYNOS_MCT)	+= exynos_mct.o
- obj-$(CONFIG_CLKSRC_SAMSUNG_PWM)	+= samsung_pwm_timer.o
- obj-$(CONFIG_FSL_FTM_TIMER)	+= fsl_ftm_timer.o
-+obj-$(CONFIG_CLKSRC_RPS_TIMER)	+= oxnas_rps_timer.o
- obj-$(CONFIG_VF_PIT_TIMER)	+= vf_pit_timer.o
- obj-$(CONFIG_CLKSRC_QCOM)	+= qcom-timer.o
- obj-$(CONFIG_MTK_TIMER)		+= mtk_timer.o
diff --git a/target/linux/oxnas/patches-4.0/320-oxnas-irqchip.patch b/target/linux/oxnas/patches-4.0/320-oxnas-irqchip.patch
deleted file mode 100644
index 4501263..0000000
--- a/target/linux/oxnas/patches-4.0/320-oxnas-irqchip.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- a/drivers/irqchip/Kconfig
-+++ b/drivers/irqchip/Kconfig
-@@ -27,6 +27,11 @@ config ARM_GIC_V3_ITS
- 	bool
- 	select PCI_MSI_IRQ_DOMAIN
- 
-+config PLXTECH_RPS
-+	def_bool y if ARHC_OXNAS
-+	depends on ARCH_OXNAS
-+	select IRQ_DOMAIN
-+
- config ARM_NVIC
- 	bool
- 	select IRQ_DOMAIN
---- a/drivers/irqchip/Makefile
-+++ b/drivers/irqchip/Makefile
-@@ -30,6 +30,7 @@ obj-$(CONFIG_IMGPDC_IRQ)		+= irq-imgpdc.
- obj-$(CONFIG_SIRF_IRQ)			+= irq-sirfsoc.o
- obj-$(CONFIG_RENESAS_INTC_IRQPIN)	+= irq-renesas-intc-irqpin.o
- obj-$(CONFIG_RENESAS_IRQC)		+= irq-renesas-irqc.o
-+obj-$(CONFIG_PLXTECH_RPS)		+= irq-rps.o
- obj-$(CONFIG_VERSATILE_FPGA_IRQ)	+= irq-versatile-fpga.o
- obj-$(CONFIG_ARCH_NSPIRE)		+= irq-zevio.o
- obj-$(CONFIG_ARCH_VT8500)		+= irq-vt8500.o
---- a/drivers/irqchip/irq-gic.c
-+++ b/drivers/irqchip/irq-gic.c
-@@ -1086,6 +1086,7 @@ IRQCHIP_DECLARE(arm1176jzf_dc_gic, "arm,
- IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init);
- IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init);
- IRQCHIP_DECLARE(cortex_a7_gic, "arm,cortex-a7-gic", gic_of_init);
-+IRQCHIP_DECLARE(arm11_mpcore_gic, "arm,arm11mp-gic", gic_of_init);
- IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init);
- IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
- 
diff --git a/target/linux/oxnas/patches-4.0/330-oxnas-pinctrl.patch b/target/linux/oxnas/patches-4.0/330-oxnas-pinctrl.patch
deleted file mode 100644
index 1183fbe..0000000
--- a/target/linux/oxnas/patches-4.0/330-oxnas-pinctrl.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/drivers/pinctrl/Kconfig
-+++ b/drivers/pinctrl/Kconfig
-@@ -188,6 +188,15 @@ config PINCTRL_COH901
- 	  COH 901 335 and COH 901 571/3. They contain 3, 5 or 7
- 	  ports of 8 GPIO pins each.
- 
-+config PINCTRL_OXNAS
-+	bool "OXNAS pinctrl driver"
-+	depends on OF
-+	depends on ARCH_OXNAS
-+	select PINMUX
-+	select PINCONF
-+	help
-+	  Say Y here to enable the oxnas pinctrl driver
-+
- config PINCTRL_PALMAS
- 	bool "Pinctrl driver for the PALMAS Series MFD devices"
- 	depends on OF && MFD_PALMAS
---- a/drivers/pinctrl/Makefile
-+++ b/drivers/pinctrl/Makefile
-@@ -18,6 +18,7 @@ obj-$(CONFIG_PINCTRL_BCM2835)	+= pinctrl
- obj-$(CONFIG_PINCTRL_BCM281XX)	+= pinctrl-bcm281xx.o
- obj-$(CONFIG_PINCTRL_FALCON)	+= pinctrl-falcon.o
- obj-$(CONFIG_PINCTRL_MESON)	+= meson/
-+obj-$(CONFIG_PINCTRL_OXNAS)	+= pinctrl-oxnas.o
- obj-$(CONFIG_PINCTRL_PALMAS)	+= pinctrl-palmas.o
- obj-$(CONFIG_PINCTRL_ROCKCHIP)	+= pinctrl-rockchip.o
- obj-$(CONFIG_PINCTRL_SINGLE)	+= pinctrl-single.o
diff --git a/target/linux/oxnas/patches-4.0/340-oxnas-pcie.patch b/target/linux/oxnas/patches-4.0/340-oxnas-pcie.patch
deleted file mode 100644
index 63175cc..0000000
--- a/target/linux/oxnas/patches-4.0/340-oxnas-pcie.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/drivers/pci/host/Kconfig
-+++ b/drivers/pci/host/Kconfig
-@@ -106,4 +106,9 @@ config PCI_VERSATILE
- 	bool "ARM Versatile PB PCI controller"
- 	depends on ARCH_VERSATILE
- 
-+config PCI_OXNAS
-+	bool "PLX Oxnas PCIe controller"
-+	depends on ARCH_OXNAS
-+	select PCIEPORTBUS
-+
- endmenu
---- a/drivers/pci/host/Makefile
-+++ b/drivers/pci/host/Makefile
-@@ -3,6 +3,7 @@ obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o
- obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
- obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
- obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
-+obj-$(CONFIG_PCI_OXNAS) += pcie-oxnas.o
- obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
- obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
- obj-$(CONFIG_PCI_RCAR_GEN2_PCIE) += pcie-rcar.o
diff --git a/target/linux/oxnas/patches-4.0/350-oxnas-reset.patch b/target/linux/oxnas/patches-4.0/350-oxnas-reset.patch
deleted file mode 100644
index 1cecd28..0000000
--- a/target/linux/oxnas/patches-4.0/350-oxnas-reset.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/drivers/reset/Kconfig
-+++ b/drivers/reset/Kconfig
-@@ -12,4 +12,9 @@ menuconfig RESET_CONTROLLER
- 
- 	  If unsure, say no.
- 
-+config RESET_CONTROLLER_OXNAS
-+	bool
-+	select RESET_CONTROLLER
-+
- source "drivers/reset/sti/Kconfig"
-+
---- a/drivers/reset/Makefile
-+++ b/drivers/reset/Makefile
-@@ -1,4 +1,5 @@
- obj-$(CONFIG_RESET_CONTROLLER) += core.o
-+obj-$(CONFIG_RESET_CONTROLLER_OXNAS) += reset-ox820.o
- obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
- obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
- obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
diff --git a/target/linux/oxnas/patches-4.0/400-oxnas-nand.patch b/target/linux/oxnas/patches-4.0/400-oxnas-nand.patch
deleted file mode 100644
index c59da35..0000000
--- a/target/linux/oxnas/patches-4.0/400-oxnas-nand.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/drivers/mtd/nand/Kconfig
-+++ b/drivers/mtd/nand/Kconfig
-@@ -530,4 +530,12 @@ config MTD_NAND_HISI504
- 	help
- 	  Enables support for NAND controller on Hisilicon SoC Hip04.
- 
-+config MTD_NAND_OXNAS
-+	tristate "Support for NAND on Plxtech NAS782X SoC"
-+	depends on ARCH_OXNAS
-+	select MTD_NAND_PLATFORM
-+	help
-+	  Enables support for NAND Flash chips on Plxtech NAS782X SoCs. NAND is attached
-+	  to the STATIC Unit.
-+
- endif # MTD_NAND
---- a/drivers/mtd/nand/Makefile
-+++ b/drivers/mtd/nand/Makefile
-@@ -45,6 +45,7 @@ obj-$(CONFIG_MTD_NAND_SOCRATES)		+= socr
- obj-$(CONFIG_MTD_NAND_TXX9NDFMC)	+= txx9ndfmc.o
- obj-$(CONFIG_MTD_NAND_NUC900)		+= nuc900_nand.o
- obj-$(CONFIG_MTD_NAND_MPC5121_NFC)	+= mpc5121_nfc.o
-+obj-$(CONFIG_MTD_NAND_OXNAS)		+= oxnas_nand.o
- obj-$(CONFIG_MTD_NAND_RICOH)		+= r852.o
- obj-$(CONFIG_MTD_NAND_JZ4740)		+= jz4740_nand.o
- obj-$(CONFIG_MTD_NAND_GPMI_NAND)	+= gpmi-nand/
diff --git a/target/linux/oxnas/patches-4.0/500-oxnas-sata.patch b/target/linux/oxnas/patches-4.0/500-oxnas-sata.patch
deleted file mode 100644
index af5e66f..0000000
--- a/target/linux/oxnas/patches-4.0/500-oxnas-sata.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/drivers/ata/Kconfig
-+++ b/drivers/ata/Kconfig
-@@ -401,6 +401,13 @@ config SATA_VITESSE
- 
- 	  If unsure, say N.
- 
-+config SATA_OXNAS
-+	tristate "PLXTECH NAS782X SATA support"
-+	help
-+	  This option enables support for Nas782x Serial ATA controller.
-+
-+	  If unsure, say N.
-+
- comment "PATA SFF controllers with BMDMA"
- 
- config PATA_ALI
---- a/drivers/ata/Makefile
-+++ b/drivers/ata/Makefile
-@@ -37,6 +37,7 @@ obj-$(CONFIG_SATA_SVW)		+= sata_svw.o
- obj-$(CONFIG_SATA_ULI)		+= sata_uli.o
- obj-$(CONFIG_SATA_VIA)		+= sata_via.o
- obj-$(CONFIG_SATA_VITESSE)	+= sata_vsc.o
-+obj-$(CONFIG_SATA_OXNAS)	+= sata_oxnas.o
- 
- # SFF PATA w/ BMDMA
- obj-$(CONFIG_PATA_ALI)		+= pata_ali.o
diff --git a/target/linux/oxnas/patches-4.0/800-oxnas-ehci.patch b/target/linux/oxnas/patches-4.0/800-oxnas-ehci.patch
deleted file mode 100644
index b283bbd..0000000
--- a/target/linux/oxnas/patches-4.0/800-oxnas-ehci.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/drivers/usb/host/Kconfig
-+++ b/drivers/usb/host/Kconfig
-@@ -313,6 +313,13 @@ config USB_OCTEON_EHCI
- 	  USB 2.0 device support.  All CN6XXX based chips with USB are
- 	  supported.
- 
-+config USB_EHCI_OXNAS
-+	tristate "OXNAS EHCI Module"
-+	depends on USB_EHCI_HCD && ARCH_OXNAS
-+	select USB_EHCI_ROOT_HUB_TT
-+	---help---
-+	  Enable support for the OX820 SOC's on-chip EHCI controller.
-+
- endif # USB_EHCI_HCD
- 
- config USB_OXU210HP_HCD
---- a/drivers/usb/host/Makefile
-+++ b/drivers/usb/host/Makefile
-@@ -42,6 +42,7 @@ obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-
- obj-$(CONFIG_USB_EHCI_MSM)	+= ehci-msm.o
- obj-$(CONFIG_USB_EHCI_TEGRA)	+= ehci-tegra.o
- obj-$(CONFIG_USB_W90X900_EHCI)	+= ehci-w90x900.o
-+obj-$(CONFIG_USB_EHCI_OXNAS)	+= ehci-oxnas.o
- 
- obj-$(CONFIG_USB_OXU210HP_HCD)	+= oxu210hp-hcd.o
- obj-$(CONFIG_USB_ISP116X_HCD)	+= isp116x-hcd.o
diff --git a/target/linux/oxnas/patches-4.0/900-more-boards.patch b/target/linux/oxnas/patches-4.0/900-more-boards.patch
deleted file mode 100644
index ffc7618..0000000
--- a/target/linux/oxnas/patches-4.0/900-more-boards.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -429,7 +429,10 @@ dtb-$(CONFIG_ARCH_ORION5X) += \
- 	orion5x-lacie-ethernet-disk-mini-v2.dtb \
- 	orion5x-maxtor-shared-storage-2.dtb \
- 	orion5x-rd88f5182-nas.dtb
--dtb-$(CONFIG_ARCH_OXNAS) += ox820-pogoplug-pro.dtb
-+dtb-$(CONFIG_ARCH_OXNAS) += ox820-pogoplug-pro.dtb \
-+	ox820-pogoplug-v3.dtb \
-+	ox820-stg212.dtb \
-+	ox820-kd20.dtb
- dtb-$(CONFIG_ARCH_PRIMA2) += \
- 	prima2-evb.dtb
- dtb-$(CONFIG_ARCH_QCOM) += \
diff --git a/target/linux/oxnas/patches-4.0/999-libata-hacks.patch b/target/linux/oxnas/patches-4.0/999-libata-hacks.patch
deleted file mode 100644
index 504bbdb..0000000
--- a/target/linux/oxnas/patches-4.0/999-libata-hacks.patch
+++ /dev/null
@@ -1,57 +0,0 @@
---- a/drivers/ata/libata-core.c
-+++ b/drivers/ata/libata-core.c
-@@ -1586,6 +1586,14 @@ unsigned ata_exec_internal_sg(struct ata
- 		return AC_ERR_SYSTEM;
- 	}
- 
-+	if (ap->ops->acquire_hw && !ap->ops->acquire_hw(ap, 0, 0)) {
-+		spin_unlock_irqrestore(ap->lock, flags);
-+		if (!ap->ops->acquire_hw(ap, 1, (2*HZ))) {
-+			return AC_ERR_TIMEOUT;
-+		}
-+		spin_lock_irqsave(ap->lock, flags);
-+	}
-+
- 	/* initialize internal qc */
- 
- 	/* XXX: Tag 0 is used for drivers with legacy EH as some
-@@ -4760,6 +4768,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
- 	if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
- 		return NULL;
- 
-+	if (ap->ops->qc_new && ap->ops->qc_new(ap))
-+		return NULL;
-+
- 	/* libsas case */
- 	if (ap->flags & ATA_FLAG_SAS_HOST) {
- 		tag = ata_sas_allocate_tag(ap);
-@@ -4805,6 +4816,8 @@ void ata_qc_free(struct ata_queued_cmd *
- 		qc->tag = ATA_TAG_POISON;
- 		if (ap->flags & ATA_FLAG_SAS_HOST)
- 			ata_sas_free_tag(tag, ap);
-+		if (ap->ops->qc_free)
-+			ap->ops->qc_free(qc);
- 	}
- }
- 
---- a/include/linux/libata.h
-+++ b/include/linux/libata.h
-@@ -903,6 +903,8 @@ struct ata_port_operations {
- 	void (*qc_prep)(struct ata_queued_cmd *qc);
- 	unsigned int (*qc_issue)(struct ata_queued_cmd *qc);
- 	bool (*qc_fill_rtf)(struct ata_queued_cmd *qc);
-+	int (*qc_new)(struct ata_port *ap);
-+	void (*qc_free)(struct ata_queued_cmd *qc);
- 
- 	/*
- 	 * Configuration and exception handling
-@@ -993,6 +995,9 @@ struct ata_port_operations {
- 	void (*phy_reset)(struct ata_port *ap);
- 	void (*eng_timeout)(struct ata_port *ap);
- 
-+	int (*acquire_hw)(struct ata_port *ap, int may_sleep,
-+			  int timeout_jiffies);
-+
- 	/*
- 	 * ->inherits must be the last field and all the preceding
- 	 * fields must be pointers.
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Mon Aug 17 06:18:40 2015
From: blogic at openwrt.org (John Crispin)
Date: Mon, 17 Aug 2015 12:18:40 +0200
Subject: [OpenWrt-Devel] [PATCH] iwinfo: do not wait for scan results if
 scan request failed.
In-Reply-To: <20150731115315.7fc0dc6dbe29df05af36197d@ubnt.com>
References: <20150731115315.7fc0dc6dbe29df05af36197d@ubnt.com>
Message-ID: <55D1B500.6070308@openwrt.org>

Hi,

I have various issues with this patch

On 31/07/2015 10:53, Dmitry Ivanov wrote:
> Do not wait for scan results if scan request failed.
> 
> Signed-off-by: Dmitry Ivanov <dima at ubnt.com>
> ---
>  iwinfo_nl80211.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
> index 900eef2..251ec33 100644
> --- a/iwinfo_nl80211.c
> +++ b/iwinfo_nl80211.c
> @@ -389,11 +389,12 @@ static struct nl80211_msg_conveyor * nl80211_send(
>  	while (err > 0)
>  		nl_recvmsgs(nls->nl_sock, cv->cb);
>  
> +	if (err)
> +		goto err;
> +

this code will never be reached due tot he while (err > 0) above


>  	return &rcv;
>  
>  err:
> -	nl_cb_put(cv->cb);
> -	nlmsg_free(cv->msg);
>  

removing the freeeing code from a global helper is not a good idea and
will cause a leak.


	John



>  	return NULL;
>  }
> @@ -2016,16 +2017,21 @@ static int nl80211_get_scanlist_cb(struct nl_msg *msg, void *arg)
>  
>  static int nl80211_get_scanlist_nl(const char *ifname, char *buf, int *len)
>  {
> -	struct nl80211_msg_conveyor *req;
> +	struct nl80211_msg_conveyor *req, *scan_res = NULL;
>  	struct nl80211_scanlist sl = { .e = (struct iwinfo_scanlist_entry *)buf };
>  
>  	req = nl80211_msg(ifname, NL80211_CMD_TRIGGER_SCAN, 0);
>  	if (req)
>  	{
> -		nl80211_send(req, NULL, NULL);
> +		scan_res = nl80211_send(req, NULL, NULL);
>  		nl80211_free(req);
>  	}
>  
> +	if (!scan_res)
> +	{
> +		return -1;
> +	}
> +
>  	nl80211_wait("nl80211", "scan", NL80211_CMD_NEW_SCAN_RESULTS);
>  
>  	req = nl80211_msg(ifname, NL80211_CMD_GET_SCAN, NLM_F_DUMP);
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Mon Aug 17 06:31:44 2015
From: blogic at openwrt.org (John Crispin)
Date: Mon, 17 Aug 2015 12:31:44 +0200
Subject: [OpenWrt-Devel] [PATCH] ramips: add support for Planex DB-WRT01
In-Reply-To: <1439219793-18015-1-git-send-email-tochiro.srchack@gmail.com>
References: <1439219793-18015-1-git-send-email-tochiro.srchack@gmail.com>
Message-ID: <55D1B810.8000101@openwrt.org>



On 10/08/2015 17:16, YuheiOKAWA wrote:
>  This patch add support for Planex DB-WRT01. DANBOARD route on
>  the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio.
>  DANBOARD is Cartoon character.
> 
> Signed-off-by: YuheiOKAWA <tochiro.srchack at gmail.com>



Hi,

i merged a huge 25 patch series today that cleans up the ramips target.
this unfortunately makes this patch not apply anymore. could you rebase
and resend your patch please ?

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


From blogic at openwrt.org  Mon Aug 17 06:36:17 2015
From: blogic at openwrt.org (John Crispin)
Date: Mon, 17 Aug 2015 12:36:17 +0200
Subject: [OpenWrt-Devel] [PATCH] [libubox] ulog: check if /dev/kmsg is
 special file
In-Reply-To: <1439723331-31367-1-git-send-email-sakib@meta.ua>
References: <1439723331-31367-1-git-send-email-sakib@meta.ua>
Message-ID: <55D1B921.1040707@openwrt.org>

Hi,

On 16/08/2015 13:08, Sergiy Kibrik wrote:
> Race is possible in ulog_kmsg: if no /dev/kmsg exists
> (e.g. while /dev gets re-mounted) regular file created instead.
> From this point system goes without kernel logger:
> special character file can't be created anymore, all clients keep
> overwriting single message in regular file.
> 
> To avoid this we check if file we're going to write to is really
> character special and ensure it doesn't go away while we check.
> 
> Signed-off-by: Sergiy Kibrik <sakib at meta.ua>


the patch is quite invasive. how about just using "r+"

from the man page -->  "r+     Open for reading and writing.  The stream
is positioned at the beginning of the file."

could you try the following and not apply any other changes ?

	John

-	if ((kmsg = fopen("/dev/kmsg", "w")) != NULL) {
+	if ((kmsg = fopen("/dev/kmsg", "r+")) != NULL) {






> ---
>  ulog.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/ulog.c b/ulog.c
> index 776a0c4..10d61da 100644
> --- a/ulog.c
> +++ b/ulog.c
> @@ -23,6 +23,9 @@
>  #include <stdlib.h>
>  #include <unistd.h>
>  #include <string.h>
> +#include <sys/types.h>
> +#include <sys/stat.h>
> +#include <fcntl.h>
>  
>  static int _ulog_channels = -1;
>  static int _ulog_facility = -1;
> @@ -89,8 +92,18 @@ static void ulog_defaults(void)
>  static void ulog_kmsg(int priority, const char *fmt, va_list ap)
>  {
>  	FILE *kmsg;
> +	int fd;
> +	struct stat s;
> +
> +	/* extra checks not to accidentally create regular file */
> +	fd = open("/dev/kmsg", O_WRONLY);
> +	if (fd < 0)
> +		return;
> +
> +	if (fstat(fd, &s) == 0 &&
> +	    s.st_mode & S_IFCHR &&
> +	    (kmsg = fdopen(fd, "w")) != NULL) {
>  
> -	if ((kmsg = fopen("/dev/kmsg", "w")) != NULL) {
>  		fprintf(kmsg, "<%u>", priority);
>  
>  		if (_ulog_ident)
> @@ -99,6 +112,8 @@ static void ulog_kmsg(int priority, const char *fmt, va_list ap)
>  		vfprintf(kmsg, fmt, ap);
>  		fclose(kmsg);
>  	}
> +
> +	close(fd);
>  }
>  
>  static void ulog_stdio(int priority, const char *fmt, va_list ap)
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 17 06:51:51 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 17 Aug 2015 12:51:51 +0200
Subject: [OpenWrt-Devel] [PATCH] generic: crypto: remove IRQF_DISABLED
Message-ID: <1439808711-28675-1-git-send-email-dirkneukirchen@web.de>

    no-op since 2.6.35
    removed in Kernel 4.1
    see https://lwn.net/Articles/380931/

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 target/linux/generic/files/crypto/ocf/kirkwood/cesa_ocf_drv.c | 2 +-
 target/linux/generic/files/crypto/ocf/pasemi/pasemi.c         | 2 +-
 target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/generic/files/crypto/ocf/kirkwood/cesa_ocf_drv.c b/target/linux/generic/files/crypto/ocf/kirkwood/cesa_ocf_drv.c
index e689f24..6fb9e09 100644
--- a/target/linux/generic/files/crypto/ocf/kirkwood/cesa_ocf_drv.c
+++ b/target/linux/generic/files/crypto/ocf/kirkwood/cesa_ocf_drv.c
@@ -1203,7 +1203,7 @@ mv_cesa_ocf_init(struct platform_device *pdev)
 #endif
 	/* register interrupt */
 	if( request_irq( cesa_device.irq, cesa_interrupt_handler,
-                             (IRQF_DISABLED) , "cesa", &cesa_ocf_id) < 0) {
+                             0, "cesa", &cesa_ocf_id) < 0) {
             	printk("%s,%d: cannot assign irq %x\n", __FILE__, __LINE__, cesa_device.reg);
 		return EINVAL;
         }
diff --git a/target/linux/generic/files/crypto/ocf/pasemi/pasemi.c b/target/linux/generic/files/crypto/ocf/pasemi/pasemi.c
index 7bb62bc..216c578 100644
--- a/target/linux/generic/files/crypto/ocf/pasemi/pasemi.c
+++ b/target/linux/generic/files/crypto/ocf/pasemi/pasemi.c
@@ -767,7 +767,7 @@ static int pasemi_dma_setup_tx_resources(struct pasemi_softc *sc, int chan)
 
 	ring->irq = irq_create_mapping(NULL, sc->base_irq + chan);
 	ret = request_irq(ring->irq, (irq_handler_t)
-			  pasemi_intr, IRQF_DISABLED, ring->irq_name, sc);
+			  pasemi_intr, 0, ring->irq_name, sc);
 	if (ret) {
 		printk(KERN_ERR DRV_NAME ": failed to hook irq %d ret %d\n",
 		       ring->irq, ret);
diff --git a/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c b/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c
index 6dc22c7..a81594e 100644
--- a/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c
+++ b/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c
@@ -499,7 +499,7 @@ ubsec_ssb_probe(struct ssb_device *sdev,
     }
 
     err = request_irq(sdev->irq, (irq_handler_t)ubsec_ssb_isr, 
-        IRQF_DISABLED | IRQF_SHARED, DRV_MODULE_NAME, sdev);
+        IRQF_SHARED, DRV_MODULE_NAME, sdev);
     if (err) {
         dev_err(sdev->dev, "Could not request irq\n");
         goto err_out_powerdown;
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 17 06:52:01 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 17 Aug 2015 12:52:01 +0200
Subject: [OpenWrt-Devel] [PATCH] orion: remove IRQF_DISABLED
Message-ID: <1439808721-28727-1-git-send-email-dirkneukirchen@web.de>

    no-op since 2.6.35
    removed in Kernel 4.1
    see https://lwn.net/Articles/380931/

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 target/linux/orion/files/arch/arm/mach-orion5x/dt2-setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/orion/files/arch/arm/mach-orion5x/dt2-setup.c b/target/linux/orion/files/arch/arm/mach-orion5x/dt2-setup.c
index b341ed6..658ea92 100644
--- a/target/linux/orion/files/arch/arm/mach-orion5x/dt2-setup.c
+++ b/target/linux/orion/files/arch/arm/mach-orion5x/dt2-setup.c
@@ -335,7 +335,7 @@ static void __init dt2_init(void)
 	platform_device_register(&dt2_leds);
 
 	if (request_irq(gpio_to_irq(DT2_PIN_GPIO_RESET), &dt2_reset_handler,
-			IRQF_DISABLED | IRQF_TRIGGER_LOW,
+			IRQF_TRIGGER_LOW,
 			"DT2: Reset button", NULL) < 0) {
 
 		printk("DT2: Reset Button IRQ %d not available\n",
@@ -343,7 +343,7 @@ static void __init dt2_init(void)
 	}
 
 	if (request_irq(gpio_to_irq(DT2_PIN_GPIO_POWER), &dt2_power_handler,
-			IRQF_DISABLED | IRQF_TRIGGER_LOW,
+			IRQF_TRIGGER_LOW,
 			"DT2: Power button", NULL) < 0) {
 
 		printk(KERN_DEBUG "DT2: Power Button IRQ %d not available\n",
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Mon Aug 17 07:24:01 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Mon, 17 Aug 2015 13:24:01 +0200
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
In-Reply-To: <55D17F03.5080101@openwrt.org>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
 <55D17F03.5080101@openwrt.org>
Message-ID: <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>

2015-08-17 8:28 GMT+02:00 John Crispin <blogic at openwrt.org>:
> Hi,
>
> just merged the whole lot. thanks a lot. what do you want to do next
> lantiq or ar71xx ? :) personally i would prefer ar71xx ;)
> [...]

Hello John,

It seems that there are some people who don't like the changes (see
below), but they don't have enough courage to use their real name and
post their comments on the list.

I will back with answers for your and Michael Heimpold (I'm sorry, I
didn't spot your e-mail before!) questions in few days. Now I'm really
busy with other things.

Cheers,
Piotr Dymacz

---

2015-08-17 13:05 GMT+02:00 West Fuck <deutchwrt at anonmail.de>:
> https://dev.openwrt.org/changeset/46617
>
> of all the bugs on related system you have choosen to change board and led
> names? why do you stick your nose into something that is not relevant? is it
> because your'e stupid fucking excuse for human being? you couldn't even make
> your uboot work without errors on some boards so why don't you stick to your
> own crap instead of acting like your're doing something
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Mon Aug 17 07:24:34 2015
From: blogic at openwrt.org (John Crispin)
Date: Mon, 17 Aug 2015 13:24:34 +0200
Subject: [OpenWrt-Devel] [PATCH] Added WIZnet WizFi630A Platform based
 on Ralink RT5350
In-Reply-To: <55CEF385.2010008@wiznet.eu>
References: <55CEF385.2010008@wiznet.eu>
Message-ID: <55D1C472.90109@openwrt.org>

Hi Tobias,

Thanks for the patch. unfortunately its line mangled and white space
broken. also it seems you sent a HTML email. If you take a few minutes
to setup git, you can use "git send-email" to avoid these issues.

	John


On 15/08/2015 10:08, Tobias Welz wrote:
> Hello OpenWrt Developers,
> 
> I added the WIZnet WizFi630A Platform to the trunk. The board is based
> on Ralink RT5350 in MiniPci Express Form Factor.
> 
> Kind regards
> Tobias Welz
> 
> 
> 
> From bd69bb513e36abda43e86f0eb64caf004260e415 Mon Sep 17 00:00:00 2001
> From: Tobias Welz <tw at wiznet.eu>
> Date: Sat, 15 Aug 2015 02:30:34 +0200
> Subject: [PATCH] Added WIZnet WizFi630A Platform based on Ralink RT5350
> 
> 
> Signed-off-by: Tobias Welz <tw at wiznet.eu>
> ---
>  .../linux/ramips/base-files/etc/board.d/02_network |    6 +
>  target/linux/ramips/base-files/etc/diag.sh         |    3 +
>  target/linux/ramips/base-files/lib/ramips.sh       |    3 +
>  .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
>  target/linux/ramips/dts/WIZFI630A.dts              |  304
> ++++++++++++++++++++
>  target/linux/ramips/image/Makefile                 |    3 +
>  target/linux/ramips/rt305x/profiles/wizfi630a.mk   |   18 ++
>  7 files changed, 338 insertions(+)
>  create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
>  create mode 100644 target/linux/ramips/rt305x/profiles/wizfi630a.mk
> 
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
> b/target/linux/ramips/base-files/etc/board.d/02_network
> index da1854a..c211ab9 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -235,6 +235,7 @@ ramips_setup_interfaces()
>          ucidef_add_switch_vlan "switch0" "2" "4 6t"
>          ;;
>  
> +    wizfi630a | \
>      y1s)
>          ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>          ucidef_add_switch "switch0" "1" "1"
> @@ -297,6 +298,11 @@ ramips_setup_macs()
>          wan_mac=$(mtd_get_mac_binary factory 46)
>          ;;
>  
> +    wizfi630a)
> +        lan_mac=$(mtd_get_mac_binary factory 4)
> +        wan_mac=$(mtd_get_mac_binary factory 40)
> +        ;;
> +
>      w306r-v20)
>          lan_mac=$(cat /sys/class/net/eth0/address)
>          wan_mac=$(macaddr_add "$lan_mac" 5)
> diff --git a/target/linux/ramips/base-files/etc/diag.sh
> b/target/linux/ramips/base-files/etc/diag.sh
> index e63f0df..3ffcc22 100644
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -252,6 +252,9 @@ get_status_led() {
>      zte-q7)
>          status_led="zte:red:status"
>          ;;
> +    wizfi630a)
> +        status_led="wizfi630a::run"
> +        ;;
>      mzk-dp150n)
>          status_led="mzkdp150n:green:power"
>          ;;
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh
> b/target/linux/ramips/base-files/lib/ramips.sh
> index 7db6d37..474fdb8 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -430,6 +430,9 @@ ramips_board_detect() {
>      *"Planex MZK-DP150N")
>          name="mzk-dp150n"
>          ;;
> +     *"WIZnet WizFi630A")
> +                name="wizfi630a"
> +                ;;
>      *)
>          name="generic"
>          ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 8221997..bdc6be9 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -105,6 +105,7 @@ platform_check_image() {
>      whr-300hp2 |\
>      whr-600d |\
>      whr-1166d |\
> +    wizfi630a |\
>      wsr-600 |\
>      wl-330n | \
>      wl-330n3g | \
> diff --git a/target/linux/ramips/dts/WIZFI630A.dts
> b/target/linux/ramips/dts/WIZFI630A.dts
> new file mode 100644
> index 0000000..b3f655d
> --- /dev/null
> +++ b/target/linux/ramips/dts/WIZFI630A.dts
> @@ -0,0 +1,304 @@
> +/dts-v1/;
> +
> +/include/ "rt5350.dtsi"
> +
> +/ {
> +    compatible = "wizfi630a", "ralink,rt5350-soc";
> +    model = "WIZnet WizFi630A";
> +
> +        chosen {
> +                bootargs = "console=ttyS1,115200";
> +        };
> +
> +    palmbus at 10000000 {
> +        gpio1: gpio at 660 {
> +                        status = "okay";
> +                };
> +
> +        spi at b00 {
> +            status = "okay";
> +
> +            m25p80 at 0 {
> +                #address-cells = <1>;
> +                #size-cells = <1>;
> +                compatible = "w25q128";
> +                reg = <0>;
> +                linux,modalias = "m25p80", "w25q128";
> +                spi-max-frequency = <10000000>;
> +
> +                partition at 0 {
> +                    label = "uboot";
> +                    reg = <0x0 0x30000>;
> +                    read-only;
> +                };
> +
> +                partition at 30000 {
> +                    label = "uboot-env";
> +                    reg = <0x30000 0x10000>;
> +                    read-only;
> +                };
> +
> +                factory: partition at 40000 {
> +                    label = "factory";
> +                    reg = <0x40000 0x10000>;
> +                    read-only;
> +                };
> +
> +                partition at 50000 {
> +                    label = "firmware";
> +                    reg = <0x50000 0xfb0000>;
> +                };
> +            };
> +        };
> +
> +                uart at 500 {
> +                        compatible = "ralink,mt7620a-uart",
> "ralink,rt2880-uart", "ns16550a";
> +                        reg = <0x500 0x100>;
> +
> +                        resets = <&rstctrl 12>;
> +                        reset-names = "uart";
> +
> +                        interrupt-parent = <&intc>;
> +                        interrupts = <5>;
> +
> +                        reg-shift = <2>;
> +
> +                        status = "okay";
> +                };
> +
> +
> +                uartlite at c00 {
> +                        compatible = "ralink,mt7620a-uart",
> "ralink,rt2880-uart", "ns16550a";
> +                        reg = <0xc00 0x100>;
> +
> +                        resets = <&rstctrl 19>;
> +                        reset-names = "uartl";
> +
> +                        interrupt-parent = <&intc>;
> +                        interrupts = <12>;
> +
> +                        reg-shift = <2>;
> +
> +                        pinctrl-names = "default";
> +                        pinctrl-0 = <&uartlite_pins>;
> +                };
> +    };
> +
> +    pinctrl {
> +        state_default: pinctrl0 {
> +            gpio {
> +                ralink,group = "i2c", "jtag" ;
> +                ralink,function = "gpio";
> +            };
> +        };
> +
> +                uartf_gpio_pins: uartf_gpio {
> +                        uartf_gpio {
> +                                ralink,group = "uartf";
> +                                //ralink,function = "gpio uartf";
> +                                ralink,function = "uartf";
> +                        };
> +                };
> +
> +                uartlite_pins: uartlite {
> +                        uart {
> +                                ralink,group = "uartlite";
> +                                ralink,function = "uartlite";
> +                        };
> +                };
> +    };
> +
> +    ethernet at 10100000 {
> +        mtd-mac-address = <&factory 0x4>;
> +    };
> +
> +    esw at 10110000 {
> +                ralink,portmap = <0x17>;
> +        };
> +
> +    wmac at 10180000 {
> +        ralink,mtd-eeprom = <&factory 0>;
> +    };
> +
> +    ehci at 101c0000 {
> +        status = "okay";
> +    };
> +
> +    ohci at 101c1000 {
> +        status = "okay";
> +    };
> +
> +
> +    gpio-export {
> +        compatible = "gpio-export";
> +        #size-cells = <0>;
> +/*
> +        gpio22 {
> +            // WAN
> +            gpio-export,name = "gpio22";
> +            gpio-export,direction_may_change = <1>;
> +            gpios = <&gpio1 0 0>; // path lfd dir
> +        };
> +        gpio23 {
> +            // LAN1
> +            gpio-export,name = "gpio23";
> +            gpio-export,direction_may_change = <1>;
> +            gpios = <&gpio1 1 0>;
> +        };
> +        gpio24 {
> +            // LAN2
> +            gpio-export,name = "gpio24";
> +            gpio-export,direction_may_change = <1>;
> +            gpios = <&gpio1 2 0>;
> +        };
> +
> +                // UARTF - UART1
> +                gpio7 {
> +                        // UARTF_RTS_N - HW Pin 6
> +                        gpio-export,name = "gpio7";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 7 0>;
> +                };
> +                gpio8 {
> +                        // UARTF_TXD - HW Pin 10
> +                        gpio-export,name = "gpio8";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 8 0>;
> +                };
> +                gpio9 {
> +                        // UARTF_CTS_N - HW Pin 5
> +                        gpio-export,name = "gpio9";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 9 0>;
> +                };
> +                gpio10 {
> +                        // UARTF_RXD - HW Pin 9
> +                        gpio-export,name = "gpio10";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 10 0>;
> +                };
> +                gpio11 {
> +                        // UARTF_DTR_N - HW Pin 8
> +                        gpio-export,name = "gpio11";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 11 0>;
> +                };
> +                gpio12 {
> +                        // UARTF_DCD_N - HW Pin 12
> +                        gpio-export,name = "gpio12";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 12 0>;
> +                };
> +                gpio13 {
> +                        // UARTF_DSR_N - HW Pin 11
> +                        gpio-export,name = "gpio13";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 13 0>;
> +                };
> +                gpio14 {
> +                        // UARTF_RIN - HW Pin 7
> +                        gpio-export,name = "gpio14";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 14 0>;
> +                };
> +
> +        // UARTLITE - UART2
> +                gpio15 {
> +                        // UART2_TXD  - HW Pin 20
> +                        gpio-export,name = "gpio15";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 15 0>;
> +                };
> +                gpio16 {
> +                        // UART2_RXD  - HW Pin 18
> +                        gpio-export,name = "gpio16";
> +                        gpio-export,direction_may_change = <1>;
> +                        gpios = <&gpio0 16 0>;
> +                };
> +
> +*/
> +/*
> +        // If you want to use this comment out the corrosponding
> gpio-keys-polled
> +        gpio0 {
> +            // wps btn
> +            gpio-export,name = "gpio0";
> +            gpio-export,direction_may_change = <1>;
> +            gpios = <&gpio0 0 1>;
> +        };
> +*/
> +
> +        gpio19 {
> +            // SCM1
> +            gpio-export,name = "gpio19";
> +            gpio-export,direction_may_change = <1>;
> +            gpios = <&gpio0 19 1>;
> +        };
> +        gpio2 {
> +            // SCM2
> +            gpio-export,name = "gpio2";
> +            gpio-export,direction_may_change = <1>;
> +            gpios = <&gpio0 2 1>;
> +        };
> +
> +    };
> +
> +
> +
> +
> +
> +    gpio-leds {
> +        compatible = "gpio-leds";
> +        run {
> +            label = "wizfi630a::run";
> +            gpios = <&gpio0 1 1>;
> +        };
> +        uart1 {
> +            label = "wizfi630a::uart1";
> +            gpios = <&gpio0 18 1>;
> +        };
> +        uart2 {
> +            label = "wizfi630a::uart2";
> +            gpios = <&gpio0 21 1>;
> +        };
> +        wps {
> +            label = "wizfi630a::wps";
> +            gpios = <&gpio0 20 1>;
> +        };
> +    };
> +
> +
> +        gpio-keys-polled {
> +                compatible = "gpio-keys-polled";
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +                poll-interval = <20>;
> +                reset {
> +                        label = "reset";
> +                        gpios = <&gpio0 17 1>;
> +                        linux,code = <0x198>;
> +                };
> +
> +                wps {
> +                        label = "wps";
> +                        gpios = <&gpio0 0 1>;
> +                        linux,code = <0x211>;
> +                };
> +/*
> +        // If you want to use this comment out the corrosponding export
> +                scm1 {
> +                        label = "SCM1";
> +                        gpios = <&gpio0 19 1>;
> +                        linux,code = <0x100>;
> +                };
> +
> +                scm2 {
> +                        label = "SCM2";
> +                        gpios = <&gpio0 2 1>;
> +                        linux,code = <0x101>;
> +                };
> +*/
> +
> +        };
> +
> +
> +};
> diff --git a/target/linux/ramips/image/Makefile
> b/target/linux/ramips/image/Makefile
> index 409ff26..fbc6775 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -673,6 +673,8 @@ Image/Build/Profile/WNCE2001=$(call
> BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WN
>  
>  Image/Build/Profile/WR512-3GN=$(call
> BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)
>  
> +Image/Build/Profile/WIZFI630A=$(call
> BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
> +
>  Image/Build/Profile/WT1520=$(call
> BuildFirmware/PorayDualSize/$(1),$(1),wt1520,WT1520)
>  
>  Image/Build/Profile/UR-326N4G=$(call
> BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)
> @@ -761,6 +763,7 @@ define Image/Build/Profile/Default
>      $(call Image/Build/Profile/W306R_V20,$(1))
>      $(call Image/Build/Profile/W502U,$(1))
>      $(call Image/Build/Profile/WCR150GN,$(1))
> +    $(call Image/Build/Profile/WIZFI630A,$(1))
>      $(call Image/Build/Profile/WHRG300N,$(1))
>      $(call Image/Build/Profile/WIZARD8800,$(1))
>      $(call Image/Build/Profile/WL_330N,$(1))
> diff --git a/target/linux/ramips/rt305x/profiles/wizfi630a.mk
> b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
> new file mode 100644
> index 0000000..22136b9
> --- /dev/null
> +++ b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
> @@ -0,0 +1,18 @@
> +#
> +# Copyright (C) 2014 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/WIZFI630A
> +    NAME:=WIZnet WizFi630A
> +    PACKAGES:=\
> +        kmod-usb-core kmod-usb-ohci kmod-usb2
> +endef
> +
> +define Profile/WIZFI630A/Description
> +    Package set for WIZnet WizFi630A board
> +endef
> +
> +$(eval $(call Profile,WIZFI630A))
> -- 
> 1.7.10.4
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sedat.dilek at gmail.com  Mon Aug 17 07:41:21 2015
From: sedat.dilek at gmail.com (Sedat Dilek)
Date: Mon, 17 Aug 2015 13:41:21 +0200
Subject: [OpenWrt-Devel] [PATCH] Added WIZnet WizFi630A Platform based
 on Ralink RT5350
In-Reply-To: <55D1C472.90109@openwrt.org>
References: <55CEF385.2010008@wiznet.eu>
	<55D1C472.90109@openwrt.org>
Message-ID: <CA+icZUVnay8EHoexmCBQPsyCZJeK0A87t5qXHrgQ08cUm4bF-Q@mail.gmail.com>

On Mon, Aug 17, 2015 at 1:24 PM, John Crispin <blogic at openwrt.org> wrote:
> Hi Tobias,
>
> Thanks for the patch. unfortunately its line mangled and white space
> broken. also it seems you sent a HTML email. If you take a few minutes
> to setup git, you can use "git send-email" to avoid these issues.
>

On Debian/Ubuntu install "git send-email" or check your distubition's
docs and help...

   root# apt-get update && apt-get install git-email

Feel free to adapt my local dot-gitconfig...

$ cat ~/.gitconfig
[user]
        name   = Sedat Dilek
        email  = sedat.dilek at gmail.com

[core]
        abbrev = 12

[format]
        subjectprefix = PATCH
        signoff = false

[pretty]
        fixes = Fixes: %h (\"%s\")

[push]
        default = matching

[sendemail]
        smtpserver = smtp.gmail.com
        smtpserverport = 587
        smtpencryption = tls
        smtpuser = sedat.dilek at gmail.com

Hope this helps.

- sed@ -


>         John
>
>
> On 15/08/2015 10:08, Tobias Welz wrote:
>> Hello OpenWrt Developers,
>>
>> I added the WIZnet WizFi630A Platform to the trunk. The board is based
>> on Ralink RT5350 in MiniPci Express Form Factor.
>>
>> Kind regards
>> Tobias Welz
>>
>>
>>
>> From bd69bb513e36abda43e86f0eb64caf004260e415 Mon Sep 17 00:00:00 2001
>> From: Tobias Welz <tw at wiznet.eu>
>> Date: Sat, 15 Aug 2015 02:30:34 +0200
>> Subject: [PATCH] Added WIZnet WizFi630A Platform based on Ralink RT5350
>>
>>
>> Signed-off-by: Tobias Welz <tw at wiznet.eu>
>> ---
>>  .../linux/ramips/base-files/etc/board.d/02_network |    6 +
>>  target/linux/ramips/base-files/etc/diag.sh         |    3 +
>>  target/linux/ramips/base-files/lib/ramips.sh       |    3 +
>>  .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
>>  target/linux/ramips/dts/WIZFI630A.dts              |  304
>> ++++++++++++++++++++
>>  target/linux/ramips/image/Makefile                 |    3 +
>>  target/linux/ramips/rt305x/profiles/wizfi630a.mk   |   18 ++
>>  7 files changed, 338 insertions(+)
>>  create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
>>  create mode 100644 target/linux/ramips/rt305x/profiles/wizfi630a.mk
>>
>> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
>> b/target/linux/ramips/base-files/etc/board.d/02_network
>> index da1854a..c211ab9 100755
>> --- a/target/linux/ramips/base-files/etc/board.d/02_network
>> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
>> @@ -235,6 +235,7 @@ ramips_setup_interfaces()
>>          ucidef_add_switch_vlan "switch0" "2" "4 6t"
>>          ;;
>>
>> +    wizfi630a | \
>>      y1s)
>>          ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>>          ucidef_add_switch "switch0" "1" "1"
>> @@ -297,6 +298,11 @@ ramips_setup_macs()
>>          wan_mac=$(mtd_get_mac_binary factory 46)
>>          ;;
>>
>> +    wizfi630a)
>> +        lan_mac=$(mtd_get_mac_binary factory 4)
>> +        wan_mac=$(mtd_get_mac_binary factory 40)
>> +        ;;
>> +
>>      w306r-v20)
>>          lan_mac=$(cat /sys/class/net/eth0/address)
>>          wan_mac=$(macaddr_add "$lan_mac" 5)
>> diff --git a/target/linux/ramips/base-files/etc/diag.sh
>> b/target/linux/ramips/base-files/etc/diag.sh
>> index e63f0df..3ffcc22 100644
>> --- a/target/linux/ramips/base-files/etc/diag.sh
>> +++ b/target/linux/ramips/base-files/etc/diag.sh
>> @@ -252,6 +252,9 @@ get_status_led() {
>>      zte-q7)
>>          status_led="zte:red:status"
>>          ;;
>> +    wizfi630a)
>> +        status_led="wizfi630a::run"
>> +        ;;
>>      mzk-dp150n)
>>          status_led="mzkdp150n:green:power"
>>          ;;
>> diff --git a/target/linux/ramips/base-files/lib/ramips.sh
>> b/target/linux/ramips/base-files/lib/ramips.sh
>> index 7db6d37..474fdb8 100755
>> --- a/target/linux/ramips/base-files/lib/ramips.sh
>> +++ b/target/linux/ramips/base-files/lib/ramips.sh
>> @@ -430,6 +430,9 @@ ramips_board_detect() {
>>      *"Planex MZK-DP150N")
>>          name="mzk-dp150n"
>>          ;;
>> +     *"WIZnet WizFi630A")
>> +                name="wizfi630a"
>> +                ;;
>>      *)
>>          name="generic"
>>          ;;
>> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
>> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
>> index 8221997..bdc6be9 100755
>> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
>> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
>> @@ -105,6 +105,7 @@ platform_check_image() {
>>      whr-300hp2 |\
>>      whr-600d |\
>>      whr-1166d |\
>> +    wizfi630a |\
>>      wsr-600 |\
>>      wl-330n | \
>>      wl-330n3g | \
>> diff --git a/target/linux/ramips/dts/WIZFI630A.dts
>> b/target/linux/ramips/dts/WIZFI630A.dts
>> new file mode 100644
>> index 0000000..b3f655d
>> --- /dev/null
>> +++ b/target/linux/ramips/dts/WIZFI630A.dts
>> @@ -0,0 +1,304 @@
>> +/dts-v1/;
>> +
>> +/include/ "rt5350.dtsi"
>> +
>> +/ {
>> +    compatible = "wizfi630a", "ralink,rt5350-soc";
>> +    model = "WIZnet WizFi630A";
>> +
>> +        chosen {
>> +                bootargs = "console=ttyS1,115200";
>> +        };
>> +
>> +    palmbus at 10000000 {
>> +        gpio1: gpio at 660 {
>> +                        status = "okay";
>> +                };
>> +
>> +        spi at b00 {
>> +            status = "okay";
>> +
>> +            m25p80 at 0 {
>> +                #address-cells = <1>;
>> +                #size-cells = <1>;
>> +                compatible = "w25q128";
>> +                reg = <0>;
>> +                linux,modalias = "m25p80", "w25q128";
>> +                spi-max-frequency = <10000000>;
>> +
>> +                partition at 0 {
>> +                    label = "uboot";
>> +                    reg = <0x0 0x30000>;
>> +                    read-only;
>> +                };
>> +
>> +                partition at 30000 {
>> +                    label = "uboot-env";
>> +                    reg = <0x30000 0x10000>;
>> +                    read-only;
>> +                };
>> +
>> +                factory: partition at 40000 {
>> +                    label = "factory";
>> +                    reg = <0x40000 0x10000>;
>> +                    read-only;
>> +                };
>> +
>> +                partition at 50000 {
>> +                    label = "firmware";
>> +                    reg = <0x50000 0xfb0000>;
>> +                };
>> +            };
>> +        };
>> +
>> +                uart at 500 {
>> +                        compatible = "ralink,mt7620a-uart",
>> "ralink,rt2880-uart", "ns16550a";
>> +                        reg = <0x500 0x100>;
>> +
>> +                        resets = <&rstctrl 12>;
>> +                        reset-names = "uart";
>> +
>> +                        interrupt-parent = <&intc>;
>> +                        interrupts = <5>;
>> +
>> +                        reg-shift = <2>;
>> +
>> +                        status = "okay";
>> +                };
>> +
>> +
>> +                uartlite at c00 {
>> +                        compatible = "ralink,mt7620a-uart",
>> "ralink,rt2880-uart", "ns16550a";
>> +                        reg = <0xc00 0x100>;
>> +
>> +                        resets = <&rstctrl 19>;
>> +                        reset-names = "uartl";
>> +
>> +                        interrupt-parent = <&intc>;
>> +                        interrupts = <12>;
>> +
>> +                        reg-shift = <2>;
>> +
>> +                        pinctrl-names = "default";
>> +                        pinctrl-0 = <&uartlite_pins>;
>> +                };
>> +    };
>> +
>> +    pinctrl {
>> +        state_default: pinctrl0 {
>> +            gpio {
>> +                ralink,group = "i2c", "jtag" ;
>> +                ralink,function = "gpio";
>> +            };
>> +        };
>> +
>> +                uartf_gpio_pins: uartf_gpio {
>> +                        uartf_gpio {
>> +                                ralink,group = "uartf";
>> +                                //ralink,function = "gpio uartf";
>> +                                ralink,function = "uartf";
>> +                        };
>> +                };
>> +
>> +                uartlite_pins: uartlite {
>> +                        uart {
>> +                                ralink,group = "uartlite";
>> +                                ralink,function = "uartlite";
>> +                        };
>> +                };
>> +    };
>> +
>> +    ethernet at 10100000 {
>> +        mtd-mac-address = <&factory 0x4>;
>> +    };
>> +
>> +    esw at 10110000 {
>> +                ralink,portmap = <0x17>;
>> +        };
>> +
>> +    wmac at 10180000 {
>> +        ralink,mtd-eeprom = <&factory 0>;
>> +    };
>> +
>> +    ehci at 101c0000 {
>> +        status = "okay";
>> +    };
>> +
>> +    ohci at 101c1000 {
>> +        status = "okay";
>> +    };
>> +
>> +
>> +    gpio-export {
>> +        compatible = "gpio-export";
>> +        #size-cells = <0>;
>> +/*
>> +        gpio22 {
>> +            // WAN
>> +            gpio-export,name = "gpio22";
>> +            gpio-export,direction_may_change = <1>;
>> +            gpios = <&gpio1 0 0>; // path lfd dir
>> +        };
>> +        gpio23 {
>> +            // LAN1
>> +            gpio-export,name = "gpio23";
>> +            gpio-export,direction_may_change = <1>;
>> +            gpios = <&gpio1 1 0>;
>> +        };
>> +        gpio24 {
>> +            // LAN2
>> +            gpio-export,name = "gpio24";
>> +            gpio-export,direction_may_change = <1>;
>> +            gpios = <&gpio1 2 0>;
>> +        };
>> +
>> +                // UARTF - UART1
>> +                gpio7 {
>> +                        // UARTF_RTS_N - HW Pin 6
>> +                        gpio-export,name = "gpio7";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 7 0>;
>> +                };
>> +                gpio8 {
>> +                        // UARTF_TXD - HW Pin 10
>> +                        gpio-export,name = "gpio8";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 8 0>;
>> +                };
>> +                gpio9 {
>> +                        // UARTF_CTS_N - HW Pin 5
>> +                        gpio-export,name = "gpio9";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 9 0>;
>> +                };
>> +                gpio10 {
>> +                        // UARTF_RXD - HW Pin 9
>> +                        gpio-export,name = "gpio10";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 10 0>;
>> +                };
>> +                gpio11 {
>> +                        // UARTF_DTR_N - HW Pin 8
>> +                        gpio-export,name = "gpio11";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 11 0>;
>> +                };
>> +                gpio12 {
>> +                        // UARTF_DCD_N - HW Pin 12
>> +                        gpio-export,name = "gpio12";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 12 0>;
>> +                };
>> +                gpio13 {
>> +                        // UARTF_DSR_N - HW Pin 11
>> +                        gpio-export,name = "gpio13";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 13 0>;
>> +                };
>> +                gpio14 {
>> +                        // UARTF_RIN - HW Pin 7
>> +                        gpio-export,name = "gpio14";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 14 0>;
>> +                };
>> +
>> +        // UARTLITE - UART2
>> +                gpio15 {
>> +                        // UART2_TXD  - HW Pin 20
>> +                        gpio-export,name = "gpio15";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 15 0>;
>> +                };
>> +                gpio16 {
>> +                        // UART2_RXD  - HW Pin 18
>> +                        gpio-export,name = "gpio16";
>> +                        gpio-export,direction_may_change = <1>;
>> +                        gpios = <&gpio0 16 0>;
>> +                };
>> +
>> +*/
>> +/*
>> +        // If you want to use this comment out the corrosponding
>> gpio-keys-polled
>> +        gpio0 {
>> +            // wps btn
>> +            gpio-export,name = "gpio0";
>> +            gpio-export,direction_may_change = <1>;
>> +            gpios = <&gpio0 0 1>;
>> +        };
>> +*/
>> +
>> +        gpio19 {
>> +            // SCM1
>> +            gpio-export,name = "gpio19";
>> +            gpio-export,direction_may_change = <1>;
>> +            gpios = <&gpio0 19 1>;
>> +        };
>> +        gpio2 {
>> +            // SCM2
>> +            gpio-export,name = "gpio2";
>> +            gpio-export,direction_may_change = <1>;
>> +            gpios = <&gpio0 2 1>;
>> +        };
>> +
>> +    };
>> +
>> +
>> +
>> +
>> +
>> +    gpio-leds {
>> +        compatible = "gpio-leds";
>> +        run {
>> +            label = "wizfi630a::run";
>> +            gpios = <&gpio0 1 1>;
>> +        };
>> +        uart1 {
>> +            label = "wizfi630a::uart1";
>> +            gpios = <&gpio0 18 1>;
>> +        };
>> +        uart2 {
>> +            label = "wizfi630a::uart2";
>> +            gpios = <&gpio0 21 1>;
>> +        };
>> +        wps {
>> +            label = "wizfi630a::wps";
>> +            gpios = <&gpio0 20 1>;
>> +        };
>> +    };
>> +
>> +
>> +        gpio-keys-polled {
>> +                compatible = "gpio-keys-polled";
>> +                #address-cells = <1>;
>> +                #size-cells = <0>;
>> +                poll-interval = <20>;
>> +                reset {
>> +                        label = "reset";
>> +                        gpios = <&gpio0 17 1>;
>> +                        linux,code = <0x198>;
>> +                };
>> +
>> +                wps {
>> +                        label = "wps";
>> +                        gpios = <&gpio0 0 1>;
>> +                        linux,code = <0x211>;
>> +                };
>> +/*
>> +        // If you want to use this comment out the corrosponding export
>> +                scm1 {
>> +                        label = "SCM1";
>> +                        gpios = <&gpio0 19 1>;
>> +                        linux,code = <0x100>;
>> +                };
>> +
>> +                scm2 {
>> +                        label = "SCM2";
>> +                        gpios = <&gpio0 2 1>;
>> +                        linux,code = <0x101>;
>> +                };
>> +*/
>> +
>> +        };
>> +
>> +
>> +};
>> diff --git a/target/linux/ramips/image/Makefile
>> b/target/linux/ramips/image/Makefile
>> index 409ff26..fbc6775 100644
>> --- a/target/linux/ramips/image/Makefile
>> +++ b/target/linux/ramips/image/Makefile
>> @@ -673,6 +673,8 @@ Image/Build/Profile/WNCE2001=$(call
>> BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WN
>>
>>  Image/Build/Profile/WR512-3GN=$(call
>> BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)
>>
>> +Image/Build/Profile/WIZFI630A=$(call
>> BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
>> +
>>  Image/Build/Profile/WT1520=$(call
>> BuildFirmware/PorayDualSize/$(1),$(1),wt1520,WT1520)
>>
>>  Image/Build/Profile/UR-326N4G=$(call
>> BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)
>> @@ -761,6 +763,7 @@ define Image/Build/Profile/Default
>>      $(call Image/Build/Profile/W306R_V20,$(1))
>>      $(call Image/Build/Profile/W502U,$(1))
>>      $(call Image/Build/Profile/WCR150GN,$(1))
>> +    $(call Image/Build/Profile/WIZFI630A,$(1))
>>      $(call Image/Build/Profile/WHRG300N,$(1))
>>      $(call Image/Build/Profile/WIZARD8800,$(1))
>>      $(call Image/Build/Profile/WL_330N,$(1))
>> diff --git a/target/linux/ramips/rt305x/profiles/wizfi630a.mk
>> b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
>> new file mode 100644
>> index 0000000..22136b9
>> --- /dev/null
>> +++ b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
>> @@ -0,0 +1,18 @@
>> +#
>> +# Copyright (C) 2014 OpenWrt.org
>> +#
>> +# This is free software, licensed under the GNU General Public License v2.
>> +# See /LICENSE for more information.
>> +#
>> +
>> +define Profile/WIZFI630A
>> +    NAME:=WIZnet WizFi630A
>> +    PACKAGES:=\
>> +        kmod-usb-core kmod-usb-ohci kmod-usb2
>> +endef
>> +
>> +define Profile/WIZFI630A/Description
>> +    Package set for WIZnet WizFi630A board
>> +endef
>> +
>> +$(eval $(call Profile,WIZFI630A))
>> --
>> 1.7.10.4
>>
>>
>>
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From s.demeszko at wireless-instruments.com  Mon Aug 17 07:51:39 2015
From: s.demeszko at wireless-instruments.com (=?UTF-8?B?U8WCYXdvbWlyIERlbWVzemtv?=)
Date: Mon, 17 Aug 2015 13:51:39 +0200
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
In-Reply-To: <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
 <55D17F03.5080101@openwrt.org>
 <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>
Message-ID: <55D1CACB.6010006@wireless-instruments.com>

W dniu 17.08.2015 o 13:24, Piotr Dymacz pisze:
 > It seems that there are some people who don't like the changes

Hi.

Don't bother that kind of people. There will be always someone who like mess. Cleanup is 
always good, especially for other people, who need to work with that code later. OpenWRT 
developers introduced some rules for patches due the same reason. Thanks for your work.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tw at wiznet.eu  Mon Aug 17 08:42:47 2015
From: tw at wiznet.eu (Tobias Welz)
Date: Mon, 17 Aug 2015 14:42:47 +0200
Subject: [OpenWrt-Devel] [PATCH] Added WIZnet WizFi630A Platform based
 on Ralink RT5350
In-Reply-To: <CA+icZUVnay8EHoexmCBQPsyCZJeK0A87t5qXHrgQ08cUm4bF-Q@mail.gmail.com>
References: <55CEF385.2010008@wiznet.eu>	<55D1C472.90109@openwrt.org>
 <CA+icZUVnay8EHoexmCBQPsyCZJeK0A87t5qXHrgQ08cUm4bF-Q@mail.gmail.com>
Message-ID: <55D1D6C7.5090708@wiznet.eu>

Hello Sedat,

thanks for the hints, I had already git installed but i did not know 
about git send-email.
I'll send the reworked patch via git send-email later.
Maybe it would be a good idea to mention git send-email in the wiki 
also: https://dev.openwrt.org/wiki/SubmittingPatches

Kind regards
Tobias

-------- Original Message --------
Subject: Re: [OpenWrt-Devel] [PATCH] Added WIZnet WizFi630A Platform 
based on Ralink RT5350
From: Sedat Dilek <sedat.dilek at gmail.com>
To: John Crispin <blogic at openwrt.org>
Cc: Tobias Welz <tw at wiznet.eu>, openwrt-devel at lists.openwrt.org
Date: 17.8.2015 13:41:21
> On Mon, Aug 17, 2015 at 1:24 PM, John Crispin <blogic at openwrt.org> wrote:
>> Hi Tobias,
>>
>> Thanks for the patch. unfortunately its line mangled and white space
>> broken. also it seems you sent a HTML email. If you take a few minutes
>> to setup git, you can use "git send-email" to avoid these issues.
>>
> On Debian/Ubuntu install "git send-email" or check your distubition's
> docs and help...
>
>     root# apt-get update && apt-get install git-email
>
> Feel free to adapt my local dot-gitconfig...
>
> $ cat ~/.gitconfig
> [user]
>          name   = Sedat Dilek
>          email  = sedat.dilek at gmail.com
>
> [core]
>          abbrev = 12
>
> [format]
>          subjectprefix = PATCH
>          signoff = false
>
> [pretty]
>          fixes = Fixes: %h (\"%s\")
>
> [push]
>          default = matching
>
> [sendemail]
>          smtpserver = smtp.gmail.com
>          smtpserverport = 587
>          smtpencryption = tls
>          smtpuser = sedat.dilek at gmail.com
>
> Hope this helps.
>
> - sed@ -
>
>
>>          John
>>
>>
>> On 15/08/2015 10:08, Tobias Welz wrote:
>>> Hello OpenWrt Developers,
>>>
>>> I added the WIZnet WizFi630A Platform to the trunk. The board is based
>>> on Ralink RT5350 in MiniPci Express Form Factor.
>>>
>>> Kind regards
>>> Tobias Welz
>>>
>>>
>>>
>>>  From bd69bb513e36abda43e86f0eb64caf004260e415 Mon Sep 17 00:00:00 2001
>>> From: Tobias Welz <tw at wiznet.eu>
>>> Date: Sat, 15 Aug 2015 02:30:34 +0200
>>> Subject: [PATCH] Added WIZnet WizFi630A Platform based on Ralink RT5350
>>>
>>>
>>> Signed-off-by: Tobias Welz <tw at wiznet.eu>
>>> ---
>>>   .../linux/ramips/base-files/etc/board.d/02_network |    6 +
>>>   target/linux/ramips/base-files/etc/diag.sh         |    3 +
>>>   target/linux/ramips/base-files/lib/ramips.sh       |    3 +
>>>   .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
>>>   target/linux/ramips/dts/WIZFI630A.dts              |  304
>>> ++++++++++++++++++++
>>>   target/linux/ramips/image/Makefile                 |    3 +
>>>   target/linux/ramips/rt305x/profiles/wizfi630a.mk   |   18 ++
>>>   7 files changed, 338 insertions(+)
>>>   create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
>>>   create mode 100644 target/linux/ramips/rt305x/profiles/wizfi630a.mk
>>>
>>> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
>>> b/target/linux/ramips/base-files/etc/board.d/02_network
>>> index da1854a..c211ab9 100755
>>> --- a/target/linux/ramips/base-files/etc/board.d/02_network
>>> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
>>> @@ -235,6 +235,7 @@ ramips_setup_interfaces()
>>>           ucidef_add_switch_vlan "switch0" "2" "4 6t"
>>>           ;;
>>>
>>> +    wizfi630a | \
>>>       y1s)
>>>           ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>>>           ucidef_add_switch "switch0" "1" "1"
>>> @@ -297,6 +298,11 @@ ramips_setup_macs()
>>>           wan_mac=$(mtd_get_mac_binary factory 46)
>>>           ;;
>>>
>>> +    wizfi630a)
>>> +        lan_mac=$(mtd_get_mac_binary factory 4)
>>> +        wan_mac=$(mtd_get_mac_binary factory 40)
>>> +        ;;
>>> +
>>>       w306r-v20)
>>>           lan_mac=$(cat /sys/class/net/eth0/address)
>>>           wan_mac=$(macaddr_add "$lan_mac" 5)
>>> diff --git a/target/linux/ramips/base-files/etc/diag.sh
>>> b/target/linux/ramips/base-files/etc/diag.sh
>>> index e63f0df..3ffcc22 100644
>>> --- a/target/linux/ramips/base-files/etc/diag.sh
>>> +++ b/target/linux/ramips/base-files/etc/diag.sh
>>> @@ -252,6 +252,9 @@ get_status_led() {
>>>       zte-q7)
>>>           status_led="zte:red:status"
>>>           ;;
>>> +    wizfi630a)
>>> +        status_led="wizfi630a::run"
>>> +        ;;
>>>       mzk-dp150n)
>>>           status_led="mzkdp150n:green:power"
>>>           ;;
>>> diff --git a/target/linux/ramips/base-files/lib/ramips.sh
>>> b/target/linux/ramips/base-files/lib/ramips.sh
>>> index 7db6d37..474fdb8 100755
>>> --- a/target/linux/ramips/base-files/lib/ramips.sh
>>> +++ b/target/linux/ramips/base-files/lib/ramips.sh
>>> @@ -430,6 +430,9 @@ ramips_board_detect() {
>>>       *"Planex MZK-DP150N")
>>>           name="mzk-dp150n"
>>>           ;;
>>> +     *"WIZnet WizFi630A")
>>> +                name="wizfi630a"
>>> +                ;;
>>>       *)
>>>           name="generic"
>>>           ;;
>>> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
>>> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
>>> index 8221997..bdc6be9 100755
>>> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
>>> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
>>> @@ -105,6 +105,7 @@ platform_check_image() {
>>>       whr-300hp2 |\
>>>       whr-600d |\
>>>       whr-1166d |\
>>> +    wizfi630a |\
>>>       wsr-600 |\
>>>       wl-330n | \
>>>       wl-330n3g | \
>>> diff --git a/target/linux/ramips/dts/WIZFI630A.dts
>>> b/target/linux/ramips/dts/WIZFI630A.dts
>>> new file mode 100644
>>> index 0000000..b3f655d
>>> --- /dev/null
>>> +++ b/target/linux/ramips/dts/WIZFI630A.dts
>>> @@ -0,0 +1,304 @@
>>> +/dts-v1/;
>>> +
>>> +/include/ "rt5350.dtsi"
>>> +
>>> +/ {
>>> +    compatible = "wizfi630a", "ralink,rt5350-soc";
>>> +    model = "WIZnet WizFi630A";
>>> +
>>> +        chosen {
>>> +                bootargs = "console=ttyS1,115200";
>>> +        };
>>> +
>>> +    palmbus at 10000000 {
>>> +        gpio1: gpio at 660 {
>>> +                        status = "okay";
>>> +                };
>>> +
>>> +        spi at b00 {
>>> +            status = "okay";
>>> +
>>> +            m25p80 at 0 {
>>> +                #address-cells = <1>;
>>> +                #size-cells = <1>;
>>> +                compatible = "w25q128";
>>> +                reg = <0>;
>>> +                linux,modalias = "m25p80", "w25q128";
>>> +                spi-max-frequency = <10000000>;
>>> +
>>> +                partition at 0 {
>>> +                    label = "uboot";
>>> +                    reg = <0x0 0x30000>;
>>> +                    read-only;
>>> +                };
>>> +
>>> +                partition at 30000 {
>>> +                    label = "uboot-env";
>>> +                    reg = <0x30000 0x10000>;
>>> +                    read-only;
>>> +                };
>>> +
>>> +                factory: partition at 40000 {
>>> +                    label = "factory";
>>> +                    reg = <0x40000 0x10000>;
>>> +                    read-only;
>>> +                };
>>> +
>>> +                partition at 50000 {
>>> +                    label = "firmware";
>>> +                    reg = <0x50000 0xfb0000>;
>>> +                };
>>> +            };
>>> +        };
>>> +
>>> +                uart at 500 {
>>> +                        compatible = "ralink,mt7620a-uart",
>>> "ralink,rt2880-uart", "ns16550a";
>>> +                        reg = <0x500 0x100>;
>>> +
>>> +                        resets = <&rstctrl 12>;
>>> +                        reset-names = "uart";
>>> +
>>> +                        interrupt-parent = <&intc>;
>>> +                        interrupts = <5>;
>>> +
>>> +                        reg-shift = <2>;
>>> +
>>> +                        status = "okay";
>>> +                };
>>> +
>>> +
>>> +                uartlite at c00 {
>>> +                        compatible = "ralink,mt7620a-uart",
>>> "ralink,rt2880-uart", "ns16550a";
>>> +                        reg = <0xc00 0x100>;
>>> +
>>> +                        resets = <&rstctrl 19>;
>>> +                        reset-names = "uartl";
>>> +
>>> +                        interrupt-parent = <&intc>;
>>> +                        interrupts = <12>;
>>> +
>>> +                        reg-shift = <2>;
>>> +
>>> +                        pinctrl-names = "default";
>>> +                        pinctrl-0 = <&uartlite_pins>;
>>> +                };
>>> +    };
>>> +
>>> +    pinctrl {
>>> +        state_default: pinctrl0 {
>>> +            gpio {
>>> +                ralink,group = "i2c", "jtag" ;
>>> +                ralink,function = "gpio";
>>> +            };
>>> +        };
>>> +
>>> +                uartf_gpio_pins: uartf_gpio {
>>> +                        uartf_gpio {
>>> +                                ralink,group = "uartf";
>>> +                                //ralink,function = "gpio uartf";
>>> +                                ralink,function = "uartf";
>>> +                        };
>>> +                };
>>> +
>>> +                uartlite_pins: uartlite {
>>> +                        uart {
>>> +                                ralink,group = "uartlite";
>>> +                                ralink,function = "uartlite";
>>> +                        };
>>> +                };
>>> +    };
>>> +
>>> +    ethernet at 10100000 {
>>> +        mtd-mac-address = <&factory 0x4>;
>>> +    };
>>> +
>>> +    esw at 10110000 {
>>> +                ralink,portmap = <0x17>;
>>> +        };
>>> +
>>> +    wmac at 10180000 {
>>> +        ralink,mtd-eeprom = <&factory 0>;
>>> +    };
>>> +
>>> +    ehci at 101c0000 {
>>> +        status = "okay";
>>> +    };
>>> +
>>> +    ohci at 101c1000 {
>>> +        status = "okay";
>>> +    };
>>> +
>>> +
>>> +    gpio-export {
>>> +        compatible = "gpio-export";
>>> +        #size-cells = <0>;
>>> +/*
>>> +        gpio22 {
>>> +            // WAN
>>> +            gpio-export,name = "gpio22";
>>> +            gpio-export,direction_may_change = <1>;
>>> +            gpios = <&gpio1 0 0>; // path lfd dir
>>> +        };
>>> +        gpio23 {
>>> +            // LAN1
>>> +            gpio-export,name = "gpio23";
>>> +            gpio-export,direction_may_change = <1>;
>>> +            gpios = <&gpio1 1 0>;
>>> +        };
>>> +        gpio24 {
>>> +            // LAN2
>>> +            gpio-export,name = "gpio24";
>>> +            gpio-export,direction_may_change = <1>;
>>> +            gpios = <&gpio1 2 0>;
>>> +        };
>>> +
>>> +                // UARTF - UART1
>>> +                gpio7 {
>>> +                        // UARTF_RTS_N - HW Pin 6
>>> +                        gpio-export,name = "gpio7";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 7 0>;
>>> +                };
>>> +                gpio8 {
>>> +                        // UARTF_TXD - HW Pin 10
>>> +                        gpio-export,name = "gpio8";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 8 0>;
>>> +                };
>>> +                gpio9 {
>>> +                        // UARTF_CTS_N - HW Pin 5
>>> +                        gpio-export,name = "gpio9";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 9 0>;
>>> +                };
>>> +                gpio10 {
>>> +                        // UARTF_RXD - HW Pin 9
>>> +                        gpio-export,name = "gpio10";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 10 0>;
>>> +                };
>>> +                gpio11 {
>>> +                        // UARTF_DTR_N - HW Pin 8
>>> +                        gpio-export,name = "gpio11";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 11 0>;
>>> +                };
>>> +                gpio12 {
>>> +                        // UARTF_DCD_N - HW Pin 12
>>> +                        gpio-export,name = "gpio12";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 12 0>;
>>> +                };
>>> +                gpio13 {
>>> +                        // UARTF_DSR_N - HW Pin 11
>>> +                        gpio-export,name = "gpio13";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 13 0>;
>>> +                };
>>> +                gpio14 {
>>> +                        // UARTF_RIN - HW Pin 7
>>> +                        gpio-export,name = "gpio14";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 14 0>;
>>> +                };
>>> +
>>> +        // UARTLITE - UART2
>>> +                gpio15 {
>>> +                        // UART2_TXD  - HW Pin 20
>>> +                        gpio-export,name = "gpio15";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 15 0>;
>>> +                };
>>> +                gpio16 {
>>> +                        // UART2_RXD  - HW Pin 18
>>> +                        gpio-export,name = "gpio16";
>>> +                        gpio-export,direction_may_change = <1>;
>>> +                        gpios = <&gpio0 16 0>;
>>> +                };
>>> +
>>> +*/
>>> +/*
>>> +        // If you want to use this comment out the corrosponding
>>> gpio-keys-polled
>>> +        gpio0 {
>>> +            // wps btn
>>> +            gpio-export,name = "gpio0";
>>> +            gpio-export,direction_may_change = <1>;
>>> +            gpios = <&gpio0 0 1>;
>>> +        };
>>> +*/
>>> +
>>> +        gpio19 {
>>> +            // SCM1
>>> +            gpio-export,name = "gpio19";
>>> +            gpio-export,direction_may_change = <1>;
>>> +            gpios = <&gpio0 19 1>;
>>> +        };
>>> +        gpio2 {
>>> +            // SCM2
>>> +            gpio-export,name = "gpio2";
>>> +            gpio-export,direction_may_change = <1>;
>>> +            gpios = <&gpio0 2 1>;
>>> +        };
>>> +
>>> +    };
>>> +
>>> +
>>> +
>>> +
>>> +
>>> +    gpio-leds {
>>> +        compatible = "gpio-leds";
>>> +        run {
>>> +            label = "wizfi630a::run";
>>> +            gpios = <&gpio0 1 1>;
>>> +        };
>>> +        uart1 {
>>> +            label = "wizfi630a::uart1";
>>> +            gpios = <&gpio0 18 1>;
>>> +        };
>>> +        uart2 {
>>> +            label = "wizfi630a::uart2";
>>> +            gpios = <&gpio0 21 1>;
>>> +        };
>>> +        wps {
>>> +            label = "wizfi630a::wps";
>>> +            gpios = <&gpio0 20 1>;
>>> +        };
>>> +    };
>>> +
>>> +
>>> +        gpio-keys-polled {
>>> +                compatible = "gpio-keys-polled";
>>> +                #address-cells = <1>;
>>> +                #size-cells = <0>;
>>> +                poll-interval = <20>;
>>> +                reset {
>>> +                        label = "reset";
>>> +                        gpios = <&gpio0 17 1>;
>>> +                        linux,code = <0x198>;
>>> +                };
>>> +
>>> +                wps {
>>> +                        label = "wps";
>>> +                        gpios = <&gpio0 0 1>;
>>> +                        linux,code = <0x211>;
>>> +                };
>>> +/*
>>> +        // If you want to use this comment out the corrosponding export
>>> +                scm1 {
>>> +                        label = "SCM1";
>>> +                        gpios = <&gpio0 19 1>;
>>> +                        linux,code = <0x100>;
>>> +                };
>>> +
>>> +                scm2 {
>>> +                        label = "SCM2";
>>> +                        gpios = <&gpio0 2 1>;
>>> +                        linux,code = <0x101>;
>>> +                };
>>> +*/
>>> +
>>> +        };
>>> +
>>> +
>>> +};
>>> diff --git a/target/linux/ramips/image/Makefile
>>> b/target/linux/ramips/image/Makefile
>>> index 409ff26..fbc6775 100644
>>> --- a/target/linux/ramips/image/Makefile
>>> +++ b/target/linux/ramips/image/Makefile
>>> @@ -673,6 +673,8 @@ Image/Build/Profile/WNCE2001=$(call
>>> BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WN
>>>
>>>   Image/Build/Profile/WR512-3GN=$(call
>>> BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)
>>>
>>> +Image/Build/Profile/WIZFI630A=$(call
>>> BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
>>> +
>>>   Image/Build/Profile/WT1520=$(call
>>> BuildFirmware/PorayDualSize/$(1),$(1),wt1520,WT1520)
>>>
>>>   Image/Build/Profile/UR-326N4G=$(call
>>> BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)
>>> @@ -761,6 +763,7 @@ define Image/Build/Profile/Default
>>>       $(call Image/Build/Profile/W306R_V20,$(1))
>>>       $(call Image/Build/Profile/W502U,$(1))
>>>       $(call Image/Build/Profile/WCR150GN,$(1))
>>> +    $(call Image/Build/Profile/WIZFI630A,$(1))
>>>       $(call Image/Build/Profile/WHRG300N,$(1))
>>>       $(call Image/Build/Profile/WIZARD8800,$(1))
>>>       $(call Image/Build/Profile/WL_330N,$(1))
>>> diff --git a/target/linux/ramips/rt305x/profiles/wizfi630a.mk
>>> b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
>>> new file mode 100644
>>> index 0000000..22136b9
>>> --- /dev/null
>>> +++ b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
>>> @@ -0,0 +1,18 @@
>>> +#
>>> +# Copyright (C) 2014 OpenWrt.org
>>> +#
>>> +# This is free software, licensed under the GNU General Public License v2.
>>> +# See /LICENSE for more information.
>>> +#
>>> +
>>> +define Profile/WIZFI630A
>>> +    NAME:=WIZnet WizFi630A
>>> +    PACKAGES:=\
>>> +        kmod-usb-core kmod-usb-ohci kmod-usb2
>>> +endef
>>> +
>>> +define Profile/WIZFI630A/Description
>>> +    Package set for WIZnet WizFi630A board
>>> +endef
>>> +
>>> +$(eval $(call Profile,WIZFI630A))
>>> --
>>> 1.7.10.4
>>>
>>>
>>>
>>> _______________________________________________
>>> openwrt-devel mailing list
>>> openwrt-devel at lists.openwrt.org
>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/a7852921/attachment.htm>

From aclass="moz-txt-link-rfc2396E"href="mailto:tw at wiznet.eu"  Fri Aug 14 20:30:34 2015
From: aclass="moz-txt-link-rfc2396E"href="mailto:tw at wiznet.eu" (Tobias Welz)
Date: Sat, 15 Aug 2015 02:30:34 +0200
Subject: [PATCH] Added WIZnet WizFi630A Platform based on Ralink RT5350
Message-ID: <mailman.116.1593078805.4661.openwrt-devel@lists.openwrt.org>


Signed-off-by: Tobias Welz <a class="moz-txt-link-rfc2396E" href="mailto:tw at wiznet.eu">&lt;tw at wiznet.eu&gt;</a>
---
 .../linux/ramips/base-files/etc/board.d/02_network |    6 +
 target/linux/ramips/base-files/etc/diag.sh         |    3 +
 target/linux/ramips/base-files/lib/ramips.sh       |    3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
 target/linux/ramips/dts/WIZFI630A.dts              |  304
++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |    3 +
 target/linux/ramips/rt305x/profiles/wizfi630a.mk   |   18 ++
 7 files changed, 338 insertions(+)
 create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
 create mode 100644 target/linux/ramips/rt305x/profiles/wizfi630a.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
b/target/linux/ramips/base-files/etc/board.d/02_network
index da1854a..c211ab9 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -235,6 +235,7 @@ ramips_setup_interfaces()
         ucidef_add_switch_vlan "switch0" "2" "4 6t"
         ;;

+    wizfi630a | \
     y1s)
         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
         ucidef_add_switch "switch0" "1" "1"
@@ -297,6 +298,11 @@ ramips_setup_macs()
         wan_mac=$(mtd_get_mac_binary factory 46)
         ;;

+    wizfi630a)
+        lan_mac=$(mtd_get_mac_binary factory 4)
+        wan_mac=$(mtd_get_mac_binary factory 40)
+        ;;
+
     w306r-v20)
         lan_mac=$(cat /sys/class/net/eth0/address)
         wan_mac=$(macaddr_add "$lan_mac" 5)
diff --git a/target/linux/ramips/base-files/etc/diag.sh
b/target/linux/ramips/base-files/etc/diag.sh
index e63f0df..3ffcc22 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -252,6 +252,9 @@ get_status_led() {
     zte-q7)
         status_led="zte:red:status"
         ;;
+    wizfi630a)
+        status_led="wizfi630a::run"
+        ;;
     mzk-dp150n)
         status_led="mzkdp150n:green:power"
         ;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh
b/target/linux/ramips/base-files/lib/ramips.sh
index 7db6d37..474fdb8 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -430,6 +430,9 @@ ramips_board_detect() {
     *"Planex MZK-DP150N")
         name="mzk-dp150n"
         ;;
+     *"WIZnet WizFi630A")
+                name="wizfi630a"
+                ;;
     *)
         name="generic"
         ;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 8221997..bdc6be9 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -105,6 +105,7 @@ platform_check_image() {
     whr-300hp2 |\
     whr-600d |\
     whr-1166d |\
+    wizfi630a |\
     wsr-600 |\
     wl-330n | \
     wl-330n3g | \
diff --git a/target/linux/ramips/dts/WIZFI630A.dts
b/target/linux/ramips/dts/WIZFI630A.dts
new file mode 100644
index 0000000..b3f655d
--- /dev/null
+++ b/target/linux/ramips/dts/WIZFI630A.dts
@@ -0,0 +1,304 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+    compatible = "wizfi630a", "ralink,rt5350-soc";
+    model = "WIZnet WizFi630A";
+
+        chosen {
+                bootargs = "console=ttyS1,115200";
+        };
+
+    palmbus at 10000000 {
+        gpio1: gpio at 660 {
+                        status = "okay";
+                };
+
+        spi at b00 {
+            status = "okay";
+
+            m25p80 at 0 {
+                #address-cells = &lt;1&gt;;
+                #size-cells = &lt;1&gt;;
+                compatible = "w25q128";
+                reg = &lt;0&gt;;
+                linux,modalias = "m25p80", "w25q128";
+                spi-max-frequency = &lt;10000000&gt;;
+
+                partition at 0 {
+                    label = "uboot";
+                    reg = &lt;0x0 0x30000&gt;;
+                    read-only;
+                };
+
+                partition at 30000 {
+                    label = "uboot-env";
+                    reg = &lt;0x30000 0x10000&gt;;
+                    read-only;
+                };
+
+                factory: partition at 40000 {
+                    label = "factory";
+                    reg = &lt;0x40000 0x10000&gt;;
+                    read-only;
+                };
+
+                partition at 50000 {
+                    label = "firmware";
+                    reg = &lt;0x50000 0xfb0000&gt;;
+                };
+            };
+        };
+
+                uart at 500 {
+                        compatible = "ralink,mt7620a-uart",
"ralink,rt2880-uart", "ns16550a";
+                        reg = &lt;0x500 0x100&gt;;
+
+                        resets = &lt;&amp;rstctrl 12&gt;;
+                        reset-names = "uart";
+
+                        interrupt-parent = &lt;&amp;intc&gt;;
+                        interrupts = &lt;5&gt;;
+
+                        reg-shift = &lt;2&gt;;
+
+                        status = "okay";
+                };
+
+
+                uartlite at c00 {
+                        compatible = "ralink,mt7620a-uart",
"ralink,rt2880-uart", "ns16550a";
+                        reg = &lt;0xc00 0x100&gt;;
+
+                        resets = &lt;&amp;rstctrl 19&gt;;
+                        reset-names = "uartl";
+
+                        interrupt-parent = &lt;&amp;intc&gt;;
+                        interrupts = &lt;12&gt;;
+
+                        reg-shift = &lt;2&gt;;
+
+                        pinctrl-names = "default";
+                        pinctrl-0 = &lt;&amp;uartlite_pins&gt;;
+                };
+    };
+
+    pinctrl {
+        state_default: pinctrl0 {
+            gpio {
+                ralink,group = "i2c", "jtag" ;
+                ralink,function = "gpio";
+            };
+        };
+
+                uartf_gpio_pins: uartf_gpio {
+                        uartf_gpio {
+                                ralink,group = "uartf";
+                                //ralink,function = "gpio uartf";
+                                ralink,function = "uartf";
+                        };
+                };
+
+                uartlite_pins: uartlite {
+                        uart {
+                                ralink,group = "uartlite";
+                                ralink,function = "uartlite";
+                        };
+                };
+    };
+
+    ethernet at 10100000 {
+        mtd-mac-address = &lt;&amp;factory 0x4&gt;;
+    };
+
+    esw at 10110000 {
+                ralink,portmap = &lt;0x17&gt;;
+        };
+
+    wmac at 10180000 {
+        ralink,mtd-eeprom = &lt;&amp;factory 0&gt;;
+    };
+
+    ehci at 101c0000 {
+        status = "okay";
+    };
+
+    ohci at 101c1000 {
+        status = "okay";
+    };
+
+
+    gpio-export {
+        compatible = "gpio-export";
+        #size-cells = &lt;0&gt;;
+/*
+        gpio22 {
+            // WAN
+            gpio-export,name = "gpio22";
+            gpio-export,direction_may_change = &lt;1&gt;;
+            gpios = &lt;&amp;gpio1 0 0&gt;; // path lfd dir
+        };
+        gpio23 {
+            // LAN1
+            gpio-export,name = "gpio23";
+            gpio-export,direction_may_change = &lt;1&gt;;
+            gpios = &lt;&amp;gpio1 1 0&gt;;
+        };
+        gpio24 {
+            // LAN2
+            gpio-export,name = "gpio24";
+            gpio-export,direction_may_change = &lt;1&gt;;
+            gpios = &lt;&amp;gpio1 2 0&gt;;
+        };
+
+                // UARTF - UART1
+                gpio7 {
+                        // UARTF_RTS_N - HW Pin 6
+                        gpio-export,name = "gpio7";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 7 0&gt;;
+                };
+                gpio8 {
+                        // UARTF_TXD - HW Pin 10
+                        gpio-export,name = "gpio8";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 8 0&gt;;
+                };
+                gpio9 {
+                        // UARTF_CTS_N - HW Pin 5
+                        gpio-export,name = "gpio9";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 9 0&gt;;
+                };
+                gpio10 {
+                        // UARTF_RXD - HW Pin 9
+                        gpio-export,name = "gpio10";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 10 0&gt;;
+                };
+                gpio11 {
+                        // UARTF_DTR_N - HW Pin 8
+                        gpio-export,name = "gpio11";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 11 0&gt;;
+                };
+                gpio12 {
+                        // UARTF_DCD_N - HW Pin 12
+                        gpio-export,name = "gpio12";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 12 0&gt;;
+                };
+                gpio13 {
+                        // UARTF_DSR_N - HW Pin 11
+                        gpio-export,name = "gpio13";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 13 0&gt;;
+                };
+                gpio14 {
+                        // UARTF_RIN - HW Pin 7
+                        gpio-export,name = "gpio14";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 14 0&gt;;
+                };
+
+        // UARTLITE - UART2
+                gpio15 {
+                        // UART2_TXD  - HW Pin 20
+                        gpio-export,name = "gpio15";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 15 0&gt;;
+                };
+                gpio16 {
+                        // UART2_RXD  - HW Pin 18
+                        gpio-export,name = "gpio16";
+                        gpio-export,direction_may_change = &lt;1&gt;;
+                        gpios = &lt;&amp;gpio0 16 0&gt;;
+                };
+
+*/
+/*
+        // If you want to use this comment out the corrosponding
gpio-keys-polled
+        gpio0 {
+            // wps btn
+            gpio-export,name = "gpio0";
+            gpio-export,direction_may_change = &lt;1&gt;;
+            gpios = &lt;&amp;gpio0 0 1&gt;;
+        };
+*/
+
+        gpio19 {
+            // SCM1
+            gpio-export,name = "gpio19";
+            gpio-export,direction_may_change = &lt;1&gt;;
+            gpios = &lt;&amp;gpio0 19 1&gt;;
+        };
+        gpio2 {
+            // SCM2
+            gpio-export,name = "gpio2";
+            gpio-export,direction_may_change = &lt;1&gt;;
+            gpios = &lt;&amp;gpio0 2 1&gt;;
+        };
+
+    };
+
+
+
+
+
+    gpio-leds {
+        compatible = "gpio-leds";
+        run {
+            label = "wizfi630a::run";
+            gpios = &lt;&amp;gpio0 1 1&gt;;
+        };
+        uart1 {
+            label = "wizfi630a::uart1";
+            gpios = &lt;&amp;gpio0 18 1&gt;;
+        };
+        uart2 {
+            label = "wizfi630a::uart2";
+            gpios = &lt;&amp;gpio0 21 1&gt;;
+        };
+        wps {
+            label = "wizfi630a::wps";
+            gpios = &lt;&amp;gpio0 20 1&gt;;
+        };
+    };
+
+
+        gpio-keys-polled {
+                compatible = "gpio-keys-polled";
+                #address-cells = &lt;1&gt;;
+                #size-cells = &lt;0&gt;;
+                poll-interval = &lt;20&gt;;
+                reset {
+                        label = "reset";
+                        gpios = &lt;&amp;gpio0 17 1&gt;;
+                        linux,code = &lt;0x198&gt;;
+                };
+
+                wps {
+                        label = "wps";
+                        gpios = &lt;&amp;gpio0 0 1&gt;;
+                        linux,code = &lt;0x211&gt;;
+                };
+/*
+        // If you want to use this comment out the corrosponding export
+                scm1 {
+                        label = "SCM1";
+                        gpios = &lt;&amp;gpio0 19 1&gt;;
+                        linux,code = &lt;0x100&gt;;
+                };
+
+                scm2 {
+                        label = "SCM2";
+                        gpios = &lt;&amp;gpio0 2 1&gt;;
+                        linux,code = &lt;0x101&gt;;
+                };
+*/
+
+        };
+
+
+};
diff --git a/target/linux/ramips/image/Makefile
b/target/linux/ramips/image/Makefile
index 409ff26..fbc6775 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -673,6 +673,8 @@ Image/Build/Profile/WNCE2001=$(call
BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WN

 Image/Build/Profile/WR512-3GN=$(call
BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)

+Image/Build/Profile/WIZFI630A=$(call
BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
+
 Image/Build/Profile/WT1520=$(call
BuildFirmware/PorayDualSize/$(1),$(1),wt1520,WT1520)

 Image/Build/Profile/UR-326N4G=$(call
BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)
@@ -761,6 +763,7 @@ define Image/Build/Profile/Default
     $(call Image/Build/Profile/W306R_V20,$(1))
     $(call Image/Build/Profile/W502U,$(1))
     $(call Image/Build/Profile/WCR150GN,$(1))
+    $(call Image/Build/Profile/WIZFI630A,$(1))
     $(call Image/Build/Profile/WHRG300N,$(1))
     $(call Image/Build/Profile/WIZARD8800,$(1))
     $(call Image/Build/Profile/WL_330N,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/wizfi630a.mk
b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
new file mode 100644
index 0000000..22136b9
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/WIZFI630A
+    NAME:=WIZnet WizFi630A
+    PACKAGES:=\
+        kmod-usb-core kmod-usb-ohci kmod-usb2
+endef
+
+define Profile/WIZFI630A/Description
+    Package set for WIZnet WizFi630A board
+endef
+
+$(eval $(call Profile,WIZFI630A))
--
1.7.10.4



_______________________________________________
openwrt-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:openwrt-devel at lists.openwrt.org">openwrt-devel at lists.openwrt.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a>

</pre>
        </blockquote>
        <pre wrap="">_______________________________________________
openwrt-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:openwrt-devel at lists.openwrt.org">openwrt-devel at lists.openwrt.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a>
</pre>
      </blockquote>
    </blockquote>
    <br>
    <div style="bottom: auto; left: 580px; right: auto; top: 102px;
      display: none;" class="translator-theme-default"
      id="translator-floating-panel">
      <div title="Zum ??bersetzen klicken"
        id="translator-floating-panel-button"></div>
    </div>
  </body>
</html>

--------------010001090206080106000807--

--===============6867360452628219917==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

--===============6867360452628219917==--


From karlp at tweak.net.au  Mon Aug 17 09:15:46 2015
From: karlp at tweak.net.au (Karl Palsson)
Date: Mon, 17 Aug 2015 13:15:46 +0000
Subject: [OpenWrt-Devel] [PATCH 1/2] lua: use pkg-config built in module to
	search for alternatives
Message-ID: <1439817346-9275-1-git-send-email-karlp@tweak.net.au>

From: Karl Palsson <karlp at remake.is>

Different distributions have different names for the lua 5.1 package.
Use cmake's built in pkg-config support to search for the first one,
rather than running it explicitly and searching for a single version.

Signed-off-by: Karl Palsson <karlp at remake.is>
---

There's a line further down that attempts to invoke "lua" that also
fails if you have multiple versions of lua installed.  I'm not sure
how best to fix that though, other than to just remove it as a check.

Perhaps if you you want to enable/disable the lua building, use cmake
features for that, rather than testing for an executable lua?

 lua/CMakeLists.txt | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt
index 10c6dc1..34c9ab1 100644
--- a/lua/CMakeLists.txt
+++ b/lua/CMakeLists.txt
@@ -5,14 +5,7 @@ PROJECT(uloop C)
 SET(CMAKE_INSTALL_PREFIX /)
 
 IF(NOT LUA_CFLAGS)
-	FIND_PROGRAM(PKG_CONFIG pkg-config)
-	IF(PKG_CONFIG)
-		EXECUTE_PROCESS(
-			COMMAND pkg-config --silence-errors --cflags lua5.1
-			OUTPUT_VARIABLE LUA_CFLAGS
-			OUTPUT_STRIP_TRAILING_WHITESPACE
-		)
-	ENDIF()
+	pkg_search_module(LUA lua5.1 lua-5.1)
 ENDIF()
 
 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})
-- 
2.1.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nicholas.e.podolak at gmail.com  Mon Aug 17 10:40:16 2015
From: nicholas.e.podolak at gmail.com (Nick Podolak)
Date: Mon, 17 Aug 2015 10:40:16 -0400
Subject: [OpenWrt-Devel] [PATCH] [netifd] enable MULTICAST on GRE
In-Reply-To: <CAJLcKsHoHtFRUpX46JtkgMLwjSaw_TxxHykAxySeJ9SX7+PWHg@mail.gmail.com>
References: <CABB0dw2QZZ3P0fxTBY6ssk9vBZAh8ZDpbEF9Fc0uPefzU2jb=A@mail.gmail.com>
 <CAJLcKsHoHtFRUpX46JtkgMLwjSaw_TxxHykAxySeJ9SX7+PWHg@mail.gmail.com>
Message-ID: <CABB0dw1WHL-h+jtRrT=qu2BNwMSascEmqQueTZ73+-_1FUVESg@mail.gmail.com>

On Sat, Aug 15, 2015 at 3:25 AM, Hans Dedecker <dedeckeh at gmail.com> wrote:

> It would be better to make this a device setting like promiscuous
>> mode,macaddr, etc ... so it can be configured via UCI for every device and
>> thus not only restricted for GRE
>>
>
> Hans
>

You make an excellent point and I agree, but I'm unsure of some of the
details.

Is promisc mode controllable from UCI?  I didn't think it was but I can't
tell from looking at these parts of netifd.

Help me understand the extent of this implementation.  Looks like each of
these would need modification.  Did i miss anything?
device.c
  static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = {
  device_merge_settings(struct device *dev, struct device_settings *n)
  device_init_settings(struct device *dev, struct blob_attr **tb)
  device_dump_status(struct blob_buf *b, struct device *dev)
system-linux.c
  system_if_get_settings(struct device *dev, struct device_settings *s)
  system_if_apply_settings(struct device *dev, struct device_settings *s,
unsigned int apply_mask)

UCI is all passthrough, right? nothing there would have to change?

-Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/c2d806e1/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From Alexey.Brodkin at synopsys.com  Mon Aug 17 11:16:55 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Mon, 17 Aug 2015 18:16:55 +0300
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of uClibc-ng
Message-ID: <1439824615-23658-1-git-send-email-abrodkin@synopsys.com>

uClibc-ng is a spin-off of original uClibc, see http://www.uclibc-ng.org/

We try to regularly add changes from uClibc to uClibc-ng.
We even sent patches and bug reports to the uClibc mailing list.
The config file is compatible between uClibc-ng 1.0 and uClibc git master.
This might change in the future.

Our main goal is to provide regularly a stable and tested release
to make embedded system developers happy.

The main advantage of uClibc-ng over olde good uClibc is regular releases
so there's no need to keep tons of patches on top of years old
0.9.33.2

Build-tested for
 [1] ARM: Sunxi generic
 [2] MIPS: Netgear WNDR3600/3700/3800

Run-tested for [yet out of the tree] Synopsys Designware ARC AXS101.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Waldemar Brodkorb <wbx at uclibc-ng.org>
Cc: Mathieu Olivari <mathieu at codeaurora.org>
Cc: Felix Fietkau <nbd at openwrt.org>
Cc: John Crispin <blogic at openwrt.org>
---
 toolchain/uClibc/Config.in                         |   4 +
 toolchain/uClibc/Config.version                    |   4 +
 toolchain/uClibc/common.mk                         |  15 +-
 toolchain/uClibc/config-ng-1.0.5/arm               |   8 +
 toolchain/uClibc/config-ng-1.0.5/armeb             |   8 +
 toolchain/uClibc/config-ng-1.0.5/common            | 223 +++++++++++++++++++++
 toolchain/uClibc/config-ng-1.0.5/debug             |   6 +
 toolchain/uClibc/config-ng-1.0.5/i386              |  21 ++
 toolchain/uClibc/config-ng-1.0.5/i686              |  21 ++
 toolchain/uClibc/config-ng-1.0.5/m68k              |   6 +
 toolchain/uClibc/config-ng-1.0.5/mips              |  18 ++
 toolchain/uClibc/config-ng-1.0.5/mips64            |  18 ++
 toolchain/uClibc/config-ng-1.0.5/mips64.32         |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64.64         |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64.n32        |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64el          |  18 ++
 toolchain/uClibc/config-ng-1.0.5/mips64el.32       |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64el.64       |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64el.n32      |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mipsel            |  18 ++
 toolchain/uClibc/config-ng-1.0.5/mipsel.cobalt     |  18 ++
 toolchain/uClibc/config-ng-1.0.5/powerpc           |   6 +
 toolchain/uClibc/config-ng-1.0.5/powerpc.e500      |   6 +
 toolchain/uClibc/config-ng-1.0.5/sparc             |   8 +
 toolchain/uClibc/config-ng-1.0.5/sparc.leon        |   8 +
 toolchain/uClibc/config-ng-1.0.5/x86_64            |   6 +
 ...backward_compatibility_symlink_by_default.patch |  32 +++
 27 files changed, 583 insertions(+), 3 deletions(-)
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/arm
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/armeb
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/common
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/debug
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/i386
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/i686
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/m68k
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64.32
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64.64
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64.n32
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64el
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64el.32
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64el.64
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64el.n32
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mipsel
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mipsel.cobalt
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/powerpc
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/powerpc.e500
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/sparc
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/sparc.leon
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/x86_64
 create mode 100644 toolchain/uClibc/patches-ng-1.0.5/0001-ldso_install_backward_compatibility_symlink_by_default.patch

diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
index 08ea00a..c923bc0 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"
+
 endchoice
 
 # Debug version.
diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
index dd302f2..7238d9a 100644
--- a/toolchain/uClibc/Config.version
+++ b/toolchain/uClibc/Config.version
@@ -2,8 +2,12 @@ config UCLIBC_VERSION
 	string
 	depends on USE_UCLIBC
 	default "0.9.33.2"       if UCLIBC_VERSION_0_9_33
+	default "1.0.5"          if UCLIBC_VERSION_NG
 	default "0.9.33.2"
 
 config UCLIBC_VERSION_0_9_33
 	default y if !TOOLCHAINOPTS && USE_UCLIBC
 	bool
+
+config UCLIBC_VERSION_NG
+	bool
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index 53a8443..bce8890 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -7,15 +7,24 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/target.mk
 
-PKG_NAME:=uClibc
 PKG_VERSION:=$(call qstrip,$(CONFIG_UCLIBC_VERSION))
+
+ifeq ($(CONFIG_UCLIBC_VERSION_NG),y)
+PKG_NAME:=uClibc-ng
+PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/
+PATCH_DIR:=$(PATH_PREFIX)/patches-ng-$(PKG_VERSION)
+CONFIG_DIR:=$(PATH_PREFIX)/config-ng-$(PKG_VERSION)
+else
+PKG_NAME:=uClibc
 PKG_SOURCE_URL:=http://www.uclibc.org/downloads
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-LIBC_SO_VERSION:=$(PKG_VERSION)
 PATCH_DIR:=$(PATH_PREFIX)/patches-$(PKG_VERSION)
 CONFIG_DIR:=$(PATH_PREFIX)/config-$(PKG_VERSION)
+endif
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+LIBC_SO_VERSION:=$(PKG_VERSION)
 
 PKG_MD5SUM_0.9.33.2 = a338aaffc56f0f5040e6d9fa8a12eda1
+PKG_MD5SUM_1.0.5 = bf15da370e1f3c1b201864238c19a375
 PKG_MD5SUM=$(PKG_MD5SUM_$(PKG_VERSION))
 
 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
diff --git a/toolchain/uClibc/config-ng-1.0.5/arm b/toolchain/uClibc/config-ng-1.0.5/arm
new file mode 100644
index 0000000..f9136c4
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/arm
@@ -0,0 +1,8 @@
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# COMPILE_IN_THUMB_MODE is not set
+TARGET_ARCH="arm"
+TARGET_arm=y
+# USE_BX is not set
+CONFIG_ARM_EABI=y
\ No newline at end of file
diff --git a/toolchain/uClibc/config-ng-1.0.5/armeb b/toolchain/uClibc/config-ng-1.0.5/armeb
new file mode 100644
index 0000000..4d7039b
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/armeb
@@ -0,0 +1,8 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_WANTS_BIG_ENDIAN=y
+# COMPILE_IN_THUMB_MODE is not set
+TARGET_ARCH="arm"
+TARGET_arm=y
+# USE_BX is not set
+CONFIG_ARM_EABI=y
\ No newline at end of file
diff --git a/toolchain/uClibc/config-ng-1.0.5/common b/toolchain/uClibc/config-ng-1.0.5/common
new file mode 100644
index 0000000..ddaf600
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/common
@@ -0,0 +1,223 @@
+# ARCH_ANY_ENDIAN is not set
+ARCH_HAS_MMU=y
+# ARCH_HAS_NO_LDSO is not set
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_LITTLE_ENDIAN is not set
+ARCH_USE_MMU=y
+# ARCH_WANTS_BIG_ENDIAN is not set
+# ARCH_WANTS_LITTLE_ENDIAN is not set
+ASSUME_DEVPTS=y
+# COMPAT_ATEXIT is not set
+CROSS_COMPILER_PREFIX=""
+DEVEL_PREFIX="/usr/"
+# DOASSERTS is not set
+# DODEBUG is not set
+# DODEBUG_PT is not set
+# DOMULTI is not set
+DOPIC=y
+DOSTRIP=y
+DO_C99_MATH=y
+# DO_XSI_MATH is not set
+# EXTRA_WARNINGS is not set
+FORCE_OPTIONS_FOR_ARCH=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+# HARDWIRED_ABSPATH is not set
+# HAS_NO_THREADS is not set
+HAVE_DOT_CONFIG=y
+# HAVE_NO_PIC is not set
+# HAVE_NO_SSP is not set
+HAVE_SHARED=y
+KERNEL_HEADERS="."
+LDSO_BASE_FILENAME="ld.so"
+LDSO_CACHE_SUPPORT=y
+# LDSO_GNU_HASH_SUPPORT is not set
+LDSO_LD_LIBRARY_PATH=y
+LDSO_LDD_SUPPORT=y
+# LDSO_NO_CLEANUP is not set
+# LDSO_PRELINK_SUPPORT is not set
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_PRELOAD_ENV_SUPPORT=y
+LDSO_RUNPATH=y
+LDSO_SAFE_RUNPATH=y
+# LDSO_RUNPATH_OF_EXECUTABLE is not set
+# LDSO_SEARCH_INTERP_PATH is not set
+# LDSO_STANDALONE_SUPPORT is not set
+# LINUXTHREADS_NEW is not set
+# LINUXTHREADS_OLD is not set
+# UCLIBC_HAS_BACKTRACE is not set
+UCLIBC_HAS_THREADS_NATIVE=y
+# MALLOC is not set
+MALLOC_GLIBC_COMPAT=y
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MULTILIB_DIR="lib"
+PTHREADS_DEBUG_SUPPORT=y
+RUNTIME_PREFIX="/"
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+TARGET_SUBARCH=""
+# TARGET_alpha is not set
+# TARGET_arc is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_c6x is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_metag is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_BUILD_NOEXECSTACK=y
+# UCLIBC_BUILD_NOW is not set
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_BUILD_RELRO=y
+UCLIBC_CTOR_DTOR=y
+UCLIBC_DYNAMIC_ATEXIT=y
+UCLIBC_EXTRA_CFLAGS=""
+UCLIBC_GRP_BUFFER_SIZE=256
+UCLIBC_HAS_ADVANCED_REALTIME=y
+# UCLIBC_HAS_ARC4RANDOM is not set
+UCLIBC_HAS_BSD_ERR=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+# UCLIBC_HAS_COMPAT_RES_STATE is not set
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_CTYPE_SIGNED=y
+UCLIBC_HAS_CTYPE_TABLES=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
+# UCLIBC_HAS_FENV is not set
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+# UCLIBC_HAS_FPU is not set
+UCLIBC_HAS_FTS=y
+UCLIBC_HAS_FTW=y
+# UCLIBC_HAS_FULL_RPC is not set
+UCLIBC_HAS_GETPT=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+UCLIBC_HAS_GNU_GLOB=y
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_IPV4=y
+UCLIBC_HAS_IPV6=y
+UCLIBC_HAS_LFS=y
+UCLIBC_HAS_LIBNSL_STUB=y
+UCLIBC_HAS_LIBRESOLV_STUB=y
+UCLIBC_HAS_LIBUTIL=y
+# UCLIBC_HAS_LOCALE is not set
+# UCLIBC_BUILD_ALL_LOCALE is not set
+# UCLIBC_BUILD_MINIMAL_LOCALE is not set
+# UCLIBC_PREGENERATED_LOCALE_DATA is not set
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_NFTW=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+UCLIBC_HAS_PRINTF_M_SPEC=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS_PTY=y
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_REENTRANT_RPC is not set
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_RESOLVER_SUPPORT=y
+# UCLIBC_HAS_RPC is not set
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
+# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_SOFT_FLOAT=y
+# UCLIBC_HAS_SSP is not set
+# UCLIBC_HAS_SSP_COMPAT is not set
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SYSLOG=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_THREADS=y
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_HAS_UTMPX=y
+UCLIBC_HAS_UTMP=y
+UCLIBC_HAS_WCHAR=y
+UCLIBC_HAS_WORDEXP=y
+# UCLIBC_HAS_XATTR is not set
+# UCLIBC_HAS_XLOCALE is not set
+UCLIBC_HAS___PROGNAME=y
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_MODULE_26=y
+UCLIBC_LINUX_SPECIFIC=y
+# UCLIBC_MALLOC_DEBUGGING is not set
+# UCLIBC_MJN3_ONLY is not set
+# UCLIBC_NTP_LEGACY is not set
+# USE_OLD_VFPRINTF is not set
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_PWD_BUFFER_SIZE=256
+# UCLIBC_STATIC_LDCONFIG is not set
+# UCLIBC_STRICT_HEADERS is not set
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_SUSV3_LEGACY=y
+UCLIBC_SUSV3_LEGACY_MACROS=y
+UCLIBC_SUSV4_LEGACY=y
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set
+UCLIBC_USE_NETLINK=y
+# UNIX98PTY_ONLY is not set
+USE_BX=y
+WARNINGS="-Wall"
+# UCLIBC_HAS_OBSTACK is not set
+# UCLIBC_SUSV2_LEGACY is not set
+# UCLIBC_HAS_CONTEXT_FUNCS is not set
+UCLIBC_HAS_GETOPT_LONG=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/debug b/toolchain/uClibc/config-ng-1.0.5/debug
new file mode 100644
index 0000000..b366e66
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/debug
@@ -0,0 +1,6 @@
+DODEBUG=y
+DODEBUG_PT=y
+PTHREADS_DEBUG_SUPPORT=y
+SUPPORT_LD_DEBUG=y
+SUPPORT_LD_DEBUG_EARLY=y
+UCLIBC_MALLOC_DEBUGGING=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/i386 b/toolchain/uClibc/config-ng-1.0.5/i386
new file mode 100644
index 0000000..5ef264c
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/i386
@@ -0,0 +1,21 @@
+ARCH_LITTLE_ENDIAN=y
+# CONFIG_386 is not set
+CONFIG_486=y
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_ELAN is not set
+# CONFIG_GENERIC_386 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_NEHEMIAH is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_WINCHIPC6 is not set
+TARGET_ARCH="i386"
+TARGET_i386=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/i686 b/toolchain/uClibc/config-ng-1.0.5/i686
new file mode 100644
index 0000000..ba615f6
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/i686
@@ -0,0 +1,21 @@
+ARCH_LITTLE_ENDIAN=y
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+CONFIG_686=y
+# CONFIG_CRUSOE is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_ELAN is not set
+# CONFIG_GENERIC_386 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_NEHEMIAH is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_WINCHIPC6 is not set
+TARGET_ARCH="i386"
+TARGET_i386=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/m68k b/toolchain/uClibc/config-ng-1.0.5/m68k
new file mode 100644
index 0000000..14ce5ae
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/m68k
@@ -0,0 +1,6 @@
+ARCH_BIG_ENDIAN=y
+LINUXTHREADS_OLD=y
+TARGET_ARCH="m68k"
+TARGET_SUBARCH=""
+TARGET_m68k=y
+# UCLIBC_HAS_THREADS_NATIVE is not set
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips b/toolchain/uClibc/config-ng-1.0.5/mips
new file mode 100644
index 0000000..8cec22f
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips64 b/toolchain/uClibc/config-ng-1.0.5/mips64
new file mode 100644
index 0000000..566d87a
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips64
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips64.32 b/toolchain/uClibc/config-ng-1.0.5/mips64.32
new file mode 100644
index 0000000..b7ea8f4
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips64.32
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips64.64 b/toolchain/uClibc/config-ng-1.0.5/mips64.64
new file mode 100644
index 0000000..2a0b755
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips64.64
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips64.n32 b/toolchain/uClibc/config-ng-1.0.5/mips64.n32
new file mode 100644
index 0000000..f8def58
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips64.n32
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+CONFIG_MIPS_N32_ABI=y
+# CONFIG_MIPS_N64_ABI is not set
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips64el b/toolchain/uClibc/config-ng-1.0.5/mips64el
new file mode 100644
index 0000000..5358078
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips64el
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips64el.32 b/toolchain/uClibc/config-ng-1.0.5/mips64el.32
new file mode 100644
index 0000000..a10840b
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips64el.32
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips64el.64 b/toolchain/uClibc/config-ng-1.0.5/mips64el.64
new file mode 100644
index 0000000..8b90a54
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips64el.64
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mips64el.n32 b/toolchain/uClibc/config-ng-1.0.5/mips64el.n32
new file mode 100644
index 0000000..4ac4d06
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mips64el.n32
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+CONFIG_MIPS_N32_ABI=y
+# CONFIG_MIPS_N64_ABI is not set
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mipsel b/toolchain/uClibc/config-ng-1.0.5/mipsel
new file mode 100644
index 0000000..d9dedbb
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mipsel
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/mipsel.cobalt b/toolchain/uClibc/config-ng-1.0.5/mipsel.cobalt
new file mode 100644
index 0000000..1d42a70
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/mipsel.cobalt
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+CONFIG_MIPS_ISA_3=y
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/powerpc b/toolchain/uClibc/config-ng-1.0.5/powerpc
new file mode 100644
index 0000000..5b1292d
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/powerpc
@@ -0,0 +1,6 @@
+ARCH_BIG_ENDIAN=y
+CONFIG_CLASSIC=y
+# CONFIG_E500 is not set
+TARGET_ARCH="powerpc"
+TARGET_SUBARCH="classic"
+TARGET_powerpc=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/powerpc.e500 b/toolchain/uClibc/config-ng-1.0.5/powerpc.e500
new file mode 100644
index 0000000..a835c3d
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/powerpc.e500
@@ -0,0 +1,6 @@
+ARCH_BIG_ENDIAN=y
+# CONFIG_CLASSIC is not set
+CONFIG_E500=y
+TARGET_ARCH="powerpc"
+TARGET_SUBARCH="classic"
+TARGET_powerpc=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/sparc b/toolchain/uClibc/config-ng-1.0.5/sparc
new file mode 100644
index 0000000..e1596c4
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/sparc
@@ -0,0 +1,8 @@
+ARCH_BIG_ENDIAN=y
+# CONFIG_SPARC_V7 is not set
+# CONFIG_SPARC_V8 is not set
+CONFIG_SPARC_V9=y
+# CONFIG_SPARC_V9B is not set
+TARGET_ARCH="sparc"
+TARGET_sparc=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/sparc.leon b/toolchain/uClibc/config-ng-1.0.5/sparc.leon
new file mode 100644
index 0000000..eb725ac
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/sparc.leon
@@ -0,0 +1,8 @@
+ARCH_BIG_ENDIAN=y
+# CONFIG_SPARC_V7 is not set
+CONFIG_SPARC_V8=y
+# CONFIG_SPARC_V9 is not set
+# CONFIG_SPARC_V9B is not set
+TARGET_ARCH="sparc"
+TARGET_sparc=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
diff --git a/toolchain/uClibc/config-ng-1.0.5/x86_64 b/toolchain/uClibc/config-ng-1.0.5/x86_64
new file mode 100644
index 0000000..b6dc2c2
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.5/x86_64
@@ -0,0 +1,6 @@
+ARCH_LITTLE_ENDIAN=y
+# LINUXTHREADS_NEW is not set
+TARGET_ARCH="x86_64"
+TARGET_x86_64=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/patches-ng-1.0.5/0001-ldso_install_backward_compatibility_symlink_by_default.patch b/toolchain/uClibc/patches-ng-1.0.5/0001-ldso_install_backward_compatibility_symlink_by_default.patch
new file mode 100644
index 0000000..c9c0199
--- /dev/null
+++ b/toolchain/uClibc/patches-ng-1.0.5/0001-ldso_install_backward_compatibility_symlink_by_default.patch
@@ -0,0 +1,32 @@
+From 9b9abfbd25d5f95010241bdd72941dafecd56b0e Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx at uclibc-ng.org>
+Date: Sat, 15 Aug 2015 00:23:19 +0200
+Subject: ldso: install backward compatibility symlink by default
+
+Simplify the switch from uClibc to uClibc-ng suggested
+by Alexey Brodkin <Alexey.Brodkin at synopsys.com>.
+Gcc always uses .0 ld.so link, so install it by default.
+
+This is a back-port from upstream, see:
+http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=9b9abfbd25d5f95010241bdd72941dafecd56b0e
+Once 1.0.6 is cut this patch must be removed.
+---
+ ldso/ldso/Makefile.in | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
+index 424131c..21e0dbc 100644
+--- a/ldso/ldso/Makefile.in
++++ b/ldso/ldso/Makefile.in
+@@ -74,6 +74,8 @@ $(ldso): $(ldso:.$(ABI_VERSION)=)
+ $(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
+ $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
+ 	$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
++	# link for backward compatibility
++	$(call link.so,$(ldso_FULL_NAME),0)
+ 
+ $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
+ 	$(Q)$(RM) $@
+-- 
+cgit v0.11.2-3-g2eb4
+
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Mon Aug 17 11:22:39 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Mon, 17 Aug 2015 18:22:39 +0300
Subject: [OpenWrt-Devel] [PATCH 1/4] lldpd: remove obsolete/unsupported
	lldpctl call
Message-ID: <1439824962-5559-1-git-send-email-aa@ocedo.com>

This call is no longer supported.
Maybe a come-back for it would be to use a config /etc/lldpd.conf
or /etc/lldpd.d/<some-file>.conf

Signed-off-by: Alexandru Ardelean <aa at ocedo.com>
---
 package/network/services/lldpd/files/lldpd.init | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 40f2611..4b49cbd 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -60,11 +60,6 @@ start() {
 	service_start /usr/sbin/lldpd $args \
 		${lldp_class:+ -M $lldp_class} \
 		${lldp_description:+ -S "$lldp_description"}
-
-	[ -n "$lldp_location" ] && {
-		sleep 1
-		/usr/sbin/lldpctl -L "$lldp_location" > /dev/null 2>&1
-	}
 }
 
 stop() {
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Mon Aug 17 11:22:40 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Mon, 17 Aug 2015 18:22:40 +0300
Subject: [OpenWrt-Devel] [PATCH 2/4] lldpd: move /var/run creation + chmod
	earlier
In-Reply-To: <1439824962-5559-1-git-send-email-aa@ocedo.com>
References: <1439824962-5559-1-git-send-email-aa@ocedo.com>
Message-ID: <1439824962-5559-2-git-send-email-aa@ocedo.com>

Signed-off-by: Alexandru Ardelean <aa at ocedo.com>
---
 package/network/services/lldpd/files/lldpd.init | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 4b49cbd..bd957b6 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -47,6 +47,9 @@ start() {
 		fi
 	done
 
+	mkdir -p /var/run/lldp
+	chown lldp:lldp /var/run/lldp
+
 	[ -n "$ifnames" ] && append args "-I $ifnames"
 	[ $enable_cdp -gt 0 ] && append args '-c'
 	[ $enable_fdp -gt 0 ] && append args '-f'
@@ -54,9 +57,6 @@ start() {
 	[ $enable_edp -gt 0 ] && append args '-e'
 	[ $readonly_mode -gt 0 ] && append args '-r'
 
-	mkdir -p /var/run/lldp
-	chown lldp:lldp /var/run/lldp
-
 	service_start /usr/sbin/lldpd $args \
 		${lldp_class:+ -M $lldp_class} \
 		${lldp_description:+ -S "$lldp_description"}
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Mon Aug 17 11:22:41 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Mon, 17 Aug 2015 18:22:41 +0300
Subject: [OpenWrt-Devel] [PATCH 3/4] lldpd: conversion of init script to
	procd format
In-Reply-To: <1439824962-5559-1-git-send-email-aa@ocedo.com>
References: <1439824962-5559-1-git-send-email-aa@ocedo.com>
Message-ID: <1439824962-5559-3-git-send-email-aa@ocedo.com>

And add respawn param (the main reason for this conversion).

Signed-off-by: Alexandru Ardelean <aa at ocedo.com>
---
 package/network/services/lldpd/files/lldpd.init | 31 ++++++++++++++-----------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index bd957b6..fca0ebf 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -3,7 +3,7 @@
 
 START=90
 
-SERVICE_USE_PID=1
+USE_PROCD=1
 
 find_release_info()
 {
@@ -14,7 +14,7 @@ find_release_info()
 	echo "${DISTRIB_DESCRIPTION:-Unknown OpenWrt release} @ $(cat /proc/sys/kernel/hostname)"
 }
 
-start() {
+start_service() {
 	. /lib/functions/network.sh
 
 	local enable_cdp
@@ -50,19 +50,24 @@ start() {
 	mkdir -p /var/run/lldp
 	chown lldp:lldp /var/run/lldp
 
-	[ -n "$ifnames" ] && append args "-I $ifnames"
-	[ $enable_cdp -gt 0 ] && append args '-c'
-	[ $enable_fdp -gt 0 ] && append args '-f'
-	[ $enable_sonmp -gt 0 ] && append args '-s'
-	[ $enable_edp -gt 0 ] && append args '-e'
-	[ $readonly_mode -gt 0 ] && append args '-r'
+	procd_open_instance
+	procd_set_param command /usr/sbin/lldpd
+	procd_append_param command -d # don't daemonize, procd will handle that for us
 
-	service_start /usr/sbin/lldpd $args \
-		${lldp_class:+ -M $lldp_class} \
-		${lldp_description:+ -S "$lldp_description"}
+	[ -n "$ifnames" ] && procd_append_param command "-I $ifnames"
+	[ $enable_cdp -gt 0 ] && procd_append_param command '-c'
+	[ $enable_fdp -gt 0 ] && procd_append_param command '-f'
+	[ $enable_sonmp -gt 0 ] && procd_append_param command '-s'
+	[ $enable_edp -gt 0 ] && procd_append_param command '-e'
+	[ $readonly_mode -gt 0 ] && procd_append_param command '-r'
+	[ -n "$lldp_class" ] && procd_append_param command "-M $lldp_class"
+	[ -n "$lldp_description" ] && procd_append_param command "-S $lldp_description"
+
+	# set auto respawn behavior
+	procd_set_param respawn
+	procd_close_instance
 }
 
-stop() {
-	service_stop /usr/sbin/lldpd
+stop_service() {
 	rm -f /var/run/lldpd.socket /var/run/lldpd.pid
 }
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Mon Aug 17 11:22:42 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Mon, 17 Aug 2015 18:22:42 +0300
Subject: [OpenWrt-Devel] [PATCH 4/4] lldpd: add extra respawn params
In-Reply-To: <1439824962-5559-1-git-send-email-aa@ocedo.com>
References: <1439824962-5559-1-git-send-email-aa@ocedo.com>
Message-ID: <1439824962-5559-4-git-send-email-aa@ocedo.com>

Signed-off-by: Alexandru Ardelean <aa at ocedo.com>
---
 package/network/services/lldpd/files/lldpd.init | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index fca0ebf..278dbaf 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -65,6 +65,9 @@ start_service() {
 
 	# set auto respawn behavior
 	procd_set_param respawn
+	procd_append_param respawn 3600
+	procd_append_param respawn 5
+	procd_append_param respawn -1
 	procd_close_instance
 }
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kabel at blackhole.sk  Mon Aug 17 11:32:42 2015
From: kabel at blackhole.sk (Marek Behun)
Date: Mon, 17 Aug 2015 17:32:42 +0200
Subject: [OpenWrt-Devel] ar71xx: RB435G PCI does not support minipci sata
	module (PER-C20S)
Message-ID: <20150817173242.14e29072@blackhole.sk>

Hi,
I recently acquired a RouterBoard 435G. There are 5 minipci slots on
this board, so I bought the PER-C20S minipci sata module to add SATA
storage to the board. The PER-C20S is supported by kernel module
sata_sil. RouterBoard 435G is an ar71xx board, the PCI setup is done in
arch/mips/ath79/mach-rb4xx.c.

I can't understand why wireless minipci cards do work (I am using
Mikrotik R52N-M) but when I connect the PER-C20S module to the minipci
slot, it does not work, and neither does the wireless card when the
sata module is connected, as if the sata module broke the PCI drivers
somehow.

Is the PCI subsystem on this board supported only for wireless cards?

Thank you.

MB
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From benwhitten at gmail.com  Mon Aug 17 12:02:39 2015
From: benwhitten at gmail.com (Ben Whitten)
Date: Mon, 17 Aug 2015 17:02:39 +0100
Subject: [OpenWrt-Devel] [PATCH] [kernel] at91: fix usb rate backport patch
	tab mangle
Message-ID: <1439827359-14836-1-git-send-email-benwhitten@gmail.com>

The patch submitted in [46649] was mangled in the use of gmails webmail interface, tabs replaced with spaces, resulting in a patch which dit not apply.
This should fix the issue, sorry for the noise.

Signed-off-by: Ben Whitten <benwhitten at gmail.com>

---
 .../201-ARM-at91-usb-determine_rate-backport.patch | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch b/target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch
index 4fc22ab..d083628 100644
--- a/target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch
+++ b/target/linux/at91/patches/201-ARM-at91-usb-determine_rate-backport.patch
@@ -2,19 +2,19 @@
 +++ b/drivers/clk/at91/clk-usb.c
 @@ -59,7 +59,7 @@ static unsigned long at91sam9x5_clk_usb_
  static long at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw,
-                           unsigned long rate,
-                           unsigned long *best_parent_rate,
--                          struct clk_hw **best_parent_hw)
-+                          struct clk **best_parent_clk)
+ 					      unsigned long rate,
+ 					      unsigned long *best_parent_rate,
+-					      struct clk_hw **best_parent_hw)
++					      struct clk **best_parent_clk)
  {
-     struct clk *parent = NULL;
-     long best_rate = -EINVAL;
+ 	struct clk *parent = NULL;
+ 	long best_rate = -EINVAL;
 @@ -91,7 +91,7 @@ static long at91sam9x5_clk_usb_determine
-                 best_rate = tmp_rate;
-                 best_diff = tmp_diff;
-                 *best_parent_rate = tmp_parent_rate;
--                *best_parent_hw = __clk_get_hw(parent);
-+                *best_parent_clk = parent;
-             }
-
-             if (!best_diff || tmp_rate < rate)
+ 				best_rate = tmp_rate;
+ 				best_diff = tmp_diff;
+ 				*best_parent_rate = tmp_parent_rate;
+-				*best_parent_hw = __clk_get_hw(parent);
++				*best_parent_clk = parent;
+ 			}
+ 
+ 			if (!best_diff || tmp_rate < rate)
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From cyrus at openwrt.org  Mon Aug 17 12:04:04 2015
From: cyrus at openwrt.org (Steven Barth)
Date: Mon, 17 Aug 2015 18:04:04 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <1439638919.8622.9.camel@gooze.eu>
References: <1439638919.8622.9.camel@gooze.eu>
Message-ID: <55D205F4.8070003@openwrt.org>

I'm not sure what you are trying to accomplish. If you are connecting a router with a default
OpenWrt image with default configuration to an ISP or IPv6 router which offers prefix delegation,
everything works out of the box including client configuration. You don't need to touch a single
config file.

OpenWrt serves stateless and stateful addresses to clients by default, the combination of
option duid and option hostid should also work to change the hostid (I'm using it right now).

So could you please explain what is special about the freebox as an uplink (sorry I don't
speak french so I can't decode your wiki page)?

What is currently working and what is broken for you? What addresses do your clients get?



Cheers,

Steven
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jow at openwrt.org  Mon Aug 17 12:42:38 2015
From: jow at openwrt.org (Jo-Philipp Wich)
Date: Mon, 17 Aug 2015 18:42:38 +0200
Subject: [OpenWrt-Devel] ar71xx: RB435G PCI does not support minipci
 sata module (PER-C20S)
In-Reply-To: <20150817173242.14e29072@blackhole.sk>
References: <20150817173242.14e29072@blackhole.sk>
Message-ID: <55D20EFE.4070405@openwrt.org>

Hi.

> Is the PCI subsystem on this board supported only for wireless cards?

Yes. The hardware controller cannot handle PCI I/O resources, therefore
only a subset of available miniPCI cards do work with it.

Anything requiring I/O resources is a no-go.

HTH,
Jow
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jmpoure at gooze.eu  Mon Aug 17 12:53:57 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Mon, 17 Aug 2015 18:53:57 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <55D205F4.8070003@openwrt.org>
References: <1439638919.8622.9.camel@gooze.eu> <55D205F4.8070003@openwrt.org>
Message-ID: <1439830437.3207.10.camel@gooze.eu>

Dear Steven,

Thank you for answering.

> I'm not sure what you are trying to accomplish. If you are connecting 
> a router with a default
> OpenWrt image with default configuration to an ISP or IPv6 router 
> which offers prefix delegation,
> everything works out of the box including client configuration. You 
> don't need to touch a single
> config file.

Prefix delegation works only with a freebox model v6 or Android with
NextHop support. This is probably a limitation on the ISP side.

> OpenWrt serves stateless and stateful addresses to clients by 
> default, the combination of
> option duid and option hostid should also work to change the hostid 
> (I'm using it right now).

We tested with success :
* manual IPv6 settings,
* stateless delegation.

Stateful IPV6 delegation does not work.

> So could you please explain what is special about the freebox as an 
> uplink (sorry I don't
> speak french so I can't decode your wiki page)?

I published the setting here, no need to speak French:
http://wiki.openwrt.org/doc/howto/freebox#configuration_des_clients_ipv
6

Could you tell us more about the setting for stateful delegation? I
would like use the less intrusive settings, including a stock OpenWRT
with no additional package. How can this be done?

How do you set duid and option hostid ? It is unclear which version of
DNSmasq to use, Should we use two configurations config host: one for
ipv4 and one for ipv6.

Here are my settings:


config dnsmasq
        option domainneeded '0'
        option boguspriv '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option ra 'server'
        option dhcpv6 'server'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

config host
        option name 'sony-vaio'
        option ip '192.168.1.xxx'
        option mac '54:42:49:xx:xx:xx'

#config host
#        option name 'sony-vaio'
#        option ip '2a01:e35:87d8:xxxx::3'
#        option duid '0004901071a15f278795aa0dd83bde8b250xxxxxxxxx'
#        option hostid '00000003'

It could be nice if there was official documentation about stateful
adressing  on the WIKI here:
http://wiki.openwrt.org/doc/uci/network

Kind regards,
Gnutella
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/f7457331/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From tochiro.srchack at gmail.com  Mon Aug 17 13:20:04 2015
From: tochiro.srchack at gmail.com (YuheiOKAWA)
Date: Tue, 18 Aug 2015 02:20:04 +0900
Subject: [OpenWrt-Devel] [PATCH v2] ramips: add support for Planex DB-WRT01
Message-ID: <1439832004-26124-1-git-send-email-tochiro.srchack@gmail.com>

 This patch add support for Planex DB-WRT01. DANBOARD route on
 the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio.
 DANBOARD is Cartoon character.

Signed-off-by: YuheiOKAWA <tochiro.srchack at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |  3 +
 .../linux/ramips/base-files/etc/board.d/02_network |  1 +
 target/linux/ramips/base-files/etc/diag.sh         |  1 +
 target/linux/ramips/base-files/lib/ramips.sh       |  3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |  1 +
 target/linux/ramips/dts/DB-WRT01.dts               | 99 ++++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |  2 +
 7 files changed, 110 insertions(+)
 create mode 100644 target/linux/ramips/dts/DB-WRT01.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 71cf3ac..a9959e3 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -87,6 +87,9 @@ d105)
 	ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
 	set_usb_led "$board:green:usb"
 	;;
+db-wrt01)
+	ucidef_set_led_default "power" "power" "$board:orange:power" "1"
+	;;
 dcs-930l-b1)
 	ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
 	ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 6a2f042..02cd682 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -61,6 +61,7 @@ ramips_setup_interfaces()
 		;;
 	3g-6200n|\
 	ai-br100|\
+	db-wrt01|\
 	dir-300-b7|\
 	dir-320-b1|\
 	dir-610-a1|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index a4911b0..f886b5d 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -94,6 +94,7 @@ get_status_led() {
 	y1s)
 		status_led="$board:blue:power"
 		;;
+	db-wrt01|\
 	esr-9753)
 		status_led="$board:orange:power"
 		;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 5cafd45..5b6808e 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -97,6 +97,9 @@ ramips_board_detect() {
 	*"DAP-1350")
 		name="dap-1350"
 		;;
+	*"DB-WRT01")
+		name="db-wrt01"
+		;;
 	*"DCS-930")
 		name="dcs-930"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 53e7070..844ed5d 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -36,6 +36,7 @@ platform_check_image() {
 	cf-wr800n|\
 	d105|\
 	dap-1350|\
+	db-wrt01|\
 	dcs-930|\
 	dcs-930l-b1|\
 	dir-300-b1|\
diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/DB-WRT01.dts
new file mode 100644
index 0000000..a8953e9
--- /dev/null
+++ b/target/linux/ramips/dts/DB-WRT01.dts
@@ -0,0 +1,99 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+	compatible = "ralink,mt7620a-soc";
+	model = "Planex DB-WRT01";
+
+	palmbus at 10000000 {
+		gpio1: gpio at 638 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "en25q64";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l6405d";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x7b0000>;
+				};
+			};
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "spi refclk", "rgmii1";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&ephy_pins>;
+
+		mtd-mac-address = <&factory 0x4>;
+		ralink,port-map = "llllw";
+	};
+
+	gsw at 10110000 {
+		ralink,port4 = "ephy";
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	pcie at 10140000 {
+		status = "okay";
+	};
+	
+	gpio-leds {
+		compatible = "gpio-leds";
+		power {
+			label = "db-wrt01:orange:power";
+			gpios = <&gpio1 1 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		s1 {
+			label = "wps";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x211>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 2f4d4cb..4632ad2 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -868,6 +868,7 @@ Image/Build/Profile/CF-WR800N=$(call BuildFirmware/Default8M/$(1),$(1),cf-wr800n
 Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
 na930_mtd_size=20971520
 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
+Image/Build/Profile/DB-WRT01=$(call BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01)
 Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
 Image/Build/Profile/OY-0001=$(call BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001)
 Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),y1,Y1)
@@ -901,6 +902,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/WHR300HP2,$(1))
 	$(call Image/Build/Profile/WHR600D,$(1))
 	$(call Image/Build/Profile/WHR1166D,$(1))
+	$(call Image/Build/Profile/DB-WRT01,$(1))
 	$(call Image/Build/Profile/MZK-750DHP,$(1))
 	$(call Image/Build/Profile/NA930,$(1))
 	$(call Image/Build/Profile/OY-0001,$(1))
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tochiro.srchack at gmail.com  Mon Aug 17 13:25:49 2015
From: tochiro.srchack at gmail.com (=?UTF-8?Q?=ef=bc=a0SRCHACK.ORG?=)
Date: Tue, 18 Aug 2015 02:25:49 +0900
Subject: [OpenWrt-Devel] [PATCH] ramips: add support for Planex DB-WRT01
In-Reply-To: <55D1B810.8000101@openwrt.org>
References: <1439219793-18015-1-git-send-email-tochiro.srchack@gmail.com>
 <55D1B810.8000101@openwrt.org>
Message-ID: <55D2191D.4020505@gmail.com>

Hi,

I re-wrote the patch.
And it re-sent a patch.


On 2015/08/17 19:31, John Crispin wrote:
>
>
> On 10/08/2015 17:16, YuheiOKAWA wrote:
>>   This patch add support for Planex DB-WRT01. DANBOARD route on
>>   the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio.
>>   DANBOARD is Cartoon character.
>>
>> Signed-off-by: YuheiOKAWA <tochiro.srchack at gmail.com>
>
>
>
> Hi,
>
> i merged a huge 25 patch series today that cleans up the ramips target.
> this unfortunately makes this patch not apply anymore. could you rebase
> and resend your patch please ?
>
> 	John
>


-- 
------------------------------------------------------
?SRCHACK.ORG
tochiro.srchack at gmail.com
http://www.srchack.org/
------------------------------------------------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From pepe2k at gmail.com  Mon Aug 17 14:13:50 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Mon, 17 Aug 2015 20:13:50 +0200
Subject: [OpenWrt-Devel] [PATCH v2] ramips: add support for Planex
	DB-WRT01
In-Reply-To: <1439832004-26124-1-git-send-email-tochiro.srchack@gmail.com>
References: <1439832004-26124-1-git-send-email-tochiro.srchack@gmail.com>
Message-ID: <CAMTkhzOCorAd-OkupCEcTKdduy7-Kj5wSSSbgwg8rir=Gx6pwA@mail.gmail.com>

Hello,

Please, see my comments inline.

2015-08-17 19:20 GMT+02:00 YuheiOKAWA <tochiro.srchack at gmail.com>:
>  This patch add support for Planex DB-WRT01. DANBOARD route on
>  the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio.
>  DANBOARD is Cartoon character.
>
> Signed-off-by: YuheiOKAWA <tochiro.srchack at gmail.com>
> ---
>  target/linux/ramips/base-files/etc/board.d/01_leds |  3 +
>  .../linux/ramips/base-files/etc/board.d/02_network |  1 +
>  target/linux/ramips/base-files/etc/diag.sh         |  1 +
>  target/linux/ramips/base-files/lib/ramips.sh       |  3 +
>  .../ramips/base-files/lib/upgrade/platform.sh      |  1 +
>  target/linux/ramips/dts/DB-WRT01.dts               | 99 ++++++++++++++++++++++
>  target/linux/ramips/image/Makefile                 |  2 +
>  7 files changed, 110 insertions(+)
>  create mode 100644 target/linux/ramips/dts/DB-WRT01.dts
>
> diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
> index 71cf3ac..a9959e3 100755
> --- a/target/linux/ramips/base-files/etc/board.d/01_leds
> +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
> @@ -87,6 +87,9 @@ d105)
>         ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
>         set_usb_led "$board:green:usb"
>         ;;
> +db-wrt01)
> +       ucidef_set_led_default "power" "power" "$board:orange:power" "1"
> +       ;;
>  dcs-930l-b1)
>         ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
>         ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps"
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
> index 6a2f042..02cd682 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -61,6 +61,7 @@ ramips_setup_interfaces()
>                 ;;
>         3g-6200n|\
>         ai-br100|\
> +       db-wrt01|\
>         dir-300-b7|\
>         dir-320-b1|\
>         dir-610-a1|\
> diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
> index a4911b0..f886b5d 100644
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -94,6 +94,7 @@ get_status_led() {
>         y1s)
>                 status_led="$board:blue:power"
>                 ;;
> +       db-wrt01|\
>         esr-9753)
>                 status_led="$board:orange:power"
>                 ;;
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
> index 5cafd45..5b6808e 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -97,6 +97,9 @@ ramips_board_detect() {
>         *"DAP-1350")
>                 name="dap-1350"
>                 ;;
> +       *"DB-WRT01")
> +               name="db-wrt01"
> +               ;;
>         *"DCS-930")
>                 name="dcs-930"
>                 ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 53e7070..844ed5d 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -36,6 +36,7 @@ platform_check_image() {
>         cf-wr800n|\
>         d105|\
>         dap-1350|\
> +       db-wrt01|\
>         dcs-930|\
>         dcs-930l-b1|\
>         dir-300-b1|\
> diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/DB-WRT01.dts
> new file mode 100644
> index 0000000..a8953e9
> --- /dev/null
> +++ b/target/linux/ramips/dts/DB-WRT01.dts
> @@ -0,0 +1,99 @@
> +/dts-v1/;
> +
> +/include/ "mt7620a.dtsi"
> +
> +/ {
> +       compatible = "ralink,mt7620a-soc";
> +       model = "Planex DB-WRT01";
> +
> +       palmbus at 10000000 {
> +               gpio1: gpio at 638 {
> +                       status = "okay";
> +               };
> +
> +               spi at b00 {
> +                       status = "okay";
> +
> +                       m25p80 at 0 {
> +                               #address-cells = <1>;
> +                               #size-cells = <1>;
> +                               compatible = "en25q64";
> +                               reg = <0 0>;
> +                               linux,modalias = "m25p80", "mx25l6405d";
> +                               spi-max-frequency = <10000000>;
> +
> +                               partition at 0 {
> +                                       label = "u-boot";
> +                                       reg = <0x0 0x30000>;
> +                                       read-only;
> +                               };
> +
> +                               partition at 30000 {
> +                                       label = "u-boot-env";
> +                                       reg = <0x30000 0x10000>;
> +                                       read-only;
> +                               };
> +
> +                               factory: partition at 40000 {
> +                                       label = "factory";
> +                                       reg = <0x40000 0x10000>;
> +                                       read-only;
> +                               };
> +
> +                               partition at 50000 {
> +                                       label = "firmware";
> +                                       reg = <0x50000 0x7b0000>;
> +                               };
> +                       };
> +               };
> +       };
> +
> +       pinctrl {
> +               state_default: pinctrl0 {
> +                       gpio {
> +                               ralink,group = "i2c", "spi refclk", "rgmii1";
> +                               ralink,function = "gpio";
> +                       };
> +               };
> +       };
> +
> +       ethernet at 10100000 {
> +               pinctrl-names = "default";
> +               pinctrl-0 = <&ephy_pins>;
> +

Is this empty line really needed here?

> +               mtd-mac-address = <&factory 0x4>;
> +               ralink,port-map = "llllw";
> +       };
> +
> +       gsw at 10110000 {
> +               ralink,port4 = "ephy";
> +       };
> +
> +       wmac at 10180000 {
> +               ralink,mtd-eeprom = <&factory 0>;
> +       };
> +
> +       pcie at 10140000 {
> +               status = "okay";
> +       };
> +
> +       gpio-leds {
> +               compatible = "gpio-leds";

Empty line here, please.

> +               power {
> +                       label = "db-wrt01:orange:power";
> +                       gpios = <&gpio1 1 1>;
> +               };
> +       };
> +
> +       gpio-keys-polled {
> +               compatible = "gpio-keys-polled";
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               poll-interval = <20>;

And here too.

> +               s1 {
> +                       label = "wps";
> +                       gpios = <&gpio0 2 1>;
> +                       linux,code = <0x211>;
> +               };
> +       };
> +};
> diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
> index 2f4d4cb..4632ad2 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -868,6 +868,7 @@ Image/Build/Profile/CF-WR800N=$(call BuildFirmware/Default8M/$(1),$(1),cf-wr800n
>  Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
>  na930_mtd_size=20971520
>  Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
> +Image/Build/Profile/DB-WRT01=$(call BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01)
>  Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
>  Image/Build/Profile/OY-0001=$(call BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001)
>  Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),y1,Y1)
> @@ -901,6 +902,7 @@ define Image/Build/Profile/Default
>         $(call Image/Build/Profile/WHR300HP2,$(1))
>         $(call Image/Build/Profile/WHR600D,$(1))
>         $(call Image/Build/Profile/WHR1166D,$(1))
> +       $(call Image/Build/Profile/DB-WRT01,$(1))
>         $(call Image/Build/Profile/MZK-750DHP,$(1))
>         $(call Image/Build/Profile/NA930,$(1))
>         $(call Image/Build/Profile/OY-0001,$(1))
> --
> 1.9.1
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From cyrus at openwrt.org  Mon Aug 17 14:32:26 2015
From: cyrus at openwrt.org (Steven Barth)
Date: Mon, 17 Aug 2015 20:32:26 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <1439830437.3207.10.camel@gooze.eu>
References: <1439830437.3207.10.camel@gooze.eu>
Message-ID: <55D228BA.8040404@openwrt.org>

Hello Jean-Michel,

according to your Wiki-Entry stateful addressing does work,
no need to do anything with dnsmasq.

Quoting your ifconfig output

" addr inet6: 2a01:e35:87d8:xxxx::953/128 Scope:Global"

is clearly a stateful address (/128) and your host got the host-id
953 for stateful adressing. You should see the lease on the router
in the WebUi or under /tmp/hosts/odhcpd. There you can also see the
duid you need for adding the static lease.

At some point using the mac-address (option mac) should work here
as well but it might be broken currently. I will put it on my todo.

Nevertheless:

config host
        option duid '0012345678900...'
        option hostid 4

is what works already.



Cheers,

Steven
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jmpoure at gooze.eu  Mon Aug 17 15:07:43 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Mon, 17 Aug 2015 21:07:43 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <55D228BA.8040404@openwrt.org>
References: <1439830437.3207.10.camel@gooze.eu> <55D228BA.8040404@openwrt.org>
Message-ID: <1439838463.19078.5.camel@gooze.eu>

Dear Steven,

Thanks for this kind response.

> " addr inet6: 2a01:e35:87d8:xxxx::953/128 Scope:Global"

OK, I cannot find the lease in Luci, but here is /tmp/hosts/odhcpd
# br-lan 0004901071a15f278795aa0dd83bde8bzzzz 49874f74 - 1439881026 953
128 2a01:e35:87d8:xxxx::953/128

Is my duid 0004901071a15f278795aa0dd83bde8bzzzz?

" addr inet6: 2a01:e35:87d8:xxxx::953/128 Scope:Global"
> is clearly a stateful address (/128) and your host got the host-id
> 953 for stateful adressing. You should see the lease on the router
> in the WebUi or under /tmp/hosts/odhcpd. There you can also see the
> duid you need for adding the static lease.

OK. Good to know.

> At some point using the mac-address (option mac) should work here
> as well but it might be broken currently. I will put it on my todo.
> 
> Nevertheless:
> 
> config host
>         option duid '0012345678900...'
>         option hostid 4
> 
> is what works already.

I used:
config host                     
        option name 'sony-vaio'
        option ip 'xxxxxxxx'          
        option mac '54:42:49:87:xx:xx'           
                               
config host
        option duid '0004901071a15f278795aa0dd83bde8bzzzz'
        option hostid '3'    


and it does not work. The assigned address is still
2a01:e35:87d8:xxxx::953

Kind regards,Jean-Michel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/2bdb9d6d/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jmpoure at gooze.eu  Mon Aug 17 15:11:11 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Mon, 17 Aug 2015 21:11:11 +0200
Subject: [OpenWrt-Devel] Setting password on serial console + disabling
 linux single user mode
Message-ID: <1439838671.19078.9.camel@gooze.eu>

Dear all,

What is the current way to ask for root password when connecting to
serial console:

/etc/inittab
::askconsole:/bin/ash --login

is there any way to ask for a password?

Also, what are the steps to disable single user mode booting?

Kind regards,
Jean-Michel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/00e5f1c1/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jmpoure at gooze.eu  Mon Aug 17 15:28:04 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Mon, 17 Aug 2015 21:28:04 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <55D228BA.8040404@openwrt.org>
References: <1439830437.3207.10.camel@gooze.eu> <55D228BA.8040404@openwrt.org>
Message-ID: <1439839684.19078.11.camel@gooze.eu>

Le lundi 17 ao?t 2015 ? 20:32 +0200, Steven Barth a ?crit :
> config host
>         option duid '0012345678900...'
>         option hostid 4

Okay, I got it, it works using 8 digits:00000008
Will add it to the HOWTO and try to make a special howto on ipv6 delegation sooner.
Kind regards,Jean-Michel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/5f2b3394/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From tw at wiznet.eu  Mon Aug 17 15:31:02 2015
From: tw at wiznet.eu (Tobias Welz)
Date: Mon, 17 Aug 2015 21:31:02 +0200
Subject: [OpenWrt-Devel] Setting password on serial console
In-Reply-To: <1439838671.19078.9.camel@gooze.eu>
References: <1439838671.19078.9.camel@gooze.eu>
Message-ID: <55D23676.8080707@wiznet.eu>

Hello Jean-Michael,

With Barrier Breaker i use this way - I assume it's the same with Chaos Calmer.
Install the login shell and change the /etc/inittab:

::askconsole:/bin/login

Regards Tobias

Am 17.08.2015 um 21:11 schrieb Jean-Michel Pour? - GOOZE:
> Dear all,
>
> What is the current way to ask for root password when connecting to
> serial console:
>
> /etc/inittab
> ::askconsole:/bin/ash --login
>
> is there any way to ask for a password?
>
> Also, what are the steps to disable single user mode booting?
>
> Kind regards,
> Jean-Michel
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/97e8f726/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From dedeckeh at gmail.com  Mon Aug 17 15:43:01 2015
From: dedeckeh at gmail.com (Hans Dedecker)
Date: Mon, 17 Aug 2015 21:43:01 +0200
Subject: [OpenWrt-Devel] [PATCH] [netifd] enable MULTICAST on GRE
In-Reply-To: <CABB0dw1WHL-h+jtRrT=qu2BNwMSascEmqQueTZ73+-_1FUVESg@mail.gmail.com>
References: <CABB0dw2QZZ3P0fxTBY6ssk9vBZAh8ZDpbEF9Fc0uPefzU2jb=A@mail.gmail.com>
 <CAJLcKsHoHtFRUpX46JtkgMLwjSaw_TxxHykAxySeJ9SX7+PWHg@mail.gmail.com>
 <CABB0dw1WHL-h+jtRrT=qu2BNwMSascEmqQueTZ73+-_1FUVESg@mail.gmail.com>
Message-ID: <CAJLcKsFb0-siVvVhY5seqyb-MAG1SsT03ik58x9aWqGnFt3kMA@mail.gmail.com>

On Mon, Aug 17, 2015 at 4:40 PM, Nick Podolak <nicholas.e.podolak at gmail.com>
wrote:

>
> On Sat, Aug 15, 2015 at 3:25 AM, Hans Dedecker <dedeckeh at gmail.com> wrote:
>
>> It would be better to make this a device setting like promiscuous
>>> mode,macaddr, etc ... so it can be configured via UCI for every device and
>>> thus not only restricted for GRE
>>>
>>
>> Hans
>>
>
> You make an excellent point and I agree, but I'm unsure of some of the
> details.
>
> Is promisc mode controllable from UCI?  I didn't think it was but I can't
> tell from looking at these parts of netifd.
>
Promiscuous mode is configurable from UCI; see device.c as all dev_attrs
entries can be set via UCI

>
> Help me understand the extent of this implementation.  Looks like each of
> these would need modification.  Did i miss anything?
> device.c
>   static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = {
>   device_merge_settings(struct device *dev, struct device_settings *n)
>   device_init_settings(struct device *dev, struct blob_attr **tb)
>   device_dump_status(struct blob_buf *b, struct device *dev)
> system-linux.c
>   system_if_get_settings(struct device *dev, struct device_settings *s)
>   system_if_apply_settings(struct device *dev, struct device_settings *s,
> unsigned int apply_mask)
>
> UCI is all passthrough, right? nothing there would have to change?
>
> Your analysis regarding UCI and the impacted functions is correct; the
promiscuous mode implementation can be used as guidance for the multicast
device support.

Hans

> -Nick
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/fd806c28/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From francesco.borromini at inventati.org  Mon Aug 17 15:52:33 2015
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Mon, 17 Aug 2015 21:52:33 +0200
Subject: [OpenWrt-Devel] [PATCH v2] AR71xx: Add Minibox V1.0 support
Message-ID: <1439841153-3938-1-git-send-email-francesco.borromini@inventati.org>

This patch adds Gainstrong Minibox V1.0 into trunk.

Don't have the device myself, so can't check on a possible
LED polarity issue, but I have built images and asked for testing
on the forum.

Signed-off by: Stijn Segers <francesco.borromini at inventati.org>
---
 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       |  6 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
 target/linux/ar71xx/config-4.1                     |  1 +
 .../ar71xx/files/arch/mips/ath79/mach-minibox-v1.c | 85 ++++++++++++++++++++++
 target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +++++
 target/linux/ar71xx/image/Makefile                 |  9 +++
 .../799-MIPS-ath79-add-minibox-v1-support.patch    | 39 ++++++++++
 9 files changed, 162 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
 create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk
 create mode 100644 target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 561c5da..8820609 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -216,6 +216,9 @@ get_status_led() {
 	smart-300)
 		status_led="nc-link:green:system"
 		;;
+	minibox-v1)
+		status_led="minibox-v1:green:system"
+		;;
 	oolite)
 		status_led="oolite:red:system"
 		;;
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 2893e62..5506e3f 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -417,6 +417,7 @@ dir-615-e4 |\
 hiwifi-hc6361 |\
 ja76pf |\
 mc-mac1200r|\
+minibox-v1 |\
 mynet-n600 |\
 oolite |\
 qihoo-c301 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..13324c3 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -119,6 +119,9 @@ tplink_board_detect() {
 	"3C0001"*)
 		model="OOLITE"
 		;;
+	"3C0002"*)
+		model="MINIBOX_V1"
+		;;
 	"070300"*)
 		model="TP-Link TL-WR703N"
 		;;
@@ -499,6 +502,9 @@ ar71xx_board_detect() {
 	*"MAC1200R")
 		name="mc-mac1200r"
 		;;
+	*"MiniBox V1.0")
+		name="minibox-v1"
+		;;
 	*MR12)
 		name="mr12"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..228b2df 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -313,6 +313,7 @@ platform_check_image() {
 	el-mini | \
 	gl-inet | \
 	mc-mac1200r | \
+	minibox-v1 |\
 	onion-omega | \
 	oolite | \
 	smart-300 | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 1e31a01..2ff4a66 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -78,6 +78,7 @@ CONFIG_ATH79_MACH_HORNET_UB=y
 CONFIG_ATH79_MACH_JA76PF=y
 CONFIG_ATH79_MACH_JWAP003=y
 CONFIG_ATH79_MACH_MC_MAC1200R=y
+CONFIG_ATH79_MACH_MINIBOX_V1=y
 CONFIG_ATH79_MACH_MR12=y
 CONFIG_ATH79_MACH_MR16=y
 CONFIG_ATH79_MACH_MR600=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
new file mode 100644
index 0000000..c9fbbe5
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
@@ -0,0 +1,85 @@
+/*
+ *  Minibox V1.0 board support
+ *
+ *
+ *  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.
+ */
+
+#include <linux/gpio.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define MINIBOX_V1_GPIO_BTN_RESET	11
+
+#define MINIBOX_V1_GPIO_LED_SYSTEM	1
+
+#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
+#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * MINIBOX_V1_KEYS_POLL_INTERVAL)
+
+static const char *MINIBOX_V1_part_probes[] = {
+	"tp-link",
+	NULL,
+};
+
+static struct flash_platform_data MINIBOX_V1_flash_data = {
+	.part_probes	= MINIBOX_V1_part_probes,
+};
+
+static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
+	{
+		.name		= "minibox-v1:green:system",
+		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
+		.active_low	= 0,
+	},
+};
+
+static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = {
+	{
+		.desc		= "reset",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
+		.active_low	= 0,
+	},
+};
+
+static void __init MINIBOX_V1_setup(void)
+{
+	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
+				 MINIBOX_V1_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
+					MINIBOX_V1_gpio_keys);
+
+	ath79_register_usb();
+
+	ath79_register_m25p80(&MINIBOX_V1_flash_data);
+	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
+
+	ath79_register_mdio(0, 0x0);
+	ath79_register_eth(1);
+	ath79_register_eth(0);
+
+	ath79_register_wmac(ee, mac);
+}
+
+MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
+	     "MiniBox V1.0", MINIBOX_V1_setup);
diff --git a/target/linux/ar71xx/generic/profiles/minibox-v1.mk b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
new file mode 100644
index 0000000..ee103fa
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/MINIBOXV1
+	NAME:=MINIBOX V1.0
+	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
+endef
+
+
+define Profile/MINIBOXV1/Description
+	Package set optimized for the MINIBOX V1.0
+endef
+$(eval $(call Profile,MINIBOXV1))
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index e894d78..8d5b376 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -389,6 +389,15 @@ define Device/mc-mac1200r
 endef
 TARGET_DEVICES += mc-mac1200r
 
+define Device/minibox-v1
+    $(Device/tplink-16mlzma)
+    BOARDNAME := MINIBOX-V1
+    DEVICE_PROFILE := MINIBOXV1
+    TPLINK_HWID := 0x3C000201
+    CONSOLE := ttyATH0,115200
+endef
+TARGET_DEVICES += minibox-v1
+
 define Device/onion-omega
     $(Device/tplink-16mlzma)
     BOARDNAME := ONION-OMEGA
diff --git a/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
new file mode 100644
index 0000000..c17b313
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
@@ -0,0 +1,39 @@
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -74,6 +74,7 @@ enum ath79_mach_type {
+	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
+	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
+	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
++	ATH79_MACH_MINIBOX_V1,	/* MINIBOX V1.0 */
+	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
+	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
+	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -596,6 +596,16 @@
+	select ATH79_DEV_M25P80
+	select ATH79_DEV_USB
+
++config ATH79_MACH_MINIBOX_V1
++	bool "MINIBOX V1.0 support"
++	select SOC_AR933X
++	select ARH79_DEV_ETH
++	select ARH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_WRT160NL
+	bool "Linksys WRT160NL board support"
+	select SOC_AR913X
+--- a/arch/mips/ath79/Makefile	2015-08-10 23:27:44.599500173 +0200
++++ b/arch/mips/ath79/Makefile	2015-08-10 23:29:25.090929262 +0200
+@@ -85,6 +85,7 @@
+ obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
+ obj-$(CONFIG_ATH79_MACH_HORNET_UB)	+= mach-hornet-ub.o
+ obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)     += mach-mc-mac1200r.o
++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
+ obj-$(CONFIG_ATH79_MACH_MR12)		+= mach-mr12.o
+ obj-$(CONFIG_ATH79_MACH_MR16)		+= mach-mr16.o
+ obj-$(CONFIG_ATH79_MACH_MR600)		+= mach-mr600.o
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jmpoure at gooze.eu  Mon Aug 17 16:05:51 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Mon, 17 Aug 2015 22:05:51 +0200
Subject: [OpenWrt-Devel] Setting password on serial console
In-Reply-To: <55D23676.8080707@wiznet.eu>
References: <1439838671.19078.9.camel@gooze.eu> <55D23676.8080707@wiznet.eu>
Message-ID: <1439841951.19078.12.camel@gooze.eu>

Le lundi 17 ao?t 2015 ? 21:31 +0200, Tobias Welz a ?crit :
> With Barrier Breaker i use this way - I assume it's the same with 
> Chaos Calmer.
> Install the login shell and change the /etc/inittab:
> 
> ::askconsole:/bin/login

There is no /bin/login anymore in OpenWRT development branch.?Do I need to install a package ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/73377c5b/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From s.l-h at gmx.de  Mon Aug 17 16:11:53 2015
From: s.l-h at gmx.de (Stefan Lippers-Hollmann)
Date: Mon, 17 Aug 2015 22:11:53 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <1439838463.19078.5.camel@gooze.eu>
References: <1439830437.3207.10.camel@gooze.eu> <55D228BA.8040404@openwrt.org>
 <1439838463.19078.5.camel@gooze.eu>
Message-ID: <20150817221153.6b4b1f38@mir>

Hi

On 2015-08-17, Jean-Michel Pour? - GOOZE wrote:
> Dear Steven,
> 
> Thanks for this kind response.
> 
> > " addr inet6: 2a01:e35:87d8:xxxx::953/128 Scope:Global"
> 
> OK, I cannot find the lease in Luci, but here is /tmp/hosts/odhcpd

LuCI should show it on Status/ Overview, quite to the bottom under 
"DHCPv6 Leases".

> # br-lan 0004901071a15f278795aa0dd83bde8bzzzz 49874f74 - 1439881026 953
> 128 2a01:e35:87d8:xxxx::953/128
> 
> Is my duid 0004901071a15f278795aa0dd83bde8bzzzz?

Yes, but you need to restart odhcpd(IPv6) (and dnsmasq(IPv4) after 
changing /etc/config/dhcp, doing that clears /tmp/hosts/odhcpd as a 
side effect.

[...]
> > At some point using the mac-address (option mac) should work here
> > as well but it might be broken currently. I will put it on my todo.

This is basically a question I was planning to ask, right now (as in 
trunk r46589 on a TP-Link TL-WDR4300) it seems that specifying the
duid is necessary. 

For my personal situation (virtual machines (kvm) for testing differing 
stateless systems, I give each of the VM definitions a static MAC/ IPv4
mapping and DNS entry - but I can't guess the duid for different OS 
images in advance), it would be great if it were possible to omit the 
duid and use the MAC address exclusively.

[...]
> I used:
> config host                     
>         option name 'sony-vaio'
>         option ip 'xxxxxxxx'          
>         option mac '54:42:49:87:xx:xx'           
>                                
> config host
>         option duid '0004901071a15f278795aa0dd83bde8bzzzz'
>         option hostid '3'    

What works for me, is this

config host
	option name 'foobar'
	option mac 'BC:5F:F4:XX:XX:XX'
	option ip '10.10.7.0'
	option duid '00020000ab119da6fe0cXXXXXXXX'
	option hostid '100700'
	option dns '1'

The dns option should be optional, but is very convenient for me; I make 
quite heavy use of local (forward- and reverse) local DNS entries for
physical and virtual systems.

> and it does not work. The assigned address is still
> 2a01:e35:87d8:xxxx::953

Most likely because you didn't restart odhcpd - or eventually because
you split it into two config sections (I'm not sure if that's valid).

Regards
	Stefan Lippers-Hollmann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/eef27f67/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From sakib at meta.ua  Mon Aug 17 16:37:28 2015
From: sakib at meta.ua (Sergiy Kibrik)
Date: Mon, 17 Aug 2015 23:37:28 +0300
Subject: [OpenWrt-Devel] [PATCH] [libubox] ulog: check if /dev/kmsg is
 special file
In-Reply-To: <55D1B921.1040707@openwrt.org>
References: <55D1B921.1040707@openwrt.org>
Message-ID: <55D24608.3090805@meta.ua>

hi John,

> the patch is quite invasive. how about just using "r+"
>
> from the man page -->  "r+     Open for reading and writing.  The stream
> is positioned at the beginning of the file."
>
> could you try the following and not apply any other changes ?
>
> 	John
>
> -	if ((kmsg = fopen("/dev/kmsg", "w")) != NULL) {
> +	if ((kmsg = fopen("/dev/kmsg", "r+")) != NULL) {

should we go on without check for character special flag then?

--
regards,
Sergey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 361 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/bd868e05/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jmpoure at gooze.eu  Mon Aug 17 16:39:27 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Mon, 17 Aug 2015 22:39:27 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <1439839684.19078.11.camel@gooze.eu>
References: <1439830437.3207.10.camel@gooze.eu>
 <55D228BA.8040404@openwrt.org> <1439839684.19078.11.camel@gooze.eu>
Message-ID: <1439843967.19078.24.camel@gooze.eu>

> Okay, I got it, it works using 8 digits:00000008


I am still having difficulties setting IPv6 gateway using DHCP only.

If using SLAAC, routes will propagate very well, but I end-up with
several IPv6. I don't want any derived IPv6 from MAC.

The client IP is 2a01:e35:87d8:xxxx::yyyy:yyyy.

The correct route is:
/sbin/route -A inet6 |grep -w "eth0"
2a01:e35:87d8:xxxx::yyyy:yyyy/128 ::                         U    256 0
     0 eth0
2a01:e35:87d8:xxxx::/64        ::                         U    100 0   
  0 eth0
fe80::/64                      ::                         U    256 0   
  3 eth0
::/0                           fe80::ea94:f6ff:xxxx:xxxx  UG   100 3   
  0 eth0
ff00::/8                       ::                         U    256 3   
  0 eth0

fe80::ea94:f6ff:xxxx:xxxx is the local OpenWRT gateway.


DNSMASQ does not know how to set this kind of route using DHCP only.

An alternative would be to use SLAAC for routes only, not to propagate
IPv6 addresses derived from MAC.

Any idea? Does dnsmasq know how to propagate routes using DHCP only?
This would be nice NOT to rely on SLAAC.

I will write a howto with these information, don't worry, just guide
me.

Kind regards,
Jean-Michel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150817/6081e83d/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From tw at wiznet.eu  Mon Aug 17 16:47:48 2015
From: tw at wiznet.eu (Tobias Welz)
Date: Mon, 17 Aug 2015 22:47:48 +0200
Subject: [OpenWrt-Devel] [PATCH] Added WIZnet WizFi630A Platform based on
	Ralink RT5350
In-Reply-To: <55D1C472.90109@openwrt.org>
References: <55D1C472.90109@openwrt.org>
Message-ID: <55D24874.9090500@wiznet.eu>

From: Tobias Welz <tw at wiznet.eu>


Signed-off-by: Tobias Welz <tw at wiznet.eu>
---
  .../linux/ramips/base-files/etc/board.d/02_network |    5 +
  target/linux/ramips/base-files/etc/diag.sh         |    3 +
  target/linux/ramips/base-files/lib/ramips.sh       |    3 +
  .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
  target/linux/ramips/dts/WIZFI630A.dts              |  294 
++++++++++++++++++++
  target/linux/ramips/image/Makefile                 |    4 +-
  target/linux/ramips/rt305x/profiles/wizfi630a.mk   |   18 ++
  7 files changed, 327 insertions(+), 1 deletion(-)
  create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
  create mode 100644 target/linux/ramips/rt305x/profiles/wizfi630a.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 6a2f042..cfd0b26 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -217,6 +217,7 @@ ramips_setup_interfaces()
  		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
  		ucidef_add_switch_vlan "switch0" "2" "5 6t"
  		;;
+	wizfi630a | \
  	y1s)
  		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
  		ucidef_add_switch "switch0" "1" "1"
@@ -320,6 +321,10 @@ ramips_setup_macs()
  	wcr-150gn)
  		wan_mac=$(mtd_get_mac_binary factory 40)
  		;;
+	wizfi630a)
+		lan_mac=$(mtd_get_mac_binary factory 4)
+		wan_mac=$(mtd_get_mac_binary factory 40)
+		;;
  	whr-1166d|\
  	whr-300hp2|\
  	whr-600d|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index a4911b0..54b84e5 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -143,6 +143,9 @@ get_status_led() {
  	whr-600d)
  		status_led="$board:orange:wifi"
  		;;
+	wizfi630a)
+		status_led="wizfi630a::run"
+		;;
  	rt-n10-plus|\
  	tew-691gr|\
  	tew-692gr|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 5cafd45..b6d1023 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -367,6 +367,9 @@ ramips_board_detect() {
  	*"WIZARD 8800")
  		name="wizard8800"
  		;;
+	*"WIZnet WizFi630A")
+		name="wizfi630a"
+		;;
  	*"WL-330N")
  		name="wl-330n"
  		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 53e7070..947a328 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -107,6 +107,7 @@ platform_check_image() {
  	whr-300hp2|\
  	whr-600d|\
  	whr-g300n|\
+	wizfi630a |\
  	wl-330n|\
  	wl-330n3g|\
  	wl-341v3|\
diff --git a/target/linux/ramips/dts/WIZFI630A.dts 
b/target/linux/ramips/dts/WIZFI630A.dts
new file mode 100644
index 0000000..0d44c71
--- /dev/null
+++ b/target/linux/ramips/dts/WIZFI630A.dts
@@ -0,0 +1,294 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "wizfi630a", "ralink,rt5350-soc";
+	model = "WIZnet WizFi630A";
+
+	chosen {
+		bootargs = "console=ttyS1,115200";
+	};
+
+	palmbus at 10000000 {
+		gpio1: gpio at 660 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "w25q128";
+				reg = <0>;
+				linux,modalias = "m25p80", "w25q128";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "uboot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "uboot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0xfb0000>;
+				};
+			};
+		};
+
+		uart at 500 {
+			compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+			reg = <0x500 0x100>;
+
+			resets = <&rstctrl 12>;
+			reset-names = "uart";
+
+			interrupt-parent = <&intc>;
+			interrupts = <5>;
+
+			reg-shift = <2>;
+
+			status = "okay";
+		};
+
+
+		uartlite at c00 {
+			compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+			reg = <0xc00 0x100>;
+
+			resets = <&rstctrl 19>;
+			reset-names = "uartl";
+
+			interrupt-parent = <&intc>;
+			interrupts = <12>;
+
+			reg-shift = <2>;
+
+			pinctrl-names = "default";
+			pinctrl-0 = <&uartlite_pins>;
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag" ;
+				ralink,function = "gpio";
+			};
+		};
+
+		uartf_gpio_pins: uartf_gpio {
+			uartf_gpio {
+				ralink,group = "uartf";
+				ralink,function = "uartf";
+			};
+		};
+
+		uartlite_pins: uartlite {
+			uart {
+				ralink,group = "uartlite";
+				ralink,function = "uartlite";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x17>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+/*
+		gpio22 {
+			// WAN +			gpio-export,name = "gpio22";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio1 0 0>; // path lfd dir
+		};
+		gpio23 {
+			// LAN1 +			gpio-export,name = "gpio23";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio1 1 0>;
+		};
+		gpio24 {
+			// LAN2 +			gpio-export,name = "gpio24";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio1 2 0>;
+		};
+
+		// UARTF - UART1 +		gpio7 {
+			// UARTF_RTS_N - HW Pin 6
+			gpio-export,name = "gpio7";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 7 0>;
+		};
+		gpio8 {
+			// UARTF_TXD - HW Pin 10 +			gpio-export,name = "gpio8";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 8 0>;
+		};
+		gpio9 {
+			// UARTF_CTS_N - HW Pin 5
+			gpio-export,name = "gpio9";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 9 0>;
+		};
+		gpio10 {
+			// UARTF_RXD - HW Pin 9
+			gpio-export,name = "gpio10";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 10 0>;
+		};
+		gpio11 {
+			// UARTF_DTR_N - HW Pin 8
+			gpio-export,name = "gpio11";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 11 0>;
+		};
+		gpio12 {
+			// UARTF_DCD_N - HW Pin 12 +			gpio-export,name = "gpio12";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 12 0>;
+		};
+		gpio13 {
+			// UARTF_DSR_N - HW Pin 11
+			gpio-export,name = "gpio13";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 13 0>;
+		};
+		gpio14 {
+			// UARTF_RIN - HW Pin 7 +			gpio-export,name = "gpio14";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 14 0>;
+		};
+
+		// UARTLITE - UART2 +		gpio15 {
+			// UART2_TXD  - HW Pin 20 +			gpio-export,name = "gpio15";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 15 0>;
+		};
+		gpio16 {
+			// UART2_RXD  - HW Pin 18 +			gpio-export,name = "gpio16";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 16 0>;
+		};
+
+*/
+/*
+		// If you want to use this comment out the corrosponding gpio-keys-polled
+		gpio0 {
+			// wps btn
+			gpio-export,name = "gpio0";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 0 1>;
+		};
+*/
+
+		gpio19 {
+			// SCM1
+			gpio-export,name = "gpio19";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 19 1>;
+		};
+		gpio2 {
+			// SCM2
+			gpio-export,name = "gpio2";
+			gpio-export,direction_may_change = <1>;
+			gpios = <&gpio0 2 1>;
+		};
+
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		run {
+			label = "wizfi630a::run";
+			gpios = <&gpio0 1 1>;
+		};
+		uart1 {
+			label = "wizfi630a::uart1";
+			gpios = <&gpio0 18 1>;
+		};
+		uart2 {
+			label = "wizfi630a::uart2";
+			gpios = <&gpio0 21 1>;
+		};
+		wps {
+			label = "wizfi630a::wps";
+			gpios = <&gpio0 20 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		reset {
+			label = "reset";
+			gpios = <&gpio0 17 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
+		};
+/*
+		// If you want to use this comment out the corrosponding export
+		scm1 {
+			label = "SCM1";
+			gpios = <&gpio0 19 1>;
+			linux,code = <0x100>;
+		};
+
+		scm2 {
+			label = "SCM2";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x101>;
+		};
+*/
+	};
+};
diff --git a/target/linux/ramips/image/Makefile 
b/target/linux/ramips/image/Makefile
index 2f4d4cb..ac2e83c 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -608,7 +608,6 @@ Image/Build/Profile/W502U=$(call 
BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
   Image/Build/Profile/WCR150GN=$(call 
BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
  -
  Image/Build/Profile/MZK-DP150N=$(call 
BuildFirmware/Default4M/$(1),$(1),mzk-dp150n,MZK-DP150N)
   buffalo_whrg300n_mtd_size=3801088
@@ -631,6 +630,8 @@ Image/Build/Profile/WHRG300N=$(call 
BuildFirmware/WHRG300N/$(1),$(1))
   Image/Build/Profile/WIZARD8800=$(call 
BuildFirmware/Default8M/$(1),$(1),wizard-8800,WIZARD8800,Linux Kernel Image)
  +Image/Build/Profile/WIZFI630A=$(call 
BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
+
  Image/Build/Profile/WL-330N=$(call 
BuildFirmware/Default4M/$(1),$(1),wl-330n,WL-330N)
   Image/Build/Profile/WL-330N3G=$(call 
BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL-330N3G)
@@ -763,6 +764,7 @@ define Image/Build/Profile/Default
  	$(call Image/Build/Profile/WCR150GN,$(1))
  	$(call Image/Build/Profile/WHRG300N,$(1))
  	$(call Image/Build/Profile/WIZARD8800,$(1))
+	$(call Image/Build/Profile/WIZFI630A,$(1))
  	$(call Image/Build/Profile/WL-330N,$(1))
  	$(call Image/Build/Profile/WL-330N3G,$(1))
  	$(call Image/Build/Profile/WL-341V3,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/wizfi630a.mk 
b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
new file mode 100644
index 0000000..2d2c001
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/WIZFI630A
+	NAME:=WIZnet WizFi630A
+	PACKAGES:=\
+		kmod-usb2 +endef
+
+define Profile/WIZFI630A/Description
+	Package set for WIZnet WizFi630A board
+endef
+
+$(eval $(call Profile,WIZFI630A))
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From karlp at tweak.net.au  Mon Aug 17 17:25:32 2015
From: karlp at tweak.net.au (Karl Palsson)
Date: Mon, 17 Aug 2015 21:25:32 -0000
Subject: [OpenWrt-Devel] [PATCH v2] AR71xx: Add Minibox V1.0 support
In-Reply-To: <1439841153-3938-1-git-send-email-francesco.borromini@inventati.org>
References: <1439841153-3938-1-git-send-email-francesco.borromini@inventati.org>
Message-ID: <20150817202431-31735-76874-mailpile@palmtree-beeroclock-net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Personally I'd like to see Gainstrong mentioned _somewhere_ in the patch
itself.

> +--- a/arch/mips/ath79/machtypes.h
> ++++ b/arch/mips/ath79/machtypes.h
> +@@ -74,6 +74,7 @@ enum ath79_mach_type {
> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
> +	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
> +	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
> ++	ATH79_MACH_MINIBOX_V1,	/* MINIBOX V1.0 */

Maybe here?  Otherwise that comment is pretty irrelevant...

> +	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
> +	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
> +	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */




The ALLCAPS_PREFIX_ in the board file is... special? Have you seen that
anywhere else?


Stijn Segers <francesco.borromini at inventati.org> wrote:
> This patch adds Gainstrong Minibox V1.0 into trunk.
> 
> Don't have the device myself, so can't check on a possible
> LED polarity issue, but I have built images and asked for testing
> on the forum.
> 
> Signed-off by: Stijn Segers <francesco.borromini at inventati.org>
> ---
>  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       |  6 ++
>  .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
>  target/linux/ar71xx/config-4.1                     |  1 +
>  .../ar71xx/files/arch/mips/ath79/mach-minibox-v1.c | 85 ++++++++++++++++++++++
>  target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +++++
>  target/linux/ar71xx/image/Makefile                 |  9 +++
>  .../799-MIPS-ath79-add-minibox-v1-support.patch    | 39 ++++++++++
>  9 files changed, 162 insertions(+)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>  create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk
>  create mode 100644 target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> 
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
> b/target/linux/ar71xx/base-files/etc/diag.sh
> index 561c5da..8820609 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -216,6 +216,9 @@ get_status_led() {
>  	smart-300)
>  		status_led="nc-link:green:system"
>  		;;
> +	minibox-v1)
> +		status_led="minibox-v1:green:system"
> +		;;
>  	oolite)
>  		status_led="oolite:red:system"
>  		;;
> 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 2893e62..5506e3f 100755
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -417,6 +417,7 @@ dir-615-e4 |\
>  hiwifi-hc6361 |\
>  ja76pf |\
>  mc-mac1200r|\
> +minibox-v1 |\
>  mynet-n600 |\
>  oolite |\
>  qihoo-c301 |\
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 256bd10..13324c3 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -119,6 +119,9 @@ tplink_board_detect() {
>  	"3C0001"*)
>  		model="OOLITE"
>  		;;
> +	"3C0002"*)
> +		model="MINIBOX_V1"
> +		;;
>  	"070300"*)
>  		model="TP-Link TL-WR703N"
>  		;;
> @@ -499,6 +502,9 @@ ar71xx_board_detect() {
>  	*"MAC1200R")
>  		name="mc-mac1200r"
>  		;;
> +	*"MiniBox V1.0")
> +		name="minibox-v1"
> +		;;
>  	*MR12)
>  		name="mr12"
>  		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index 76d8c5b..228b2df 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -313,6 +313,7 @@ platform_check_image() {
>  	el-mini | \
>  	gl-inet | \
>  	mc-mac1200r | \
> +	minibox-v1 |\
>  	onion-omega | \
>  	oolite | \
>  	smart-300 | \
> diff --git a/target/linux/ar71xx/config-4.1
> b/target/linux/ar71xx/config-4.1
> index 1e31a01..2ff4a66 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -78,6 +78,7 @@ CONFIG_ATH79_MACH_HORNET_UB=y
>  CONFIG_ATH79_MACH_JA76PF=y
>  CONFIG_ATH79_MACH_JWAP003=y
>  CONFIG_ATH79_MACH_MC_MAC1200R=y
> +CONFIG_ATH79_MACH_MINIBOX_V1=y
>  CONFIG_ATH79_MACH_MR12=y
>  CONFIG_ATH79_MACH_MR16=y
>  CONFIG_ATH79_MACH_MR600=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> new file mode 100644
> index 0000000..c9fbbe5
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> @@ -0,0 +1,85 @@
> +/*
> + *  Minibox V1.0 board support
> + *
> + *
> + *  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.
> + */
> +
> +#include <linux/gpio.h>
> +
> +#include <asm/mach-ath79/ath79.h>
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-usb.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +
> +#define MINIBOX_V1_GPIO_BTN_RESET	11
> +
> +#define MINIBOX_V1_GPIO_LED_SYSTEM	1
> +
> +#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * MINIBOX_V1_KEYS_POLL_INTERVAL)
> +
> +static const char *MINIBOX_V1_part_probes[] = {
> +	"tp-link",
> +	NULL,
> +};
> +
> +static struct flash_platform_data MINIBOX_V1_flash_data = {
> +	.part_probes	= MINIBOX_V1_part_probes,
> +};
> +
> +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
> +	{
> +		.name		= "minibox-v1:green:system",
> +		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
> +		.active_low	= 0,
> +	},
> +};
> +
> +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "reset",
> +		.type		= EV_KEY,
> +		.code		= KEY_RESTART,
> +		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
> +		.active_low	= 0,
> +	},
> +};
> +
> +static void __init MINIBOX_V1_setup(void)
> +{
> +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
> +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
> +				 MINIBOX_V1_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
> +					MINIBOX_V1_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +	ath79_register_m25p80(&MINIBOX_V1_flash_data);
> +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
> +
> +	ath79_register_mdio(0, 0x0);
> +	ath79_register_eth(1);
> +	ath79_register_eth(0);
> +
> +	ath79_register_wmac(ee, mac);
> +}
> +
> +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
> +	     "MiniBox V1.0", MINIBOX_V1_setup);
> diff --git a/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> new file mode 100644
> index 0000000..ee103fa
> --- /dev/null
> +++ b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/MINIBOXV1
> +	NAME:=MINIBOX V1.0
> +	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
> +endef
> +
> +
> +define Profile/MINIBOXV1/Description
> +	Package set optimized for the MINIBOX V1.0
> +endef
> +$(eval $(call Profile,MINIBOXV1))
> diff --git a/target/linux/ar71xx/image/Makefile
> b/target/linux/ar71xx/image/Makefile
> index e894d78..8d5b376 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -389,6 +389,15 @@ define Device/mc-mac1200r
>  endef
>  TARGET_DEVICES += mc-mac1200r
>  
> +define Device/minibox-v1
> +    $(Device/tplink-16mlzma)
> +    BOARDNAME := MINIBOX-V1
> +    DEVICE_PROFILE := MINIBOXV1
> +    TPLINK_HWID := 0x3C000201
> +    CONSOLE := ttyATH0,115200
> +endef
> +TARGET_DEVICES += minibox-v1
> +
>  define Device/onion-omega
>      $(Device/tplink-16mlzma)
>      BOARDNAME := ONION-OMEGA
> diff --git
> a/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> new file mode 100644
> index 0000000..c17b313
> --- /dev/null
> +++ b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> @@ -0,0 +1,39 @@
> +--- a/arch/mips/ath79/machtypes.h
> ++++ b/arch/mips/ath79/machtypes.h
> +@@ -74,6 +74,7 @@ enum ath79_mach_type {
> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
> +	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
> +	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
> ++	ATH79_MACH_MINIBOX_V1,	/* MINIBOX V1.0 */



> +	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
> +	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
> +	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
> +--- a/arch/mips/ath79/Kconfig
> ++++ b/arch/mips/ath79/Kconfig
> +@@ -596,6 +596,16 @@
> +	select ATH79_DEV_M25P80
> +	select ATH79_DEV_USB
> +
> ++config ATH79_MACH_MINIBOX_V1
> ++	bool "MINIBOX V1.0 support"
> ++	select SOC_AR933X
> ++	select ARH79_DEV_ETH
> ++	select ARH79_DEV_GPIO_BUTTONS
> ++	select ATH79_DEV_LEDS_GPIO
> ++	select ATH79_DEV_M25P80
> ++	select ATH79_DEV_USB
> ++	select ATH79_DEV_WMAC
> ++
> + config ATH79_MACH_WRT160NL
> +	bool "Linksys WRT160NL board support"
> +	select SOC_AR913X
> +--- a/arch/mips/ath79/Makefile	2015-08-10 23:27:44.599500173 +0200
> ++++ b/arch/mips/ath79/Makefile	2015-08-10 23:29:25.090929262 +0200
> +@@ -85,6 +85,7 @@
> + obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
> + obj-$(CONFIG_ATH79_MACH_HORNET_UB)	+= mach-hornet-ub.o
> + obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)     += mach-mc-mac1200r.o
> ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
> + obj-$(CONFIG_ATH79_MACH_MR12)		+= mach-mr12.o
> + obj-$(CONFIG_ATH79_MACH_MR16)		+= mach-mr16.o
> + obj-$(CONFIG_ATH79_MACH_MR600)		+= mach-mr600.o

- -- 
Sent using Mailpile, Free Software from www.mailpile.is

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

iQIcBAEBAgAGBQJV0lFNAAoJEBmotQ/U1cr2H34P/Rdajhddfg5+W1x0zUhNdEI8
1oBM+/GxsOctTYgRclDJ9m4RTE7cJNVKMnh7KvuvYTH8MuxrkNQTCrrPlHgxFeNw
uuUl+nEFDK5BUeULqdJ3LO6dqDB1CYR8Jbm94nb4eUtoJ1SvCERFd+x6kdBku2PJ
LdarI3/CPDD/hModk/hNCzlQb+9N4zdXw3tmfc3VCNMVkXULRH5DP2x9U+4lkVbG
Gd0g7zzidrwygc8uxlx45H8HOTRtRsxv+vkMQuYM3bCBInPI+o8XgJizVYSa1Wbk
muUu2peUMVnHXWH2GM0zv2+UvxO3BiBO3U3z/tmn6+PPJhy0JqkDrx8Cfa5GC9P1
bCQM8XSO2LsEAjkvWU3G0MW8imKsTO1b1vd67Q1BlZ2WFiFFPWuIcy95ij7OOYeo
O44VbPSXAAmD4Vqf7kXP1aiziLhsuJecHsPNRzuEkbWswUhwrDcVjSBNbQnychq0
+BeDdqeoXnVJCiPTeb2YH28Uw3vPvKJW8CIqnsTdwItIqtvsay4GBpAltezmEVao
wSD7JecbPa+FB17yRzG2DmqCJuxVOHx20SdZ7EcesVm2Sw9wQ7hSv0SpQJaH5Ri9
63SqQVKOfE38yW9yHvfz2I3Q2q34GiRatKC91w3YvsheYueYCe+SnE0nT87yt67v
UAqzjagC3r4VioP52CWT
=Rz4V
-----END PGP SIGNATURE-----
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From hauke at hauke-m.de  Mon Aug 17 17:29:11 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon, 17 Aug 2015 23:29:11 +0200
Subject: [OpenWrt-Devel] Linux kernel config options handling in OpenWRT
In-Reply-To: <1439801007.3667.23.camel@synopsys.com>
References: <1439801007.3667.23.camel@synopsys.com>
Message-ID: <55D25227.9000002@hauke-m.de>

On 08/17/2015 10:43 AM, Alexey Brodkin wrote:
> Hello,
> 
> I'm playing with OpenWRT for a new platform and have a question on
> how OpenWRT handles KCONFIG kernel options.
> 
> For example I select "KernelPackage/crypto-core" in OpenWRT's menuconfig
> then KCONFIG is populated with:
> ------------------>8--------------------
> CONFIG_CRYPTO=y
> CONFIG_CRYPTO_HW=y
> CONFIG_CRYPTO_BLKCIPHER
> CONFIG_CRYPTO_ALGAPI
> ------------------>8--------------------
> 
> From what I may see from grepping through OpenWRT that KCONFIG value
> is only used to determine if those options are enabled in kernel configuration
> but not for force selection of options in kernel.

They are mainly used for selecting the config options in the kernel. I
do not know how exactly it is done.

> In other words if I want to get crypto core built I need to make sure first
> that in my say "target/linux/board/config-4.1" options mentioned above are
> enabled. Is that observation correct?

no

> I'm asking because my initial assumption was I need to provide a minimal
> kernel configuration in "target/linux/board/config-4.1" and then on
> selection of kmods in OpenWRT's menuconfig missing config options
> will be automatically added in kernel config.

Your initial assumption was correct. You should provide a minimal
"target/linux/board/config-4.1" which selects all kernel options which
will be compiled into the main kernel image, it should not contain any
option selected as a module, everything you want to build as a module
should be defined in a OpenWrt kernel package and they it can be
selected optional.

> But apparently no options are auto-enabled because I'm seeing that kind
> of build failure if CONFIG_CRYPTO_BLKCIPHER is not explicitly set in my
> kernel config:
> ------------------>8--------------------
> NOTICE: module 'xxx/openwrt/build_dir/target-yyy/linux-zzz/linux
> -4.1.3/crypto/crypto_algapi.ko' is built-in.
> ERROR: module 'xxx/openwrt/build_dir/target-yyy/linux-zzz/linux
> -4.1.3/crypto/crypto_blkcipher.ko' is missing.
> modules/crypto.mk:30: recipe for target 'xxx/openwrt/bin/axs10x
> -uClibc/packages/base/kmod-crypto-core_4.1.3-1_axs10x.ipk' failed
> make[3]: *** [xxx/openwrt/bin/axs10x
> -uClibc/packages/base/kmod-crypto-core_4.1.3-1_axs10x.ipk] Error 1
> ------------------>8--------------------

The kmod-crypto-core from KernelPackage/crypto-core should select the
CONFIG_CRYPTO_BLKCIPHER option.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From gch981213 at gmail.com  Tue Aug 18 00:04:05 2015
From: gch981213 at gmail.com (=?UTF-8?B?6YOt5Lyg6Yic?=)
Date: Tue, 18 Aug 2015 12:04:05 +0800
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
In-Reply-To: <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
 <55D17F03.5080101@openwrt.org>
 <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>
Message-ID: <CAJsYDVJQHf0bwtR+8oTSB-HWDFZAs1G5SHX40RJYMQ7OYnBrLg@mail.gmail.com>

Hi!
    I just wonder why you chose to use the board name in LED
names?Sometimes we can use the same dts file for different boards.For
example, in ar71xx wr841nd-v3 wr941nd-v2 and wr941nd-v3 shares
mach-tl-wr941nd-v2.c(I haven't found such examples in ramips target.)I
think the LED name will be a bit strange in this situation:-(

2015-08-17 19:24 GMT+08:00 Piotr Dymacz <pepe2k at gmail.com>:
> 2015-08-17 8:28 GMT+02:00 John Crispin <blogic at openwrt.org>:
>> Hi,
>>
>> just merged the whole lot. thanks a lot. what do you want to do next
>> lantiq or ar71xx ? :) personally i would prefer ar71xx ;)
>> [...]
>
> Hello John,
>
> It seems that there are some people who don't like the changes (see
> below), but they don't have enough courage to use their real name and
> post their comments on the list.
>
> I will back with answers for your and Michael Heimpold (I'm sorry, I
> didn't spot your e-mail before!) questions in few days. Now I'm really
> busy with other things.
>
> Cheers,
> Piotr Dymacz
>
> ---
>
> 2015-08-17 13:05 GMT+02:00 West Fuck <deutchwrt at anonmail.de>:
>> https://dev.openwrt.org/changeset/46617
>>
>> of all the bugs on related system you have choosen to change board and led
>> names? why do you stick your nose into something that is not relevant? is it
>> because your'e stupid fucking excuse for human being? you couldn't even make
>> your uboot work without errors on some boards so why don't you stick to your
>> own crap instead of acting like your're doing something
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tochiro.srchack at gmail.com  Tue Aug 18 00:07:21 2015
From: tochiro.srchack at gmail.com (Tochiro SrcHack)
Date: Tue, 18 Aug 2015 13:07:21 +0900
Subject: [OpenWrt-Devel] [PATCH v2] ramips: add support for Planex
	DB-WRT01
In-Reply-To: <CAMTkhzOCorAd-OkupCEcTKdduy7-Kj5wSSSbgwg8rir=Gx6pwA@mail.gmail.com>
References: <1439832004-26124-1-git-send-email-tochiro.srchack@gmail.com>
 <CAMTkhzOCorAd-OkupCEcTKdduy7-Kj5wSSSbgwg8rir=Gx6pwA@mail.gmail.com>
Message-ID: <CADu=5U2Wnjrp4RY-SB3e+LLRnSxd+Yt8V5HAAvYxRdy0kFS5bg@mail.gmail.com>

Sorry,

Re-send After correcting the patch.


2015-08-18 3:13 GMT+09:00 Piotr Dymacz <pepe2k at gmail.com>:

> Hello,
>
> Please, see my comments inline.
>
> 2015-08-17 19:20 GMT+02:00 YuheiOKAWA <tochiro.srchack at gmail.com>:
> >  This patch add support for Planex DB-WRT01. DANBOARD route on
> >  the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio.
> >  DANBOARD is Cartoon character.
> >
> > Signed-off-by: YuheiOKAWA <tochiro.srchack at gmail.com>
> > ---
> >  target/linux/ramips/base-files/etc/board.d/01_leds |  3 +
> >  .../linux/ramips/base-files/etc/board.d/02_network |  1 +
> >  target/linux/ramips/base-files/etc/diag.sh         |  1 +
> >  target/linux/ramips/base-files/lib/ramips.sh       |  3 +
> >  .../ramips/base-files/lib/upgrade/platform.sh      |  1 +
> >  target/linux/ramips/dts/DB-WRT01.dts               | 99
> ++++++++++++++++++++++
> >  target/linux/ramips/image/Makefile                 |  2 +
> >  7 files changed, 110 insertions(+)
> >  create mode 100644 target/linux/ramips/dts/DB-WRT01.dts
> >
> > diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds
> b/target/linux/ramips/base-files/etc/board.d/01_leds
> > index 71cf3ac..a9959e3 100755
> > --- a/target/linux/ramips/base-files/etc/board.d/01_leds
> > +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
> > @@ -87,6 +87,9 @@ d105)
> >         ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
> >         set_usb_led "$board:green:usb"
> >         ;;
> > +db-wrt01)
> > +       ucidef_set_led_default "power" "power" "$board:orange:power" "1"
> > +       ;;
> >  dcs-930l-b1)
> >         ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
> >         ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps"
> > diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
> b/target/linux/ramips/base-files/etc/board.d/02_network
> > index 6a2f042..02cd682 100755
> > --- a/target/linux/ramips/base-files/etc/board.d/02_network
> > +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> > @@ -61,6 +61,7 @@ ramips_setup_interfaces()
> >                 ;;
> >         3g-6200n|\
> >         ai-br100|\
> > +       db-wrt01|\
> >         dir-300-b7|\
> >         dir-320-b1|\
> >         dir-610-a1|\
> > diff --git a/target/linux/ramips/base-files/etc/diag.sh
> b/target/linux/ramips/base-files/etc/diag.sh
> > index a4911b0..f886b5d 100644
> > --- a/target/linux/ramips/base-files/etc/diag.sh
> > +++ b/target/linux/ramips/base-files/etc/diag.sh
> > @@ -94,6 +94,7 @@ get_status_led() {
> >         y1s)
> >                 status_led="$board:blue:power"
> >                 ;;
> > +       db-wrt01|\
> >         esr-9753)
> >                 status_led="$board:orange:power"
> >                 ;;
> > diff --git a/target/linux/ramips/base-files/lib/ramips.sh
> b/target/linux/ramips/base-files/lib/ramips.sh
> > index 5cafd45..5b6808e 100755
> > --- a/target/linux/ramips/base-files/lib/ramips.sh
> > +++ b/target/linux/ramips/base-files/lib/ramips.sh
> > @@ -97,6 +97,9 @@ ramips_board_detect() {
> >         *"DAP-1350")
> >                 name="dap-1350"
> >                 ;;
> > +       *"DB-WRT01")
> > +               name="db-wrt01"
> > +               ;;
> >         *"DCS-930")
> >                 name="dcs-930"
> >                 ;;
> > diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> > index 53e7070..844ed5d 100755
> > --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> > +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> > @@ -36,6 +36,7 @@ platform_check_image() {
> >         cf-wr800n|\
> >         d105|\
> >         dap-1350|\
> > +       db-wrt01|\
> >         dcs-930|\
> >         dcs-930l-b1|\
> >         dir-300-b1|\
> > diff --git a/target/linux/ramips/dts/DB-WRT01.dts
> b/target/linux/ramips/dts/DB-WRT01.dts
> > new file mode 100644
> > index 0000000..a8953e9
> > --- /dev/null
> > +++ b/target/linux/ramips/dts/DB-WRT01.dts
> > @@ -0,0 +1,99 @@
> > +/dts-v1/;
> > +
> > +/include/ "mt7620a.dtsi"
> > +
> > +/ {
> > +       compatible = "ralink,mt7620a-soc";
> > +       model = "Planex DB-WRT01";
> > +
> > +       palmbus at 10000000 {
> > +               gpio1: gpio at 638 {
> > +                       status = "okay";
> > +               };
> > +
> > +               spi at b00 {
> > +                       status = "okay";
> > +
> > +                       m25p80 at 0 {
> > +                               #address-cells = <1>;
> > +                               #size-cells = <1>;
> > +                               compatible = "en25q64";
> > +                               reg = <0 0>;
> > +                               linux,modalias = "m25p80", "mx25l6405d";
> > +                               spi-max-frequency = <10000000>;
> > +
> > +                               partition at 0 {
> > +                                       label = "u-boot";
> > +                                       reg = <0x0 0x30000>;
> > +                                       read-only;
> > +                               };
> > +
> > +                               partition at 30000 {
> > +                                       label = "u-boot-env";
> > +                                       reg = <0x30000 0x10000>;
> > +                                       read-only;
> > +                               };
> > +
> > +                               factory: partition at 40000 {
> > +                                       label = "factory";
> > +                                       reg = <0x40000 0x10000>;
> > +                                       read-only;
> > +                               };
> > +
> > +                               partition at 50000 {
> > +                                       label = "firmware";
> > +                                       reg = <0x50000 0x7b0000>;
> > +                               };
> > +                       };
> > +               };
> > +       };
> > +
> > +       pinctrl {
> > +               state_default: pinctrl0 {
> > +                       gpio {
> > +                               ralink,group = "i2c", "spi refclk",
> "rgmii1";
> > +                               ralink,function = "gpio";
> > +                       };
> > +               };
> > +       };
> > +
> > +       ethernet at 10100000 {
> > +               pinctrl-names = "default";
> > +               pinctrl-0 = <&ephy_pins>;
> > +
>
> Is this empty line really needed here?
>
> > +               mtd-mac-address = <&factory 0x4>;
> > +               ralink,port-map = "llllw";
> > +       };
> > +
> > +       gsw at 10110000 {
> > +               ralink,port4 = "ephy";
> > +       };
> > +
> > +       wmac at 10180000 {
> > +               ralink,mtd-eeprom = <&factory 0>;
> > +       };
> > +
> > +       pcie at 10140000 {
> > +               status = "okay";
> > +       };
> > +
> > +       gpio-leds {
> > +               compatible = "gpio-leds";
>
> Empty line here, please.
>
> > +               power {
> > +                       label = "db-wrt01:orange:power";
> > +                       gpios = <&gpio1 1 1>;
> > +               };
> > +       };
> > +
> > +       gpio-keys-polled {
> > +               compatible = "gpio-keys-polled";
> > +               #address-cells = <1>;
> > +               #size-cells = <0>;
> > +               poll-interval = <20>;
>
> And here too.
>
> > +               s1 {
> > +                       label = "wps";
> > +                       gpios = <&gpio0 2 1>;
> > +                       linux,code = <0x211>;
> > +               };
> > +       };
> > +};
> > diff --git a/target/linux/ramips/image/Makefile
> b/target/linux/ramips/image/Makefile
> > index 2f4d4cb..4632ad2 100644
> > --- a/target/linux/ramips/image/Makefile
> > +++ b/target/linux/ramips/image/Makefile
> > @@ -868,6 +868,7 @@ Image/Build/Profile/CF-WR800N=$(call
> BuildFirmware/Default8M/$(1),$(1),cf-wr800n
> >  Image/Build/Profile/DIR-810L=$(call
> BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
> >  na930_mtd_size=20971520
> >  Image/Build/Profile/NA930=$(call
> BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
> > +Image/Build/Profile/DB-WRT01=$(call
> BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01)
> >  Image/Build/Profile/MZK-750DHP=$(call
> BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
> >  Image/Build/Profile/OY-0001=$(call
> BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001)
> >  Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),y1,Y1)
> > @@ -901,6 +902,7 @@ define Image/Build/Profile/Default
> >         $(call Image/Build/Profile/WHR300HP2,$(1))
> >         $(call Image/Build/Profile/WHR600D,$(1))
> >         $(call Image/Build/Profile/WHR1166D,$(1))
> > +       $(call Image/Build/Profile/DB-WRT01,$(1))
> >         $(call Image/Build/Profile/MZK-750DHP,$(1))
> >         $(call Image/Build/Profile/NA930,$(1))
> >         $(call Image/Build/Profile/OY-0001,$(1))
> > --
> > 1.9.1
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel at lists.openwrt.org
> > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150818/441967b5/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jbscience87 at gmail.com  Tue Aug 18 00:14:16 2015
From: jbscience87 at gmail.com (Jonathan Bennett)
Date: Tue, 18 Aug 2015 04:14:16 +0000
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
In-Reply-To: <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
 <55D17F03.5080101@openwrt.org>
 <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>
Message-ID: <CAB-pspfmx6X0ycJc+LAir=XwJTapuJgrZojnSAXA48nGRoyATw@mail.gmail.com>

Those sort of emails are always just a bit discouraging. Keep in mind that
they tend to come from people that are slightly autistic or have Aspergers.

From blogic at openwrt.org  Tue Aug 18 01:33:56 2015
From: blogic at openwrt.org (John Crispin)
Date: Tue, 18 Aug 2015 07:33:56 +0200
Subject: [OpenWrt-Devel] [PATCH] [libubox] ulog: check if /dev/kmsg is
 special file
In-Reply-To: <55D24608.3090805@meta.ua>
References: <55D1B921.1040707@openwrt.org> <55D24608.3090805@meta.ua>
Message-ID: <55D2C3C4.9090702@openwrt.org>



On 17/08/2015 22:37, Sergiy Kibrik wrote:
> hi John,
> 
>> the patch is quite invasive. how about just using "r+"
>>
>> from the man page -->  "r+     Open for reading and writing.  The stream
>> is positioned at the beginning of the file."
>>
>> could you try the following and not apply any other changes ?
>>
>> 	John
>>
>> -	if ((kmsg = fopen("/dev/kmsg", "w")) != NULL) {
>> +	if ((kmsg = fopen("/dev/kmsg", "r+")) != NULL) {
> 
> should we go on without check for character special flag then?
> 

well, if we use r+ i think the problem will not arise so we can skip the
detection




> --
> regards,
> Sergey
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From john at phrozen.org  Tue Aug 18 01:40:31 2015
From: john at phrozen.org (John Crispin)
Date: Tue, 18 Aug 2015 07:40:31 +0200
Subject: [OpenWrt-Devel] lantiq DSL drivers / firmware info
In-Reply-To: <55CFB15D.3040106@kresin.me>
References: <1430320363.2279.3.camel@sipsolutions.net>
 <CAFBinCDZ2oz4BGMOLiKVx9zGuS3hL95EdqFnDpnQ=XX-SLHwuw@mail.gmail.com>
 <CAONAcYPuxYG9LAApLZdO2QNtw_N7v7Dvt1fjMZVARGAKkkpqBg@mail.gmail.com>
 <55714F60.6040402@gmail.com>
 <CAONAcYP30ZdjgQ=fkK2fX5KNgdqctSJ00COQdW0D-aPK4v6pCA@mail.gmail.com>
 <5572F43B.1080509@gmail.com>
 <CAFBinCAC+AVpfQ-1xCQ_mfW95Cm4VvsixcoSD4hBiT62bA8Nbg@mail.gmail.com>
 <CAONAcYMnkRxKdfNyDfn_QPjUrA=pA-O=hbMjxdiV_LhFvtp0RQ@mail.gmail.com>
 <55A0C816.3050703@gmail.com>
 <CAFBinCDO8koQ7ZGj=0PNpqCUqkVq=iU7FrTpj3E+2zyeN0unug@mail.gmail.com>
 <CAHsu+b-j8dZ+GWG6QgGTKL_xqQyqOaieo9=c5bDVfW5i=-EzqA@mail.gmail.com>
 <CAFBinCCtrCt73rkh3jqVzYnCL5+Ajic0aCmZw8cEoy2KPpSDNQ@mail.gmail.com>
 <20150724000306.11ac27b4@lazus.yip>
 <CAONAcYNPJPCPaYx70vqFbfy3fcObZzoXQGZ-5YYg75B8A2UmXw@mail.gmail.com>
 <CAONAcYMnNmzWTm=sUSL8eQU=aDMs55Pvs0PBE2J5JOMREZCEPQ@mail.gmail.com>
 <CAFBinCB0OO6o+8HQbiS1t4Tqkw2w9AeZ=nf=1rzHGgx2T_EEdg@mail.gmail.com>
 <55CFB15D.3040106@kresin.me>
Message-ID: <55D2C54F.7050707@phrozen.org>

Hi,

On 15/08/2015 23:38, Mathias Kresin wrote:
> Am 24.07.2015 um 01:20 schrieb Martin Blumenstingl:
>> On Fri, Jul 24, 2015 at 1:00 AM, Aleksander Wa??ski
>> <olewales at gmail.com> wrote:
>>> Actually, it just dawned on me that they can be doing just that. In
>>> the bootloader. This is the only part of firmware we are not changing.
>>> If PCBs turn out to be identical we might want to check this.
>> That was my first guess, but I am using the open source u-boot version
>> on the BT Home Hub 5A (= Annex A device) and it still refuses to
>> connect to Annex B (at least back when I tried last, I switched to
>> VDSL like two months ago).
> 
> I can confirm that it is unrelated to the bootloader. I crossflashed my
> Annex A W8980v1 with the W9980B (Annex B) firmware. During crossflash,
> the bootloader is updated as well. Afterwards, I do get exactly the same
> error message as Andre:
> 
> xDSL Leave SHOWTIME!!
> DSL_CPE: Wrong combination of DSL PHY Firmware and hybrid type used!

this line above says it all ... here is a bit of tech background.

Annex-A is when you run dsl on an analogue phone line
Annex-B is when you run dsl on a digital phone line

For this to work the dsl has a so called hybrid. consider it like a
frequency filter. The hybrid dictates which firmware is required and
what line you can run it on. running an annex-a unit will only ever work
with an annex-a firmware on a POTS line. a annex-b hybrid will require a
annex-b firmware and an ISDN line.

	John


> Please change one of it.
> nReturn=0 nData="E843 0003 0001 0009 "
> nReturn=0 nData="5048 0000 0001 "
> nReturn=0 nData="1762 0000 0001 "
> 
> I did not connected the device to an Annex B ADSL line yet, but I guess
> the result will be the same.
> 
> Furthermore, I replaced the content of mtd4 at f200 (@f100 is the device
> mac address stored) and mtd5 with a bunch of 0x11, to test for a magic
> value, that is read from there. U-boot replaces the content of mtd5 with
> the ddr params right after reboot and neither the error message changes
> if a W9980B firmware is booted, nor an error message appears if a W9980
> firmware is booted. The content of mtd6 seams to be unrelated to me,
> since it contains the ath calibration data.
> 
> I share Daniels guess, that there could be a resistor, which locks the
> VRX208 to Annex A/Annex B ADSL mode. As already mentioned, it's
> unrelated to VDSL. My Annex B VDSL line works with the W9980B (and
> properly W9980) firmware out of the box.
> 
>> If you can figure out where the boot_sel pins are (similar to [0] or
>> [1]) to get it into CFG04 mode (= boot via UART) then I can add a
>> patch for Daniel Schwierzeck's open source lantiq u-boot. But be
>> aware: you need to pull some of them HIGH (= 3.3V, *NOT* 5V) - you
>> could damage your device by pulling the wrong pin HIGH.
> 
> I found the location of the boot_sel pin and have updated the W8980v1
> wiki page.
> 
> Mathias
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From blogic at openwrt.org  Tue Aug 18 01:46:51 2015
From: blogic at openwrt.org (John Crispin)
Date: Tue, 18 Aug 2015 07:46:51 +0200
Subject: [OpenWrt-Devel] [PATCH v2] AR71xx: Add Minibox V1.0 support
In-Reply-To: <20150817202431-31735-76874-mailpile@palmtree-beeroclock-net>
References: <1439841153-3938-1-git-send-email-francesco.borromini@inventati.org>
 <20150817202431-31735-76874-mailpile@palmtree-beeroclock-net>
Message-ID: <55D2C6CB.7000409@openwrt.org>



On 17/08/2015 23:25, Karl Palsson wrote:
> Personally I'd like to see Gainstrong mentioned _somewhere_ in the patch
> itself.
> 
>> +--- a/arch/mips/ath79/machtypes.h
>> ++++ b/arch/mips/ath79/machtypes.h
>> +@@ -74,6 +74,7 @@ enum ath79_mach_type {
>> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
>> +	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
>> +	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
>> ++	ATH79_MACH_MINIBOX_V1,	/* MINIBOX V1.0 */
> 

Its a comment, but feel free to send a patch to modify the comment.

> Maybe here?  Otherwise that comment is pretty irrelevant...
> 
>> +	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
>> +	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
>> +	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
> 
> 
> 
> 
> The ALLCAPS_PREFIX_ in the board file is... special? Have you seen that
> anywhere else?

-EPARSE





> 
> 
> Stijn Segers <francesco.borromini at inventati.org> wrote:
>> This patch adds Gainstrong Minibox V1.0 into trunk.
> 
>> Don't have the device myself, so can't check on a possible
>> LED polarity issue, but I have built images and asked for testing
>> on the forum.
> 
>> Signed-off by: Stijn Segers <francesco.borromini at inventati.org>
>> ---
>>  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       |  6 ++
>>  .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
>>  target/linux/ar71xx/config-4.1                     |  1 +
>>  .../ar71xx/files/arch/mips/ath79/mach-minibox-v1.c | 85 ++++++++++++++++++++++
>>  target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +++++
>>  target/linux/ar71xx/image/Makefile                 |  9 +++
>>  .../799-MIPS-ath79-add-minibox-v1-support.patch    | 39 ++++++++++
>>  9 files changed, 162 insertions(+)
>>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>>  create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk
>>  create mode 100644 target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> 
>> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
>> b/target/linux/ar71xx/base-files/etc/diag.sh
>> index 561c5da..8820609 100644
>> --- a/target/linux/ar71xx/base-files/etc/diag.sh
>> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
>> @@ -216,6 +216,9 @@ get_status_led() {
>>  	smart-300)
>>  		status_led="nc-link:green:system"
>>  		;;
>> +	minibox-v1)
>> +		status_led="minibox-v1:green:system"
>> +		;;
>>  	oolite)
>>  		status_led="oolite:red:system"
>>  		;;
>> 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 2893e62..5506e3f 100755
>> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
>> @@ -417,6 +417,7 @@ dir-615-e4 |\
>>  hiwifi-hc6361 |\
>>  ja76pf |\
>>  mc-mac1200r|\
>> +minibox-v1 |\
>>  mynet-n600 |\
>>  oolite |\
>>  qihoo-c301 |\
>> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> index 256bd10..13324c3 100755
>> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>> @@ -119,6 +119,9 @@ tplink_board_detect() {
>>  	"3C0001"*)
>>  		model="OOLITE"
>>  		;;
>> +	"3C0002"*)
>> +		model="MINIBOX_V1"
>> +		;;
>>  	"070300"*)
>>  		model="TP-Link TL-WR703N"
>>  		;;
>> @@ -499,6 +502,9 @@ ar71xx_board_detect() {
>>  	*"MAC1200R")
>>  		name="mc-mac1200r"
>>  		;;
>> +	*"MiniBox V1.0")
>> +		name="minibox-v1"
>> +		;;
>>  	*MR12)
>>  		name="mr12"
>>  		;;
>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> index 76d8c5b..228b2df 100755
>> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
>> @@ -313,6 +313,7 @@ platform_check_image() {
>>  	el-mini | \
>>  	gl-inet | \
>>  	mc-mac1200r | \
>> +	minibox-v1 |\
>>  	onion-omega | \
>>  	oolite | \
>>  	smart-300 | \
>> diff --git a/target/linux/ar71xx/config-4.1
>> b/target/linux/ar71xx/config-4.1
>> index 1e31a01..2ff4a66 100644
>> --- a/target/linux/ar71xx/config-4.1
>> +++ b/target/linux/ar71xx/config-4.1
>> @@ -78,6 +78,7 @@ CONFIG_ATH79_MACH_HORNET_UB=y
>>  CONFIG_ATH79_MACH_JA76PF=y
>>  CONFIG_ATH79_MACH_JWAP003=y
>>  CONFIG_ATH79_MACH_MC_MAC1200R=y
>> +CONFIG_ATH79_MACH_MINIBOX_V1=y
>>  CONFIG_ATH79_MACH_MR12=y
>>  CONFIG_ATH79_MACH_MR16=y
>>  CONFIG_ATH79_MACH_MR600=y
>> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>> b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>> new file mode 100644
>> index 0000000..c9fbbe5
>> --- /dev/null
>> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>> @@ -0,0 +1,85 @@
>> +/*
>> + *  Minibox V1.0 board support
>> + *
>> + *
>> + *  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.
>> + */
>> +
>> +#include <linux/gpio.h>
>> +
>> +#include <asm/mach-ath79/ath79.h>
>> +#include <asm/mach-ath79/ar71xx_regs.h>
>> +
>> +#include "common.h"
>> +#include "dev-eth.h"
>> +#include "dev-gpio-buttons.h"
>> +#include "dev-leds-gpio.h"
>> +#include "dev-m25p80.h"
>> +#include "dev-usb.h"
>> +#include "dev-wmac.h"
>> +#include "machtypes.h"
>> +
>> +#define MINIBOX_V1_GPIO_BTN_RESET	11
>> +
>> +#define MINIBOX_V1_GPIO_LED_SYSTEM	1
>> +
>> +#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
>> +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * MINIBOX_V1_KEYS_POLL_INTERVAL)
>> +
>> +static const char *MINIBOX_V1_part_probes[] = {
>> +	"tp-link",
>> +	NULL,
>> +};
>> +
>> +static struct flash_platform_data MINIBOX_V1_flash_data = {
>> +	.part_probes	= MINIBOX_V1_part_probes,
>> +};
>> +
>> +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
>> +	{
>> +		.name		= "minibox-v1:green:system",
>> +		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
>> +		.active_low	= 0,
>> +	},
>> +};
>> +
>> +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = {
>> +	{
>> +		.desc		= "reset",
>> +		.type		= EV_KEY,
>> +		.code		= KEY_RESTART,
>> +		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
>> +		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
>> +		.active_low	= 0,
>> +	},
>> +};
>> +
>> +static void __init MINIBOX_V1_setup(void)
>> +{
>> +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
>> +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
>> +
>> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio),
>> +				 MINIBOX_V1_leds_gpio);
>> +
>> +	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
>> +					ARRAY_SIZE(MINIBOX_V1_gpio_keys),
>> +					MINIBOX_V1_gpio_keys);
>> +
>> +	ath79_register_usb();
>> +
>> +	ath79_register_m25p80(&MINIBOX_V1_flash_data);
>> +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
>> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
>> +
>> +	ath79_register_mdio(0, 0x0);
>> +	ath79_register_eth(1);
>> +	ath79_register_eth(0);
>> +
>> +	ath79_register_wmac(ee, mac);
>> +}
>> +
>> +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1",
>> +	     "MiniBox V1.0", MINIBOX_V1_setup);
>> diff --git a/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>> b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>> new file mode 100644
>> index 0000000..ee103fa
>> --- /dev/null
>> +++ b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
>> @@ -0,0 +1,17 @@
>> +#
>> +# Copyright (C) 2015 OpenWrt.org
>> +#
>> +# This is free software, licensed under the GNU General Public License v2.
>> +# See /LICENSE for more information.
>> +#
>> +
>> +define Profile/MINIBOXV1
>> +	NAME:=MINIBOX V1.0
>> +	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
>> +endef
>> +
>> +
>> +define Profile/MINIBOXV1/Description
>> +	Package set optimized for the MINIBOX V1.0
>> +endef
>> +$(eval $(call Profile,MINIBOXV1))
>> diff --git a/target/linux/ar71xx/image/Makefile
>> b/target/linux/ar71xx/image/Makefile
>> index e894d78..8d5b376 100644
>> --- a/target/linux/ar71xx/image/Makefile
>> +++ b/target/linux/ar71xx/image/Makefile
>> @@ -389,6 +389,15 @@ define Device/mc-mac1200r
>>  endef
>>  TARGET_DEVICES += mc-mac1200r
> 
>> +define Device/minibox-v1
>> +    $(Device/tplink-16mlzma)
>> +    BOARDNAME := MINIBOX-V1
>> +    DEVICE_PROFILE := MINIBOXV1
>> +    TPLINK_HWID := 0x3C000201
>> +    CONSOLE := ttyATH0,115200
>> +endef
>> +TARGET_DEVICES += minibox-v1
>> +
>>  define Device/onion-omega
>>      $(Device/tplink-16mlzma)
>>      BOARDNAME := ONION-OMEGA
>> diff --git
>> a/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>> b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>> new file mode 100644
>> index 0000000..c17b313
>> --- /dev/null
>> +++ b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
>> @@ -0,0 +1,39 @@
>> +--- a/arch/mips/ath79/machtypes.h
>> ++++ b/arch/mips/ath79/machtypes.h
>> +@@ -74,6 +74,7 @@ enum ath79_mach_type {
>> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
>> +	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
>> +	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
>> ++	ATH79_MACH_MINIBOX_V1,	/* MINIBOX V1.0 */
> 
> 
> 
>> +	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
>> +	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
>> +	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
>> +--- a/arch/mips/ath79/Kconfig
>> ++++ b/arch/mips/ath79/Kconfig
>> +@@ -596,6 +596,16 @@
>> +	select ATH79_DEV_M25P80
>> +	select ATH79_DEV_USB
>> +
>> ++config ATH79_MACH_MINIBOX_V1
>> ++	bool "MINIBOX V1.0 support"
>> ++	select SOC_AR933X
>> ++	select ARH79_DEV_ETH
>> ++	select ARH79_DEV_GPIO_BUTTONS
>> ++	select ATH79_DEV_LEDS_GPIO
>> ++	select ATH79_DEV_M25P80
>> ++	select ATH79_DEV_USB
>> ++	select ATH79_DEV_WMAC
>> ++
>> + config ATH79_MACH_WRT160NL
>> +	bool "Linksys WRT160NL board support"
>> +	select SOC_AR913X
>> +--- a/arch/mips/ath79/Makefile	2015-08-10 23:27:44.599500173 +0200
>> ++++ b/arch/mips/ath79/Makefile	2015-08-10 23:29:25.090929262 +0200
>> +@@ -85,6 +85,7 @@
>> + obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
>> + obj-$(CONFIG_ATH79_MACH_HORNET_UB)	+= mach-hornet-ub.o
>> + obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)     += mach-mc-mac1200r.o
>> ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
>> + obj-$(CONFIG_ATH79_MACH_MR12)		+= mach-mr12.o
>> + obj-$(CONFIG_ATH79_MACH_MR16)		+= mach-mr16.o
>> + obj-$(CONFIG_ATH79_MACH_MR600)		+= mach-mr600.o
> 
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sakib at meta.ua  Tue Aug 18 02:28:39 2015
From: sakib at meta.ua (Sergiy Kibrik)
Date: Tue, 18 Aug 2015 09:28:39 +0300
Subject: [OpenWrt-Devel] [PATCH v2] [libubox] ulog: avoid accidental
	/dev/kmsg creation
In-Reply-To: <55D2C3C4.9090702@openwrt.org>
References: <55D2C3C4.9090702@openwrt.org>
Message-ID: <1439879319-4950-1-git-send-email-sakib@meta.ua>

Race is possible in ulog_kmsg(): if no /dev/kmsg exists
(e.g. while /dev gets re-mounted) regular file created instead.

From pepe2k at gmail.com  Tue Aug 18 03:33:25 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Tue, 18 Aug 2015 09:33:25 +0200
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
In-Reply-To: <CAJsYDVJQHf0bwtR+8oTSB-HWDFZAs1G5SHX40RJYMQ7OYnBrLg@mail.gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
 <55D17F03.5080101@openwrt.org>
 <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>
 <CAJsYDVJQHf0bwtR+8oTSB-HWDFZAs1G5SHX40RJYMQ7OYnBrLg@mail.gmail.com>
Message-ID: <CAMTkhzOAV_RJ8L=-vOdJ2UGPqB_u34AfoYYowsPdct0dtgrVPg@mail.gmail.com>

Hello,

2015-08-18 6:04 GMT+02:00 ??? <gch981213 at gmail.com>:
> Hi!
>     I just wonder why you chose to use the board name in LED
> names?

Please, take a look at first version of my series and discussion about
"device:color:led-name" convention: [1].
I thought that OpenWrt uses different convention:
"manufacturer:color:led-name", but if you look deeper, we have both
approaches in code.

As an example, take a look at current version of diag.sh script in
ar71xx target [2].
There is exactly the same mix as it was in ramips target before my
cleans - some of boards follow upstream convention and rest don't.

> Sometimes we can use the same dts file for different boards.For
> example, in ar71xx wr841nd-v3 wr941nd-v2 and wr941nd-v3 shares
> mach-tl-wr941nd-v2.c(I haven't found such examples in ramips target.)I
> think the LED name will be a bit strange in this situation:-(

Yes, that's good point and I was thinking about the same problem.

IMHO, using same LED names for different boards is a mistake (assuming
that we switch to upstream convention).
Take TL-MR3420 v2 as an example ([3]) - for me it's not a TL-WR841N v8
"clone". They are similar from hardware POV (same platform, almost the
same specification), but manufacturer gave them different model names,
not without a reason.

That means all boards should have own names for LEDs. Question is how
to do it without duplicating and increasing code size.
What's more, what should we do with boards like TL-WR841N/ND vx -
should they share same code and use something like
"tl-wr841nx-vx:color:led-name" convention or separate that too
("tl-wr841n-v8:...", "tl-wr841nd-v8...", "tl-wr841nd-v7:..:", etc.)?
And what to do with clones like Mercury or Fast?

Maybe we should have separate mach-* files for all supported boards,
but then... what about DRY (don?t repeat yourself)?

Cheers,
Piotr

[1] http://patchwork.ozlabs.org/patch/500071/
[2] https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/base-files/etc/diag.sh
[3] https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c#L254

> 2015-08-17 19:24 GMT+08:00 Piotr Dymacz <pepe2k at gmail.com>:
>> 2015-08-17 8:28 GMT+02:00 John Crispin <blogic at openwrt.org>:
>>> Hi,
>>>
>>> just merged the whole lot. thanks a lot. what do you want to do next
>>> lantiq or ar71xx ? :) personally i would prefer ar71xx ;)
>>> [...]
>>
>> Hello John,
>>
>> It seems that there are some people who don't like the changes (see
>> below), but they don't have enough courage to use their real name and
>> post their comments on the list.
>>
>> I will back with answers for your and Michael Heimpold (I'm sorry, I
>> didn't spot your e-mail before!) questions in few days. Now I'm really
>> busy with other things.
>>
>> Cheers,
>> Piotr Dymacz
>>
>> ---
>>
>> 2015-08-17 13:05 GMT+02:00 West Fuck <deutchwrt at anonmail.de>:
>>> https://dev.openwrt.org/changeset/46617
>>>
>>> of all the bugs on related system you have choosen to change board and led
>>> names? why do you stick your nose into something that is not relevant? is it
>>> because your'e stupid fucking excuse for human being? you couldn't even make
>>> your uboot work without errors on some boards so why don't you stick to your
>>> own crap instead of acting like your're doing something
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From larsg at systemli.org  Tue Aug 18 05:12:39 2015
From: larsg at systemli.org (Lars)
Date: Tue, 18 Aug 2015 11:12:39 +0200
Subject: [OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups
In-Reply-To: <CAB-pspfmx6X0ycJc+LAir=XwJTapuJgrZojnSAXA48nGRoyATw@mail.gmail.com>
References: <1438799426-24409-1-git-send-email-pepe2k@gmail.com>
 <55D17F03.5080101@openwrt.org>
 <CAMTkhzNT0-chJCeT651nm8PKMT+zmMHg9FPmvDU-7j+PX6rz=Q@mail.gmail.com>
 <CAB-pspfmx6X0ycJc+LAir=XwJTapuJgrZojnSAXA48nGRoyATw@mail.gmail.com>
Message-ID: <55D2F707.7050200@systemli.org>

That wasn't less discouraging -- you shouldn't pathologize a behaviour
if you simply want to express that they're being dicks.

Piotr, thanks for your work, keep it up!

On 18.08.2015 06:14, Jonathan Bennett wrote:
> Those sort of emails are always just a bit discouraging. Keep in mind
> that they tend to come from people that are slightly autistic or have
> Aspergers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x7E86809F.asc
Type: application/pgp-keys
Size: 7893 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150818/0e68e97d/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From bapclenet at gmail.com  Tue Aug 18 05:59:11 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Tue, 18 Aug 2015 11:59:11 +0200
Subject: [OpenWrt-Devel] Mount mmc block
Message-ID: <CAPpUg6MR=anhX+J7DNNca9ifrz=RbBm8D7R_aiDQvxXjR6vk7g@mail.gmail.com>

Hi,

I'm trying to mount a emmc block on /mnt/mmc on a Ralink MT7628 board:

root at OpenWrt:/# ls /dev/mmcblk0p1
/dev/mmcblk0p1
root at OpenWrt:/# ls /mnt/mmc/
root at OpenWrt:/# mount -t -ext3 /dev/mmcblk0p1 /mnt/mmc/
mount: mounting /dev/mmcblk0p1 on /mnt/mmc/ failed: No such device

Am I missing something here? /mnt/mmc and /dev/mmcblk0p1 both exist.

Regards,

-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From karlp at tweak.net.au  Tue Aug 18 06:21:09 2015
From: karlp at tweak.net.au (Karl Palsson)
Date: Tue, 18 Aug 2015 10:21:09 -0000
Subject: [OpenWrt-Devel] [PATCH v2] AR71xx: Add Minibox V1.0 support
In-Reply-To: <55D2C6CB.7000409@openwrt.org>
References: <55D2C6CB.7000409@openwrt.org>
Message-ID: <20150818100742-31735-52733-mailpile@palmtree-beeroclock-net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Crispin <blogic at openwrt.org> wrote:
> 
> 
> On 17/08/2015 23:25, Karl Palsson wrote:
> > Personally I'd like to see Gainstrong mentioned _somewhere_ in the patch
> > itself.
> > 
> >> +--- a/arch/mips/ath79/machtypes.h
> >> ++++ b/arch/mips/ath79/machtypes.h
> >> +@@ -74,6 +74,7 @@ enum ath79_mach_type {
> >> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
> >> +	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
> >> +	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
> >> ++	ATH79_MACH_MINIBOX_V1,	/* MINIBOX V1.0 */
> > 
> 
> Its a comment, but feel free to send a patch to modify the comment.

And my review comment is that retyping the define is useless, most of
the defines use the comment to include a full name, normally including
the vendor, in this case Gainstrong.  This entire patch has no mention
of the word Gainstrong in it at all, just "minibox" in various
capitalizations.   Do you have a particular reason to _encourage_
omitting useful, common information?  Is there a reason that this
version as submitted would be _preferable_ to a version that followed
the existing examples and included useful vendor information?  Is there
any reason that I would want to send a _patch_ to fix someone else's
patch, that hasn't even been merged?

> 
> > Maybe here?  Otherwise that comment is pretty irrelevant...
> > 
> >> +	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
> >> +	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
> >> +	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
> > 
> > The ALLCAPS_PREFIX_ in the board file is... special? Have you seen that
> > anywhere else?
> 
> -EPARSE
> 
> 

- -EAGAIN?

>> +static const char *MINIBOX_V1_part_probes[] = {
>> +static struct flash_platform_data MINIBOX_V1_flash_data = {
>> +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
>> +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = {
>> +static void __init MINIBOX_V1_setup(void)

I've never seen all caps used in the prefix of methods in board files. 
Truly, I'm not widely read, but that would seem to be very out of style.
 Is this a style you wish to encourage?  If so, please let the community know so we can patch other files to bring them inline.  

Sincerely,
Karl Palsson

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

iQIcBAEBAgAGBQJV0wcWAAoJEBmotQ/U1cr2FUAQALqSPtknCawz8zqL5mfmjC4N
ynsNs6y3YQ8ZOc6RVTMdCLTvtNZmE1NZcrk7nAKVzrZBpXDCB6j6iPIal7fkM55m
+mrilQUwj2ZdFJ0Egfj4QFsdqc6LIth5WalpnkNqrnBsDEgUpUX6Vs+Xb8alJFhC
Iv+ILHvEif2ejlhM7Z/k39EzGsnDxLHUBY/tyJoVtJbOisO4oL73PXigjpx8cdrY
LcUoB3I84Pi2eLCo+iA2YOBioc3dR+ZY/lpSp+h0HF3XP8CYePsjbAa7H0LOJzC/
M44uXJoeGYQFSv23sVt6SZKFjFF6+rthMrf1WDLTH9NHU4venJsX/7Jn1XcVhcte
6QEZ60IYBTbXzw2GrN+p6dWYtGZia+blECXjhDCRqH6/72GdoD/XnVly4fH9M9HE
ekSjBMCCd7P6AWCwzf1z1Kg9adUQWOaajwSFyW75psb9f3p44tU8bpt0d82/aFam
+oCtcgjGoU6O7ndgH5QIYERIk9O65CZu90VQh5G2B1cYn1OE2ODoGMGr/yXNOWbs
t01vrbDtKKmkkpuyXwtDIulq8sOQhrAw0O37c7bIgGsH1CYUipEFyTDw2ngSalsO
7V3xsIRHK4/JHI4wUi17kK9r1h+5FSvFQIkHZuEyDR6/mdZ+GsO4zCf+YTghRjaK
bl+7Nsr+645uGFMuFfpb
=8o2o
-----END PGP SIGNATURE-----
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From dirkneukirchen at web.de  Tue Aug 18 06:59:41 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Tue, 18 Aug 2015 12:59:41 +0200
Subject: [OpenWrt-Devel] [PATCH] rules.mk : remove GCC 4.4 and GCC 4.5
	conditional
Message-ID: <1439895581-6203-1-git-send-email-dirkneukirchen@web.de>

gcc 4.4 was removed in r44957 gcc: remove 4.4.7 (only used by avr32)
gcc 4.5 was removed in r36149

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 rules.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rules.mk b/rules.mk
index 58b9f3e..819bea5 100644
--- a/rules.mk
+++ b/rules.mk
@@ -143,7 +143,7 @@ ifndef DUMP
     -include $(TOOLCHAIN_DIR)/info.mk
     export GCC_HONOUR_COPTS:=0
     TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-)
-    TARGET_CFLAGS+= -fhonour-copts $(if $(CONFIG_GCC_VERSION_4_4)$(CONFIG_GCC_VERSION_4_5),,-Wno-error=unused-but-set-variable)
+    TARGET_CFLAGS+= -fhonour-copts -Wno-error=unused-but-set-variable
     TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include
     ifeq ($(CONFIG_USE_MUSL),y)
       TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include/fortify
@@ -201,7 +201,7 @@ HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include
 HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
 HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib
 
-ifeq ($(CONFIG_GCC_VERSION_4_4)$(CONFIG_GCC_VERSION_4_6)$(CONFIG_EXTERNAL_TOOLCHAIN),)
+ifeq ($(CONFIG_GCC_VERSION_4_6)$(CONFIG_EXTERNAL_TOOLCHAIN),)
   TARGET_AR:=$(TARGET_CROSS)gcc-ar
   TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib
   TARGET_NM:=$(TARGET_CROSS)gcc-nm
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From francesco.borromini at inventati.org  Tue Aug 18 07:09:00 2015
From: francesco.borromini at inventati.org (francesco.borromini at inventati.org)
Date: Tue, 18 Aug 2015 13:09:00 +0200
Subject: [OpenWrt-Devel] [PATCH v2] AR71xx: Add Minibox V1.0 support
In-Reply-To: <20150817202431-31735-76874-mailpile@palmtree-beeroclock-net>
Message-ID: <f2cf07bc-cfed-46e6-9abd-85d032a9e332@email.android.com>

I can adapt the patch and send in a v3 of that's preferred.

Stijn

Op 17-aug.-2015 23:25 schreef Karl Palsson <karlp at tweak.net.au>:
>
> -----BEGIN PGP SIGNED MESSAGE----- 
> Hash: SHA1 
>
> Personally I'd like to see Gainstrong mentioned _somewhere_ in the patch 
> itself. 
>
> > +--- a/arch/mips/ath79/machtypes.h 
> > ++++ b/arch/mips/ath79/machtypes.h 
> > +@@ -74,6 +74,7 @@ enum ath79_mach_type { 
> > + ATH79_MACH_JA76PF2, /* jjPlus JA76PF2 */ 
> > + ATH79_MACH_JWAP003, /* jjPlus JWAP003 */ 
> > + ATH79_MACH_HORNET_UB, /* ALFA Networks Hornet-UB */ 
> > ++ ATH79_MACH_MINIBOX_V1, /* MINIBOX V1.0 */ 
>
> Maybe here?? Otherwise that comment is pretty irrelevant... 
>
> > + ATH79_MACH_MR12, /* Cisco Meraki MR12 */ 
> > + ATH79_MACH_MR16, /* Cisco Meraki MR16 */ 
> > + ATH79_MACH_MR600V2, /* OpenMesh MR600v2 */ 
>
>
>
>
> The ALLCAPS_PREFIX_ in the board file is... special? Have you seen that 
> anywhere else? 
>
>
> Stijn Segers <francesco.borromini at inventati.org> wrote: 
> > This patch adds Gainstrong Minibox V1.0 into trunk. 
> > 
> > Don't have the device myself, so can't check on a possible 
> > LED polarity issue, but I have built images and asked for testing 
> > on the forum. 
> > 
> > Signed-off by: Stijn Segers <francesco.borromini at inventati.org> 
> > --- 
> >? 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?????? |? 6 ++ 
> >? .../ar71xx/base-files/lib/upgrade/platform.sh????? |? 1 + 
> >? target/linux/ar71xx/config-4.1???????????????????? |? 1 + 
> >? .../ar71xx/files/arch/mips/ath79/mach-minibox-v1.c | 85 ++++++++++++++++++++++ 
> >? target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +++++ 
> >? target/linux/ar71xx/image/Makefile???????????????? |? 9 +++ 
> >? .../799-MIPS-ath79-add-minibox-v1-support.patch??? | 39 ++++++++++ 
> >? 9 files changed, 162 insertions(+) 
> >? create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c 
> >? create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk 
> >? create mode 100644 target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch 
> > 
> > diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
> > b/target/linux/ar71xx/base-files/etc/diag.sh 
> > index 561c5da..8820609 100644 
> > --- a/target/linux/ar71xx/base-files/etc/diag.sh 
> > +++ b/target/linux/ar71xx/base-files/etc/diag.sh 
> > @@ -216,6 +216,9 @@ get_status_led() { 
> >? smart-300) 
> >? status_led="nc-link:green:system" 
> >? ;; 
> > + minibox-v1) 
> > + status_led="minibox-v1:green:system" 
> > + ;; 
> >? oolite) 
> >? status_led="oolite:red:system" 
> >? ;; 
> > 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 2893e62..5506e3f 100755 
> > --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
> > +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
> > @@ -417,6 +417,7 @@ dir-615-e4 |\ 
> >? hiwifi-hc6361 |\ 
> >? ja76pf |\ 
> >? mc-mac1200r|\ 
> > +minibox-v1 |\ 
> >? mynet-n600 |\ 
> >? oolite |\ 
> >? qihoo-c301 |\ 
> > diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> > b/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> > index 256bd10..13324c3 100755 
> > --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> > +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> > @@ -119,6 +119,9 @@ tplink_board_detect() { 
> >? "3C0001"*) 
> >? model="OOLITE" 
> >? ;; 
> > + "3C0002"*) 
> > + model="MINIBOX_V1" 
> > + ;; 
> >? "070300"*) 
> >? model="TP-Link TL-WR703N" 
> >? ;; 
> > @@ -499,6 +502,9 @@ ar71xx_board_detect() { 
> >? *"MAC1200R") 
> >? name="mc-mac1200r" 
> >? ;; 
> > + *"MiniBox V1.0") 
> > + name="minibox-v1" 
> > + ;; 
> >? *MR12) 
> >? name="mr12" 
> >? ;; 
> > diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> > b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> > index 76d8c5b..228b2df 100755 
> > --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> > +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> > @@ -313,6 +313,7 @@ platform_check_image() { 
> >? el-mini | \ 
> >? gl-inet | \ 
> >? mc-mac1200r | \ 
> > + minibox-v1 |\ 
> >? onion-omega | \ 
> >? oolite | \ 
> >? smart-300 | \ 
> > diff --git a/target/linux/ar71xx/config-4.1 
> > b/target/linux/ar71xx/config-4.1 
> > index 1e31a01..2ff4a66 100644 
> > --- a/target/linux/ar71xx/config-4.1 
> > +++ b/target/linux/ar71xx/config-4.1 
> > @@ -78,6 +78,7 @@ CONFIG_ATH79_MACH_HORNET_UB=y 
> >? CONFIG_ATH79_MACH_JA76PF=y 
> >? CONFIG_ATH79_MACH_JWAP003=y 
> >? CONFIG_ATH79_MACH_MC_MAC1200R=y 
> > +CONFIG_ATH79_MACH_MINIBOX_V1=y 
> >? CONFIG_ATH79_MACH_MR12=y 
> >? CONFIG_ATH79_MACH_MR16=y 
> >? CONFIG_ATH79_MACH_MR600=y 
> > diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c 
> > b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c 
> > new file mode 100644 
> > index 0000000..c9fbbe5 
> > --- /dev/null 
> > +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c 
> > @@ -0,0 +1,85 @@ 
> > +/* 
> > + *? Minibox V1.0 board support 
> > + * 
> > + * 
> > + *? 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. 
> > + */ 
> > + 
> > +#include <linux/gpio.h> 
> > + 
> > +#include <asm/mach-ath79/ath79.h> 
> > +#include <asm/mach-ath79/ar71xx_regs.h> 
> > + 
> > +#include "common.h" 
> > +#include "dev-eth.h" 
> > +#include "dev-gpio-buttons.h" 
> > +#include "dev-leds-gpio.h" 
> > +#include "dev-m25p80.h" 
> > +#include "dev-usb.h" 
> > +#include "dev-wmac.h" 
> > +#include "machtypes.h" 
> > + 
> > +#define MINIBOX_V1_GPIO_BTN_RESET 11 
> > + 
> > +#define MINIBOX_V1_GPIO_LED_SYSTEM 1 
> > + 
> > +#define MINIBOX_V1_KEYS_POLL_INTERVAL 20 /* msecs */ 
> > +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * MINIBOX_V1_KEYS_POLL_INTERVAL) 
> > + 
> > +static const char *MINIBOX_V1_part_probes[] = { 
> > + "tp-link", 
> > + NULL, 
> > +}; 
> > + 
> > +static struct flash_platform_data MINIBOX_V1_flash_data = { 
> > + .part_probes = MINIBOX_V1_part_probes, 
> > +}; 
> > + 
> > +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = { 
> > + { 
> > + .name = "minibox-v1:green:system", 
> > + .gpio = MINIBOX_V1_GPIO_LED_SYSTEM, 
> > + .active_low = 0, 
> > + }, 
> > +}; 
> > + 
> > +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = { 
> > + { 
> > + .desc = "reset", 
> > + .type = EV_KEY, 
> > + .code = KEY_RESTART, 
> > + .debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL, 
> > + .gpio = MINIBOX_V1_GPIO_BTN_RESET, 
> > + .active_low = 0, 
> > + }, 
> > +}; 
> > + 
> > +static void __init MINIBOX_V1_setup(void) 
> > +{ 
> > + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); 
> > + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); 
> > + 
> > + ath79_register_leds_gpio(-1, ARRAY_SIZE(MINIBOX_V1_leds_gpio), 
> > + MINIBOX_V1_leds_gpio); 
> > + 
> > + ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL, 
> > + ARRAY_SIZE(MINIBOX_V1_gpio_keys), 
> > + MINIBOX_V1_gpio_keys); 
> > + 
> > + ath79_register_usb(); 
> > + 
> > + ath79_register_m25p80(&MINIBOX_V1_flash_data); 
> > + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); 
> > + ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); 
> > + 
> > + ath79_register_mdio(0, 0x0); 
> > + ath79_register_eth(1); 
> > + ath79_register_eth(0); 
> > + 
> > + ath79_register_wmac(ee, mac); 
> > +} 
> > + 
> > +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1", 
> > + ???? "MiniBox V1.0", MINIBOX_V1_setup); 
> > diff --git a/target/linux/ar71xx/generic/profiles/minibox-v1.mk 
> > b/target/linux/ar71xx/generic/profiles/minibox-v1.mk 
> > new file mode 100644 
> > index 0000000..ee103fa 
> > --- /dev/null 
> > +++ b/target/linux/ar71xx/generic/profiles/minibox-v1.mk 
> > @@ -0,0 +1,17 @@ 
> > +# 
> > +# Copyright (C) 2015 OpenWrt.org 
> > +# 
> > +# This is free software, licensed under the GNU General Public License v2. 
> > +# See /LICENSE for more information. 
> > +# 
> > + 
> > +define Profile/MINIBOXV1 
> > + NAME:=MINIBOX V1.0 
> > + PACKAGES:=kmod-usb-core kmod-usb2? kmod-ledtrig-usbdev 
> > +endef 
> > + 
> > + 
> > +define Profile/MINIBOXV1/Description 
> > + Package set optimized for the MINIBOX V1.0 
> > +endef 
> > +$(eval $(call Profile,MINIBOXV1)) 
> > diff --git a/target/linux/ar71xx/image/Makefile 
> > b/target/linux/ar71xx/image/Makefile 
> > index e894d78..8d5b376 100644 
> > --- a/target/linux/ar71xx/image/Makefile 
> > +++ b/target/linux/ar71xx/image/Makefile 
> > @@ -389,6 +389,15 @@ define Device/mc-mac1200r 
> >? endef 
> >? TARGET_DEVICES += mc-mac1200r 
> >? 
> > +define Device/minibox-v1 
> > +??? $(Device/tplink-16mlzma) 
> > +??? BOARDNAME := MINIBOX-V1 
> > +??? DEVICE_PROFILE := MINIBOXV1 
> > +??? TPLINK_HWID := 0x3C000201 
> > +??? CONSOLE := ttyATH0,115200 
> > +endef 
> > +TARGET_DEVICES += minibox-v1 
> > + 
> >? define Device/onion-omega 
> >????? $(Device/tplink-16mlzma) 
> >????? BOARDNAME := ONION-OMEGA 
> > diff --git 
> > a/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch 
> > b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch 
> > new file mode 100644 
> > index 0000000..c17b313 
> > --- /dev/null 
> > +++ b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch 
> > @@ -0,0 +1,39 @@ 
> > +--- a/arch/mips/ath79/machtypes.h 
> > ++++ b/arch/mips/ath79/machtypes.h 
> > +@@ -74,6 +74,7 @@ enum ath79_mach_type { 
> > + ATH79_MACH_JA76PF2, /* jjPlus JA76PF2 */ 
> > + ATH79_MACH_JWAP003, /* jjPlus JWAP003 */ 
> > + ATH79_MACH_HORNET_UB, /* ALFA Networks Hornet-UB */ 
> > ++ ATH79_MACH_MINIBOX_V1, /* MINIBOX V1.0 */ 
>
>
>
> > + ATH79_MACH_MR12, /* Cisco Meraki MR12 */ 
> > + ATH79_MACH_MR16, /* Cisco Meraki MR16 */ 
> > + ATH79_MACH_MR600V2, /* OpenMesh MR600v2 */ 
> > +--- a/arch/mips/ath79/Kconfig 
> > ++++ b/arch/mips/ath79/Kconfig 
> > +@@ -596,6 +596,16 @@ 
> > + select ATH79_DEV_M25P80 
> > + select ATH79_DEV_USB 
> > + 
> > ++config ATH79_MACH_MINIBOX_V1 
> > ++ bool "MINIBOX V1.0 support" 
> > ++ select SOC_AR933X 
> > ++ select ARH79_DEV_ETH 
> > ++ select ARH79_DEV_GPIO_BUTTONS 
> > ++ select ATH79_DEV_LEDS_GPIO 
> > ++ select ATH79_DEV_M25P80 
> > ++ select ATH79_DEV_USB 
> > ++ select ATH79_DEV_WMAC 
> > ++ 
> > + config ATH79_MACH_WRT160NL 
> > + bool "Linksys WRT160NL board support" 
> > + select SOC_AR913X 
> > +--- a/arch/mips/ath79/Makefile 2015-08-10 23:27:44.599500173 +0200 
> > ++++ b/arch/mips/ath79/Makefile 2015-08-10 23:29:25.090929262 +0200 
> > +@@ -85,6 +85,7 @@ 
> > + obj-$(CONFIG_ATH79_MACH_JWAP003) += mach-jwap003.o 
> > + obj-$(CONFIG_ATH79_MACH_HORNET_UB) += mach-hornet-ub.o 
> > + obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)???? += mach-mc-mac1200r.o 
> > ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1) += mach-minibox-v1.o 
> > + obj-$(CONFIG_ATH79_MACH_MR12) += mach-mr12.o 
> > + obj-$(CONFIG_ATH79_MACH_MR16) += mach-mr16.o 
> > + obj-$(CONFIG_ATH79_MACH_MR600) += mach-mr600.o 
>
> - -- 
> Sent using Mailpile, Free Software from www.mailpile.is 
>
> -----BEGIN PGP SIGNATURE----- 
> Version: GnuPG v1.4.11 (GNU/Linux) 
>
> iQIcBAEBAgAGBQJV0lFNAAoJEBmotQ/U1cr2H34P/Rdajhddfg5+W1x0zUhNdEI8 
> 1oBM+/GxsOctTYgRclDJ9m4RTE7cJNVKMnh7KvuvYTH8MuxrkNQTCrrPlHgxFeNw 
> uuUl+nEFDK5BUeULqdJ3LO6dqDB1CYR8Jbm94nb4eUtoJ1SvCERFd+x6kdBku2PJ 
> LdarI3/CPDD/hModk/hNCzlQb+9N4zdXw3tmfc3VCNMVkXULRH5DP2x9U+4lkVbG 
> Gd0g7zzidrwygc8uxlx45H8HOTRtRsxv+vkMQuYM3bCBInPI+o8XgJizVYSa1Wbk 
> muUu2peUMVnHXWH2GM0zv2+UvxO3BiBO3U3z/tmn6+PPJhy0JqkDrx8Cfa5GC9P1 
> bCQM8XSO2LsEAjkvWU3G0MW8imKsTO1b1vd67Q1BlZ2WFiFFPWuIcy95ij7OOYeo 
> O44VbPSXAAmD4Vqf7kXP1aiziLhsuJecHsPNRzuEkbWswUhwrDcVjSBNbQnychq0 
> +BeDdqeoXnVJCiPTeb2YH28Uw3vPvKJW8CIqnsTdwItIqtvsay4GBpAltezmEVao 
> wSD7JecbPa+FB17yRzG2DmqCJuxVOHx20SdZ7EcesVm2Sw9wQ7hSv0SpQJaH5Ri9 
> 63SqQVKOfE38yW9yHvfz2I3Q2q34GiRatKC91w3YvsheYueYCe+SnE0nT87yt67v 
> UAqzjagC3r4VioP52CWT 
> =Rz4V 
> -----END PGP SIGNATURE----- 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From blogic at openwrt.org  Tue Aug 18 07:23:30 2015
From: blogic at openwrt.org (John Crispin)
Date: Tue, 18 Aug 2015 13:23:30 +0200
Subject: [OpenWrt-Devel] [PATCH v2] AR71xx: Add Minibox V1.0 support
In-Reply-To: <20150818100742-31735-52733-mailpile@palmtree-beeroclock-net>
References: <55D2C6CB.7000409@openwrt.org>
 <20150818100742-31735-52733-mailpile@palmtree-beeroclock-net>
Message-ID: <55D315B2.3060701@openwrt.org>



On 18/08/2015 12:21, Karl Palsson wrote:
> John Crispin <blogic at openwrt.org> wrote:
> 
> 
>> On 17/08/2015 23:25, Karl Palsson wrote:
>>> Personally I'd like to see Gainstrong mentioned _somewhere_ in the patch
>>> itself.
>>>
>>>> +--- a/arch/mips/ath79/machtypes.h
>>>> ++++ b/arch/mips/ath79/machtypes.h
>>>> +@@ -74,6 +74,7 @@ enum ath79_mach_type {
>>>> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
>>>> +	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
>>>> +	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
>>>> ++	ATH79_MACH_MINIBOX_V1,	/* MINIBOX V1.0 */
>>>
> 
>> Its a comment, but feel free to send a patch to modify the comment.
> 
> And my review comment is that retyping the define is useless, most of
> the defines use the comment to include a full name, normally including
> the vendor, in this case Gainstrong.  This entire patch has no mention
> of the word Gainstrong in it at all, just "minibox" in various
> capitalizations.   Do you have a particular reason to _encourage_
> omitting useful, common information?  Is there a reason that this
> version as submitted would be _preferable_ to a version that followed
> the existing examples and included useful vendor information?  Is there
> any reason that I would want to send a _patch_ to fix someone else's
> patch, that hasn't even been merged?
> 
> 
>>> Maybe here?  Otherwise that comment is pretty irrelevant...
>>>
>>>> +	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
>>>> +	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
>>>> +	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
>>>
>>> The ALLCAPS_PREFIX_ in the board file is... special? Have you seen that
>>> anywhere else?
> 
>> -EPARSE
> 
> 
> 
> -EAGAIN?
> 
>>> +static const char *MINIBOX_V1_part_probes[] = {
>>> +static struct flash_platform_data MINIBOX_V1_flash_data = {
>>> +static struct gpio_led MINIBOX_V1_leds_gpio[] __initdata = {
>>> +static struct gpio_keys_button MINIBOX_V1_gpio_keys[] __initdata = {
>>> +static void __init MINIBOX_V1_setup(void)
> 

these certainly need to be fixed ...

> I've never seen all caps used in the prefix of methods in board files. 
> Truly, I'm not widely read, but that would seem to be very out of style.
>  Is this a style you wish to encourage?  If so, please let the community know so we can patch other files to bring them inline.  

aha, its a rethoric question ... no, that that is not encouraged and
please don't send patches for that kind of stuff as it would not make
much sense

> 
> Sincerely,
> Karl Palsson
> 
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From adrien+dev at schischi.me  Tue Aug 18 07:44:44 2015
From: adrien+dev at schischi.me (Adrien Schildknecht)
Date: Tue, 18 Aug 2015 13:44:44 +0200
Subject: [OpenWrt-Devel] [PATCH] [package] base-files: sysupgrade: quote
	source image name
Message-ID: <1439898284-28166-1-git-send-email-adrien+dev@schischi.me>

get_image() eval a filename without quoting it, resulting in errors with
filenames containing characters that need to be escaped.
    $ sysupgrade -T -f ./cfg\(12\).tar.gz img.bin; echo $?
    Image check 'platform_check_image' failed.
    Invalid config file. Please use only .tar.gz files
    1
    $ mv cfg\(12\).tar.gz cfg_12.tar.gz
    $ mv img\(1\).bin img.bin
    sysupgrade -T -f ./cfg_12.tar.gz img.bin; echo $?
    0

Enclose the content of $from in double quotes.

Signed-off-by: Adrien Schildknecht <adrien+dev at schischi.me>
---
 package/base-files/files/lib/upgrade/common.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index 189ef69..761b4c1 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -184,14 +184,14 @@ get_image() { # <source> [ <command> ]
 		*) cmd="cat";;
 	esac
 	if [ -z "$conc" ]; then
-		local magic="$(eval $cmd $from 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
+		local magic="$(eval $cmd \"$from\" 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
 		case "$magic" in
 			1f8b) conc="zcat";;
 			425a) conc="bzcat";;
 		esac
 	fi
 
-	eval "$cmd $from 2>/dev/null ${conc:+| $conc}"
+	eval "$cmd \"$from\" 2>/dev/null ${conc:+| $conc}"
 }
 
 get_magic_word() {
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jmpoure at gooze.eu  Tue Aug 18 07:45:09 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Tue, 18 Aug 2015 13:45:09 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <55D228BA.8040404@openwrt.org>
References: <1439830437.3207.10.camel@gooze.eu> <55D228BA.8040404@openwrt.org>
Message-ID: <1439898309.3410.3.camel@gooze.eu>

Le lundi 17 ao?t 2015 ? 20:32 +0200, Steven Barth a ?crit :
> is clearly a stateful address (/128) and your host got the host-id
> 953 for stateful adressing. You should see the lease on the router
> in the WebUi or under /tmp/hosts/odhcpd. There you can also see the
> duid you need for adding the static lease.


Dear Steven,

I could solve all issues and write a complete HOWTO (in French only at
first).http://wiki.openwrt.org/doc/howto/freebox

My only question would be :

OpenWRT seems to provide at the same time stateful and stateless
adressing. 

Whatever I do, I always receive an IPv6 based on MAC when I would like
my station to have only a stateful address. On the converse, if I
request a stateless address, I also reveive a stateful address.

Is there a way to avoid this?

Kind regards,
Gnutella
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150818/4865e22b/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From cyrus at openwrt.org  Tue Aug 18 07:49:12 2015
From: cyrus at openwrt.org (Steven Barth)
Date: Tue, 18 Aug 2015 13:49:12 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <1439898309.3410.3.camel@gooze.eu>
References: <1439830437.3207.10.camel@gooze.eu> <55D228BA.8040404@openwrt.org>
 <1439898309.3410.3.camel@gooze.eu>
Message-ID: <55D31BB8.3070903@openwrt.org>


> I could solve all issues and write a complete HOWTO (in French only at
> first).http://wiki.openwrt.org/doc/howto/freebox

That is nice to hear.

> OpenWRT seems to provide at the same time stateful and stateless
> adressing. 

Where you have option dhcpv6 and option ra you can add an option ra_management
and set it to 0, 1 or 2.

0 means stateless only,
1 means stateless + stateful (default)
2 means stateful only

Please note that stateful is not supported by all clients, e.g. all android-based devices
will not have IPv6 connectivity with setting 2.


Cheers,

Steven
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bapclenet at gmail.com  Tue Aug 18 09:15:08 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Tue, 18 Aug 2015 15:15:08 +0200
Subject: [OpenWrt-Devel] Mount mmc block
In-Reply-To: <CAPpUg6MR=anhX+J7DNNca9ifrz=RbBm8D7R_aiDQvxXjR6vk7g@mail.gmail.com>
References: <CAPpUg6MR=anhX+J7DNNca9ifrz=RbBm8D7R_aiDQvxXjR6vk7g@mail.gmail.com>
Message-ID: <CAPpUg6OyEnwixU39Ajv946oH57h4nzUidyvJT2fPhfPPryurPw@mail.gmail.com>

2015-08-18 11:59 GMT+02:00 Baptiste Clenet <bapclenet at gmail.com>:
> Hi,
>
> I'm trying to mount a emmc block on /mnt/mmc on a Ralink MT7628 board:
>
> root at OpenWrt:/# ls /dev/mmcblk0p1
> /dev/mmcblk0p1
> root at OpenWrt:/# ls /mnt/mmc/
> root at OpenWrt:/# mount -t -ext3 /dev/mmcblk0p1 /mnt/mmc/
> mount: mounting /dev/mmcblk0p1 on /mnt/mmc/ failed: No such device
>
> Am I missing something here? /mnt/mmc and /dev/mmcblk0p1 both exist.
>
> Regards,
>
> --
> Baptiste

I'm using Kernel 4.1.0 btw.

I tried to find the filesystem of /dev/mmcblk0p1 with
root at OpenWrt:/# tune2fs -l /dev/mmcblk0p1
tune2fs 1.42.12 (29-Aug-2014)
tune2fs: Bad magic number in super-block while trying to open /dev/mmcblk0p1
Couldn't find valid filesystem superblock.

root at OpenWrt:/# fdisk
Disk /dev/mmcblk0: 3875 MB, 3875536896 bytes
235 heads, 20 sectors/track, 1610 cylinders
Units = cylinders of 4700 * 512 = 2406400 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1               1        1610     3781632   6 FAT16


How may I mount this partition?


-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tochiro.srchack at gmail.com  Tue Aug 18 09:47:51 2015
From: tochiro.srchack at gmail.com (YuheiOKAWA)
Date: Tue, 18 Aug 2015 22:47:51 +0900
Subject: [OpenWrt-Devel] [PATCH v3] ramips: add support for Planex DB-WRT01
Message-ID: <1439905671-26850-1-git-send-email-tochiro.srchack@gmail.com>

 This patch add support for Planex DB-WRT01. DANBOARD route on
 the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio.
 DANBOARD is Cartoon character.

Signed-off-by: YuheiOKAWA <tochiro.srchack at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   3 +
 .../linux/ramips/base-files/etc/board.d/02_network |   1 +
 target/linux/ramips/base-files/etc/diag.sh         |   1 +
 target/linux/ramips/base-files/lib/ramips.sh       |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ramips/dts/DB-WRT01.dts               | 100 +++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |   2 +
 7 files changed, 111 insertions(+)
 create mode 100644 target/linux/ramips/dts/DB-WRT01.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 71cf3ac..a9959e3 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -87,6 +87,9 @@ d105)
 	ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
 	set_usb_led "$board:green:usb"
 	;;
+db-wrt01)
+	ucidef_set_led_default "power" "power" "$board:orange:power" "1"
+	;;
 dcs-930l-b1)
 	ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
 	ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 6a2f042..02cd682 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -61,6 +61,7 @@ ramips_setup_interfaces()
 		;;
 	3g-6200n|\
 	ai-br100|\
+	db-wrt01|\
 	dir-300-b7|\
 	dir-320-b1|\
 	dir-610-a1|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index a4911b0..f886b5d 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -94,6 +94,7 @@ get_status_led() {
 	y1s)
 		status_led="$board:blue:power"
 		;;
+	db-wrt01|\
 	esr-9753)
 		status_led="$board:orange:power"
 		;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 5cafd45..5b6808e 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -97,6 +97,9 @@ ramips_board_detect() {
 	*"DAP-1350")
 		name="dap-1350"
 		;;
+	*"DB-WRT01")
+		name="db-wrt01"
+		;;
 	*"DCS-930")
 		name="dcs-930"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 53e7070..844ed5d 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -36,6 +36,7 @@ platform_check_image() {
 	cf-wr800n|\
 	d105|\
 	dap-1350|\
+	db-wrt01|\
 	dcs-930|\
 	dcs-930l-b1|\
 	dir-300-b1|\
diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/DB-WRT01.dts
new file mode 100644
index 0000000..d0fbaf3
--- /dev/null
+++ b/target/linux/ramips/dts/DB-WRT01.dts
@@ -0,0 +1,100 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+	compatible = "ralink,mt7620a-soc";
+	model = "Planex DB-WRT01";
+
+	palmbus at 10000000 {
+		gpio1: gpio at 638 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "en25q64";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "mx25l6405d";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x7b0000>;
+				};
+			};
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "spi refclk", "rgmii1";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&ephy_pins>;
+		mtd-mac-address = <&factory 0x4>;
+		ralink,port-map = "llllw";
+	};
+
+	gsw at 10110000 {
+		ralink,port4 = "ephy";
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	pcie at 10140000 {
+		status = "okay";
+	};
+	
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power {
+			label = "db-wrt01:orange:power";
+			gpios = <&gpio1 1 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		s1 {
+			label = "wps";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x211>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 2f4d4cb..4632ad2 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -868,6 +868,7 @@ Image/Build/Profile/CF-WR800N=$(call BuildFirmware/Default8M/$(1),$(1),cf-wr800n
 Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
 na930_mtd_size=20971520
 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
+Image/Build/Profile/DB-WRT01=$(call BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01)
 Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP)
 Image/Build/Profile/OY-0001=$(call BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001)
 Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),y1,Y1)
@@ -901,6 +902,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/WHR300HP2,$(1))
 	$(call Image/Build/Profile/WHR600D,$(1))
 	$(call Image/Build/Profile/WHR1166D,$(1))
+	$(call Image/Build/Profile/DB-WRT01,$(1))
 	$(call Image/Build/Profile/MZK-750DHP,$(1))
 	$(call Image/Build/Profile/NA930,$(1))
 	$(call Image/Build/Profile/OY-0001,$(1))
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From wigyori at uid0.hu  Tue Aug 18 09:54:21 2015
From: wigyori at uid0.hu (Zoltan HERPAI)
Date: Tue, 18 Aug 2015 15:54:21 +0200
Subject: [OpenWrt-Devel] [PATCH v4 1/4] sunxi: don't copy DTS files to
 BIN_DIR
In-Reply-To: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>
References: <444251c58f56858b17765dec62d2992431d964b1.1439487967.git.mschiffer@universe-factory.net>
Message-ID: <55D3390D.5000103@uid0.hu>

Matthias Schiffer wrote:
> The DTS files aren't useful (other targets don't copy them either) and
> clutter BIN_DIR with files unrelated to the chosen profile.
>
> Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
>   
[snip]

Thanks Matthias, I've committed the series in r46604-46608.

Regards,
Zoltan H
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nyt-openwrt at countercultured.net  Tue Aug 18 10:21:13 2015
From: nyt-openwrt at countercultured.net (Rob Mosher)
Date: Tue, 18 Aug 2015 10:21:13 -0400
Subject: [OpenWrt-Devel] [PATCH] Fix for mvebu (WRT1900AC/WRT1200AC/etc)
	boot counter
Message-ID: <1439907673-23019-1-git-send-email-nyt-openwrt@countercultured.net>

The uboot boot counter was never reset after a successful boot.
This patch prevents bootcmd and boot_part from becoming out of sync
after a sysupgrade and ensures the proper partition is booted.

Signed-off-by: Rob Mosher <nyt-openwrt at countercultured.net>
---
 package/system/mtd/Makefile                        |   2 +-
 package/system/mtd/src/Makefile                    |   1 +
 package/system/mtd/src/mvebu.c                     | 100 +++++++++++++++++++++
 .../linux/mvebu/base-files/etc/init.d/u-boot_env   |   1 +
 4 files changed, 103 insertions(+), 1 deletion(-)
 create mode 100644 package/system/mtd/src/mvebu.c

diff --git a/package/system/mtd/Makefile b/package/system/mtd/Makefile
index 8d7bb44..ae1922f 100644
--- a/package/system/mtd/Makefile
+++ b/package/system/mtd/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mtd
-PKG_RELEASE:=20
+PKG_RELEASE:=21
 
 PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME)
 STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS)
diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile
index 27ac339..3424dd2 100644
--- a/package/system/mtd/src/Makefile
+++ b/package/system/mtd/src/Makefile
@@ -10,6 +10,7 @@ obj.brcm47xx = $(obj.brcm)
 obj.bcm53xx = $(obj.brcm)
 obj.brcm63xx = imagetag.o
 obj.ramips = $(obj.seama)
+obj.mvebu = mvebu.c
 
 ifdef FIS_SUPPORT
   obj += fis.o
diff --git a/package/system/mtd/src/mvebu.c b/package/system/mtd/src/mvebu.c
new file mode 100644
index 0000000..0929a97
--- /dev/null
+++ b/package/system/mtd/src/mvebu.c
@@ -0,0 +1,100 @@
+/*
+ * GPL Header ...
+ */
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <endian.h>
+#include <string.h>
+#include <errno.h>
+
+#include <sys/ioctl.h>
+#include <mtd/mtd-user.h>
+
+#include "mtd.h"
+
+#define BOOTCOUNT_MAGIC	0x20110811
+
+struct bootcounter {
+	uint32_t magic;
+	uint32_t count;
+	uint32_t checksum;
+};
+
+static char page[2048];
+
+int mtd_fixtrx(const char *mtd, size_t offset)
+{
+	struct mtd_info_user mtd_info;
+	struct bootcounter *curr = (struct bootcounter *)page;
+	unsigned int i;
+	int last_count = 0;
+	int num_bc;
+	int fd;
+	int ret;
+
+	fd = mtd_check_open(mtd);
+
+	if (ioctl(fd, MEMGETINFO, &mtd_info) < 0) {
+		fprintf(stderr, "failed to get mtd info!");
+		return -1;
+	}
+
+	num_bc = mtd_info.size / mtd_info.writesize;
+
+	for (i = 0; i < num_bc; i++) {
+		pread(fd, curr, sizeof(*curr), i * mtd_info.writesize);
+
+		if (curr->magic != BOOTCOUNT_MAGIC && curr->magic != 0xffffffff) {
+			printf("unexpected magic %08x, bailing out\n", curr->magic);
+			goto out;
+		}
+
+		if (curr->magic == 0xffffffff)
+			break;
+
+		last_count = curr->count;
+	}
+
+	/* no need to do writes when last boot count is already 0 */
+	if (last_count == 0)
+		goto out;
+
+
+	if (i == num_bc) {
+		struct erase_info_user erase_info;
+		erase_info.start = 0;
+		erase_info.length = mtd_info.size;
+
+		/* erase block */
+		ret = ioctl(fd, MEMERASE, &erase_info);
+		if (ret < 0) {
+			printf("failed to erase block: %i\n", ret);
+			return -1;
+		}
+
+		i = 0;
+	}
+
+	memset(curr, 0xff, mtd_info.writesize);
+
+	curr->magic = BOOTCOUNT_MAGIC;
+	curr->count = 0;
+	curr->checksum = BOOTCOUNT_MAGIC;
+
+	ret = pwrite(fd, curr, mtd_info.writesize, i * mtd_info.writesize);
+	if (ret < 0)
+		printf("failed to write: %i\n", ret);
+	sync();
+out:
+	close(fd);
+
+	return 0;
+}
diff --git a/target/linux/mvebu/base-files/etc/init.d/u-boot_env b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
index 82f36cb..2869dd6 100755
--- a/target/linux/mvebu/base-files/etc/init.d/u-boot_env
+++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
@@ -9,6 +9,7 @@ boot() {
 case $(mvebu_board_name) in
 	armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
 		fw_setenv auto_recovery off
+		mtd fixtrx s_env
 		;;
 esac
 }
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Tue Aug 18 11:36:39 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Tue, 18 Aug 2015 17:36:39 +0200
Subject: [OpenWrt-Devel] Mount mmc block
In-Reply-To: <CAPpUg6OyEnwixU39Ajv946oH57h4nzUidyvJT2fPhfPPryurPw@mail.gmail.com>
References: <CAPpUg6MR=anhX+J7DNNca9ifrz=RbBm8D7R_aiDQvxXjR6vk7g@mail.gmail.com>
 <CAPpUg6OyEnwixU39Ajv946oH57h4nzUidyvJT2fPhfPPryurPw@mail.gmail.com>
Message-ID: <55D35107.5060008@web.de>

On 18.08.2015 15:15, Baptiste Clenet wrote:
>  mount -t -ext3

On 18.08.2015 15:15, Baptiste Clenet wrote:
> /dev/mmcblk0p1               1        1610     3781632   6 ***FAT16***

mounting FAT16 with ext3 param fails ?
tune2fs is a part of e2fsprogs and probably cannot handle FAT16
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Tue Aug 18 12:10:42 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Tue, 18 Aug 2015 18:10:42 +0200
Subject: [OpenWrt-Devel] [PATCH] Fix for mvebu (WRT1900AC/WRT1200AC/etc)
 boot counter
In-Reply-To: <1439907673-23019-1-git-send-email-nyt-openwrt@countercultured.net>
References: <1439907673-23019-1-git-send-email-nyt-openwrt@countercultured.net>
Message-ID: <CAOiHx=mKNgzfavvZhoGuA+Jj6txN9ALMarhOMG-F+8u_aaeWog@mail.gmail.com>

On Tue, Aug 18, 2015 at 4:21 PM, Rob Mosher
<nyt-openwrt at countercultured.net> wrote:
> The uboot boot counter was never reset after a successful boot.
> This patch prevents bootcmd and boot_part from becoming out of sync
> after a sysupgrade and ensures the proper partition is booted.
>
> Signed-off-by: Rob Mosher <nyt-openwrt at countercultured.net>

Hm, that code looks awfully familiar ... right, I wrote it! So what
happened to my SOB?

> ---
>  package/system/mtd/Makefile                        |   2 +-
>  package/system/mtd/src/Makefile                    |   1 +
>  package/system/mtd/src/mvebu.c                     | 100 +++++++++++++++++++++
>  .../linux/mvebu/base-files/etc/init.d/u-boot_env   |   1 +
>  4 files changed, 103 insertions(+), 1 deletion(-)
>  create mode 100644 package/system/mtd/src/mvebu.c
>
> diff --git a/package/system/mtd/Makefile b/package/system/mtd/Makefile
> index 8d7bb44..ae1922f 100644
> --- a/package/system/mtd/Makefile
> +++ b/package/system/mtd/Makefile
> @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
>  include $(INCLUDE_DIR)/kernel.mk
>
>  PKG_NAME:=mtd
> -PKG_RELEASE:=20
> +PKG_RELEASE:=21
>
>  PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME)
>  STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS)
> diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile
> index 27ac339..3424dd2 100644
> --- a/package/system/mtd/src/Makefile
> +++ b/package/system/mtd/src/Makefile
> @@ -10,6 +10,7 @@ obj.brcm47xx = $(obj.brcm)
>  obj.bcm53xx = $(obj.brcm)
>  obj.brcm63xx = imagetag.o
>  obj.ramips = $(obj.seama)
> +obj.mvebu = mvebu.c

Does this even compile?

>
>  ifdef FIS_SUPPORT
>    obj += fis.o
> diff --git a/package/system/mtd/src/mvebu.c b/package/system/mtd/src/mvebu.c
> new file mode 100644
> index 0000000..0929a97
> --- /dev/null
> +++ b/package/system/mtd/src/mvebu.c
> @@ -0,0 +1,100 @@
> +/*
> + * GPL Header ...

You didn't even bother inserting a proper GPL license header here.

> + */
> +
> +
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <stddef.h>
> +#include <unistd.h>
> +#include <fcntl.h>
> +#include <sys/mman.h>
> +#include <sys/stat.h>
> +#include <endian.h>
> +#include <string.h>
> +#include <errno.h>
> +
> +#include <sys/ioctl.h>
> +#include <mtd/mtd-user.h>
> +
> +#include "mtd.h"
> +
> +#define BOOTCOUNT_MAGIC        0x20110811
> +
> +struct bootcounter {
> +       uint32_t magic;
> +       uint32_t count;
> +       uint32_t checksum;
> +};
> +
> +static char page[2048];
> +
> +int mtd_fixtrx(const char *mtd, size_t offset)
> +{
> +       struct mtd_info_user mtd_info;
> +       struct bootcounter *curr = (struct bootcounter *)page;
> +       unsigned int i;
> +       int last_count = 0;
> +       int num_bc;
> +       int fd;
> +       int ret;
> +
> +       fd = mtd_check_open(mtd);
> +
> +       if (ioctl(fd, MEMGETINFO, &mtd_info) < 0) {
> +               fprintf(stderr, "failed to get mtd info!");

or fix the missing newline here.

> +               return -1;
> +       }
> +
> +       num_bc = mtd_info.size / mtd_info.writesize;
> +
> +       for (i = 0; i < num_bc; i++) {
> +               pread(fd, curr, sizeof(*curr), i * mtd_info.writesize);
> +
> +               if (curr->magic != BOOTCOUNT_MAGIC && curr->magic != 0xffffffff) {
> +                       printf("unexpected magic %08x, bailing out\n", curr->magic);
> +                       goto out;
> +               }
> +
> +               if (curr->magic == 0xffffffff)
> +                       break;
> +
> +               last_count = curr->count;
> +       }
> +
> +       /* no need to do writes when last boot count is already 0 */
> +       if (last_count == 0)
> +               goto out;
> +
> +
> +       if (i == num_bc) {
> +               struct erase_info_user erase_info;
> +               erase_info.start = 0;
> +               erase_info.length = mtd_info.size;
> +
> +               /* erase block */
> +               ret = ioctl(fd, MEMERASE, &erase_info);
> +               if (ret < 0) {
> +                       printf("failed to erase block: %i\n", ret);
> +                       return -1;
> +               }
> +
> +               i = 0;
> +       }
> +
> +       memset(curr, 0xff, mtd_info.writesize);
> +
> +       curr->magic = BOOTCOUNT_MAGIC;
> +       curr->count = 0;
> +       curr->checksum = BOOTCOUNT_MAGIC;
> +
> +       ret = pwrite(fd, curr, mtd_info.writesize, i * mtd_info.writesize);
> +       if (ret < 0)
> +               printf("failed to write: %i\n", ret);
> +       sync();
> +out:
> +       close(fd);
> +
> +       return 0;
> +}
> diff --git a/target/linux/mvebu/base-files/etc/init.d/u-boot_env b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
> index 82f36cb..2869dd6 100755
> --- a/target/linux/mvebu/base-files/etc/init.d/u-boot_env
> +++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
> @@ -9,6 +9,7 @@ boot() {
>  case $(mvebu_board_name) in
>         armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
>                 fw_setenv auto_recovery off
> +               mtd fixtrx s_env
>                 ;;
>  esac
>  }
> --
> 2.1.4
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jmpoure at gooze.eu  Tue Aug 18 12:26:22 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Tue, 18 Aug 2015 18:26:22 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <55D31BB8.3070903@openwrt.org>
References: <1439830437.3207.10.camel@gooze.eu>
 <55D228BA.8040404@openwrt.org> <1439898309.3410.3.camel@gooze.eu>
 <55D31BB8.3070903@openwrt.org>
Message-ID: <1439915182.3147.2.camel@gooze.eu>

Le mardi 18 ao?t 2015 ? 13:49 +0200, Steven Barth a ?crit :
> Where you have option dhcpv6 and option ra you can add an option 
> ra_management
> and set it to 0, 1 or 2.
> 
> 0 means stateless only,
> 1 means stateless + stateful (default)
> 2 means stateful only
> 
> Please note that stateful is not supported by all clients, e.g. all 
> android-based devices
> will not have IPv6 connectivity with setting 2.

Thanks ! I could update my docs and add acknowledgment for your kind help.http://wiki.openwrt.org/doc/howto/freebox?&#acknowledgmentsremerciements
The only missing part in stateful only configuration is the?the default IPv6 gateway fe80::5642:49ff:fe87:xxxx on local network.
Do you know how to propagate the gateway automatically using DHCP6?
Kind regards,Gnutella
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150818/7e032fe7/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From cyrus at openwrt.org  Tue Aug 18 12:30:27 2015
From: cyrus at openwrt.org (Steven Barth)
Date: Tue, 18 Aug 2015 18:30:27 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <1439915182.3147.2.camel@gooze.eu>
References: <1439830437.3207.10.camel@gooze.eu> <55D228BA.8040404@openwrt.org>
 <1439898309.3410.3.camel@gooze.eu> <55D31BB8.3070903@openwrt.org>
 <1439915182.3147.2.camel@gooze.eu>
Message-ID: <55D35DA3.6010500@openwrt.org>


> Thanks ! I could update my docs and add acknowledgment for your kind help.http://wiki.openwrt.org/doc/howto/freebox?&#acknowledgmentsremerciements
> The only missing part in stateful only configuration is the the default IPv6 gateway fe80::5642:49ff:fe87:xxxx on local network.
> Do you know how to propagate the gateway automatically using DHCP6?

It is not possible, DHCPv6 doesn't carry routes. So you still need RAs even with ra_management set to 2.
OpenWrt announces itself as default router via RAs if it has an IPv6 default route itself and there is a suitable global address prefix on the interface (if option ra is set to server).
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nyt-openwrt at countercultured.net  Tue Aug 18 13:17:23 2015
From: nyt-openwrt at countercultured.net (Rob Mosher)
Date: Tue, 18 Aug 2015 13:17:23 -0400
Subject: [OpenWrt-Devel] [PATCH] Fix for mvebu (WRT1900AC/WRT1200AC/etc)
 boot counter
In-Reply-To: <CAOiHx=mKNgzfavvZhoGuA+Jj6txN9ALMarhOMG-F+8u_aaeWog@mail.gmail.com>
References: <1439907673-23019-1-git-send-email-nyt-openwrt@countercultured.net>
 <CAOiHx=mKNgzfavvZhoGuA+Jj6txN9ALMarhOMG-F+8u_aaeWog@mail.gmail.com>
Message-ID: <55D368A3.7050501@countercultured.net>

What's SOB?

Kaloz sent me the E4500 patch and told me less than a day to get it 
included into CC for the mvebu stuff.  I just applied it, fixed some 
very minor compile things, tested it, and sent in the patch since he 
went idle on IRC and I had to get to work after staying up all night.  I 
was going to reverse engineer the linksys recovery binary but he 
presented this instead.  I'm not trying to take any credit for this, 
just trying to get the router working properly and understood the CC 
deadline was fast approaching.  I'm new to the patch 
generation/submitting here so apologize if this stepped on any toes.

Yes, it compiles without warnings and it works.  Once it's run the boot 
counter no longer increments until a new image is flashed.  It should 
probably be renamed to something other than fixtrx as well. If you want 
to modify it properly or have suggestions on what to clean up I'm all ears.

On 8/18/2015 12:10 PM, Jonas Gorski wrote:
> On Tue, Aug 18, 2015 at 4:21 PM, Rob Mosher
> <nyt-openwrt at countercultured.net> wrote:
>> The uboot boot counter was never reset after a successful boot.
>> This patch prevents bootcmd and boot_part from becoming out of sync
>> after a sysupgrade and ensures the proper partition is booted.
>>
>> Signed-off-by: Rob Mosher <nyt-openwrt at countercultured.net>
> Hm, that code looks awfully familiar ... right, I wrote it! So what
> happened to my SOB?
>
>> ---
>>   package/system/mtd/Makefile                        |   2 +-
>>   package/system/mtd/src/Makefile                    |   1 +
>>   package/system/mtd/src/mvebu.c                     | 100 +++++++++++++++++++++
>>   .../linux/mvebu/base-files/etc/init.d/u-boot_env   |   1 +
>>   4 files changed, 103 insertions(+), 1 deletion(-)
>>   create mode 100644 package/system/mtd/src/mvebu.c
>>
>> diff --git a/package/system/mtd/Makefile b/package/system/mtd/Makefile
>> index 8d7bb44..ae1922f 100644
>> --- a/package/system/mtd/Makefile
>> +++ b/package/system/mtd/Makefile
>> @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
>>   include $(INCLUDE_DIR)/kernel.mk
>>
>>   PKG_NAME:=mtd
>> -PKG_RELEASE:=20
>> +PKG_RELEASE:=21
>>
>>   PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME)
>>   STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS)
>> diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile
>> index 27ac339..3424dd2 100644
>> --- a/package/system/mtd/src/Makefile
>> +++ b/package/system/mtd/src/Makefile
>> @@ -10,6 +10,7 @@ obj.brcm47xx = $(obj.brcm)
>>   obj.bcm53xx = $(obj.brcm)
>>   obj.brcm63xx = imagetag.o
>>   obj.ramips = $(obj.seama)
>> +obj.mvebu = mvebu.c
> Does this even compile?
>
>>   ifdef FIS_SUPPORT
>>     obj += fis.o
>> diff --git a/package/system/mtd/src/mvebu.c b/package/system/mtd/src/mvebu.c
>> new file mode 100644
>> index 0000000..0929a97
>> --- /dev/null
>> +++ b/package/system/mtd/src/mvebu.c
>> @@ -0,0 +1,100 @@
>> +/*
>> + * GPL Header ...
> You didn't even bother inserting a proper GPL license header here.
>
>> + */
>> +
>> +
>> +
>> +#include <stdio.h>
>> +#include <stdlib.h>
>> +#include <stddef.h>
>> +#include <unistd.h>
>> +#include <fcntl.h>
>> +#include <sys/mman.h>
>> +#include <sys/stat.h>
>> +#include <endian.h>
>> +#include <string.h>
>> +#include <errno.h>
>> +
>> +#include <sys/ioctl.h>
>> +#include <mtd/mtd-user.h>
>> +
>> +#include "mtd.h"
>> +
>> +#define BOOTCOUNT_MAGIC        0x20110811
>> +
>> +struct bootcounter {
>> +       uint32_t magic;
>> +       uint32_t count;
>> +       uint32_t checksum;
>> +};
>> +
>> +static char page[2048];
>> +
>> +int mtd_fixtrx(const char *mtd, size_t offset)
>> +{
>> +       struct mtd_info_user mtd_info;
>> +       struct bootcounter *curr = (struct bootcounter *)page;
>> +       unsigned int i;
>> +       int last_count = 0;
>> +       int num_bc;
>> +       int fd;
>> +       int ret;
>> +
>> +       fd = mtd_check_open(mtd);
>> +
>> +       if (ioctl(fd, MEMGETINFO, &mtd_info) < 0) {
>> +               fprintf(stderr, "failed to get mtd info!");
> or fix the missing newline here.
>
>> +               return -1;
>> +       }
>> +
>> +       num_bc = mtd_info.size / mtd_info.writesize;
>> +
>> +       for (i = 0; i < num_bc; i++) {
>> +               pread(fd, curr, sizeof(*curr), i * mtd_info.writesize);
>> +
>> +               if (curr->magic != BOOTCOUNT_MAGIC && curr->magic != 0xffffffff) {
>> +                       printf("unexpected magic %08x, bailing out\n", curr->magic);
>> +                       goto out;
>> +               }
>> +
>> +               if (curr->magic == 0xffffffff)
>> +                       break;
>> +
>> +               last_count = curr->count;
>> +       }
>> +
>> +       /* no need to do writes when last boot count is already 0 */
>> +       if (last_count == 0)
>> +               goto out;
>> +
>> +
>> +       if (i == num_bc) {
>> +               struct erase_info_user erase_info;
>> +               erase_info.start = 0;
>> +               erase_info.length = mtd_info.size;
>> +
>> +               /* erase block */
>> +               ret = ioctl(fd, MEMERASE, &erase_info);
>> +               if (ret < 0) {
>> +                       printf("failed to erase block: %i\n", ret);
>> +                       return -1;
>> +               }
>> +
>> +               i = 0;
>> +       }
>> +
>> +       memset(curr, 0xff, mtd_info.writesize);
>> +
>> +       curr->magic = BOOTCOUNT_MAGIC;
>> +       curr->count = 0;
>> +       curr->checksum = BOOTCOUNT_MAGIC;
>> +
>> +       ret = pwrite(fd, curr, mtd_info.writesize, i * mtd_info.writesize);
>> +       if (ret < 0)
>> +               printf("failed to write: %i\n", ret);
>> +       sync();
>> +out:
>> +       close(fd);
>> +
>> +       return 0;
>> +}
>> diff --git a/target/linux/mvebu/base-files/etc/init.d/u-boot_env b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
>> index 82f36cb..2869dd6 100755
>> --- a/target/linux/mvebu/base-files/etc/init.d/u-boot_env
>> +++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
>> @@ -9,6 +9,7 @@ boot() {
>>   case $(mvebu_board_name) in
>>          armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
>>                  fw_setenv auto_recovery off
>> +               mtd fixtrx s_env
>>                  ;;
>>   esac
>>   }
>> --
>> 2.1.4
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From smilebef at gmail.com  Tue Aug 18 14:39:20 2015
From: smilebef at gmail.com (smilebef at gmail.com)
Date: Tue, 18 Aug 2015 20:39:20 +0200
Subject: [OpenWrt-Devel] Mount mmc block
In-Reply-To: <CAPpUg6MR=anhX+J7DNNca9ifrz=RbBm8D7R_aiDQvxXjR6vk7g@mail.gmail.com>
References: <CAPpUg6MR=anhX+J7DNNca9ifrz=RbBm8D7R_aiDQvxXjR6vk7g@mail.gmail.com>
Message-ID: <20150818203920.1c52a6e3@None>

On Tue, 18 Aug 2015 11:59:11 +0200
Baptiste Clenet <bapclenet at gmail.com> wrote:

> mount -t -ext3 /dev/mmcblk0p1 /mnt/mmc/

is ist better so?

mount -t ext3 /dev/mmcblk0p1 /mnt/mmc/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150818/c5385b19/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From bapclenet at gmail.com  Tue Aug 18 14:56:59 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Tue, 18 Aug 2015 20:56:59 +0200
Subject: [OpenWrt-Devel] Mount mmc block
In-Reply-To: <20150818203920.1c52a6e3@None>
References: <CAPpUg6MR=anhX+J7DNNca9ifrz=RbBm8D7R_aiDQvxXjR6vk7g@mail.gmail.com>
 <20150818203920.1c52a6e3@None>
Message-ID: <CAPpUg6MmnbGAgKxq7e_xxPNWGv6u3J1X=0K4MxWBmkUiYR313g@mail.gmail.com>

2015-08-18 20:39 GMT+02:00  <smilebef at gmail.com>:
> On Tue, 18 Aug 2015 11:59:11 +0200
> Baptiste Clenet <bapclenet at gmail.com> wrote:
>
>> mount -t -ext3 /dev/mmcblk0p1 /mnt/mmc/
I tried with FAT16 as well
>
> is ist better so?
>
> mount -t ext3 /dev/mmcblk0p1 /mnt/mmc/
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
The solution was to format the emmc and create an ext4 file system.

Thanks.


-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From martin.blumenstingl at googlemail.com  Tue Aug 18 15:03:09 2015
From: martin.blumenstingl at googlemail.com (Martin Blumenstingl)
Date: Tue, 18 Aug 2015 21:03:09 +0200
Subject: [OpenWrt-Devel] [PATCH v3] lantiq: get more status information
 from xDSL
In-Reply-To: <CALPCC5y35hb2sN1EBgJKS8MOg7AW_hFA7bW8FTp4NRpUCLzHtQ@mail.gmail.com>
References: <1438839704-7187-1-git-send-email-Eckert.Florian@googlemail.com>
 <55C3099B.20807@gmail.com>
 <CALPCC5wd1x65PxN9FhKs1gDGhzgUCpTqmdevCPHbtQz80k16kw@mail.gmail.com>
 <CAJSWe5ZaLfNh2Jd08fJsn0=xWCFqZXYBQ+p7j-Bm-UkGqwOsoA@mail.gmail.com>
 <CALPCC5y35hb2sN1EBgJKS8MOg7AW_hFA7bW8FTp4NRpUCLzHtQ@mail.gmail.com>
Message-ID: <CAFBinCAkjX0PLSwsUnjkePEzhcmmk8PV4FnbFdz0ujtoS7G2xQ@mail.gmail.com>

Hi John,

I have just seen that you are not CC'ed here yet.
Could you please have a look at Florian's patch [0] and merge it,
since quite a few people seem to be interested in this kind of
functionality?


Regards,
Martin


[0] http://patchwork.ozlabs.org/patch/504567/
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From francesco.borromini at inventati.org  Tue Aug 18 15:44:29 2015
From: francesco.borromini at inventati.org (Stijn Segers)
Date: Tue, 18 Aug 2015 21:44:29 +0200
Subject: [OpenWrt-Devel] [PATCH v3] Add Minibox v1.0 support
Message-ID: <1439927069-2780-1-git-send-email-francesco.borromini@inventati.org>

This patch adds Gainstrong Minibox v1.0 into trunk. I have addressed the
following issues:
- all caps prefix
- added vendor

I have built images and asked for testing on the forums, the image has
been confirmed working but the LED is off during normal operation (I assume
this is the possible LED polarity issue Karl Palsson was talking about?)

Questions:

- Can I simply set gpio_led minibox_v1_leds_gpio to active.low = 1 or isn't
  that how it works?
- Should I give the 799 minibox kernel support patch a number that follows
  the existing patches more closely (e.g. 750) or doesn't that matter?

Thanks

Signed-off by: Stijn Segers <francesco.borromini at inventati.org>

---
 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       |  6 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
 target/linux/ar71xx/config-4.1                     |  1 +
 .../ar71xx/files/arch/mips/ath79/mach-minibox-v1.c | 84 ++++++++++++++++++++++
 target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +++++
 target/linux/ar71xx/image/Makefile                 |  9 +++
 .../799-MIPS-ath79-add-minibox-v1-support.patch    | 39 ++++++++++
 9 files changed, 161 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
 create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk
 create mode 100644 target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 36de775..342c68c 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -219,6 +219,9 @@ get_status_led() {
 	smart-300)
 		status_led="nc-link:green:system"
 		;;
+	minibox-v1)
+		status_led="minibox-v1:green:system"
+		;;
 	oolite)
 		status_led="oolite:red:system"
 		;;
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 686fce9..49f6b55 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -425,6 +425,7 @@ dir-615-e4 |\
 hiwifi-hc6361 |\
 ja76pf |\
 mc-mac1200r|\
+minibox-v1 |\
 mynet-n600 |\
 oolite |\
 qihoo-c301 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index e1f345e..4f9735f 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -119,6 +119,9 @@ tplink_board_detect() {
 	"3C0001"*)
 		model="OOLITE"
 		;;
+	"3C0002"*)
+		model="Minibox_v1"
+		;;
 	"070300"*)
 		model="TP-Link TL-WR703N"
 		;;
@@ -502,6 +505,9 @@ ar71xx_board_detect() {
 	*"MAC1200R")
 		name="mc-mac1200r"
 		;;
+	*"Minibox v1.0")
+		name="minibox-v1"
+		;;
 	*MR12)
 		name="mr12"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index c1962e4..0b7b84c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -314,6 +314,7 @@ platform_check_image() {
 	el-mini | \
 	gl-inet | \
 	mc-mac1200r | \
+	minibox-v1 |\
 	onion-omega | \
 	oolite | \
 	smart-300 | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 21c4601..49f2ac1 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -79,6 +79,7 @@ CONFIG_ATH79_MACH_HORNET_UB=y
 CONFIG_ATH79_MACH_JA76PF=y
 CONFIG_ATH79_MACH_JWAP003=y
 CONFIG_ATH79_MACH_MC_MAC1200R=y
+CONFIG_ATH79_MACH_MINIBOX_V1=y
 CONFIG_ATH79_MACH_MR12=y
 CONFIG_ATH79_MACH_MR16=y
 CONFIG_ATH79_MACH_MR600=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
new file mode 100644
index 0000000..7c26cab
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
@@ -0,0 +1,84 @@
+/*
+ *  Minibox v1.0 board support
+ *
+ *
+ *  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.
+ */
+
+#include <linux/gpio.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define MINIBOX_V1_GPIO_BTN_RESET	11
+
+#define MINIBOX_V1_GPIO_LED_SYSTEM	1
+
+#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
+#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * MINIBOX_V1_KEYS_POLL_INTERVAL)
+
+static const char *minibox_v1_part_probes[] = {
+	"tp-link",
+	NULL,
+};
+
+static struct flash_platform_data minibox_v1_flash_data = {
+	.part_probes	= minibox_v1_part_probes,
+};
+
+static struct gpio_led minibox_v1_leds_gpio[] __initdata = {
+	{
+		.name		= "minibox-v1:green:system",
+		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
+		.active_low	= 0,
+	},
+};
+
+static struct gpio_keys_button minibox_v1_gpio_keys[] __initdata = {
+	{
+		.desc		= "reset",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
+		.active_low	= 0,
+	},
+};
+
+static void __init minibox_v1_setup(void)
+{
+	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(minibox_v1_leds_gpio),
+				 minibox_v1_leds_gpio);
+
+	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(minibox_v1_gpio_keys),
+					minibox_v1_gpio_keys);
+
+	ath79_register_usb();
+
+	ath79_register_m25p80(&minibox_v1_flash_data);
+	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
+
+	ath79_register_mdio(0, 0x0);
+	ath79_register_eth(1);
+	ath79_register_eth(0);
+
+	ath79_register_wmac(ee, mac);
+}
+
+MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1", "MiniBox V1.0", minibox_v1_setup);
diff --git a/target/linux/ar71xx/generic/profiles/minibox-v1.mk b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
new file mode 100644
index 0000000..cbdb123
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Miniboxv1
+	NAME:=Minibox v1.0
+	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
+endef
+
+
+define Profile/Miniboxv1/Description
+	Package set optimized for the Gainstrong Minibox v1.0
+endef
+$(eval $(call Profile,Miniboxv1))
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 8f609de..4a2a45e 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -397,6 +397,15 @@ define Device/mc-mac1200r
 endef
 TARGET_DEVICES += mc-mac1200r
 
+define Device/minibox-v1
+    $(Device/tplink-16mlzma)
+    BOARDNAME := Minibox-v1
+    DEVICE_PROFILE := Miniboxv1
+    TPLINK_HWID := 0x3C000201
+    CONSOLE := ttyATH0,115200
+endef
+TARGET_DEVICES += minibox-v1
+
 define Device/onion-omega
     $(Device/tplink-16mlzma)
     BOARDNAME := ONION-OMEGA
diff --git a/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
new file mode 100644
index 0000000..75be5fe
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
@@ -0,0 +1,39 @@
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -74,6 +74,7 @@ enum ath79_mach_type {
+	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
+	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
+	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
++	ATH79_MACH_MINIBOX_V1,		/* Gainstrong Minibox v1.0 */
+	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
+	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
+	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -596,6 +596,16 @@
+	select ATH79_DEV_M25P80
+	select ATH79_DEV_USB
+
++config ATH79_MACH_MINIBOX_V1
++	bool "Minibox v1.0 support"
++	select SOC_AR933X
++	select ARH79_DEV_ETH
++	select ARH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_WRT160NL
+	bool "Linksys WRT160NL board support"
+	select SOC_AR913X
+--- a/arch/mips/ath79/Makefile	2015-08-10 23:27:44.599500173 +0200
++++ b/arch/mips/ath79/Makefile	2015-08-10 23:29:25.090929262 +0200
+@@ -85,6 +85,7 @@
+ obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
+ obj-$(CONFIG_ATH79_MACH_HORNET_UB)	+= mach-hornet-ub.o
+ obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)     += mach-mc-mac1200r.o
++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
+ obj-$(CONFIG_ATH79_MACH_MR12)		+= mach-mr12.o
+ obj-$(CONFIG_ATH79_MACH_MR16)		+= mach-mr16.o
+ obj-$(CONFIG_ATH79_MACH_MR600)		+= mach-mr600.o
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From karlp at tweak.net.au  Tue Aug 18 16:43:58 2015
From: karlp at tweak.net.au (Karl Palsson)
Date: Tue, 18 Aug 2015 20:43:58 -0000
Subject: [OpenWrt-Devel] [PATCH v3] Add Minibox v1.0 support
In-Reply-To: <1439927069-2780-1-git-send-email-francesco.borromini@inventati.org>
References: <1439927069-2780-1-git-send-email-francesco.borromini@inventati.org>
Message-ID: <20150818203821-21159-19246-mailpile@palmtree-beeroclock-net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stijn Segers <francesco.borromini at inventati.org> wrote:
> This patch adds Gainstrong Minibox v1.0 into trunk. I have addressed the
> following issues:
> - all caps prefix
> - added vendor
> 
> I have built images and asked for testing on the forums, the image has
> been confirmed working but the LED is off during normal operation (I
> assume
> this is the possible LED polarity issue Karl Palsson was talking about?)
> 
> Questions:
> 
> - Can I simply set gpio_led minibox_v1_leds_gpio to active.low = 1 or isn't
>   that how it works?

Yup, that's exactly how it works, and is indeed what I was getting
earlier.  Test that out and make sure that when you modify the leds
files in  /sys/class/leds/xxxxx/brightness that 255 means led is on/lit,
and 0 means off/dark.  

Cheers,
Karl P

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

iQIcBAEBAgAGBQJV05kOAAoJEBmotQ/U1cr2VbwQAKoXshakR92v+RHsrCxttIfi
8jS2BzWGQWhWQOGPkMPevDlX+kLYUrySliLALmZYWCuvXimkFXb5k9BsQycOy02n
ZV5aZEkdUWwqISnVVqKuhCnDuP5RSEdkTleCs6+BzdqMAOYmgSl5eEmxaZWO0QeH
652xyvis+JhmLyw/jjn6pjbHgeUazpyfYwMWAJQ7iQUfQy2BGBUgQbtlX2nm0H4y
gonY6LUl8xyikV/d8IagzOMViGvPZ0w4oV1bx7xG5a6jmHKrvnXD+5yqv13Fq5+v
aHh5q243MPm5LG+qxsDS/Y5BAv2IxZ8sdzmdQPwbuhbH5JXEDNZhJZllznNITwEh
Wzg+VqMDNnpxlVR9UsMU6mnqjDieGngermw0kfaCiLyRL7JNyCfSEWSgfQFXjrSk
Tc83AdQ+D39ymPyLm0uP9ylvg3pL9/TqO34R26OB4mOdeiQJA3fBqVoKSZzQbmz6
4V3PY+eKD/GOabjaSZLRhOXjykhFqkv9K8E1F12jGlryy9ZrPFSk5+d/lsRGOBJ7
JfIJeQ1/746KkYk79YbFgqgjGYIqGvc+GSq4QXRPT+UCh+TONxQOCkSf3OQ2egMX
XpvWu9dcSlK7glrBOYURHKPNiUvmUYl1Fx5OKBQlSuBi1nblDi40NSpYaCYMcT8g
T2Oxf6TjYzGh+fJ7gvlY
=cbeg
-----END PGP SIGNATURE-----
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nyt-openwrt at countercultured.net  Tue Aug 18 18:56:14 2015
From: nyt-openwrt at countercultured.net (Rob Mosher)
Date: Tue, 18 Aug 2015 18:56:14 -0400
Subject: [OpenWrt-Devel] [PATCH V2] Fix for mvebu (WRT1900AC/WRT1200AC/etc)
	boot counter
Message-ID: <1439938574-26818-1-git-send-email-nyt-openwrt@countercultured.net>

The uboot boot counter was never reset after a successful boot.
This patch prevents bootcmd and boot_part from becoming out of sync
after a sysupgrade and ensures the proper partition is booted.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
Signed-off-by: Rob Mosher <nyt-openwrt at countercultured.net>
---
 package/system/mtd/Makefile                        |   2 +-
 package/system/mtd/src/Makefile                    |   1 +
 package/system/mtd/src/linksys_bootcount.c         | 114 +++++++++++++++++++++
 package/system/mtd/src/mtd.c                       |  12 +++
 package/system/mtd/src/mtd.h                       |   1 +
 .../linux/mvebu/base-files/etc/init.d/u-boot_env   |   1 +
 6 files changed, 130 insertions(+), 1 deletion(-)
 create mode 100644 package/system/mtd/src/linksys_bootcount.c

diff --git a/package/system/mtd/Makefile b/package/system/mtd/Makefile
index 8d7bb44..ae1922f 100644
--- a/package/system/mtd/Makefile
+++ b/package/system/mtd/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mtd
-PKG_RELEASE:=20
+PKG_RELEASE:=21
 
 PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME)
 STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS)
diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile
index 27ac339..40a165e 100644
--- a/package/system/mtd/src/Makefile
+++ b/package/system/mtd/src/Makefile
@@ -10,6 +10,7 @@ obj.brcm47xx = $(obj.brcm)
 obj.bcm53xx = $(obj.brcm)
 obj.brcm63xx = imagetag.o
 obj.ramips = $(obj.seama)
+obj.mvebu = linksys_bootcount.o
 
 ifdef FIS_SUPPORT
   obj += fis.o
diff --git a/package/system/mtd/src/linksys_bootcount.c b/package/system/mtd/src/linksys_bootcount.c
new file mode 100644
index 0000000..95f75fe
--- /dev/null
+++ b/package/system/mtd/src/linksys_bootcount.c
@@ -0,0 +1,114 @@
+/*
+ * Linksys boot counter reset code for mtd
+ *
+ * Copyright (C) 2013 Jonas Gorski <jogo at openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License v2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <endian.h>
+#include <string.h>
+#include <errno.h>
+
+#include <sys/ioctl.h>
+#include <mtd/mtd-user.h>
+
+#include "mtd.h"
+
+#define BOOTCOUNT_MAGIC	0x20110811
+
+struct bootcounter {
+	uint32_t magic;
+	uint32_t count;
+	uint32_t checksum;
+};
+
+static char page[2048];
+
+int mtd_resetbc(const char *mtd)
+{
+	struct mtd_info_user mtd_info;
+	struct bootcounter *curr = (struct bootcounter *)page;
+	unsigned int i;
+	int last_count = 0;
+	int num_bc;
+	int fd;
+	int ret;
+
+	fd = mtd_check_open(mtd);
+
+	if (ioctl(fd, MEMGETINFO, &mtd_info) < 0) {
+		fprintf(stderr, "failed to get mtd info!\n");
+		return -1;
+	}
+
+	num_bc = mtd_info.size / mtd_info.writesize;
+
+	for (i = 0; i < num_bc; i++) {
+		pread(fd, curr, sizeof(*curr), i * mtd_info.writesize);
+
+		if (curr->magic != BOOTCOUNT_MAGIC && curr->magic != 0xffffffff) {
+			fprintf(stderr, "unexpected magic %08x, bailing out\n", curr->magic);
+			goto out;
+		}
+
+		if (curr->magic == 0xffffffff)
+			break;
+
+		last_count = curr->count;
+	}
+
+	/* no need to do writes when last boot count is already 0 */
+	if (last_count == 0)
+		goto out;
+
+
+	if (i == num_bc) {
+		struct erase_info_user erase_info;
+		erase_info.start = 0;
+		erase_info.length = mtd_info.size;
+
+		/* erase block */
+		ret = ioctl(fd, MEMERASE, &erase_info);
+		if (ret < 0) {
+			fprintf(stderr, "failed to erase block: %i\n", ret);
+			return -1;
+		}
+
+		i = 0;
+	}
+
+	memset(curr, 0xff, mtd_info.writesize);
+
+	curr->magic = BOOTCOUNT_MAGIC;
+	curr->count = 0;
+	curr->checksum = BOOTCOUNT_MAGIC;
+
+	ret = pwrite(fd, curr, mtd_info.writesize, i * mtd_info.writesize);
+	if (ret < 0)
+		fprintf(stderr, "failed to write: %i\n", ret);
+	sync();
+out:
+	close(fd);
+
+	return 0;
+}
diff --git a/package/system/mtd/src/mtd.c b/package/system/mtd/src/mtd.c
index 741b57b..0247630 100644
--- a/package/system/mtd/src/mtd.c
+++ b/package/system/mtd/src/mtd.c
@@ -640,6 +640,10 @@ static void usage(void)
 	"        verify <imagefile>|-    verify <imagefile> (use - for stdin) to device\n"
 	"        write <imagefile>|-     write <imagefile> (use - for stdin) to device\n"
 	"        jffs2write <file>       append <file> to the jffs2 partition on the device\n");
+	if (mtd_resetbc) {
+	    fprintf(stderr,
+	"        resetbc <device>        reset the uboot boot counter\n");
+	}
 	if (mtd_fixtrx) {
 	    fprintf(stderr,
 	"        fixtrx                  fix the checksum in a trx header on first boot\n");
@@ -706,6 +710,7 @@ int main (int argc, char **argv)
 		CMD_FIXSEAMA,
 		CMD_VERIFY,
 		CMD_DUMP,
+		CMD_RESETBC,
 	} cmd = -1;
 
 	erase[0] = NULL;
@@ -800,6 +805,9 @@ int main (int argc, char **argv)
 	} else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) {
 		cmd = CMD_ERASE;
 		device = argv[1];
+	} else if (((strcmp(argv[0], "resetbc") == 0) && (argc == 2)) && mtd_resetbc) {
+		cmd = CMD_RESETBC;
+		device = argv[1];
 	} else if (((strcmp(argv[0], "fixtrx") == 0) && (argc == 2)) && mtd_fixtrx) {
 		cmd = CMD_FIXTRX;
 		device = argv[1];
@@ -892,6 +900,10 @@ int main (int argc, char **argv)
 		    if (mtd_fixtrx) {
 			    mtd_fixtrx(device, offset);
             }
+		case CMD_RESETBC:
+		    if (mtd_resetbc) {
+			    mtd_resetbc(device);
+            }
 		case CMD_FIXSEAMA:
 			if (mtd_fixseama)
 			    mtd_fixseama(device, 0);
diff --git a/package/system/mtd/src/mtd.h b/package/system/mtd/src/mtd.h
index d94f394..fb37b8b 100644
--- a/package/system/mtd/src/mtd.h
+++ b/package/system/mtd/src/mtd.h
@@ -27,4 +27,5 @@ extern int trx_fixup(int fd, const char *name)  __attribute__ ((weak));
 extern int trx_check(int imagefd, const char *mtd, char *buf, int *len) __attribute__ ((weak));
 extern int mtd_fixtrx(const char *mtd, size_t offset) __attribute__ ((weak));
 extern int mtd_fixseama(const char *mtd, size_t offset) __attribute__ ((weak));
+extern int mtd_resetbc(const char *mtd) __attribute__ ((weak));
 #endif /* __mtd_h */
diff --git a/target/linux/mvebu/base-files/etc/init.d/u-boot_env b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
index 82f36cb..bf038b2 100755
--- a/target/linux/mvebu/base-files/etc/init.d/u-boot_env
+++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
@@ -9,6 +9,7 @@ boot() {
 case $(mvebu_board_name) in
 	armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
 		fw_setenv auto_recovery off
+		mtd resetbc s_env
 		;;
 esac
 }
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From attila at lendvai.name  Tue Aug 18 19:40:29 2015
From: attila at lendvai.name (Attila Lendvai)
Date: Wed, 19 Aug 2015 01:40:29 +0200
Subject: [OpenWrt-Devel] PATCH two patches for the AP121 reference board
	(ar9331)
Message-ID: <CAE4vfc+7Q3wOV01YEsz1Gv6i888oLTBc8nesROT5HOQfU+tFng@mail.gmail.com>

hi!

these are my first OpenWRT patches, sorry if i'm breaking any rules.

one of them fixes board name detection (and thus sysupgrade); the
other one adds a 8M flash target and rearranges the kernel size so
that the firmware files get built properly.

they are attached in the issue tracker also:

https://dev.openwrt.org/ticket/17885
https://dev.openwrt.org/ticket/14571

it would be great if they could get into CC final.

-- 
? attila lendvai
? PGP: 963F 5D5F 45C7 DFCD 0A39
--
?Few facts are more revealing than the direction people travel when
they vote with their feet.?
	? Don Boudreaux, http://bit.ly/afZgx2
-------------- next part --------------
Index: target/linux/ar71xx/image/Makefile
===================================================================
--- target/linux/ar71xx/image/Makefile	(revision 46302)
+++ target/linux/ar71xx/image/Makefile	(working copy)
@@ -909,7 +909,8 @@
 ap96_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1728k(kernel),64k(art)ro,7872k at 0x40000(firmware)
 ap113_mtd_layout=mtdparts=spi0.0:64k(u-boot),3008k(rootfs),896k(uImage),64k(NVRAM),64k(ART),3904k at 0x10000(firmware)
 ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k at 0x10000(firmware)
-ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k at 0x50000(firmware)
+ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2448k(rootfs),1200k(kernel),64k(nvram),64k(art)ro,3648k at 0x50000(firmware)
+ap121_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 ap132_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art),7808k at 0x50000(firmware)
 ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k at 0x50000(firmware)
 ap136_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(mib0),64k(art)ro,7744k at 0x50000(firmware)
@@ -1801,6 +1802,7 @@
 $(eval $(call SingleProfile,AthLzma,64k,AP113,ap113,AP113,ttyS0,115200,$$(ap113_mtd_layout),RK))
 $(eval $(call SingleProfile,AthLzma,64k,AP121_2M,ap121-2M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_2M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP121_4M,ap121-4M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP121_8M,ap121-8M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_8M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP121MINI,ap121-mini,AP121-MINI,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP132,ap132,AP132,ttyS0,115200,$$(ap132_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP135,ap135-020,AP135-020,ttyS0,115200,$$(ap135_mtdlayout),RKuImage))
@@ -1971,7 +1973,7 @@
 
 $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
 
-$(eval $(call MultiProfile,AP121,AP121_2M AP121_4M))
+$(eval $(call MultiProfile,AP121,AP121_2M AP121_4M AP121_8M))
 $(eval $(call MultiProfile,AP136,AP136_010 AP136_020))
 $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M))
 $(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AP121-fix-board-detection-in-ar71xx.sh.patch
Type: text/x-patch
Size: 713 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150819/4362b13b/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From leitec at staticky.com  Tue Aug 18 20:16:24 2015
From: leitec at staticky.com (Claudio Leite)
Date: Tue, 18 Aug 2015 20:16:24 -0400
Subject: [OpenWrt-Devel] [PATCH V2] Fix for mvebu
 (WRT1900AC/WRT1200AC/etc) boot counter
In-Reply-To: <1439938574-26818-1-git-send-email-nyt-openwrt@countercultured.net>
References: <1439938574-26818-1-git-send-email-nyt-openwrt@countercultured.net>
Message-ID: <20150819001624.GR4848@pfzt.net>

* Rob Mosher (nyt-openwrt at countercultured.net) wrote:
> +++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
> @@ -9,6 +9,7 @@ boot() {
>  case $(mvebu_board_name) in
>  	armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
>  		fw_setenv auto_recovery off

With s_env now properly updated, is there still a reason to turn off
auto_recovery?

I know it's generally a poor recovery mechanism, but as long as it
doesn't interfere with booting OpenWrt it might be better than nothing.

> +		mtd resetbc s_env
>  		;;
>  esac
>  }
> -- 
> 2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nyt-openwrt at countercultured.net  Tue Aug 18 20:29:05 2015
From: nyt-openwrt at countercultured.net (Rob Mosher)
Date: Tue, 18 Aug 2015 20:29:05 -0400
Subject: [OpenWrt-Devel] [PATCH V2] Fix for mvebu
 (WRT1900AC/WRT1200AC/etc) boot counter
In-Reply-To: <20150819001624.GR4848@pfzt.net>
References: <1439938574-26818-1-git-send-email-nyt-openwrt@countercultured.net>
 <20150819001624.GR4848@pfzt.net>
Message-ID: <55D3CDD1.2060805@countercultured.net>

Auto recovery is enabled when flashing, so if it goes wrong, you can get 
back to your previous image.  Otherwise, I don't think there's a need 
for it as all it does is switch which kernel/root partitions are booted 
which shouldn't ever change unless flashing (famous last words?).


root at ZOMGWTFBBQWIFI:/lib/upgrade# cat linksys.sh
#
# Copyright (C) 2014-2015 OpenWrt.org
#

linksys_get_target_firmware() {
         cur_boot_part=`/usr/sbin/fw_printenv -n boot_part`
         target_firmware=""
         if [ "$cur_boot_part" = "1" ]
         then
                 # current primary boot - update alt boot
                 target_firmware="kernel2"
                 fw_setenv boot_part 2
                 fw_setenv bootcmd "run altnandboot"
         elif [ "$cur_boot_part" = "2" ]
         then
                 # current alt boot - update primary boot
                 target_firmware="kernel1"
                 fw_setenv boot_part 1
                 fw_setenv bootcmd "run nandboot"
         fi

         # re-enable recovery so we get back if the new firmware is broken
         fw_setenv auto_recovery yes

         echo "$target_firmware"
}
[...]


On 8/18/2015 8:16 PM, Claudio Leite wrote:
> * Rob Mosher (nyt-openwrt at countercultured.net) wrote:
>> +++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
>> @@ -9,6 +9,7 @@ boot() {
>>   case $(mvebu_board_name) in
>>   	armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
>>   		fw_setenv auto_recovery off
> With s_env now properly updated, is there still a reason to turn off
> auto_recovery?
>
> I know it's generally a poor recovery mechanism, but as long as it
> doesn't interfere with booting OpenWrt it might be better than nothing.
>
>> +		mtd resetbc s_env
>>   		;;
>>   esac
>>   }
>> -- 
>> 2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From leitec at staticky.com  Tue Aug 18 21:00:52 2015
From: leitec at staticky.com (Claudio Leite)
Date: Tue, 18 Aug 2015 21:00:52 -0400
Subject: [OpenWrt-Devel] [PATCH V2] Fix for mvebu
 (WRT1900AC/WRT1200AC/etc) boot counter
In-Reply-To: <55D3CDD1.2060805@countercultured.net>
References: <1439938574-26818-1-git-send-email-nyt-openwrt@countercultured.net>
 <20150819001624.GR4848@pfzt.net>
 <55D3CDD1.2060805@countercultured.net>
Message-ID: <20150819010052.GS4848@pfzt.net>

* Rob Mosher (nyt-openwrt at countercultured.net) wrote:
> Auto recovery is enabled when flashing, so if it goes wrong, you can get
> back to your previous image.  Otherwise, I don't think there's a need for it
> as all it does is switch which kernel/root partitions are booted which
> shouldn't ever change unless flashing (famous last words?).

The use case for leaving it on is for somebody without serial console
access who tries something slightly risky and breaks the active image.
Say, an image that gets far enough to get to mtd resetbc and set
auto_recovery to off, but not actually work (no network, etc.) There are
also enough cases of people messing up their active images on the
WRT1900AC forum thread, one way or another.

If auto_recovery were kept on, they could then use that trick posted
in the wiki ("Stock Firmware Recovery") to manually trigger the
auto recovery to flip back to the other image. (that of course assumes
the other firmware works, but again, this isn't a great recovery
mechanism...)

I tested a build with this patch but auto_recovery kept to "on" and it
works as expected after many reboots. I also manually triggered the
auto_recovery flip, which also worked as expected. So, it seems like it
doesn't really cost anything to keep it on (not yet, at least) while
providing a fringe benefit.

-Claudio
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nyt-openwrt at countercultured.net  Tue Aug 18 21:10:22 2015
From: nyt-openwrt at countercultured.net (Rob Mosher)
Date: Tue, 18 Aug 2015 21:10:22 -0400
Subject: [OpenWrt-Devel] [PATCH V2] Fix for mvebu
 (WRT1900AC/WRT1200AC/etc) boot counter
In-Reply-To: <20150819010052.GS4848@pfzt.net>
References: <1439938574-26818-1-git-send-email-nyt-openwrt@countercultured.net>
 <20150819001624.GR4848@pfzt.net> <55D3CDD1.2060805@countercultured.net>
 <20150819010052.GS4848@pfzt.net>
Message-ID: <55D3D77E.70509@countercultured.net>

Good point.  It looks like Linksys actually just did the same thing as 
well in their firmware.  Anyway, this patch is just to fix the boot 
counter, I'll submit another to leave auto recovery on.

On 8/18/2015 9:00 PM, Claudio Leite wrote:
> * Rob Mosher (nyt-openwrt at countercultured.net) wrote:
>> Auto recovery is enabled when flashing, so if it goes wrong, you can get
>> back to your previous image.  Otherwise, I don't think there's a need for it
>> as all it does is switch which kernel/root partitions are booted which
>> shouldn't ever change unless flashing (famous last words?).
> The use case for leaving it on is for somebody without serial console
> access who tries something slightly risky and breaks the active image.
> Say, an image that gets far enough to get to mtd resetbc and set
> auto_recovery to off, but not actually work (no network, etc.) There are
> also enough cases of people messing up their active images on the
> WRT1900AC forum thread, one way or another.
>
> If auto_recovery were kept on, they could then use that trick posted
> in the wiki ("Stock Firmware Recovery") to manually trigger the
> auto recovery to flip back to the other image. (that of course assumes
> the other firmware works, but again, this isn't a great recovery
> mechanism...)
>
> I tested a build with this patch but auto_recovery kept to "on" and it
> works as expected after many reboots. I also manually triggered the
> auto_recovery flip, which also worked as expected. So, it seems like it
> doesn't really cost anything to keep it on (not yet, at least) while
> providing a fringe benefit.
>
> -Claudio
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nyt-openwrt at countercultured.net  Tue Aug 18 22:13:22 2015
From: nyt-openwrt at countercultured.net (Rob Mosher)
Date: Tue, 18 Aug 2015 22:13:22 -0400
Subject: [OpenWrt-Devel] [PATCH] mvebu: enable auto recovery all the time
Message-ID: <1439950402-17527-1-git-send-email-nyt-openwrt@countercultured.net>

This will have the autorecovery mechanism enabled permanently.
This patch depends on patch
  "Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter"

Signed-off-by: Rob Mosher <nyt-openwrt at countercultured.net>
---
 target/linux/mvebu/base-files/etc/init.d/u-boot_env | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/target/linux/mvebu/base-files/etc/init.d/u-boot_env b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
index bf038b2..d67c0a4 100755
--- a/target/linux/mvebu/base-files/etc/init.d/u-boot_env
+++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
@@ -8,8 +8,14 @@ boot() {
 
 case $(mvebu_board_name) in
 	armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
-		fw_setenv auto_recovery off
+		# make sure auto_recovery in uboot is turned on
+		AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
+		if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then
+			fw_setenv auto_recovery yes
+		fi
 		mtd resetbc s_env
+		sync
+
 		;;
 esac
 }
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bjorn at mork.no  Wed Aug 19 03:27:21 2015
From: bjorn at mork.no (=?utf-8?Q?Bj=C3=B8rn_Mork?=)
Date: Wed, 19 Aug 2015 09:27:21 +0200
Subject: [OpenWrt-Devel] [PATCH V2] Fix for mvebu
	(WRT1900AC/WRT1200AC/etc) boot counter
In-Reply-To: <1439938574-26818-1-git-send-email-nyt-openwrt@countercultured.net>
 (Rob Mosher's message of "Tue, 18 Aug 2015 18:56:14 -0400")
References: <1439938574-26818-1-git-send-email-nyt-openwrt@countercultured.net>
Message-ID: <87si7feo12.fsf@nemi.mork.no>

Rob Mosher <nyt-openwrt at countercultured.net> writes:

> +#define BOOTCOUNT_MAGIC	0x20110811
> +
> +struct bootcounter {
> +	uint32_t magic;
> +	uint32_t count;
> +	uint32_t checksum;
> +};

Maybe make it clear that these numbers are stored in little endian
order?  Or will that always be the native endianness?

> +static char page[2048];
> +
> +int mtd_resetbc(const char *mtd)
> +{
> +	struct mtd_info_user mtd_info;
> +	struct bootcounter *curr = (struct bootcounter *)page;
> +	unsigned int i;
> +	int last_count = 0;
> +	int num_bc;
> +	int fd;
> +	int ret;
> +
> +	fd = mtd_check_open(mtd);
> +
> +	if (ioctl(fd, MEMGETINFO, &mtd_info) < 0) {
> +		fprintf(stderr, "failed to get mtd info!\n");
> +		return -1;
> +	}
> +
> +	num_bc = mtd_info.size / mtd_info.writesize;
> +
> +	for (i = 0; i < num_bc; i++) {
> +		pread(fd, curr, sizeof(*curr), i * mtd_info.writesize);
> +
> +		if (curr->magic != BOOTCOUNT_MAGIC && curr->magic != 0xffffffff) {
> +			fprintf(stderr, "unexpected magic %08x, bailing out\n", curr->magic);
> +			goto out;
> +		}

Maybe verify the checksum sanity as well as an extra failsafe?

> +		mtd resetbc s_env

What good does it do to make the partition name an input parameter?
It's just as static as the BOOTCOUNT_MAGIC, AFAICT.


Bj?rn
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From alejandro.enrique at fon.com  Wed Aug 19 03:56:51 2015
From: alejandro.enrique at fon.com (Alejandro Enrique)
Date: Wed, 19 Aug 2015 09:56:51 +0200
Subject: [OpenWrt-Devel] [PATCH] [iwinfo] nl80211: fix not terminated string
	in get_countrylist
Message-ID: <1439971011-4599-1-git-send-email-alejandro.enrique@fon.com>

nl80211_get_countrylist function was not appending the terminating
NULL character to the ccodes returned

Signed-off-by: Alejandro Enrique <alejandro.enrique at fon.com>
---
 iwinfo_nl80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 55bfd0f..8672dd8 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -2478,8 +2478,8 @@ static int nl80211_get_countrylist(const char *ifname, char *buf, int *len)
 	for (l = IWINFO_ISO3166_NAMES, count = 0; l->iso3166; l++, e++, count++)
 	{
 		e->iso3166 = l->iso3166;
-		e->ccode[0] = (l->iso3166 / 256);
-		e->ccode[1] = (l->iso3166 % 256);
+		snprintf(e->ccode, sizeof(e->ccode), "%c%c",
+			 (l->iso3166 / 256), (l->iso3166 % 256));
 	}
 
 	*len = (count * sizeof(struct iwinfo_country_entry));
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jmpoure at gooze.eu  Wed Aug 19 04:53:50 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Wed, 19 Aug 2015 10:53:50 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <55D35DA3.6010500@openwrt.org>
References: <1439830437.3207.10.camel@gooze.eu>
 <55D228BA.8040404@openwrt.org> <1439898309.3410.3.camel@gooze.eu>
 <55D31BB8.3070903@openwrt.org> <1439915182.3147.2.camel@gooze.eu>
 <55D35DA3.6010500@openwrt.org>
Message-ID: <1439974430.15364.17.camel@gooze.eu>

Le mardi 18 ao?t 2015 ? 18:30 +0200, Steven Barth a ?crit :
> It is not possible, DHCPv6 doesn't carry routes. So you still need 
> RAs even with ra_management set to 2.


I spotted a problem with ra_management = 2
First configuration: stateful only configuration/sbin/route -A inet6 Table de routage IPv6 du noyauDestination????????????????????Next Hop???????????????????Flag Met Ref Use If2a01:e35:xxxx:xxxx::3/128??????::?????????????????????????U????256 0?????0 eth0fe80::/64??????????????????????::?????????????????????????U????256 1?????4 eth0::/0???????????????????????????::?????????????????????????!n???-1??1 11892 lo::1/128????????????????????????::?????????????????????????Un???0???11???101 lo2a01:e35:xxxx:xxxx::3/128??????::?????????????????????????Un???0???1????15 lofe80::5642:49ff:xxxx:xxxx/128??::?????????????????????????Un???0???1????39 loff00::/8???????????????????????::?????????????????????????U????256 3?????0 eth0::/0???????????????????????????::?????????????????????????!n???-1??1 11892 lo
There is no unique gateway (no Next Hop for?::/0).The unique gateway should be the local address of the OpenWRT gateway.As a result, ping6 does not work (network unreachable).
Second configuration: static IPv6 configurationIf i set the IPv6 staticly with correct gateway, the routing table becomes:/sbin/route -A inet6 Table de routage IPv6 du noyauDestination????????????????????Next Hop???????????????????Flag Met Ref Use If2a01:e35:xxxx:xxxx::7/128??????::?????????????????????????U????256 0?????0 eth0fe80::ea94:f6ff:xxxx:xxxx/128??::?????????????????????????U????100 0?????3 eth0fe80::/64??????????????????????::?????????????????????????U????256 0?????0 eth0::/0???????????????????????????fe80::ea94:f6ff:xxxx:xxxx??UG???100 7?????0 eth0::/0???????????????????????????::?????????????????????????!n???-1??1 11937 lo::1/128????????????????????????::?????????????????????????Un???0???11???107 lo2a01:e35:xxxx:xxxx::7/128??????::?????????????????????????Un???0???1????38 lofe80::5642:49ff:xxxx:xxxx/128??::?????????????????????????Un???0???1?????9 loff00::/8???????????????????????::?????????????????????????U????256 2?????0 eth0::/0???????????????????????????::?????????????????????????!n???-1??1 11937 lo
fe80::ea94:f6ff:xxxx:xxx is the correct UG. ping6 works.

To me, it seems that when using stateful only configuration, IPv6 gateway is not broadcasted.?How can this be configured/fixed?
The best would be IMHO to broadcast IPv6 gateway along with dhcp:config host????????option name 'sony-vaio'????????option ip '192.168.1.xxx'????????option mac '54:42:49:xx:xx:xx'????????option duid '0004901071a15f278795aa0ddxxxxxxxxxxx'????????option hostid '3'        => option gateway 'fe80::ea94:f6ff:xxxx:xxxx'???
What do you think? Do you know a workaround??Shall I open a bug/feature report?
Kind regards,Gnutella
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150819/c29f3f16/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jmpoure at gooze.eu  Wed Aug 19 05:27:05 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Wed, 19 Aug 2015 11:27:05 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <55D35DA3.6010500@openwrt.org>
References: <1439830437.3207.10.camel@gooze.eu>
 <55D228BA.8040404@openwrt.org> <1439898309.3410.3.camel@gooze.eu>
 <55D31BB8.3070903@openwrt.org> <1439915182.3147.2.camel@gooze.eu>
 <55D35DA3.6010500@openwrt.org>
Message-ID: <1439976425.15364.19.camel@gooze.eu>

Le mardi 18 ao?t 2015 ? 18:30 +0200, Steven Barth a ?crit :
> It is not possible, DHCPv6 doesn't carry routes. So you still need 
> RAs even with ra_management set to 2.

Sorry for this garbage, I just resend my email :

I spotted a problem with ra_management = 2

First configuration: stateful only configuration/

sbin/route -A inet6 

noyauDestination                    Next Hop                   Flag Met
Ref Use If2a01:e35:xxxx:xxxx::3/128      ::                         U  
  256 0     0 eth0fe80::/64                      ::                    
     U    256 1     4 eth0::/0                           ::            
             !n   -1  1 11892 lo::1/128                        ::      
                   Un   0   11   101 lo2a01:e35:xxxx:xxxx::3/128     
 ::                         Un   0   1    15
lofe80::5642:49ff:xxxx:xxxx/128  ::                         Un   0   1 
   39 loff00::/8                       ::                         U   
 256 3     0 eth0::/0                           ::                     
    !n   -1  1 11892 lo

There is no unique gateway (no Next Hop for ::/0).
The unique gateway should be the local address of the OpenWRT gateway.

As a result, ping6 does not work (network unreachable).

Second configuration: static IPv6 configuration

If i set the IPv6 staticly with correct gateway, the routing table
becomes:

/sbin/route -A inet6 
noyauDestination                    Next Hop                   Flag Met
Ref Use If2a01:e35:xxxx:xxxx::7/128      ::                         U  
  256 0     0 eth0fe80::ea94:f6ff:xxxx:xxxx/128  ::                    
     U    100 0     3 eth0fe80::/64                      ::            
             U    256 0     0 eth0::/0                          
 fe80::ea94:f6ff:xxxx:xxxx  UG   100 7     0 eth0::/0                  
         ::                         !n   -1  1 11937 lo::1/128         
               ::                         Un   0   11   107
lo2a01:e35:xxxx:xxxx::7/128      ::                         Un   0   1 
   38 lofe80::5642:49ff:xxxx:xxxx/128  ::                         Un  
 0   1     9 loff00::/8                       ::                       
  U    256 2     0 eth0::/0                           ::               
          !n   -1  1 11937 lo
fe80::ea94:f6ff:xxxx:xxx is the correct UG. ping6 works.

To me, it seems that when using stateful only configuration, IPv6
gateway is not broadcasted. How can this be configured/fixed?

Kind regards,
Gnutella
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150819/2df654f9/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From jmpoure at gooze.eu  Wed Aug 19 05:57:54 2015
From: jmpoure at gooze.eu (Jean-Michel =?ISO-8859-1?Q?Pour=E9?= - GOOZE)
Date: Wed, 19 Aug 2015 11:57:54 +0200
Subject: [OpenWrt-Devel] Recommended settings ip6 DNS server / dnsmasq
In-Reply-To: <1439976425.15364.19.camel@gooze.eu>
References: <1439830437.3207.10.camel@gooze.eu>
 <55D228BA.8040404@openwrt.org> <1439898309.3410.3.camel@gooze.eu>
 <55D31BB8.3070903@openwrt.org> <1439915182.3147.2.camel@gooze.eu>
 <55D35DA3.6010500@openwrt.org> <1439976425.15364.19.camel@gooze.eu>
Message-ID: <1439978274.25592.0.camel@gooze.eu>

Le mercredi 19 ao?t 2015 ? 11:27 +0200, Jean-Michel Pour? - GOOZE a
?crit :
> > It is not possible, DHCPv6 doesn't carry routes. So you still need 
> > RAs even with ra_management set to 2.

Please don't reply on the devel list. My messages are becoming messy and fill the list.
Just use this ticket:https://dev.openwrt.org/ticket/20354
Kind regards,Gnutella
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5640 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150819/84e01d8e/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From ardeleanalex at gmail.com  Wed Aug 19 08:38:46 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Wed, 19 Aug 2015 15:38:46 +0300
Subject: [OpenWrt-Devel] Openvswitch package not available in trunk
In-Reply-To: <CA+U=DsqDxj763m_6XOc93_h=eL3yRkDpAgSCc0rgcz3EBZtOfA@mail.gmail.com>
References: <55C08938.6030507@inf.h-brs.de>
 <CA+U=DsrrMmjF=waE5gfUtVsKWTOb7omCLFSMTH1yegPViVn5LQ@mail.gmail.com>
 <CA+U=Dsony4dUX2zK3cM07v7v=saskAcW8qh8GswZBRcrXDVKfg@mail.gmail.com>
 <55C20742.6000607@inf.h-brs.de>
 <CA+U=DspR42pDEe+aqZgoNgbuKCLjHaWfH=RBXyziUmrdxHD6Fg@mail.gmail.com>
 <CA+U=Dsp02P33TROP7PUosOwZ2BqwgCuH4wZbd1TZNC9=YE_5dA@mail.gmail.com>
 <55C8BA4A.1010901@inf.h-brs.de>
 <CA+U=DsqDxj763m_6XOc93_h=eL3yRkDpAgSCc0rgcz3EBZtOfA@mail.gmail.com>
Message-ID: <CA+U=DsrXgRspYcWRUotGmbfAM5cJstWEKEhcYGCAuHbzSgYT3g@mail.gmail.com>

OVS seems to work fine if I compile it with uClibc instead of musl
On x86 (kernel 4.1 added manually) + uClibc + OVS 2.4 it works fine
On x86 (kernel 4.1 added manually) + musl + OVS 2.4 it seems to segfault

Will keep looking.


On Tue, Aug 11, 2015 at 12:05 PM, Alexandru Ardelean <ardeleanalex at gmail.com
> wrote:

> Will make some more time to try this.
>
> Thanks for testing
>
> On Mon, Aug 10, 2015 at 5:50 PM, Florian Siebertz <
> florian.siebertz at inf.h-brs.de> wrote:
>
>> Today I compiled with your fork and everything seemed fine at first.
>> After flashing to a TP-Link WDR3600 Router I can see the ovsdb-server
>> running
>> and <ovs-vsctl show> reveals the usual String ID.
>>
>> When I try to add a bridge with <ovs-vsctl add-br br0> the command does
>> not return
>> to the input prompt. After pressing ctrl+c and checking <ovs-vsctl show>
>> it seems like
>> the bridge was created. The same happens when adding ports or changing any
>> settings on the bridge.
>>
>> Additionally, the switch does not connect to the controller. I'm not sure
>> how to debug
>> this further, but if you have an idea I will test it on the device.
>>
>>
>> Am 07.08.2015 um 16:14 schrieb Alexandru Ardelean:
>> > @Florian
>> > So, I took some time today to patch a bit of support for OVS to compile
>> on
>> > OpenWRT with kernel 4.1
>> >
>> > Can you pull this from my fork and test it out a bit ?
>> > Branch is here: https://github.com/commodo/packages/tree/ovs-kernel-4.1
>> > Commit is this one:
>> >
>> https://github.com/commodo/packages/commit/de519aac8c751cd8744d839efd071cdf02891db1
>> >
>> > If you need a tarball, send me a message and I can prepare one, or maybe
>> > Github has a download zip/tar button per branches somewhere not sure.
>> >
>> > Anyway, I'd appreciate if you took the time to test it out a bit.
>> > I'm a bit swamped and don't have time to do proper testing ; to be
>> honest I
>> > just made it build, and I haven't managed to get hold of a device with
>> > which to actually test it.
>> > If all is good I'll add a PR into the official OpenWRT packages.
>> >
>> > Thanks
>> >
>> > On Wed, Aug 5, 2015 at 5:18 PM, Alexandru Ardelean <
>> ardeleanalex at gmail.com>
>> > wrote:
>> >
>> >> I will admit I only tested with x86.
>> >> I ASSumed that it's on kernel 4.1.
>> >>
>> >> Will check again and try to spin up a patch for kernel 4.1.
>> >>
>> >> On Wed, Aug 5, 2015 at 3:53 PM, Florian Siebertz <
>> >> florian.siebertz at inf.h-brs.de> wrote:
>> >>
>> >>> Thank you for your work, i really appreciate it.
>> >>> Now the package is back, but at compilation it fails when
>> >>> checking against the kernel version:
>> >>>
>> >>> (cd
>> >>>
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/./;
>> >>> if [ -x ./configure ]; then find
>> >>>
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>> >>> -name config.guess | xargs -r chmod u+w; find
>> >>>
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>> >>> -name config.guess | xargs -r -n1 cp --remove-destination
>> >>> /home/administrator/openwrt/scripts/config.guess; find
>> >>>
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>> >>> -name config.sub | xargs -r chmod u+w; find
>> >>>
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/
>> >>> -name config.sub | xargs -r -n1 cp --remove-destination
>> >>> /home/administrator/openwrt/scripts/config.sub;
>> >>> AR="mips-openwrt-linux-musl-gcc-ar" AS="mips-openwrt-linux-musl-gcc
>> -c -Os
>> >>> -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves
>> >>> -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float
>> -Wformat !
>> >>>  -Werror=fo
>> >>> rmat-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now
>> >>> -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99"
>> >>> LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm"
>> >>> CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc"
>> >>> CXX="mips-openwrt-linux-musl-g++"
>> >>> RANLIB="mips-openwrt-linux-musl-gcc-ranlib"
>> >>> STRIP=mips-openwrt-linux-musl-strip
>> OBJCOPY=mips-openwrt-linux-musl-objcopy
>> >>> OBJDUMP=mips-openwrt-linux-musl-objdump
>> SIZE=mips-openwrt-linux-musl-size
>> >>> CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc
>> >>> -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable
>> >>> -msoft-float -Wformat -Werror=format-security -fstack-protector
>> >>> -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -mno-mips16
>> >>> -mno-interlink-mips16 -flto -std=gnu99 " CXXFLAGS="-Os -pipe
>> >>> -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves
>> -fhonour-copts
>> >>> -Wno-error=unused-but-set-variable -msoft-float -Wformat
>> >>> -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1!
>> >>>   -Wl,-z,no
>> >>> w -Wl,-z,relro -mno-mips16 -mno-interlink-mips16 -flto -std=gnu99 "
>> >>>
>> CPPFLAGS="-I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/include
>> >>>
>> -I/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/include
>> >>>
>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/include
>> >>>
>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/fortify
>> >>>
>> -I/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include
>> >>> "
>> >>>
>> LDFLAGS="-L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/usr/lib
>> >>>
>> -L/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/lib
>> >>>
>> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/usr/lib
>> >>>
>> -L/home/administrator/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/lib
>> >>> -znow -zrelro "   ./configure --target=mips-openwrt-linux
>> >>> --host=mips-openwrt-linux --build!
>> >>>  =x86_64-li
>> >>> nux-gnu --program-prefix="" --program-suffix="" --prefix=/usr
>> >>> --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
>> >>> --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share
>> >>> --localstatedir=/var --mandir=/usr/man --infodir=/usr/info
>> --disable-nls
>> >>>
>> _python_sysroot="/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10"
>> >>> _python_prefix="/usr" _python_exec_prefix="/usr"
>> >>>
>> --with-linux=/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
>> >>> --with-rundir=/var/run --enable-ndebug --disable-ssl --enable-shared
>> ; fi; )
>> >>>
>> >>> [...] (a bunch of checks)
>> >>>
>> >>> checking for kernel version... 4.1.3
>> >>> configure: error: Linux kernel in
>> >>>
>> /home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/linux-4.1.3
>> >>> is version 4.1.3, but version newer than 4.0.x is not supported
>> (please
>> >>> refer to the FAQ for advice)
>> >>> make[3]: ***
>> >>>
>> [/home/administrator/openwrt/build_dir/target-mips_34kc_musl-1.1.10/openvswitch-2.4.0/.configured_yyyyyyyy]
>> >>> Error 1
>> >>> make[3]: Leaving directory
>> >>> `/home/administrator/openwrt/feeds/packages/net/openvswitch'
>> >>> make[2]: *** [package/feeds/packages/openvswitch/compile] Error 2
>> >>> make[2]: Leaving directory `/home/administrator/openwrt'
>> >>> make[1]: ***
>> >>>
>> [/home/administrator/openwrt/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile]
>> >>> Error 2
>> >>> make[1]: Leaving directory `/home/administrator/openwrt'
>> >>> make: *** [world] Error 2
>> >>>
>> >>>
>> >>>
>> >>> Am 04.08.2015 um 16:08 schrieb Alexandru Ardelean:
>> >>>> Took some 20-30 minutes to upgrade OVS and test it (with kernel 4.1).
>> >>>> Seems to work fine so far.
>> >>>>
>> >>>> Please monitor this PR; after it's merged it should appear.
>> >>>>
>> >>>> On Tue, Aug 4, 2015 at 1:37 PM, Alexandru Ardelean <
>> >>> ardeleanalex at gmail.com>
>> >>>> wrote:
>> >>>>
>> >>>>> Well, OpenVSwitch is a bit behind on kernel support.
>> >>>>> It's at 3.18 currently.
>> >>>>> OpenWRT is at 4.1
>> >>>>>
>> >>>>> We'd need to do an upgrade of OVS to get it up to speed.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On Tue, Aug 4, 2015 at 12:43 PM, Florian Siebertz <
>> >>>>> florian.siebertz at inf.h-brs.de> wrote:
>> >>>>>
>> >>>>>> Hi,
>> >>>>>>
>> >>>>>> i noticed that the openvswitch package is not available in trunk at
>> >>> the
>> >>>>>> moment. It is not in the precompiled snapshots, neither can it be
>> >>>>>> choosen in 'make menuconfig'. (Yes, i did ./scripts/feeds
>> >>>>>> [update|install] -a).
>> >>>>>>
>> >>>>>> Does anyone know why and when it will be back?
>> >>>>>>
>> >>>>>> Thanks!
>> >>>>>>
>> >>>>>> Florian Siebertz
>> >>>>>> _______________________________________________
>> >>>>>> openwrt-devel mailing list
>> >>>>>> openwrt-devel at lists.openwrt.org
>> >>>>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>> >>>>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>
>> >>
>> >>
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150819/4634b0c0/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From sven at open-mesh.com  Wed Aug 19 09:54:54 2015
From: sven at open-mesh.com (Sven Eckelmann)
Date: Wed, 19 Aug 2015 15:54:54 +0200
Subject: [OpenWrt-Devel] [PATCH 1/8] ar71xx: add kernel support for the
	OpenMesh MR1750 board
Message-ID: <1439992501-9123-1-git-send-email-sven@open-mesh.com>

Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-mr1750.c     | 129 +++++++++++++++++++++
 .../815-MIPS-ath79-add-mr1750-support.patch        |  39 +++++++
 3 files changed, 169 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-mr1750-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 21c460178d26..5188f6b70261 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -81,6 +81,7 @@ CONFIG_ATH79_MACH_JWAP003=y
 CONFIG_ATH79_MACH_MC_MAC1200R=y
 CONFIG_ATH79_MACH_MR12=y
 CONFIG_ATH79_MACH_MR16=y
+CONFIG_ATH79_MACH_MR1750=y
 CONFIG_ATH79_MACH_MR600=y
 CONFIG_ATH79_MACH_MR900=y
 CONFIG_ATH79_MACH_MYNET_N600=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c
new file mode 100644
index 000000000000..8ace02f9b1ae
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c
@@ -0,0 +1,129 @@
+/*
+ * MR1750 board support
+ *
+ * Copyright (c) 2012 Qualcomm Atheros
+ * Copyright (c) 2012-2013 Marek Lindner <marek at open-mesh.com>
+ *
+ * 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 WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include <linux/platform_device.h>
+#include <linux/ar8216_platform.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-gpio-buttons.h"
+#include "dev-eth.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+#include "pci.h"
+
+#define MR1750_GPIO_LED_LAN		12
+#define MR1750_GPIO_LED_WLAN_2G		13
+#define MR1750_GPIO_LED_STATUS_GREEN	19
+#define MR1750_GPIO_LED_STATUS_RED	21
+#define MR1750_GPIO_LED_POWER		22
+#define MR1750_GPIO_LED_WLAN_5G		23
+
+#define MR1750_GPIO_BTN_RESET		17
+
+#define MR1750_KEYS_POLL_INTERVAL	20	/* msecs */
+#define MR1750_KEYS_DEBOUNCE_INTERVAL	(3 * MR1750_KEYS_POLL_INTERVAL)
+
+#define MR1750_MAC0_OFFSET		0
+#define MR1750_WMAC_CALDATA_OFFSET	0x1000
+
+static struct gpio_led mr1750_leds_gpio[] __initdata = {
+	{
+		.name		= "mr1750:blue:power",
+		.gpio		= MR1750_GPIO_LED_POWER,
+		.active_low	= 1,
+	},
+	{
+		.name		= "mr1750:blue:wan",
+		.gpio		= MR1750_GPIO_LED_LAN,
+		.active_low	= 1,
+	},
+	{
+		.name		= "mr1750:blue:wlan24",
+		.gpio		= MR1750_GPIO_LED_WLAN_2G,
+		.active_low	= 1,
+	},
+	{
+		.name		= "mr1750:blue:wlan58",
+		.gpio		= MR1750_GPIO_LED_WLAN_5G,
+		.active_low	= 1,
+	},
+	{
+		.name		= "mr1750:green:status",
+		.gpio		= MR1750_GPIO_LED_STATUS_GREEN,
+		.active_low	= 1,
+	},
+	{
+		.name		= "mr1750:red:status",
+		.gpio		= MR1750_GPIO_LED_STATUS_RED,
+		.active_low	= 1,
+	},
+};
+
+static struct gpio_keys_button mr1750_gpio_keys[] __initdata = {
+	{
+		.desc		= "Reset button",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = MR1750_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= MR1750_GPIO_BTN_RESET,
+		.active_low	= 1,
+	},
+};
+
+static void __init mr1750_setup(void)
+{
+	u8 *art = (u8 *)KSEG1ADDR(0x1fff0000);
+	u8 mac[6];
+
+	ath79_eth0_pll_data.pll_1000 = 0xbe000101;
+	ath79_eth0_pll_data.pll_100 = 0x80000101;
+	ath79_eth0_pll_data.pll_10 = 0x80001313;
+
+	ath79_register_m25p80(NULL);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(mr1750_leds_gpio),
+				 mr1750_leds_gpio);
+	ath79_register_gpio_keys_polled(-1, MR1750_KEYS_POLL_INTERVAL,
+					ARRAY_SIZE(mr1750_gpio_keys),
+					mr1750_gpio_keys);
+
+	ath79_init_mac(mac, art + MR1750_MAC0_OFFSET, 1);
+	ath79_register_wmac(art + MR1750_WMAC_CALDATA_OFFSET, mac);
+	ath79_register_pci();
+
+	ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);
+	ath79_register_mdio(0, 0x0);
+
+	ath79_init_mac(ath79_eth0_data.mac_addr, art + MR1750_MAC0_OFFSET, 0);
+
+	/* GMAC0 is connected to the RMGII interface */
+	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+	ath79_eth0_data.phy_mask = BIT(5);
+	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
+
+	ath79_register_eth(0);
+}
+
+MIPS_MACHINE(ATH79_MACH_MR1750, "MR1750", "OpenMesh MR1750", mr1750_setup);
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-mr1750-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-mr1750-support.patch
new file mode 100644
index 000000000000..d802a12d60f7
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-mr1750-support.patch
@@ -0,0 +1,39 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -763,6 +763,16 @@ config ATH79_MACH_CAP4200AG
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_MR1750
++	bool "OpenMesh MR1750 board support"
++	select SOC_QCA955X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_MR900
+ 	bool "OpenMesh MR900 board support"
+ 	select SOC_QCA955X
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -80,6 +80,7 @@ obj-$(CONFIG_ATH79_MACH_HORNET_UB)	+= ma
+ obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)     += mach-mc-mac1200r.o
+ obj-$(CONFIG_ATH79_MACH_MR12)		+= mach-mr12.o
+ obj-$(CONFIG_ATH79_MACH_MR16)		+= mach-mr16.o
++obj-$(CONFIG_ATH79_MACH_MR1750)		+= mach-mr1750.o
+ obj-$(CONFIG_ATH79_MACH_MR600)		+= mach-mr600.o
+ obj-$(CONFIG_ATH79_MACH_MR900)		+= mach-mr900.o
+ obj-$(CONFIG_ATH79_MACH_MYNET_N600)	+= mach-mynet-n600.o
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -69,6 +69,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
+ 	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
+ 	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
++	ATH79_MACH_MR1750,		/* OpenMesh MR1750 */
+ 	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
+ 	ATH79_MACH_MR600,		/* OpenMesh MR600 */
+ 	ATH79_MACH_MR900,		/* OpenMesh MR900 */
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sven at open-mesh.com  Wed Aug 19 09:54:55 2015
From: sven at open-mesh.com (Sven Eckelmann)
Date: Wed, 19 Aug 2015 15:54:55 +0200
Subject: [OpenWrt-Devel] [PATCH 2/8] ar71xx: add user-space support for the
	OpenMesh MR1750 board
In-Reply-To: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
References: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
Message-ID: <1439992501-9123-2-git-send-email-sven@open-mesh.com>

Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
---
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 4 files changed, 13 insertions(+)

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 36de775df5ba..68eac503bc9e 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -147,6 +147,9 @@ get_status_led() {
 	mr600v2)
 		status_led="mr600:blue:power"
 		;;
+	mr1750)
+		status_led="mr1750:blue:power"
+		;;
 	mr900 | \
 	mr900v2)
 		status_led="mr900:blue: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 e7f7a4cd62c5..b7015701b816 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -257,6 +257,12 @@ mr600)
 	ucidef_set_led_wlan "wlan58" "WLAN58" "mr600:green:wlan58" "phy0tpt"
 	;;
 
+mr1750)
+	ucidef_set_led_netdev "lan" "LAN" "mr1750:blue:wan" "eth0"
+	ucidef_set_led_wlan "wlan58" "WLAN58" "mr1750:blue:wlan58" "phy0tpt"
+	ucidef_set_led_wlan "wlan24" "WLAN24" "mr1750:blue:wlan24" "phy1tpt"
+	;;
+
 mr900 | \
 mr900v2)
 	ucidef_set_led_netdev "lan" "LAN" "mr900:blue:wan" "eth0"
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 686fce98b3b8..d9053be5a422 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 @@ eap300v2 |\
 eap7660d |\
 el-mini |\
 loco-m-xw |\
+mr1750 |\
 mr600 |\
 mr600v2 |\
 mr900 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index e1f345eb93c5..d2bf0ae0831b 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -511,6 +511,9 @@ ar71xx_board_detect() {
 	*MR600v2)
 		name="mr600v2"
 		;;
+	*MR1750)
+		name="mr1750"
+		;;
 	*MR600)
 		name="mr600"
 		;;
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sven at open-mesh.com  Wed Aug 19 09:54:56 2015
From: sven at open-mesh.com (Sven Eckelmann)
Date: Wed, 19 Aug 2015 15:54:56 +0200
Subject: [OpenWrt-Devel] [PATCH 3/8] scripts/om-fwupgradecfg-gen.sh: add
	support for the MR1750
In-Reply-To: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
References: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
Message-ID: <1439992501-9123-3-git-send-email-sven@open-mesh.com>

Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
---
 scripts/om-fwupgradecfg-gen.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh
index e1329549b831..c790214854dc 100644
--- a/scripts/om-fwupgradecfg-gen.sh
+++ b/scripts/om-fwupgradecfg-gen.sh
@@ -7,7 +7,7 @@
 #
 
 usage() {
-	echo "Usage: $0 <OM2P|OM5P|MR600|MR900> <out file path> <kernel path> <rootfs path>"
+	echo "Usage: $0 <OM2P|OM5P|MR600|MR900|MR1750> <out file path> <kernel path> <rootfs path>"
 	rm -f $CFG_OUT
 	exit 1
 }
@@ -26,7 +26,7 @@ case $CE_TYPE in
 		FLASH_BS=262144
 		MD5_SKIP_BLOCKS=1
 		;;
-	OM5P|MR600|MR900)
+	OM5P|MR600|MR900|MR1750)
 		MAX_PART_SIZE=7808
 		KERNEL_FLASH_ADDR=0xb0000
 		FLASH_BS=65536
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sven at open-mesh.com  Wed Aug 19 09:54:57 2015
From: sven at open-mesh.com (Sven Eckelmann)
Date: Wed, 19 Aug 2015 15:54:57 +0200
Subject: [OpenWrt-Devel] [PATCH 4/8] ar71xx: enable sysupgrade for the
	OpenMesh MR1750
In-Reply-To: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
References: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
Message-ID: <1439992501-9123-4-git-send-email-sven@open-mesh.com>

Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
---
 target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh | 7 ++++++-
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
index 547116e6d49c..9ca0f5be4d7f 100644
--- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
@@ -72,6 +72,11 @@ platform_check_image_openmesh()
 			echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform"
 			return 1
 			;;
+		MR1750)
+			[ "$board" = "mr1750" ] && break
+			echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform"
+			return 1
+			;;
 		MR600)
 			[ "$board" = "mr600" ] && break
 			[ "$board" = "mr600v2" ] && break
@@ -157,7 +162,7 @@ platform_do_upgrade_openmesh()
 			kernel_start_addr1=0x9f1c0000
 			kernel_start_addr2=0x9f8c0000
 			;;
-		OM5P|MR600|MR900)
+		OM5P|MR600|MR900|MR1750)
 			block_size=$((64 * 1024))
 			total_size=7995392
 			kernel_start_addr1=0x9f0b0000
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index c1962e4e9fdb..76d2877a3634 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -291,6 +291,7 @@ platform_check_image() {
 
 		return 0;
 		;;
+	mr1750 | \
 	mr600 | \
 	mr600v2 | \
 	mr900 | \
@@ -517,6 +518,7 @@ platform_do_upgrade() {
 	tew-673gru)
 		platform_do_upgrade_dir825b "$ARGV"
 		;;
+	mr1750 | \
 	mr600 | \
 	mr600v2 | \
 	mr900 | \
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sven at open-mesh.com  Wed Aug 19 09:54:58 2015
From: sven at open-mesh.com (Sven Eckelmann)
Date: Wed, 19 Aug 2015 15:54:58 +0200
Subject: [OpenWrt-Devel] [PATCH 5/8] package/om-watchdog: add OpenMesh
	MR1750 support
In-Reply-To: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
References: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
Message-ID: <1439992501-9123-5-git-send-email-sven@open-mesh.com>

Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
---
 package/kernel/om-watchdog/files/om-watchdog.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init
index 135fef7835d3..c792968e539f 100644
--- a/package/kernel/om-watchdog/files/om-watchdog.init
+++ b/package/kernel/om-watchdog/files/om-watchdog.init
@@ -25,7 +25,7 @@ boot() {
 			"mr600v2")
 				service_start /sbin/om-watchdog 15
 				;;
-			"mr900"|"mr900v2")
+			"mr900"|"mr900v2"|"mr1750")
 				service_start /sbin/om-watchdog 16
 				;;
 		esac
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sven at open-mesh.com  Wed Aug 19 09:54:59 2015
From: sven at open-mesh.com (Sven Eckelmann)
Date: Wed, 19 Aug 2015 15:54:59 +0200
Subject: [OpenWrt-Devel] [PATCH 6/8] package/uboot-envtools: add OpenMesh
	MR1750 support
In-Reply-To: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
References: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
Message-ID: <1439992501-9123-6-git-send-email-sven@open-mesh.com>

Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
---
 package/boot/uboot-envtools/files/ar71xx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e76684..0c81f328b6b7 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -20,6 +20,7 @@ carambola2 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
+mr1750 | \
 mr600 | \
 mr600v2 | \
 mr900 | \
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sven at open-mesh.com  Wed Aug 19 09:55:00 2015
From: sven at open-mesh.com (Sven Eckelmann)
Date: Wed, 19 Aug 2015 15:55:00 +0200
Subject: [OpenWrt-Devel] [PATCH 7/8] ar71xx: create profile and build image
	for the OpenMesh MR1750 board
In-Reply-To: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
References: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
Message-ID: <1439992501-9123-7-git-send-email-sven@open-mesh.com>

Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
---
 target/linux/ar71xx/generic/profiles/openmesh.mk | 13 ++++++++++++-
 target/linux/ar71xx/image/Makefile               |  3 ++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk
index 41b462e86b73..1c51e93a92ec 100644
--- a/target/linux/ar71xx/generic/profiles/openmesh.mk
+++ b/target/linux/ar71xx/generic/profiles/openmesh.mk
@@ -49,9 +49,20 @@ endef
 
 $(eval $(call Profile,MR900))
 
+define Profile/MR1750
+        NAME:=OpenMesh MR1750
+        PACKAGES:=kmod-ath9k kmod-ath10k
+endef
+
+define Profile/MR1750/Description
+        Package set optimized for the OpenMesh MR1750.
+endef
+
+$(eval $(call Profile,MR1750))
+
 define Profile/OPENMESH
 	NAME:=OpenMesh products
-	PACKAGES:=kmod-ath9k om-watchdog
+	PACKAGES:=kmod-ath9k kmod-ath10k om-watchdog
 endef
 
 define Profile/OPENMESH/Description
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 8f609de774b4..7ae567678320 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -2158,6 +2158,7 @@ $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P))
 $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P))
 $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600))
 $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900))
+$(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750))
 
 $(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200))
 $(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200))
@@ -2233,7 +2234,7 @@ $(eval $(call MultiProfile,AP143,AP143_8M AP143_16M))
 $(eval $(call MultiProfile,AP147,AP147_010))
 $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3))
 $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M))
-$(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900))
+$(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900 MR1750))
 $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
 $(eval $(call MultiProfile,TLMR3220,TLMR3220V1))
 $(eval $(call MultiProfile,TLMR3420,TLMR3420V1))
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From sven at open-mesh.com  Wed Aug 19 09:55:01 2015
From: sven at open-mesh.com (Sven Eckelmann)
Date: Wed, 19 Aug 2015 15:55:01 +0200
Subject: [OpenWrt-Devel] [PATCH 8/8] ar71xx: extract ath10k wifi board.bin
	for the OpenMesh MR1750 board
In-Reply-To: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
References: <1439992501-9123-1-git-send-email-sven@open-mesh.com>
Message-ID: <1439992501-9123-8-git-send-email-sven@open-mesh.com>

Signed-off-by: Sven Eckelmann <sven at open-mesh.com>
---
 .../linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata  | 4 ++++
 1 file changed, 4 insertions(+)

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 a79643e2ae99..f53c85384114 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
@@ -71,6 +71,10 @@ case "$FIRMWARE" in
 		ath10kcal_extract "caldata" 20480 2116
 		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
 		;;
+	mr1750)
+		ath10kcal_extract "ART" 20480 2116
+		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
+		;;
 	esac
 	;;
 "ath10k/cal-pci-0000:01:00.0.bin")
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From zajec5 at gmail.com  Wed Aug 19 12:40:49 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Wed, 19 Aug 2015 18:40:49 +0200
Subject: [OpenWrt-Devel] [PATCH packages] lighttpd: backport a fix for
	running out of filedescriptors
In-Reply-To: <CACna6rxAmaTop+UKYmOqKt8iDe6wFmdjuk-_8m-tZS0FA5UdBw@mail.gmail.com>
References: <1439497407-15562-1-git-send-email-zajec5@gmail.com>
 <CACna6rxAmaTop+UKYmOqKt8iDe6wFmdjuk-_8m-tZS0FA5UdBw@mail.gmail.com>
Message-ID: <CACna6rxMQj=fvoKjM=A+OwznRj970d055Ue-__d=mgscMtJRHA@mail.gmail.com>

On 16 August 2015 at 02:44, Rafa? Mi?ecki <zajec5 at gmail.com> wrote:
> On 13 August 2015 at 22:23, Rafa? Mi?ecki <zajec5 at gmail.com> wrote:
>> It was breaking uploads of files 4 MiB+. This patch fixes:
>> https://github.com/openwrt/packages/issues/1658
>>
>> Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
>> ---
>> This should be applied to both: master and 15.05 branch.
>
> Can you push this?

I've pushed this fix on my own.

Michael: I hope you're OK and you can still maintain this package in the future.

-- 
Rafa?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From sakib at meta.ua  Wed Aug 19 12:57:44 2015
From: sakib at meta.ua (Sergiy Kibrik)
Date: Wed, 19 Aug 2015 19:57:44 +0300
Subject: [OpenWrt-Devel] [PATCH] [procd] inittab: always proceed to next
	state
Message-ID: <1440003464-8533-1-git-send-email-sakib@meta.ua>

If no S or K rc scripts provided we still should
be able to go on to next state, or we won't boot
properly and would not be able to reboot/shutdown later.

Signed-off-by: Sergiy Kibrik <sakib at meta.ua>
---
 inittab.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/inittab.c b/inittab.c
index eb402f8..f8f0218 100644
--- a/inittab.c
+++ b/inittab.c
@@ -151,7 +151,10 @@ static void runrc(struct init_action *a)
 		ERROR("valid format is rcS <S|K> <param>\n");
 		return;
 	}
-	rcS(a->argv[1], a->argv[2], rcdone);
+
+	/* proceed even if no init or shutdown scripts run */
+	if (rcS(a->argv[1], a->argv[2], rcdone))
+		rcdone(NULL);
 }
 
 static void askfirst(struct init_action *a)
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mike at flyn.org  Wed Aug 19 13:17:08 2015
From: mike at flyn.org (W. Michael Petullo)
Date: Wed, 19 Aug 2015 13:17:08 -0400
Subject: [OpenWrt-Devel] [PATCH packages] lighttpd: backport a fix for
 running out of filedescriptors
In-Reply-To: <CACna6rxMQj=fvoKjM=A+OwznRj970d055Ue-__d=mgscMtJRHA@mail.gmail.com>
References: <1439497407-15562-1-git-send-email-zajec5@gmail.com>
 <CACna6rxAmaTop+UKYmOqKt8iDe6wFmdjuk-_8m-tZS0FA5UdBw@mail.gmail.com>
 <CACna6rxMQj=fvoKjM=A+OwznRj970d055Ue-__d=mgscMtJRHA@mail.gmail.com>
Message-ID: <20150819171707.GA18136@imp.flyn.org>

>>> This should be applied to both: master and 15.05 branch.

>> Can you push this?

> I've pushed this fix on my own.
> 
> Michael: I hope you're OK and you can still maintain this package in the future.

Thank you, Rafa?. My workload did not allow me to get to this in time.

-- 
Mike

:wq
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Wed Aug 19 19:30:28 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Wed, 19 Aug 2015 19:30:28 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [kernel] Fix kmod-v4l2 modules have
 missing symbols due to lack of clk support
In-Reply-To: <55CF4DF8.4070207@hauke-m.de>
References: <20150810153018.6240123A1534@danielcent.thecshore.com>
 <55CF4DF8.4070207@hauke-m.de>
Message-ID: <55D51194.7090008@daniel.thecshore.com>

Your patch resolves the issue of compiling - I have not yet tested the 
functionality of the resulting v4l module.  I suspect the disadvantage 
of this patch is that it will silently fail to work for the types of 
devices (DV primarily) that depend on clock support whereas my patch 
omits building code/modules for devices that depend on clock support a 
kernel config option that prevents building useless modules (although I 
realized the DV_SUPPORT should depend on CLK_COMMON since that's the 
whole reason for making that a config option) and (and of course 
#ifdef's out the code and dependencies on clk support when it's not 
present).

Regards,

Daniel

On 2015-08-15 10:34 AM, Hauke Mehrtens wrote:
> On 08/02/2015 04:34 PM, Daniel Dickinson wrote:
>> The v4l kernel modules fail to compile on latest kernels due to a new
>> dependency on a clock source.  Since most routers won't have a suitable
>> clock source, I have added a kernel config option that omits the functionality
>> that requires the clock source.
>>
>> That means v4l modules in OpenWrt can't support DV devices (DV requires
>> the clock source support) but unless clock source support was addded to
>> OpenWrt the other alternative is to drop v4l altogether).
>>
>> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
>> ---
>>   package/kernel/linux/modules/video.mk              |   3 +-
>>   ...avoid-clk-for-devices-that-do-not-need-it.patch | 348 +++++++++++++++++++++
>>   2 files changed, 350 insertions(+), 1 deletion(-)
>>   create mode 100644 target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch
>>
>
> The build problem of ar71xx was fixed here:
> https://dev.openwrt.org/changeset/46572
>
> The arch code did not export all the clk functions needed, but claimed
> to do so. Is your patch needed with r46572 any more? When an arch really
> does not support clocks it a driver would use the static inline
> functions doing nothing instead.
>
> Hauke
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Wed Aug 19 19:31:11 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Wed, 19 Aug 2015 19:31:11 -0400
Subject: [OpenWrt-Devel] [PATCH 1/1] [buildroot] Fix for liblzma breaks
 redhat-like systems
In-Reply-To: <55CF4EAA.9070603@hauke-m.de>
References: <20150810153021.796FC23A1534@danielcent.thecshore.com>
 <55CF4EAA.9070603@hauke-m.de>
Message-ID: <55D511BF.2050408@daniel.thecshore.com>

This resolves the build issue on CentOS.

On 2015-08-15 10:37 AM, Hauke Mehrtens wrote:
> On 08/09/2015 05:50 AM, Daniel Dickinson wrote:
>> On RedHat/Fedora and derivatives we must use the system liblzma
>> from xz-devel because the liblzma in tools/xz breaks these
>> systems due to system tools (which use liblzma) having
>> missing symbols when staging_dir/host/lib has liblzma
>> (because buildroot puts staging_dir/host/lib first in
>> library load path and therefore all binaries not just
>> buildroot's binaries use liblzma from staging_dir/host/lib, at
>> least while building OpenWrt).
>>
>> Closes: 20134
>> Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
>> ---
>>   include/host.mk          |  7 ++++++-
>>   include/prereq-build.mk  |  7 +++++++
>>   tools/Makefile           | 11 ++++++++---
>>   tools/squashfs4/Makefile |  2 +-
>>   4 files changed, 22 insertions(+), 5 deletions(-)
>>
> Please check if your patch is still needed with r46603
> https://dev.openwrt.org/changeset/46603
>
> Hauke
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Wed Aug 19 19:45:44 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Wed, 19 Aug 2015 19:45:44 -0400
Subject: [OpenWrt-Devel] [PATCH 0/8] Add support for three PowerCloud
 Systems devices
In-Reply-To: <55D17EBC.9090103@openwrt.org>
References: <20150810154128.2DE0923A1534@danielcent.thecshore.com>
 <55D17EBC.9090103@openwrt.org>
Message-ID: <55D51528.3080806@daniel.thecshore.com>

Yeah, sorry I tried to rush something out the door and have completely 
forgotten how to send git patches series - I've had to relearn those 
skills (mostly a matter of taking the time to read the man pages).

I also screwed the patches up when I copied them from a private repo I 
had for BB into trunk which mean I have to take the time to redo them 
and test them on actual hardware before resubmitting.

Regards,

Daniel

On 2015-08-17 2:27 AM, John Crispin wrote:
> Hi,
>
> the series is in patchwork several times. some mails are duplicated 8
> times. others exist twice, have identical content but 2 different
> subjects. i marked all 25 patches as invalid. can you please work out
> what we should merge and just resend it as a clean series against trunk
> please.
>
> 	John
>
> On 09/08/2015 06:12, Daniel Dickinson wrote:
>> Sorry, one last time; this series got concatenated into one big email.
>>
>> Hi all,
>>
>> I have added suport for three PowerCloud Systems devices based on
>> the patches posted in
>> https://lists.openwrt.org/pipermail/opewrt-devel/2012-Novembre/017340.html,
>> updated board support in the OpenWrt tree, and some tweaks of my own.
>>
>> These patches are against trunk.
>>
>> Daniel Dickinson (8):
>>    CC PowerCloud CAP324 Image generation
>>    CC PowerCloud CAP324 OpenWrt configuration
>>    CC PowerCloud CR3000 Kernel BSP
>>    CC PowerCloud CR3000 image generation
>>    CC PowerCloud CR3000 OpenWrt configuration
>>    CC PowerCloud CR5000 Kernel BSP
>>    CC PowerCloud CR5000 image generation
>>    CC PowerCloud CR5000 OpenWrt configuration
>>
>>   package/boot/uboot-envtools/files/ar71xx           |   3 +
>>   target/linux/ar71xx/base-files/etc/diag.sh         |   9 +
>>   .../ar71xx/base-files/etc/uci-defaults/01_leds     |  20 ++
>>   .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
>>   target/linux/ar71xx/base-files/lib/ar71xx.sh       |   9 +
>>   .../ar71xx/base-files/lib/upgrade/platform.sh      |   5 +-
>>   target/linux/ar71xx/config-4.1                     |   2 +
>>   target/linux/ar71xx/generic/profiles/pcs.mk        |  79 +++++++
>>   target/linux/ar71xx/image/Makefile                 |  12 ++
>>   .../815-MIPS-ath79-add-cr3000-support.patch        | 211 +++++++++++++++++++
>>   .../816-MIPS-ath79-add-cr5000-support.patch        | 230 +++++++++++++++++++++
>>   11 files changed, 587 insertions(+), 1 deletion(-)
>>   create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-cr3000-support.patch
>>   create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-cr5000-support.patch
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From cyrus at openwrt.org  Thu Aug 20 00:58:49 2015
From: cyrus at openwrt.org (Steven Barth)
Date: Thu, 20 Aug 2015 06:58:49 +0200
Subject: [OpenWrt-Devel] [PATCH 2/2] proto-shell: add checkup timeout to
 restart interface.
In-Reply-To: <1439384896-11218-2-git-send-email-yszhou4tech@gmail.com>
References: <1439384896-11218-2-git-send-email-yszhou4tech@gmail.com>
Message-ID: <55D55E89.5000505@openwrt.org>

Hello Yousong,

thanks for your patch.

Shouldn't there by a timeout cancel path somewhere in case the protocol
gets removed after the timer was armed but before it was fired?
I could imagine it causing memory corruption otherwise.


Cheers,

Steven
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dmitrijs.ivanovs at ubnt.com  Thu Aug 20 04:06:53 2015
From: dmitrijs.ivanovs at ubnt.com (Dmitrijs Ivanovs)
Date: Thu, 20 Aug 2015 11:06:53 +0300
Subject: [OpenWrt-Devel] [PATCH] iwinfo: do not wait for scan results if
 scan request failed.
In-Reply-To: <55D1B500.6070308@openwrt.org>
References: <20150731115315.7fc0dc6dbe29df05af36197d@ubnt.com>
 <55D1B500.6070308@openwrt.org>
Message-ID: <CAFSVvRfiD9sWyUaF89wGNziBZ4UifcEWPVV93zGgVSEcgju7YA@mail.gmail.com>

Hi John!

1) The code is reachable because "err" is signed integer. Negative
value is error indication.
2) Cleanup is called later in all cases. Actually, calling it here
leads to an error - a kind of "double free". It was never encountered
because it was never called in past.

I had to create this patch after transition to the new kernel because
AP scan patch was accidentally removed. Inability of kernel to do wifi
scan in AP mode caused this situation where libiwinfo had to wait
indefinitely for scan results. Ok, AP scan patch is restored now, but
libiwinfo should be more robust against similar situations in future.
In fact, I have tested my patch with both AP scan turned on and off.


On Mon, Aug 17, 2015 at 1:18 PM, John Crispin <blogic at openwrt.org> wrote:
> Hi,
>
> I have various issues with this patch
>
> On 31/07/2015 10:53, Dmitry Ivanov wrote:
>> Do not wait for scan results if scan request failed.
>>
>> Signed-off-by: Dmitry Ivanov <dima at ubnt.com>
>> ---
>>  iwinfo_nl80211.c | 14 ++++++++++----
>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
>> index 900eef2..251ec33 100644
>> --- a/iwinfo_nl80211.c
>> +++ b/iwinfo_nl80211.c
>> @@ -389,11 +389,12 @@ static struct nl80211_msg_conveyor * nl80211_send(
>>       while (err > 0)
>>               nl_recvmsgs(nls->nl_sock, cv->cb);
>>
>> +     if (err)
>> +             goto err;
>> +
>
> this code will never be reached due tot he while (err > 0) above
>
>
>>       return &rcv;
>>
>>  err:
>> -     nl_cb_put(cv->cb);
>> -     nlmsg_free(cv->msg);
>>
>
> removing the freeeing code from a global helper is not a good idea and
> will cause a leak.
>
>
>         John
>
>
>
>>       return NULL;
>>  }
>> @@ -2016,16 +2017,21 @@ static int nl80211_get_scanlist_cb(struct nl_msg *msg, void *arg)
>>
>>  static int nl80211_get_scanlist_nl(const char *ifname, char *buf, int *len)
>>  {
>> -     struct nl80211_msg_conveyor *req;
>> +     struct nl80211_msg_conveyor *req, *scan_res = NULL;
>>       struct nl80211_scanlist sl = { .e = (struct iwinfo_scanlist_entry *)buf };
>>
>>       req = nl80211_msg(ifname, NL80211_CMD_TRIGGER_SCAN, 0);
>>       if (req)
>>       {
>> -             nl80211_send(req, NULL, NULL);
>> +             scan_res = nl80211_send(req, NULL, NULL);
>>               nl80211_free(req);
>>       }
>>
>> +     if (!scan_res)
>> +     {
>> +             return -1;
>> +     }
>> +
>>       nl80211_wait("nl80211", "scan", NL80211_CMD_NEW_SCAN_RESULTS);
>>
>>       req = nl80211_msg(ifname, NL80211_CMD_GET_SCAN, NLM_F_DUMP);
>>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Thu Aug 20 04:13:56 2015
From: blogic at openwrt.org (John Crispin)
Date: Thu, 20 Aug 2015 10:13:56 +0200
Subject: [OpenWrt-Devel] [PATCH] iwinfo: do not wait for scan results if
 scan request failed.
In-Reply-To: <CAFSVvRfiD9sWyUaF89wGNziBZ4UifcEWPVV93zGgVSEcgju7YA@mail.gmail.com>
References: <20150731115315.7fc0dc6dbe29df05af36197d@ubnt.com>
 <55D1B500.6070308@openwrt.org>
 <CAFSVvRfiD9sWyUaF89wGNziBZ4UifcEWPVV93zGgVSEcgju7YA@mail.gmail.com>
Message-ID: <55D58C44.5080700@openwrt.org>



On 20/08/2015 10:06, Dmitrijs Ivanovs wrote:
> Hi John!
> 
> 1) The code is reachable because "err" is signed integer. Negative
> value is error indication.

of course ... i read the while as "err will be 0 when it leaves the loop"

> 2) Cleanup is called later in all cases. Actually, calling it here
> leads to an error - a kind of "double free". It was never encountered
> because it was never called in past.
> 

ok, just looked at the patch without the context

> I had to create this patch after transition to the new kernel because
> AP scan patch was accidentally removed. Inability of kernel to do wifi
> scan in AP mode caused this situation where libiwinfo had to wait
> indefinitely for scan results. Ok, AP scan patch is restored now, but
> libiwinfo should be more robust against similar situations in future.
> In fact, I have tested my patch with both AP scan turned on and off.

fair enough, will have a closer look later, thanks




> On Mon, Aug 17, 2015 at 1:18 PM, John Crispin <blogic at openwrt.org> wrote:
>> Hi,
>>
>> I have various issues with this patch
>>
>> On 31/07/2015 10:53, Dmitry Ivanov wrote:
>>> Do not wait for scan results if scan request failed.
>>>
>>> Signed-off-by: Dmitry Ivanov <dima at ubnt.com>
>>> ---
>>>  iwinfo_nl80211.c | 14 ++++++++++----
>>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
>>> index 900eef2..251ec33 100644
>>> --- a/iwinfo_nl80211.c
>>> +++ b/iwinfo_nl80211.c
>>> @@ -389,11 +389,12 @@ static struct nl80211_msg_conveyor * nl80211_send(
>>>       while (err > 0)
>>>               nl_recvmsgs(nls->nl_sock, cv->cb);
>>>
>>> +     if (err)
>>> +             goto err;
>>> +
>>
>> this code will never be reached due tot he while (err > 0) above
>>
>>
>>>       return &rcv;
>>>
>>>  err:
>>> -     nl_cb_put(cv->cb);
>>> -     nlmsg_free(cv->msg);
>>>
>>
>> removing the freeeing code from a global helper is not a good idea and
>> will cause a leak.
>>
>>
>>         John
>>
>>
>>
>>>       return NULL;
>>>  }
>>> @@ -2016,16 +2017,21 @@ static int nl80211_get_scanlist_cb(struct nl_msg *msg, void *arg)
>>>
>>>  static int nl80211_get_scanlist_nl(const char *ifname, char *buf, int *len)
>>>  {
>>> -     struct nl80211_msg_conveyor *req;
>>> +     struct nl80211_msg_conveyor *req, *scan_res = NULL;
>>>       struct nl80211_scanlist sl = { .e = (struct iwinfo_scanlist_entry *)buf };
>>>
>>>       req = nl80211_msg(ifname, NL80211_CMD_TRIGGER_SCAN, 0);
>>>       if (req)
>>>       {
>>> -             nl80211_send(req, NULL, NULL);
>>> +             scan_res = nl80211_send(req, NULL, NULL);
>>>               nl80211_free(req);
>>>       }
>>>
>>> +     if (!scan_res)
>>> +     {
>>> +             return -1;
>>> +     }
>>> +
>>>       nl80211_wait("nl80211", "scan", NL80211_CMD_NEW_SCAN_RESULTS);
>>>
>>>       req = nl80211_msg(ifname, NL80211_CMD_GET_SCAN, NLM_F_DUMP);
>>>
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Thu Aug 20 05:40:12 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Thu, 20 Aug 2015 11:40:12 +0200
Subject: [OpenWrt-Devel] Broken GCC 4.9 (and 5.2) on ARM - asking for
	review/test
Message-ID: <55D5A07C.6070707@web.de>

GCC 4.9 was marked BROKEN with r46089. Recently GCC 5.2 was added (marked as broken too)

commit msg: " toolchain: mark gcc 4.9 as broken, it miscompiles some code especially on ARM"

Looking through some GCC 5 serious regressions I found:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932

I cannot replicate the ARM issue because of missing details and I dont have ARM hw where it occurs (arch: malta seems fine)
 - but there was an open ticket from a dev on github regarding the boot problem, which might be a symptom of code miscompile

https://github.com/wongsyrone/openwrt-1/issues/44

According to his tests GCC4.9 and GCC5.2 now work with this 2 changes:

adding -fno-ipa-sra to Kernel/CPU CFLAGS

https://github.com/wongsyrone/openwrt-1/commit/35308f2435ec75192324d68817e7702e3b257e71
https://github.com/wongsyrone/openwrt-1/commit/93c0a5173414cfa7684547de3c3a1f3dc4240383
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Thu Aug 20 06:57:44 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Thu, 20 Aug 2015 12:57:44 +0200
Subject: [OpenWrt-Devel] Broken GCC 4.9 (and 5.2) on ARM - asking for
	review/test
In-Reply-To: <55D5A07C.6070707@web.de>
References: <55D5A07C.6070707@web.de>
Message-ID: <CAOiHx=ktBb5OG3134ROPPOmfPy9BpXUwQeJXurZWxGKyWB5s+A@mail.gmail.com>

Hi,

On Thu, Aug 20, 2015 at 11:40 AM, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
> GCC 4.9 was marked BROKEN with r46089. Recently GCC 5.2 was added (marked as broken too)
>
> commit msg: " toolchain: mark gcc 4.9 as broken, it miscompiles some code especially on ARM"
>
> Looking through some GCC 5 serious regressions I found:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932
>
> I cannot replicate the ARM issue because of missing details and I dont have ARM hw where it occurs (arch: malta seems fine)
>  - but there was an open ticket from a dev on github regarding the boot problem, which might be a symptom of code miscompile
>
> https://github.com/wongsyrone/openwrt-1/issues/44
>
> According to his tests GCC4.9 and GCC5.2 now work with this 2 changes:
>
> adding -fno-ipa-sra to Kernel/CPU CFLAGS
>
> https://github.com/wongsyrone/openwrt-1/commit/35308f2435ec75192324d68817e7702e3b257e71
> https://github.com/wongsyrone/openwrt-1/commit/93c0a5173414cfa7684547de3c3a1f3dc4240383

Readin the bug ticket, it seems that

https://gcc.gnu.org/bugzilla/attachment.cgi?id=35775&action=diff

should fix the issue at the root cause, but with the "disadvantage" of
breaking some testcases relying on the (mis-?)behaviour, which sounds
like the "blocker" for this change.

So I wonder if adding that wouldn't be a better solution.


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


From yszhou4tech at gmail.com  Thu Aug 20 08:05:37 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Thu, 20 Aug 2015 20:05:37 +0800
Subject: [OpenWrt-Devel] [PATCH 2/2] proto-shell: add checkup timeout to
 restart interface.
In-Reply-To: <55D55E89.5000505@openwrt.org>
References: <1439384896-11218-2-git-send-email-yszhou4tech@gmail.com>
 <55D55E89.5000505@openwrt.org>
Message-ID: <CAECwjAgEW3gwhoX3_64=e430pgrD+hBvRPVJo4N-Cqz3kcH_dw@mail.gmail.com>

On 20 August 2015 at 12:58, Steven Barth <cyrus at openwrt.org> wrote:
> Hello Yousong,
>
> thanks for your patch.
>
> Shouldn't there by a timeout cancel path somewhere in case the protocol
> gets removed after the timer was armed but before it was fired?
> I could imagine it causing memory corruption otherwise.
>

Indeed.  Thank you.  I will fix that.

Cheers,

               yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From guenther.kelleter at devolo.de  Thu Aug 20 11:14:21 2015
From: guenther.kelleter at devolo.de (=?UTF-8?q?G=C3=BCnther=20Kelleter?=)
Date: Thu, 20 Aug 2015 17:14:21 +0200
Subject: [OpenWrt-Devel] [PATCH CC 0/3] Backport dLAN USB extender
Message-ID: <1440083664-27934-1-git-send-email-guenther.kelleter@devolo.de>

This is the backport of patchset r46646..r46648
fixing kernel and image build for dLAN USDB extender

blogic (3):
  mcs814x: fix debug UART
  mcs814x: fix interrupt handling
  mcs814x: use firmware partition splitter on dLAN USB Extender

 target/linux/mcs814x/config-3.18                   | 14 ++++++--
 .../arch/arm/boot/dts/dlan-usb-extender.dts        |  8 -----
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 21 ++++++-----
 .../files-3.18/arch/arm/mach-mcs814x/timer.c       | 28 +++++++--------
 target/linux/mcs814x/image/Makefile                |  2 +-
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++++++++++++++++++++++
 6 files changed, 80 insertions(+), 34 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

-- 
2.4.6.89.g851dcf4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From guenther.kelleter at devolo.de  Thu Aug 20 11:14:22 2015
From: guenther.kelleter at devolo.de (=?UTF-8?q?G=C3=BCnther=20Kelleter?=)
Date: Thu, 20 Aug 2015 17:14:22 +0200
Subject: [OpenWrt-Devel] [PATCH CC 1/3] mcs814x: fix debug UART
In-Reply-To: <1440083664-27934-1-git-send-email-guenther.kelleter@devolo.de>
References: <1440083664-27934-1-git-send-email-guenther.kelleter@devolo.de>
Message-ID: <1440083664-27934-2-git-send-email-guenther.kelleter@devolo.de>

From: blogic <blogic at 3c298f89-4303-0410-b956-a3cf2f4a3e73>

Switch to new 8250 debug uart code because the old
mach-mcs814x/include/mach/debug-macro.S tries to include
asm/hardware/debug-8250.S which no longer exists since kernel 3.14

Signed-off-by: G?nther Kelleter <guenther.kelleter at devolo.de>

Backport of r46646
---
 target/linux/mcs814x/config-3.18                   | 10 ++++--
 .../linux/mcs814x/patches-3.18/014-debuguart.patch | 41 ++++++++++++++++++++++
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/mcs814x/patches-3.18/014-debuguart.patch

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index 87a8382..e57f5ff 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -49,10 +49,15 @@ CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
 CONFIG_DEBUG_LL_UART_NONE=y
-# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_UART_8250=y
+# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+CONFIG_DEBUG_UART_PHYS=0x400dc000
 # CONFIG_DEBUG_UART_PL01X is not set
+CONFIG_DEBUG_UART_VIRT=0xf00dc000
 # CONFIG_DEBUG_USER is not set
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
@@ -157,7 +162,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
-CONFIG_NEED_MACH_MEMORY_H=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_KEY=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
diff --git a/target/linux/mcs814x/patches-3.18/014-debuguart.patch b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
new file mode 100644
index 0000000..5f1b67f
--- /dev/null
+++ b/target/linux/mcs814x/patches-3.18/014-debuguart.patch
@@ -0,0 +1,41 @@
+--- a/arch/arm/mach-mcs814x/include/mach/debug-macro.S
++++ /dev/null
+@@ -1,11 +0,0 @@
+-#include <mach/mcs814x.h>
+-
+-                .macro  addruart, rp, rv, tmp
+-		ldr	\rp, =MCS814X_PHYS_BASE
+-		ldr	\rv, =MCS814X_VIRT_BASE
+-		orr	\rp, \rp, #MCS814X_UART
+-		orr	\rv, \rv, #MCS814X_UART
+-                .endm
+-
+-#define UART_SHIFT	2
+-#include <asm/hardware/debug-8250.S>
+--- a/arch/arm/Kconfig.debug
++++ b/arch/arm/Kconfig.debug
+@@ -1089,7 +1089,7 @@ config DEBUG_UART_8250
+ 		(FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
+ 		ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
+ 		ARCH_IOP33X || ARCH_IXP4XX || \
+-		ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
++		ARCH_LPC32XX || ARCH_MCS814X || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
+ 
+ # Compatibility options for BCM63xx
+ config DEBUG_UART_BCM63XX
+@@ -1124,6 +1124,7 @@ config DEBUG_UART_PHYS
+ 	default 0x3e000000 if DEBUG_BCM_KONA_UART
+ 	default 0x4000e400 if DEBUG_LL_UART_EFM32
+ 	default 0x40090000 if ARCH_LPC32XX
++	default 0x400dc000 if ARCH_MCS814X
+ 	default 0x40100000 if DEBUG_PXA_UART1
+ 	default 0x42000000 if ARCH_GEMINI
+ 	default 0x50000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
+@@ -1178,6 +1179,7 @@ config DEBUG_UART_VIRT
+ 	default 0xe0010fe0 if ARCH_RPC
+ 	default 0xe1000000 if DEBUG_MSM_UART
+ 	default 0xf0000be0 if ARCH_EBSA110
++	default 0xf00dc000 if ARCH_MCS814X
+ 	default 0xf01fb000 if DEBUG_NOMADIK_UART
+ 	default 0xf0201000 if DEBUG_BCM2835
+ 	default 0xf1000300 if DEBUG_BCM_5301X
-- 
2.4.6.89.g851dcf4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From guenther.kelleter at devolo.de  Thu Aug 20 11:14:23 2015
From: guenther.kelleter at devolo.de (=?UTF-8?q?G=C3=BCnther=20Kelleter?=)
Date: Thu, 20 Aug 2015 17:14:23 +0200
Subject: [OpenWrt-Devel] [PATCH CC 2/3] mcs814x: fix interrupt handling
In-Reply-To: <1440083664-27934-1-git-send-email-guenther.kelleter@devolo.de>
References: <1440083664-27934-1-git-send-email-guenther.kelleter@devolo.de>
Message-ID: <1440083664-27934-3-git-send-email-guenther.kelleter@devolo.de>

From: blogic <blogic at 3c298f89-4303-0410-b956-a3cf2f4a3e73>

Switch to generich chip irqs/irq domains.
Interrupts were broken since kernel 3.14. dLAN USB extender is now
booting again.

Signed-off-by: G?nther Kelleter <guenther.kelleter at devolo.de>

Backport of r46647
---
 .../mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c | 21 +++++++++-------
 .../files-3.18/arch/arm/mach-mcs814x/timer.c       | 28 +++++++++++-----------
 2 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
index f84c412..d1cab68 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/irq.c
@@ -17,6 +17,7 @@
 #include <mach/mcs814x.h>
 
 static void __iomem *mcs814x_intc_base;
+static struct irq_domain *domain;
 
 static void __init mcs814x_alloc_gc(void __iomem *base, unsigned int irq_start,
 					unsigned int num)
@@ -24,11 +25,15 @@ static void __init mcs814x_alloc_gc(void __iomem *base, unsigned int irq_start,
 	struct irq_chip_generic *gc;
 	struct irq_chip_type *ct;
 
-	gc = irq_alloc_generic_chip("mcs814x-intc", 1,
-			irq_start, base, handle_level_irq);
+	if (irq_alloc_domain_generic_chips(domain, num, 1, "mcs814x-intc", handle_level_irq,
+                IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST, 0))
+		panic("unable to allocate domain generic irq chip");
+
+	gc = irq_get_domain_generic_chip(domain, irq_start);
 	if (!gc)
-		panic("unable to allocate generic irq chip");
+		panic("unable to get generic irq chip");
 
+	gc->reg_base = base;
 	ct = gc->chip_types;
 	ct->chip.irq_ack = irq_gc_unmask_enable_reg;
 	ct->chip.irq_mask = irq_gc_mask_clr_bit;
@@ -36,9 +41,6 @@ static void __init mcs814x_alloc_gc(void __iomem *base, unsigned int irq_start,
 	ct->regs.mask = MCS814X_IRQ_MASK;
 	ct->regs.enable = MCS814X_IRQ_ICR;
 
-	irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
-		IRQ_NOREQUEST, 0);
-
 	/* Clear all interrupts */
 	writel_relaxed(0xffffffff, base + MCS814X_IRQ_ICR);
 }
@@ -58,7 +60,7 @@ asmlinkage void __exception_irq_entry mcs814x_handle_irq(struct pt_regs *regs)
 		/* clear the interrupt */
 		__raw_writel(status, mcs814x_intc_base + MCS814X_IRQ_STS0);
 		/* call the generic handler */
-		handle_IRQ(irq, regs);
+		handle_domain_irq(domain, irq, regs);
 
 	} while (1);
 }
@@ -80,7 +82,10 @@ void __init mcs814x_of_irq_init(void)
 	if (!mcs814x_intc_base)
 		panic("unable to map intc cpu registers\n");
 
-	irq_domain_add_simple(np, 32, 0, &irq_generic_chip_ops, NULL);
+	domain = irq_domain_add_linear(np, 32, &irq_generic_chip_ops, NULL);
+	if (!domain)
+		panic("unable to add irq domain\n");
+	irq_set_default_host(domain);
 
 	of_node_put(np);
 
diff --git a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
index ff9d44a..31d0ba6 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
+++ b/target/linux/mcs814x/files-3.18/arch/arm/mach-mcs814x/timer.c
@@ -15,6 +15,7 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/mach/time.h>
 #include <mach/mcs814x.h>
@@ -71,21 +72,15 @@ static irqreturn_t mcs814x_timer_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static struct irqaction mcs814x_timer_irq = {
-	.name		= "mcs814x-timer",
-	.flags		= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-	.handler	= mcs814x_timer_interrupt,
-};
-
 static struct of_device_id mcs814x_timer_ids[] = {
 	{ .compatible = "moschip,mcs814x-timer" },
 	{ /* sentinel */ },
 };
 
-static void __init mcs814x_of_timer_init(void)
+static int __init mcs814x_of_timer_init(void)
 {
 	struct device_node *np;
-	const unsigned int *intspec;
+	int irq;
 
 	np = of_find_matching_node(NULL, mcs814x_timer_ids);
 	if (!np)
@@ -95,16 +90,17 @@ static void __init mcs814x_of_timer_init(void)
 	if (!mcs814x_timer_base)
 		panic("unable to remap timer cpu registers");
 
-	intspec = of_get_property(np, "interrupts", NULL);
-	if (!intspec)
-		panic("no interrupts property for timer");
+	irq = irq_of_parse_and_map(np, 0);
+	if (!irq)
+		panic("no interrupts property/mapping failed for timer");
 
-	mcs814x_timer_irq.irq = be32_to_cpup(intspec);
+	return irq;
 }
 
 void __init mcs814x_timer_init(void)
 {
 	struct clk *clk;
+	int irq;
 
 	arch_gettimeoffset = mcs814x_gettimeoffset;
 
@@ -114,7 +110,7 @@ void __init mcs814x_timer_init(void)
 
 	clock_rate = clk_get_rate(clk);
 
-	mcs814x_of_timer_init();
+	irq = mcs814x_of_timer_init();
 
 	pr_info("Timer frequency: %d (kHz)\n", clock_rate / 1000);
 
@@ -125,7 +121,11 @@ void __init mcs814x_timer_init(void)
 	writel_relaxed(timer_reload_value, mcs814x_timer_base + TIMER_VAL);
 	last_reload = timer_reload_value;
 
-	setup_irq(mcs814x_timer_irq.irq, &mcs814x_timer_irq);
+	if (request_irq(irq, mcs814x_timer_interrupt,
+		IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+		"mcs814x-timer", NULL))
+		panic("unable to request timer0 irq %d", irq);
+
 	/* enable timer, stop timer in debug mode */
 	writel_relaxed(TIMER_CTL_EN | TIMER_CTL_DBG,
 		mcs814x_timer_base + TIMER_CTL);
-- 
2.4.6.89.g851dcf4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From guenther.kelleter at devolo.de  Thu Aug 20 11:14:24 2015
From: guenther.kelleter at devolo.de (=?UTF-8?q?G=C3=BCnther=20Kelleter?=)
Date: Thu, 20 Aug 2015 17:14:24 +0200
Subject: [OpenWrt-Devel] [PATCH CC 3/3] mcs814x: use firmware partition
	splitter on dLAN USB Extender
In-Reply-To: <1440083664-27934-1-git-send-email-guenther.kelleter@devolo.de>
References: <1440083664-27934-1-git-send-email-guenther.kelleter@devolo.de>
Message-ID: <1440083664-27934-4-git-send-email-guenther.kelleter@devolo.de>

From: blogic <blogic at 3c298f89-4303-0410-b956-a3cf2f4a3e73>

to avoid editing the dts every time the kernel size changes.
uImage is now bigger than 1MB. Pad uImage to 64k erase block size.

Signed-off-by: G?nther Kelleter <guenther.kelleter at devolo.de>

Backport of r46648
---
 target/linux/mcs814x/config-3.18                                  | 4 ++++
 .../mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts    | 8 --------
 target/linux/mcs814x/image/Makefile                               | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/target/linux/mcs814x/config-3.18 b/target/linux/mcs814x/config-3.18
index e57f5ff..427a7c9 100644
--- a/target/linux/mcs814x/config-3.18
+++ b/target/linux/mcs814x/config-3.18
@@ -159,6 +159,10 @@ CONFIG_MODULES_USE_ELF_REL=y
 # CONFIG_MTD_IMPA7 is not set
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_ROOTFS_SPLIT is not set
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_KUSER_HELPERS=y
diff --git a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
index 0c85b94..59830e8 100644
--- a/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
+++ b/target/linux/mcs814x/files-3.18/arch/arm/boot/dts/dlan-usb-extender.dts
@@ -48,14 +48,6 @@
 						reg = <0x40000 0x10000>;
 					};
 					partition at 50000 {
-						label = "kernel";
-						reg = <0x50000 0x100000>;
-					};
-					partition at 150000 {
-						label = "rootfs";
-						reg = <0x150000 0x3C0000>;
-					};
-					partition at 50001 {
 						label = "linux";
 						reg = <0x50000 0x4C0000>;
 					};
diff --git a/target/linux/mcs814x/image/Makefile b/target/linux/mcs814x/image/Makefile
index 4c8af97..74f8ad4 100644
--- a/target/linux/mcs814x/image/Makefile
+++ b/target/linux/mcs814x/image/Makefile
@@ -30,7 +30,7 @@ define Image/Build/DTB
 endef
 
 define Image/Build/Profile/dLAN_USB_Extender
-	dd if=$(KDIR)/uImage-dlan-usb-extender bs=1M conv=sync of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
+	dd if=$(KDIR)/uImage-dlan-usb-extender bs=64k conv=sync of=$(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
 	cat $(KDIR)/root.$(1) >> $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin
 	cp $(KDIR)/$(IMG_PREFIX)-dlan-usb-extender-upgrade-$(1).bin $(BIN_DIR)/
 endef
-- 
2.4.6.89.g851dcf4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Thu Aug 20 12:01:48 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Thu, 20 Aug 2015 19:01:48 +0300
Subject: [OpenWrt-Devel] [PATCH 0/4] lantiq: AR9 platform USB DWC2 support
Message-ID: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>

I recently came across a lantiq AR9 device and after studying the 
ltq-hcd driver for a while I came to the conclusion that the USB works 
identically compared to the VR9 platform.

Since ltq-hcd is known to have some bugs and DWC2 is maintained in 
upstream kernel here is a series of patches which add support for the 
DWC2 to the AR9 platform too.

While at it I also included a patch to add missing Kconfig define to the 
DWC2 driver.

These patches have been successfully tested on Buffalo WBMR-HP-G300H.

Antti Sepp?l? (4):
  lantiq: Initialize USB on AR9 platform
  lantiq: Introduce DWC2 compatible DTS definitions for AR9 USB
  lantiq: Add AR9 compatibility bits to DWC2 driver
  dwc2: Add missing config symbol definition

 package/kernel/linux/modules/usb.mk                           |  3 ++-
 target/linux/lantiq/dts/ar9.dtsi                              | 11 ++++++++++-
 .../0039-MIPS-lantiq-initialize-usb-on-boot.patch             |  5 +++--
 .../lantiq/patches-3.18/0041-USB-DWC2-add-ltq-params.patch    |  5 +++--
 .../patches-4.1/0039-MIPS-lantiq-initialize-usb-on-boot.patch |  5 +++--
 .../lantiq/patches-4.1/0041-USB-DWC2-add-ltq-params.patch     |  5 +++--
 6 files changed, 24 insertions(+), 10 deletions(-)

-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Thu Aug 20 12:01:49 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Thu, 20 Aug 2015 19:01:49 +0300
Subject: [OpenWrt-Devel] [PATCH 1/4] lantiq: Initialize USB on AR9 platform
In-Reply-To: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>
References: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1440086512-12772-2-git-send-email-a.seppala@gmail.com>

Based on the ltq-hcd driver the AR9 USB can be initialized the same way
as the VR9 platform. Use the same initialization bits for both 
platforms.

Signed-off-by: Antti Sepp?l? <a.seppala at gmail.com>
---
 .../patches-3.18/0039-MIPS-lantiq-initialize-usb-on-boot.patch       | 5 +++--
 .../lantiq/patches-4.1/0039-MIPS-lantiq-initialize-usb-on-boot.patch | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/target/linux/lantiq/patches-3.18/0039-MIPS-lantiq-initialize-usb-on-boot.patch b/target/linux/lantiq/patches-3.18/0039-MIPS-lantiq-initialize-usb-on-boot.patch
index 052e45e..fd0da8e 100644
--- a/target/linux/lantiq/patches-3.18/0039-MIPS-lantiq-initialize-usb-on-boot.patch
+++ b/target/linux/lantiq/patches-3.18/0039-MIPS-lantiq-initialize-usb-on-boot.patch
@@ -84,11 +84,12 @@
  static int __init mips_reboot_setup(void)
  {
  	struct resource res;
-@@ -223,6 +293,9 @@ static int __init mips_reboot_setup(void
+@@ -223,6 +293,10 @@ static int __init mips_reboot_setup(void
  	if (!ltq_rcu_membase)
  		panic("Failed to remap core memory");
  
-+	if (of_machine_is_compatible("lantiq,vr9"))
++	if (of_machine_is_compatible("lantiq,ar9") ||
++	    of_machine_is_compatible("lantiq,vr9"))
 +		ltq_usb_init();
 +
  	_machine_restart = ltq_machine_restart;
diff --git a/target/linux/lantiq/patches-4.1/0039-MIPS-lantiq-initialize-usb-on-boot.patch b/target/linux/lantiq/patches-4.1/0039-MIPS-lantiq-initialize-usb-on-boot.patch
index 052e45e..fd0da8e 100644
--- a/target/linux/lantiq/patches-4.1/0039-MIPS-lantiq-initialize-usb-on-boot.patch
+++ b/target/linux/lantiq/patches-4.1/0039-MIPS-lantiq-initialize-usb-on-boot.patch
@@ -84,11 +84,12 @@
  static int __init mips_reboot_setup(void)
  {
  	struct resource res;
-@@ -223,6 +293,9 @@ static int __init mips_reboot_setup(void
+@@ -223,6 +293,10 @@ static int __init mips_reboot_setup(void
  	if (!ltq_rcu_membase)
  		panic("Failed to remap core memory");
  
-+	if (of_machine_is_compatible("lantiq,vr9"))
++	if (of_machine_is_compatible("lantiq,ar9") ||
++	    of_machine_is_compatible("lantiq,vr9"))
 +		ltq_usb_init();
 +
  	_machine_restart = ltq_machine_restart;
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Thu Aug 20 12:01:50 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Thu, 20 Aug 2015 19:01:50 +0300
Subject: [OpenWrt-Devel] [PATCH 2/4] lantiq: Introduce DWC2 compatible DTS
	definitions for AR9 USB
In-Reply-To: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>
References: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1440086512-12772-3-git-send-email-a.seppala@gmail.com>

Since the AR9 USB is very similar to the VR9 USB it too can be used with
the upstream DWC2 driver.

Here are the DTS definitions which make it compatible with the DWC2
driver.

Signed-off-by: Antti Sepp?l? <a.seppala at gmail.com>
---
 target/linux/lantiq/dts/ar9.dtsi | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/target/linux/lantiq/dts/ar9.dtsi b/target/linux/lantiq/dts/ar9.dtsi
index cc65fd1..ee4e374 100644
--- a/target/linux/lantiq/dts/ar9.dtsi
+++ b/target/linux/lantiq/dts/ar9.dtsi
@@ -115,7 +115,7 @@
 		};
 
 		ifxhcd at E101000 {
-			compatible = "lantiq,ifxhcd-arx100";
+			compatible = "lantiq,ifxhcd-arx100", "lantiq,ifxhcd-arx100-dwc2";
 			reg = <0xE101000 0x1000
 				0xE120000 0x3f000>;
 			interrupt-parent = <&icu0>;
@@ -123,6 +123,15 @@
 			status = "disabled";
 		};
 
+		ifxhcd at E106000 {
+			compatible = "lantiq,ifxhcd-arx100-dwc2";
+			reg = <0xE106000 0x1000
+				0xE1E0000 0x3f000>;
+			interrupt-parent = <&icu0>;
+			interrupts = <91>;
+			status = "disabled";
+		};
+
 		deu at E103100 {
 			compatible = "lantiq,deu-arx100";
 			reg = <0xE103100 0xf00>;
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Thu Aug 20 12:01:51 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Thu, 20 Aug 2015 19:01:51 +0300
Subject: [OpenWrt-Devel] [PATCH 3/4] lantiq: Add AR9 compatibility bits to
	DWC2 driver
In-Reply-To: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>
References: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1440086512-12772-4-git-send-email-a.seppala@gmail.com>

Add AR9 DTS definition to be recognized by the DWC2 driver.

The same driver parameters can be mostly used except that some boards 
seem to erroneously report OTG HNP/SRP capability of the USB HCD.
Forcing the HNP/SRP off allows these boards to work with the DWC2 as well.

Signed-off-by: Antti Sepp?l? <a.seppala at gmail.com>
---
 target/linux/lantiq/patches-3.18/0041-USB-DWC2-add-ltq-params.patch | 5 +++--
 target/linux/lantiq/patches-4.1/0041-USB-DWC2-add-ltq-params.patch  | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/target/linux/lantiq/patches-3.18/0041-USB-DWC2-add-ltq-params.patch b/target/linux/lantiq/patches-3.18/0041-USB-DWC2-add-ltq-params.patch
index 396aa7d..a0af123 100644
--- a/target/linux/lantiq/patches-3.18/0041-USB-DWC2-add-ltq-params.patch
+++ b/target/linux/lantiq/patches-3.18/0041-USB-DWC2-add-ltq-params.patch
@@ -5,7 +5,7 @@
  };
  
 +static const struct dwc2_core_params params_ltq = {
-+	.otg_cap			= -1,
++	.otg_cap			= 2,	/* non-HNP/non-SRP */
 +	.otg_ver			= -1,
 +	.dma_enable			= -1,
 +	.dma_desc_enable		= -1,
@@ -35,10 +35,11 @@
  /**
   * dwc2_driver_remove() - Called when the DWC_otg core is unregistered with the
   * DWC_otg driver
-@@ -129,6 +157,7 @@ static int dwc2_driver_remove(struct pla
+@@ -129,6 +157,8 @@ static int dwc2_driver_remove(struct pla
  static const struct of_device_id dwc2_of_match_table[] = {
  	{ .compatible = "brcm,bcm2835-usb", .data = &params_bcm2835 },
  	{ .compatible = "rockchip,rk3066-usb", .data = &params_rk3066 },
++	{ .compatible = "lantiq,ifxhcd-arx100-dwc2", .data = &params_ltq },
 +	{ .compatible = "lantiq,ifxhcd-xrx200-dwc2", .data = &params_ltq },
  	{ .compatible = "snps,dwc2", .data = NULL },
  	{},
diff --git a/target/linux/lantiq/patches-4.1/0041-USB-DWC2-add-ltq-params.patch b/target/linux/lantiq/patches-4.1/0041-USB-DWC2-add-ltq-params.patch
index 850d7a8..c55f5b6 100644
--- a/target/linux/lantiq/patches-4.1/0041-USB-DWC2-add-ltq-params.patch
+++ b/target/linux/lantiq/patches-4.1/0041-USB-DWC2-add-ltq-params.patch
@@ -5,7 +5,7 @@
  };
  
 +static const struct dwc2_core_params params_ltq = {
-+	.otg_cap			= -1,
++	.otg_cap			= 2,	/* non-HNP/non-SRP */
 +	.otg_ver			= -1,
 +	.dma_enable			= -1,
 +	.dma_desc_enable		= -1,
@@ -35,10 +35,11 @@
  /**
   * dwc2_driver_remove() - Called when the DWC_otg core is unregistered with the
   * DWC_otg driver
-@@ -133,6 +161,7 @@ static int dwc2_driver_remove(struct pla
+@@ -133,6 +161,8 @@ static int dwc2_driver_remove(struct pla
  static const struct of_device_id dwc2_of_match_table[] = {
  	{ .compatible = "brcm,bcm2835-usb", .data = &params_bcm2835 },
  	{ .compatible = "rockchip,rk3066-usb", .data = &params_rk3066 },
++	{ .compatible = "lantiq,ifxhcd-arx100-dwc2", .data = &params_ltq },
 +	{ .compatible = "lantiq,ifxhcd-xrx200-dwc2", .data = &params_ltq },
  	{ .compatible = "snps,dwc2", .data = NULL },
  	{ .compatible = "samsung,s3c6400-hsotg", .data = NULL},
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From a.seppala at gmail.com  Thu Aug 20 12:01:52 2015
From: a.seppala at gmail.com (=?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?=)
Date: Thu, 20 Aug 2015 19:01:52 +0300
Subject: [OpenWrt-Devel] [PATCH 4/4] dwc2: Add missing config symbol
	definition
In-Reply-To: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>
References: <1440086512-12772-1-git-send-email-a.seppala@gmail.com>
Message-ID: <1440086512-12772-5-git-send-email-a.seppala@gmail.com>

DWC2 driver has config symbol CONFIG_USB_DWC2_DEBUG_PERIODIC which
should be defined for the module build.

Signed-off-by: Antti Sepp?l? <a.seppala at gmail.com>
---
 package/kernel/linux/modules/usb.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index 8f6013c..986f53f 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -466,7 +466,8 @@ define KernelPackage/usb-dwc2
 	CONFIG_USB_DWC2_PLATFORM \
 	CONFIG_USB_DWC2_DEBUG=n \
 	CONFIG_USB_DWC2_VERBOSE=n \
-	CONFIG_USB_DWC2_TRACK_MISSED_SOFS=n
+	CONFIG_USB_DWC2_TRACK_MISSED_SOFS=n \
+	CONFIG_USB_DWC2_DEBUG_PERIODIC=n
   FILES:= \
 	$(LINUX_DIR)/drivers/usb/dwc2/dwc2.ko \
 	$(LINUX_DIR)/drivers/usb/dwc2/dwc2_platform.ko
-- 
2.4.6
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From marcos.lois at teratic.com  Thu Aug 20 13:42:35 2015
From: marcos.lois at teratic.com (=?UTF-8?Q?Marcos_Lois_Berm=C3=BAdez?=)
Date: Thu, 20 Aug 2015 19:42:35 +0200
Subject: [OpenWrt-Devel] Compile kernel modules with SDK
Message-ID: <CAPHf=oWrFskcQqgK0FL6SB=bmMK=6ShBySevyY_6N8Zr06yQNw@mail.gmail.com>

Hi,

I'm trying to build kernel modules using the SDK, I already can build 3rd
party kernel modules with OpenWrt-SDK. But after searching in the lists i
can't find how compile a linux kernel module not included in OpenWrt
Release.

I also compiled this modules using buildroot, but this will compile a
entire linux kernel, it's a bit overkill, also I want kmod packages be
binary compatible with OpenWrt oficial releases, because I want make this
modules available to anybody that wants it.

I use Chaos Calmer 15.05 RC3 SDK :
OpenWrt-SDK-15.05-rc3-x86-64_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64

It runs on Jetway NF9HQL Mini-ITX Motherboard
http://www.jetwaycomputer.com/NF9H.html

And want to build some modules that some atom embedded board has: sensors,
hwmon, etc.

Can be possible to simple compile linux kernel modules that was omitted in
the official release with the SDK?

Regards,
Marcos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150820/78d7aa35/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From champetier.etienne at gmail.com  Thu Aug 20 18:39:50 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Thu, 20 Aug 2015 22:39:50 +0000
Subject: [OpenWrt-Devel] [PATCH 1/2] [procd] add UTRACE_SUPPORT option
Message-ID: <1440110391-8054-1-git-send-email-champetier.etienne@gmail.com>

we now can build seccomp, ujail, utrace separatly

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6af17a3..805e2ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,7 +84,9 @@ TARGET_LINK_LIBRARIES(ujail ubox)
 INSTALL(TARGETS ujail
 	RUNTIME DESTINATION sbin
 )
+endif()
 
+IF(UTRACE_SUPPORT)
 ADD_EXECUTABLE(utrace trace/trace.c)
 TARGET_LINK_LIBRARIES(utrace ubox ${json} blobmsg_json)
 INSTALL(TARGETS utrace
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Thu Aug 20 18:39:51 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Thu, 20 Aug 2015 22:39:51 +0000
Subject: [OpenWrt-Devel] [PATCH 2/2] [procd, RFC] ujail: reworks & cleanups
In-Reply-To: <1440110391-8054-1-git-send-email-champetier.etienne@gmail.com>
References: <1440110391-8054-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440110391-8054-2-git-send-email-champetier.etienne@gmail.com>

This is an RFC patch for ujail

-use EXIT_SUCCESS/EXIT_FAILURE (not -1)
-parse every options in main, put them in opts struct
-add CLONE_NEWIPC to the clone() call (it's already compiled in openwrt kernel)
-return the exit status of the jailed process, or the num of the signal that killed it
-add missing options to usage()
-add a warning in usage() about ujail security
-debug option can now take an int as parameter (~debug level),
  with -d2 you now activate "LD_DEBUG=all" for exemple
-do not depend on libpreload-seccomp.so if -S is not present
-there is now only one ujail process instead of two

jail creation is now as follow:
1) create jail root dir (mkdir)
2) create new namespace (clone)
(in the parent wait for the child with uloop)
3) build the jail root fs (mount bind all the libs/bins ...),
pivot_root and mount special fs (procfs, sysfs) (build_jail_fs())
4) build envp (LD_PRELOAD the seccomp helper or ...)
5) coming soon: drop capabilities()
6) execve the jailed bin
7) remove jail root dir (once child is dead)

there is no need to umount anything because we are already in the namespace

Todo:
-add capabilities() support
-allow signals from the parent to the child

Feature request:
-when we add a file or dir, detect if it's an exec and add it's dependencies

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/jail.c | 390 ++++++++++++++++++++++++------------------------------------
 1 file changed, 155 insertions(+), 235 deletions(-)

diff --git a/jail/jail.c b/jail/jail.c
index 2bba292..dd46c86 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -43,7 +43,17 @@
 #include <libubox/uloop.h>
 
 #define STACK_SIZE	(1024 * 1024)
-#define OPT_ARGS	"P:S:n:r:w:psuldo"
+#define OPT_ARGS	"P:S:n:r:w:d:psulo"
+
+static struct {
+	char *path;
+	char *name;
+	char **jail_argv;
+	char *seccomp;
+	int procfs;
+	int ronly;
+	int sysfs;
+} opts;
 
 struct extra {
 	struct list_head list;
@@ -125,7 +135,7 @@ static int mount_bind(const char *root, const char *path, const char *name, int
 		return -1;
 	}
 
-	if (readonly && mount(old, new, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL)) {
+	if (readonly && mount(NULL, new, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL)) {
 		ERROR("failed to remount ro %s: %s\n", new, strerror(errno));
 		return -1;
 	}
@@ -135,80 +145,75 @@ static int mount_bind(const char *root, const char *path, const char *name, int
 	return 0;
 }
 
-static int build_jail(const char *path)
+static int build_jail_fs()
 {
 	struct library *l;
 	struct extra *m;
-	int ret = 0;
 
-	mkdir(path, 0755);
-
-	if (mount("tmpfs", path, "tmpfs", MS_NOATIME, "mode=0755")) {
+	if (mount("tmpfs", opts.path, "tmpfs", MS_NOATIME, "mode=0755")) {
 		ERROR("tmpfs mount failed %s\n", strerror(errno));
 		return -1;
 	}
 
-	avl_for_each_element(&libraries, l, avl)
-		if (mount_bind(path, l->path, l->name, 1, -1))
-			return -1;
-
-	list_for_each_entry(m, &extras, list)
-		if (mount_bind(path, m->path, m->name, m->readonly, 0))
-			return -1;
-
-	return ret;
-}
+	if (chdir(opts.path)) {
+		ERROR("failed to chdir() in the jail root\n");
+		return -1;
+	}
 
-static void _umount(const char *root, const char *path)
-{
-	char *buf = NULL;
+	avl_init(&libraries, avl_strcmp, false, NULL);
+	alloc_library_path("/lib64");
+	alloc_library_path("/lib");
+	alloc_library_path("/usr/lib");
+	load_ldso_conf("/etc/ld.so.conf");
 
-	if (asprintf(&buf, "%s%s", root, path) < 0) {
-		ERROR("failed to alloc umount buffer: %s\n", strerror(errno));
-	} else {
-		DEBUG("umount %s\n", buf);
-		umount(buf);
-		free(buf);
+	if (elf_load_deps(*opts.jail_argv)) {
+		ERROR("failed to load dependencies\n");
+		return -1;
 	}
-}
 
-static int stop_jail(const char *root)
-{
-	struct library *l;
-	struct extra *m;
+	if (opts.seccomp && elf_load_deps("libpreload-seccomp.so")) {
+		ERROR("failed to load libpreload-seccomp.so\n");
+		return -1;
+	}
 
-	avl_for_each_element(&libraries, l, avl) {
-		char path[256];
-		char *p = l->path;
+	avl_for_each_element(&libraries, l, avl)
+		if (mount_bind(opts.path, l->path, l->name, 1, -1))
+			return -1;
 
-		if (strstr(p, "local"))
-			p = "/lib";
+	list_for_each_entry(m, &extras, list)
+		if (mount_bind(opts.path, m->path, m->name, m->readonly, 0))
+			return -1;
 
-		snprintf(path, sizeof(path), "%s%s/%s", root, p, l->name);
-		DEBUG("umount %s\n", path);
-		umount(path);
+	char *mpoint;
+	if (asprintf(&mpoint, "%s/old", opts.path) < 0) {
+		ERROR("failed to alloc pivot path: %s\n", strerror(errno));
+		return -1;
 	}
-
-	list_for_each_entry(m, &extras, list) {
-		char path[256];
-
-		snprintf(path, sizeof(path), "%s%s/%s", root, m->path, m->name);
-		DEBUG("umount %s\n", path);
-		umount(path);
+	mkdir_p(mpoint, 0755);
+	if (pivot_root(opts.path, mpoint) == -1) {
+		ERROR("pivot_root failed:%s\n", strerror(errno));
+		free(mpoint);
+		return -1;
 	}
-
-	_umount(root, "/proc");
-	_umount(root, "/sys");
-
-	DEBUG("umount %s\n", root);
-	umount(root);
-	rmdir(root);
+	free(mpoint);
+	umount2("/old", MNT_DETACH);
+	rmdir("/old");
+	if (opts.procfs) {
+		mkdir("/proc", 0755);
+		mount("proc", "/proc", "proc", MS_NOATIME, 0);
+	}
+	if (opts.sysfs) {
+		mkdir("/sys", 0755);
+		mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
+	}
+	if (opts.ronly)
+		mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
 
 	return 0;
 }
 
 #define MAX_ENVP	8
-static char** build_envp(const char *seccomp, int debug)
+static char** build_envp(const char *seccomp)
 {
 	static char *envp[MAX_ENVP];
 	static char preload_var[64];
@@ -227,177 +232,77 @@ static char** build_envp(const char *seccomp, int debug)
 		snprintf(preload_var, sizeof(preload_var), "LD_PRELOAD=%s", preload_lib);
 		envp[count++] = preload_var;
 	}
-	if (debug)
+	if (debug > 1)
 		envp[count++] = debug_var;
 
 	return envp;
 }
 
-static int spawn(const char *path, char **argv, const char *seccomp)
-{
-	pid_t pid = fork();
-
-	if (pid < 0) {
-		ERROR("failed to spawn %s: %s\n", *argv, strerror(errno));
-		return -1;
-	} else if (!pid) {
-		char **envp = build_envp(seccomp, 0);
-
-		INFO("spawning %s\n", *argv);
-		execve(*argv, argv, envp);
-		ERROR("failed to spawn child %s: %s\n", *argv, strerror(errno));
-		exit(-1);
-	}
-
-	return pid;
-}
-
-static int usage(void)
+static void usage(void)
 {
-	fprintf(stderr, "jail <options> -D <binary> <params ...>\n");
+	fprintf(stderr, "ujail <options> -- <binary> <params ...>\n");
 	fprintf(stderr, "  -P <path>\tpath where the jail will be staged\n");
 	fprintf(stderr, "  -S <file>\tseccomp filter\n");
 	fprintf(stderr, "  -n <name>\tthe name of the jail\n");
 	fprintf(stderr, "  -r <file>\treadonly files that should be staged\n");
 	fprintf(stderr, "  -w <file>\twriteable files that should be staged\n");
-	fprintf(stderr, "  -p\t\tjail has /proc\t\n");
-	fprintf(stderr, "  -s\t\tjail has /sys\t\n");
-	fprintf(stderr, "  -l\t\tjail has /dev/log\t\n");
-	fprintf(stderr, "  -u\t\tjail has a ubus socket\t\n");
-
-	return -1;
-}
-
-static int child_running = 1;
-
-static void child_process_handler(struct uloop_process *c, int ret)
-{
-	INFO("child (%d) exited: %d\n", c->pid, ret);
-	uloop_end();
-	child_running = 0;
+	fprintf(stderr, "  -d <num>\tshow debug log (increase num to increase verbosity)\n");
+	fprintf(stderr, "  -p\t\tjail has /proc\n");
+	fprintf(stderr, "  -s\t\tjail has /sys\n");
+	fprintf(stderr, "  -l\t\tjail has /dev/log\n");
+	fprintf(stderr, "  -u\t\tjail has a ubus socket\n");
+	fprintf(stderr, "  -o\t\tremont jail root (/) read only\n");
+	fprintf(stderr, "\nWarning: by default root inside the jail is the same\n\
+and he has the same powers as root outside the jail,\n\
+thus he can escape the jail and/or break stuff.\n\
+Please use an appropriate seccomp filter (-S) to restrict his powers\n");
 }
 
-struct uloop_process child_process = {
-	.cb = child_process_handler,
-};
-
-static int spawn_child(void *arg)
+static int spawn_jail(void *arg)
 {
-	char *path = get_current_dir_name();
-	int procfs = 0, sysfs = 0;
-	char *seccomp = NULL;
-	char **argv = arg;
-	int argc = 0, ch;
-	char *mpoint;
-	int ronly = 0;
-
-	while (argv[argc])
-		argc++;
-
-	optind = 0;
-	while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
-		switch (ch) {
-		case 'd':
-			debug = 1;
-			break;
-		case 'S':
-			seccomp = optarg;
-			break;
-		case 'p':
-			procfs = 1;
-			break;
-		case 'o':
-			ronly = 1;
-			break;
-		case 's':
-			sysfs = 1;
-			break;
-		case 'n':
-			if (sethostname(optarg, strlen(optarg)))
-				ERROR("failed to sethostname: %s\n", strerror(errno));
-			break;
-		}
+	if (opts.name && sethostname(opts.name, strlen(opts.name))) {
+		ERROR("failed to sethostname: %s\n", strerror(errno));
 	}
 
-	if (asprintf(&mpoint, "%s/old", path) < 0) {
-		ERROR("failed to alloc pivot path: %s\n", strerror(errno));
-		return -1;
-	}
-	mkdir_p(mpoint, 0755);
-	if (pivot_root(path, mpoint) == -1) {
-		ERROR("pivot_root failed:%s\n", strerror(errno));
-		return -1;
-	}
-	free(mpoint);
-	umount2("/old", MNT_DETACH);
-	rmdir("/old");
-	if (procfs) {
-		mkdir("/proc", 0755);
-		mount("proc", "/proc", "proc", MS_NOATIME, 0);
+	if (build_jail_fs()) {
+		ERROR("failed to build jail fs");
+		exit(EXIT_FAILURE);
 	}
-	if (sysfs) {
-		mkdir("/sys", 0755);
-		mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
-	}
-	if (ronly)
-		mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
 
-	uloop_init();
+	char **envp = build_envp(opts.seccomp);
+	if (!envp)
+		exit(EXIT_FAILURE);
 
-	child_process.pid = spawn(path, &argv[optind], seccomp);
-	uloop_process_add(&child_process);
-	uloop_run();
-	uloop_done();
-	if (child_running) {
-		kill(child_process.pid, SIGTERM);
-		waitpid(child_process.pid, NULL, 0);
-	}
+	//TODO: drop capabilities() here
+	//prctl(PR_CAPBSET_DROP, ..., 0, 0, 0);
 
-	return 0;
+	INFO("exec-ing %s\n", *opts.jail_argv);
+	execve(*opts.jail_argv, opts.jail_argv, envp);
+	//we get there only if execve fails
+	ERROR("failed to execve %s: %s\n", *opts.jail_argv, strerror(errno));
+	exit(EXIT_FAILURE);
 }
 
-static int namespace_running = 1;
+static int jail_running = 1;
+static int jail_return_code = 0;
 
-static void namespace_process_handler(struct uloop_process *c, int ret)
+static void jail_process_handler(struct uloop_process *c, int ret)
 {
-	INFO("namespace (%d) exited: %d\n", c->pid, ret);
+	if (WIFEXITED(ret)) {
+		jail_return_code = WEXITSTATUS(ret);
+		INFO("jail (%d) exited with exit: %d\n", c->pid, jail_return_code);
+	} else {
+		jail_return_code = WTERMSIG(ret);
+		INFO("jail (%d) exited with signal: %d\n", c->pid, jail_return_code);
+	}
+	jail_running = 0;
 	uloop_end();
-	namespace_running = 0;
 }
 
-struct uloop_process namespace_process = {
-	.cb = namespace_process_handler,
+static struct uloop_process jail_process = {
+	.cb = jail_process_handler,
 };
 
-static void spawn_namespace(const char *path, int argc, char **argv)
-{
-	char *dir = get_current_dir_name();
-
-	uloop_init();
-	if (chdir(path)) {
-		ERROR("failed to chdir() into the jail\n");
-		return;
-	}
-	namespace_process.pid = clone(spawn_child,
-			child_stack + STACK_SIZE,
-			CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | SIGCHLD, argv);
-
-	if (namespace_process.pid != -1) {
-		if (chdir(dir))
-			ERROR("failed to chdir() out of the jail\n");
-		free(dir);
-		uloop_process_add(&namespace_process);
-		uloop_run();
-		uloop_done();
-		if (namespace_running) {
-			kill(namespace_process.pid, SIGTERM);
-			waitpid(namespace_process.pid, NULL, 0);
-		}
-	} else {
-		ERROR("failed to spawn namespace: %s\n", strerror(errno));
-	}
-}
-
 static void add_extra(char *name, int readonly)
 {
 	struct extra *f;
@@ -419,16 +324,14 @@ static void add_extra(char *name, int readonly)
 int main(int argc, char **argv)
 {
 	uid_t uid = getuid();
-	const char *name = NULL;
-	char *path = NULL;
-	struct stat s;
-	int ch, ret;
 	char log[] = "/dev/log";
 	char ubus[] = "/var/run/ubus.sock";
+	int ret = EXIT_SUCCESS;
+	int ch;
 
 	if (uid) {
 		ERROR("not root, aborting: %s\n", strerror(errno));
-		return -1;
+		return EXIT_FAILURE;
 	}
 
 	umask(022);
@@ -436,15 +339,26 @@ int main(int argc, char **argv)
 	while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
 		switch (ch) {
 		case 'd':
-			debug = 1;
+			debug = atoi(optarg);
+			break;
+		case 'p':
+			opts.procfs = 1;
+			break;
+		case 'o':
+			opts.ronly = 1;
+			break;
+		case 's':
+			opts.sysfs = 1;
+			break;
+		case 'S':
+			opts.seccomp = optarg;
 			break;
 		case 'P':
-			path = optarg;
+			opts.path = optarg;
 			break;
 		case 'n':
-			name = optarg;
+			opts.name = optarg;
 			break;
-		case 'S':
 		case 'r':
 			add_extra(optarg, 1);
 			break;
@@ -460,46 +374,52 @@ int main(int argc, char **argv)
 		}
 	}
 
-	if (argc - optind < 1)
-		return usage();
+	//no <binary> param found
+	if (argc - optind < 1) {
+		usage();
+		return EXIT_FAILURE;
+	}
 
-	if (!path && asprintf(&path, "/tmp/%s", basename(argv[optind])) == -1) {
-		ERROR("failed to set root path\n: %s", strerror(errno));
-		return -1;
+	opts.jail_argv = &argv[optind];
+
+	if (!opts.path && asprintf(&opts.path, "/tmp/%s", basename(*opts.jail_argv)) == -1) {
+		ERROR("failed to asprintf root path: %s\n", strerror(errno));
+		return EXIT_FAILURE;
 	}
 
-	if (!stat(path, &s)) {
-		ERROR("%s already exists: %s\n", path, strerror(errno));
-		return -1;
+	if (mkdir(opts.path, 0755)) {
+		ERROR("unable to create root path: %s (%s)\n", opts.path, strerror(errno));
+		return EXIT_FAILURE;
 	}
 
-	if (name)
-		prctl(PR_SET_NAME, name, NULL, NULL, NULL);
+	if (opts.name)
+		prctl(PR_SET_NAME, opts.name, NULL, NULL, NULL);
 
-	avl_init(&libraries, avl_strcmp, false, NULL);
-	alloc_library_path("/lib64");
-	alloc_library_path("/lib");
-	alloc_library_path("/usr/lib");
-	load_ldso_conf("/etc/ld.so.conf");
+	uloop_init();
+	jail_process.pid = clone(spawn_jail,
+			child_stack + STACK_SIZE,
+			CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | SIGCHLD, argv);
 
-	if (elf_load_deps(argv[optind])) {
-		ERROR("failed to load dependencies\n");
-		return -1;
+	if (jail_process.pid != -1) {
+		uloop_process_add(&jail_process);
+		uloop_run();
+		uloop_done();
+		if (jail_running) {
+			kill(jail_process.pid, SIGTERM);
+			waitpid(jail_process.pid, NULL, 0);
+		}
+	} else {
+		ERROR("failed to spawn namespace: %s\n", strerror(errno));
+		ret = EXIT_FAILURE;
 	}
 
-	if (elf_load_deps("libpreload-seccomp.so")) {
-		ERROR("failed to load libpreload-seccomp.so\n");
-		return -1;
+	if (rmdir(opts.path)) {
+		ERROR("Unable to remove root path: %s (%s)\n", opts.path, strerror(errno));
+		ret = EXIT_FAILURE;
 	}
 
-	ret = build_jail(path);
-
-	if (!ret)
-		spawn_namespace(path, argc, argv);
-	else
-		ERROR("failed to build jail\n");
-
-	stop_jail(path);
+	if (ret)
+		return ret;
 
-	return ret;
+	return jail_return_code;
 }
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Thu Aug 20 18:44:02 2015
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Fri, 21 Aug 2015 00:44:02 +0200
Subject: [OpenWrt-Devel] [PATCH 2/2] [procd,
	RFC] ujail: reworks & cleanups
In-Reply-To: <1440110391-8054-2-git-send-email-champetier.etienne@gmail.com>
References: <1440110391-8054-1-git-send-email-champetier.etienne@gmail.com>
 <1440110391-8054-2-git-send-email-champetier.etienne@gmail.com>
Message-ID: <CAOdf3gqSokhq8J4kEbWXecAxd4To5Xpadfa1fS1ehrk37oCONg@mail.gmail.com>

2015-08-21 0:39 GMT+02:00 Etienne CHAMPETIER <champetier.etienne at gmail.com>:

> This is an RFC patch for ujail
>
> -use EXIT_SUCCESS/EXIT_FAILURE (not -1)
> -parse every options in main, put them in opts struct
> -add CLONE_NEWIPC to the clone() call (it's already compiled in openwrt
> kernel)
> -return the exit status of the jailed process, or the num of the signal
> that killed it
> -add missing options to usage()
> -add a warning in usage() about ujail security
> -debug option can now take an int as parameter (~debug level),
>   with -d2 you now activate "LD_DEBUG=all" for exemple
> -do not depend on libpreload-seccomp.so if -S is not present
> -there is now only one ujail process instead of two
>
> jail creation is now as follow:
> 1) create jail root dir (mkdir)
> 2) create new namespace (clone)
> (in the parent wait for the child with uloop)
> 3) build the jail root fs (mount bind all the libs/bins ...),
> pivot_root and mount special fs (procfs, sysfs) (build_jail_fs())
> 4) build envp (LD_PRELOAD the seccomp helper or ...)
> 5) coming soon: drop capabilities()
> 6) execve the jailed bin
> 7) remove jail root dir (once child is dead)
>
> there is no need to umount anything because we are already in the namespace
>
> Todo:
> -add capabilities() support
> -allow signals from the parent to the child
>
> Feature request:
> -when we add a file or dir, detect if it's an exec and add it's
> dependencies
>

forgot to say: run tested on openwrt CC ar71xx


>
> Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
> ---
>  jail/jail.c | 390
> ++++++++++++++++++++++++------------------------------------
>  1 file changed, 155 insertions(+), 235 deletions(-)
>
> diff --git a/jail/jail.c b/jail/jail.c
> index 2bba292..dd46c86 100644
> --- a/jail/jail.c
> +++ b/jail/jail.c
> @@ -43,7 +43,17 @@
>  #include <libubox/uloop.h>
>
>  #define STACK_SIZE     (1024 * 1024)
> -#define OPT_ARGS       "P:S:n:r:w:psuldo"
> +#define OPT_ARGS       "P:S:n:r:w:d:psulo"
> +
> +static struct {
> +       char *path;
> +       char *name;
> +       char **jail_argv;
> +       char *seccomp;
> +       int procfs;
> +       int ronly;
> +       int sysfs;
> +} opts;
>
>  struct extra {
>         struct list_head list;
> @@ -125,7 +135,7 @@ static int mount_bind(const char *root, const char
> *path, const char *name, int
>                 return -1;
>         }
>
> -       if (readonly && mount(old, new, NULL, MS_BIND | MS_REMOUNT |
> MS_RDONLY, NULL)) {
> +       if (readonly && mount(NULL, new, NULL, MS_BIND | MS_REMOUNT |
> MS_RDONLY, NULL)) {
>                 ERROR("failed to remount ro %s: %s\n", new,
> strerror(errno));
>                 return -1;
>         }
> @@ -135,80 +145,75 @@ static int mount_bind(const char *root, const char
> *path, const char *name, int
>         return 0;
>  }
>
> -static int build_jail(const char *path)
> +static int build_jail_fs()
>  {
>         struct library *l;
>         struct extra *m;
> -       int ret = 0;
>
> -       mkdir(path, 0755);
> -
> -       if (mount("tmpfs", path, "tmpfs", MS_NOATIME, "mode=0755")) {
> +       if (mount("tmpfs", opts.path, "tmpfs", MS_NOATIME, "mode=0755")) {
>                 ERROR("tmpfs mount failed %s\n", strerror(errno));
>                 return -1;
>         }
>
> -       avl_for_each_element(&libraries, l, avl)
> -               if (mount_bind(path, l->path, l->name, 1, -1))
> -                       return -1;
> -
> -       list_for_each_entry(m, &extras, list)
> -               if (mount_bind(path, m->path, m->name, m->readonly, 0))
> -                       return -1;
> -
> -       return ret;
> -}
> +       if (chdir(opts.path)) {
> +               ERROR("failed to chdir() in the jail root\n");
> +               return -1;
> +       }
>
> -static void _umount(const char *root, const char *path)
> -{
> -       char *buf = NULL;
> +       avl_init(&libraries, avl_strcmp, false, NULL);
> +       alloc_library_path("/lib64");
> +       alloc_library_path("/lib");
> +       alloc_library_path("/usr/lib");
> +       load_ldso_conf("/etc/ld.so.conf");
>
> -       if (asprintf(&buf, "%s%s", root, path) < 0) {
> -               ERROR("failed to alloc umount buffer: %s\n",
> strerror(errno));
> -       } else {
> -               DEBUG("umount %s\n", buf);
> -               umount(buf);
> -               free(buf);
> +       if (elf_load_deps(*opts.jail_argv)) {
> +               ERROR("failed to load dependencies\n");
> +               return -1;
>         }
> -}
>
> -static int stop_jail(const char *root)
> -{
> -       struct library *l;
> -       struct extra *m;
> +       if (opts.seccomp && elf_load_deps("libpreload-seccomp.so")) {
> +               ERROR("failed to load libpreload-seccomp.so\n");
> +               return -1;
> +       }
>
> -       avl_for_each_element(&libraries, l, avl) {
> -               char path[256];
> -               char *p = l->path;
> +       avl_for_each_element(&libraries, l, avl)
> +               if (mount_bind(opts.path, l->path, l->name, 1, -1))
> +                       return -1;
>
> -               if (strstr(p, "local"))
> -                       p = "/lib";
> +       list_for_each_entry(m, &extras, list)
> +               if (mount_bind(opts.path, m->path, m->name, m->readonly,
> 0))
> +                       return -1;
>
> -               snprintf(path, sizeof(path), "%s%s/%s", root, p, l->name);
> -               DEBUG("umount %s\n", path);
> -               umount(path);
> +       char *mpoint;
> +       if (asprintf(&mpoint, "%s/old", opts.path) < 0) {
> +               ERROR("failed to alloc pivot path: %s\n", strerror(errno));
> +               return -1;
>         }
> -
> -       list_for_each_entry(m, &extras, list) {
> -               char path[256];
> -
> -               snprintf(path, sizeof(path), "%s%s/%s", root, m->path,
> m->name);
> -               DEBUG("umount %s\n", path);
> -               umount(path);
> +       mkdir_p(mpoint, 0755);
> +       if (pivot_root(opts.path, mpoint) == -1) {
> +               ERROR("pivot_root failed:%s\n", strerror(errno));
> +               free(mpoint);
> +               return -1;
>         }
> -
> -       _umount(root, "/proc");
> -       _umount(root, "/sys");
> -
> -       DEBUG("umount %s\n", root);
> -       umount(root);
> -       rmdir(root);
> +       free(mpoint);
> +       umount2("/old", MNT_DETACH);
> +       rmdir("/old");
> +       if (opts.procfs) {
> +               mkdir("/proc", 0755);
> +               mount("proc", "/proc", "proc", MS_NOATIME, 0);
> +       }
> +       if (opts.sysfs) {
> +               mkdir("/sys", 0755);
> +               mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
> +       }
> +       if (opts.ronly)
> +               mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
>
>         return 0;
>  }
>
>  #define MAX_ENVP       8
> -static char** build_envp(const char *seccomp, int debug)
> +static char** build_envp(const char *seccomp)
>  {
>         static char *envp[MAX_ENVP];
>         static char preload_var[64];
> @@ -227,177 +232,77 @@ static char** build_envp(const char *seccomp, int
> debug)
>                 snprintf(preload_var, sizeof(preload_var),
> "LD_PRELOAD=%s", preload_lib);
>                 envp[count++] = preload_var;
>         }
> -       if (debug)
> +       if (debug > 1)
>                 envp[count++] = debug_var;
>
>         return envp;
>  }
>
> -static int spawn(const char *path, char **argv, const char *seccomp)
> -{
> -       pid_t pid = fork();
> -
> -       if (pid < 0) {
> -               ERROR("failed to spawn %s: %s\n", *argv, strerror(errno));
> -               return -1;
> -       } else if (!pid) {
> -               char **envp = build_envp(seccomp, 0);
> -
> -               INFO("spawning %s\n", *argv);
> -               execve(*argv, argv, envp);
> -               ERROR("failed to spawn child %s: %s\n", *argv,
> strerror(errno));
> -               exit(-1);
> -       }
> -
> -       return pid;
> -}
> -
> -static int usage(void)
> +static void usage(void)
>  {
> -       fprintf(stderr, "jail <options> -D <binary> <params ...>\n");
> +       fprintf(stderr, "ujail <options> -- <binary> <params ...>\n");
>         fprintf(stderr, "  -P <path>\tpath where the jail will be
> staged\n");
>         fprintf(stderr, "  -S <file>\tseccomp filter\n");
>         fprintf(stderr, "  -n <name>\tthe name of the jail\n");
>         fprintf(stderr, "  -r <file>\treadonly files that should be
> staged\n");
>         fprintf(stderr, "  -w <file>\twriteable files that should be
> staged\n");
> -       fprintf(stderr, "  -p\t\tjail has /proc\t\n");
> -       fprintf(stderr, "  -s\t\tjail has /sys\t\n");
> -       fprintf(stderr, "  -l\t\tjail has /dev/log\t\n");
> -       fprintf(stderr, "  -u\t\tjail has a ubus socket\t\n");
> -
> -       return -1;
> -}
> -
> -static int child_running = 1;
> -
> -static void child_process_handler(struct uloop_process *c, int ret)
> -{
> -       INFO("child (%d) exited: %d\n", c->pid, ret);
> -       uloop_end();
> -       child_running = 0;
> +       fprintf(stderr, "  -d <num>\tshow debug log (increase num to
> increase verbosity)\n");
> +       fprintf(stderr, "  -p\t\tjail has /proc\n");
> +       fprintf(stderr, "  -s\t\tjail has /sys\n");
> +       fprintf(stderr, "  -l\t\tjail has /dev/log\n");
> +       fprintf(stderr, "  -u\t\tjail has a ubus socket\n");
> +       fprintf(stderr, "  -o\t\tremont jail root (/) read only\n");
> +       fprintf(stderr, "\nWarning: by default root inside the jail is the
> same\n\
> +and he has the same powers as root outside the jail,\n\
> +thus he can escape the jail and/or break stuff.\n\
> +Please use an appropriate seccomp filter (-S) to restrict his powers\n");
>  }
>
> -struct uloop_process child_process = {
> -       .cb = child_process_handler,
> -};
> -
> -static int spawn_child(void *arg)
> +static int spawn_jail(void *arg)
>  {
> -       char *path = get_current_dir_name();
> -       int procfs = 0, sysfs = 0;
> -       char *seccomp = NULL;
> -       char **argv = arg;
> -       int argc = 0, ch;
> -       char *mpoint;
> -       int ronly = 0;
> -
> -       while (argv[argc])
> -               argc++;
> -
> -       optind = 0;
> -       while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
> -               switch (ch) {
> -               case 'd':
> -                       debug = 1;
> -                       break;
> -               case 'S':
> -                       seccomp = optarg;
> -                       break;
> -               case 'p':
> -                       procfs = 1;
> -                       break;
> -               case 'o':
> -                       ronly = 1;
> -                       break;
> -               case 's':
> -                       sysfs = 1;
> -                       break;
> -               case 'n':
> -                       if (sethostname(optarg, strlen(optarg)))
> -                               ERROR("failed to sethostname: %s\n",
> strerror(errno));
> -                       break;
> -               }
> +       if (opts.name && sethostname(opts.name, strlen(opts.name))) {
> +               ERROR("failed to sethostname: %s\n", strerror(errno));
>         }
>
> -       if (asprintf(&mpoint, "%s/old", path) < 0) {
> -               ERROR("failed to alloc pivot path: %s\n", strerror(errno));
> -               return -1;
> -       }
> -       mkdir_p(mpoint, 0755);
> -       if (pivot_root(path, mpoint) == -1) {
> -               ERROR("pivot_root failed:%s\n", strerror(errno));
> -               return -1;
> -       }
> -       free(mpoint);
> -       umount2("/old", MNT_DETACH);
> -       rmdir("/old");
> -       if (procfs) {
> -               mkdir("/proc", 0755);
> -               mount("proc", "/proc", "proc", MS_NOATIME, 0);
> +       if (build_jail_fs()) {
> +               ERROR("failed to build jail fs");
> +               exit(EXIT_FAILURE);
>         }
> -       if (sysfs) {
> -               mkdir("/sys", 0755);
> -               mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
> -       }
> -       if (ronly)
> -               mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
>
> -       uloop_init();
> +       char **envp = build_envp(opts.seccomp);
> +       if (!envp)
> +               exit(EXIT_FAILURE);
>
> -       child_process.pid = spawn(path, &argv[optind], seccomp);
> -       uloop_process_add(&child_process);
> -       uloop_run();
> -       uloop_done();
> -       if (child_running) {
> -               kill(child_process.pid, SIGTERM);
> -               waitpid(child_process.pid, NULL, 0);
> -       }
> +       //TODO: drop capabilities() here
> +       //prctl(PR_CAPBSET_DROP, ..., 0, 0, 0);
>
> -       return 0;
> +       INFO("exec-ing %s\n", *opts.jail_argv);
> +       execve(*opts.jail_argv, opts.jail_argv, envp);
> +       //we get there only if execve fails
> +       ERROR("failed to execve %s: %s\n", *opts.jail_argv,
> strerror(errno));
> +       exit(EXIT_FAILURE);
>  }
>
> -static int namespace_running = 1;
> +static int jail_running = 1;
> +static int jail_return_code = 0;
>
> -static void namespace_process_handler(struct uloop_process *c, int ret)
> +static void jail_process_handler(struct uloop_process *c, int ret)
>  {
> -       INFO("namespace (%d) exited: %d\n", c->pid, ret);
> +       if (WIFEXITED(ret)) {
> +               jail_return_code = WEXITSTATUS(ret);
> +               INFO("jail (%d) exited with exit: %d\n", c->pid,
> jail_return_code);
> +       } else {
> +               jail_return_code = WTERMSIG(ret);
> +               INFO("jail (%d) exited with signal: %d\n", c->pid,
> jail_return_code);
> +       }
> +       jail_running = 0;
>         uloop_end();
> -       namespace_running = 0;
>  }
>
> -struct uloop_process namespace_process = {
> -       .cb = namespace_process_handler,
> +static struct uloop_process jail_process = {
> +       .cb = jail_process_handler,
>  };
>
> -static void spawn_namespace(const char *path, int argc, char **argv)
> -{
> -       char *dir = get_current_dir_name();
> -
> -       uloop_init();
> -       if (chdir(path)) {
> -               ERROR("failed to chdir() into the jail\n");
> -               return;
> -       }
> -       namespace_process.pid = clone(spawn_child,
> -                       child_stack + STACK_SIZE,
> -                       CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS |
> SIGCHLD, argv);
> -
> -       if (namespace_process.pid != -1) {
> -               if (chdir(dir))
> -                       ERROR("failed to chdir() out of the jail\n");
> -               free(dir);
> -               uloop_process_add(&namespace_process);
> -               uloop_run();
> -               uloop_done();
> -               if (namespace_running) {
> -                       kill(namespace_process.pid, SIGTERM);
> -                       waitpid(namespace_process.pid, NULL, 0);
> -               }
> -       } else {
> -               ERROR("failed to spawn namespace: %s\n", strerror(errno));
> -       }
> -}
> -
>  static void add_extra(char *name, int readonly)
>  {
>         struct extra *f;
> @@ -419,16 +324,14 @@ static void add_extra(char *name, int readonly)
>  int main(int argc, char **argv)
>  {
>         uid_t uid = getuid();
> -       const char *name = NULL;
> -       char *path = NULL;
> -       struct stat s;
> -       int ch, ret;
>         char log[] = "/dev/log";
>         char ubus[] = "/var/run/ubus.sock";
> +       int ret = EXIT_SUCCESS;
> +       int ch;
>
>         if (uid) {
>                 ERROR("not root, aborting: %s\n", strerror(errno));
> -               return -1;
> +               return EXIT_FAILURE;
>         }
>
>         umask(022);
> @@ -436,15 +339,26 @@ int main(int argc, char **argv)
>         while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
>                 switch (ch) {
>                 case 'd':
> -                       debug = 1;
> +                       debug = atoi(optarg);
> +                       break;
> +               case 'p':
> +                       opts.procfs = 1;
> +                       break;
> +               case 'o':
> +                       opts.ronly = 1;
> +                       break;
> +               case 's':
> +                       opts.sysfs = 1;
> +                       break;
> +               case 'S':
> +                       opts.seccomp = optarg;
>                         break;
>                 case 'P':
> -                       path = optarg;
> +                       opts.path = optarg;
>                         break;
>                 case 'n':
> -                       name = optarg;
> +                       opts.name = optarg;
>                         break;
> -               case 'S':
>                 case 'r':
>                         add_extra(optarg, 1);
>                         break;
> @@ -460,46 +374,52 @@ int main(int argc, char **argv)
>                 }
>         }
>
> -       if (argc - optind < 1)
> -               return usage();
> +       //no <binary> param found
> +       if (argc - optind < 1) {
> +               usage();
> +               return EXIT_FAILURE;
> +       }
>
> -       if (!path && asprintf(&path, "/tmp/%s", basename(argv[optind])) ==
> -1) {
> -               ERROR("failed to set root path\n: %s", strerror(errno));
> -               return -1;
> +       opts.jail_argv = &argv[optind];
> +
> +       if (!opts.path && asprintf(&opts.path, "/tmp/%s",
> basename(*opts.jail_argv)) == -1) {
> +               ERROR("failed to asprintf root path: %s\n",
> strerror(errno));
> +               return EXIT_FAILURE;
>         }
>
> -       if (!stat(path, &s)) {
> -               ERROR("%s already exists: %s\n", path, strerror(errno));
> -               return -1;
> +       if (mkdir(opts.path, 0755)) {
> +               ERROR("unable to create root path: %s (%s)\n", opts.path,
> strerror(errno));
> +               return EXIT_FAILURE;
>         }
>
> -       if (name)
> -               prctl(PR_SET_NAME, name, NULL, NULL, NULL);
> +       if (opts.name)
> +               prctl(PR_SET_NAME, opts.name, NULL, NULL, NULL);
>
> -       avl_init(&libraries, avl_strcmp, false, NULL);
> -       alloc_library_path("/lib64");
> -       alloc_library_path("/lib");
> -       alloc_library_path("/usr/lib");
> -       load_ldso_conf("/etc/ld.so.conf");
> +       uloop_init();
> +       jail_process.pid = clone(spawn_jail,
> +                       child_stack + STACK_SIZE,
> +                       CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS |
> CLONE_NEWIPC | SIGCHLD, argv);
>
> -       if (elf_load_deps(argv[optind])) {
> -               ERROR("failed to load dependencies\n");
> -               return -1;
> +       if (jail_process.pid != -1) {
> +               uloop_process_add(&jail_process);
> +               uloop_run();
> +               uloop_done();
> +               if (jail_running) {
> +                       kill(jail_process.pid, SIGTERM);
> +                       waitpid(jail_process.pid, NULL, 0);
> +               }
> +       } else {
> +               ERROR("failed to spawn namespace: %s\n", strerror(errno));
> +               ret = EXIT_FAILURE;
>         }
>
> -       if (elf_load_deps("libpreload-seccomp.so")) {
> -               ERROR("failed to load libpreload-seccomp.so\n");
> -               return -1;
> +       if (rmdir(opts.path)) {
> +               ERROR("Unable to remove root path: %s (%s)\n", opts.path,
> strerror(errno));
> +               ret = EXIT_FAILURE;
>         }
>
> -       ret = build_jail(path);
> -
> -       if (!ret)
> -               spawn_namespace(path, argc, argv);
> -       else
> -               ERROR("failed to build jail\n");
> -
> -       stop_jail(path);
> +       if (ret)
> +               return ret;
>
> -       return ret;
> +       return jail_return_code;
>  }
> --
> 1.9.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150821/123aabea/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From champetier.etienne at gmail.com  Thu Aug 20 18:46:22 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Thu, 20 Aug 2015 22:46:22 +0000
Subject: [OpenWrt-Devel] [PATCH] procd: rework makefile, split ujail/seccomp
Message-ID: <1440110782-8104-1-git-send-email-champetier.etienne@gmail.com>

this need to be applied after my work on ujail (procd git)
ujail doesn't depend on seccomp and some archs dont support seccomp

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 package/system/procd/Makefile | 50 +++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index 2c7ea3b..727a231 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -24,7 +24,8 @@ PKG_LICENSE_FILES:=
 
 PKG_MAINTAINER:=John Crispin <blogic at openwrt.org>
 
-PKG_CONFIG_DEPENDS:= CONFIG_KERNEL_SECCOMP CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS CONFIG_PROCD_JAIL_SUPPORT
+PKG_CONFIG_DEPENDS:= CONFIG_KERNEL_SECCOMP CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \
+	CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
@@ -38,12 +39,18 @@ define Package/procd
   TITLE:=OpenWrt system process manager
 endef
 
-define Package/procd-jail
+define Package/procd-ujail
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=procd + at KERNEL_NAMESPACES + at KERNEL_UTS_NS + at KERNEL_IPC_NS + at KERNEL_PID_NS @PROCD_JAIL_SUPPORT
-  TITLE:=OpenWrt process jail
-  DEFAULT:=n
+  DEPENDS:=@KERNEL_NAMESPACES + at KERNEL_UTS_NS + at KERNEL_IPC_NS + at KERNEL_PID_NS +libubox
+  TITLE:=OpenWrt process jail helper
+endef
+
+define Package/procd-seccomp
+  SECTION:=base
+  CATEGORY:=Base system
+  DEPENDS:=@arm||@armeb||@mips||@mipsel||@i386||@x86_64 @!TARGET_uml @KERNEL_SECCOMP +libubox +libblobmsg-json
+  TITLE:=OpenWrt process seccomp helper + utrace
 endef
 
 define Package/procd-nand
@@ -73,16 +80,6 @@ config PROCD_ZRAM_TMPFS
 	bool
 	default n
 	prompt "Mount /tmp using zram."
-
-config PROCD_JAIL_SUPPORT
-	bool
-	default y
-	depends on (arm || armeb || mips || mipsel || i386 || x86_64) && PROCD_SECCOMP_SUPPORT
-
-config PROCD_SECCOMP_SUPPORT
-	bool
-	default y
-	depends on (arm || armeb || mips || mipsel || i386 || x86_64) && !TARGET_uml && @KERNEL_SECCOMP
 endmenu
 endef
 
@@ -99,12 +96,12 @@ ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
   CMAKE_OPTIONS += -DZRAM_TMPFS=1
 endif
 
-ifeq ($(CONFIG_PROCD_JAIL_SUPPORT),y)
+ifdef CONFIG_PACKAGE_procd-ujail
   CMAKE_OPTIONS += -DJAIL_SUPPORT=1
 endif
 
-ifeq ($(CONFIG_PROCD_SECCOMP_SUPPORT),y)
-  CMAKE_OPTIONS += -DSECCOMP_SUPPORT=1
+ifdef CONFIG_PACKAGE_procd-seccomp
+  CMAKE_OPTIONS += -DSECCOMP_SUPPORT=1 -DUTRACE_SUPPORT=1
 endif
 
 define Package/procd/install
@@ -115,15 +112,17 @@ define Package/procd/install
 	$(INSTALL_BIN) ./files/reload_config $(1)/sbin/
 	$(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
 	$(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
-ifeq ($(CONFIG_PROCD_SECCOMP_SUPPORT),y)
-	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
-endif
 endef
 
-define Package/procd-jail/install
-	$(INSTALL_DIR) $(1)/sbin $(1)/lib
+define Package/procd-ujail/install
+	$(INSTALL_DIR) $(1)/sbin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ujail $(1)/sbin/
+endef
 
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{utrace,ujail} $(1)/sbin/
+define Package/procd-seccomp/install
+	$(INSTALL_DIR) $(1)/sbin $(1)/lib
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
 	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
 endef
 
@@ -141,6 +140,7 @@ define Package/procd-nand-firstboot/install
 endef
 
 $(eval $(call BuildPackage,procd))
-$(eval $(call BuildPackage,procd-jail))
+$(eval $(call BuildPackage,procd-ujail))
+$(eval $(call BuildPackage,procd-seccomp))
 $(eval $(call BuildPackage,procd-nand))
 $(eval $(call BuildPackage,procd-nand-firstboot))
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mreeve at tenxnetworks.com  Thu Aug 20 21:19:02 2015
From: mreeve at tenxnetworks.com (Matthew Reeve)
Date: Thu, 20 Aug 2015 19:19:02 -0600
Subject: [OpenWrt-Devel] [PATCH] ar71xx: Add UBNT airGateway Pro support
Message-ID: <55D67C86.8070108@tenxnetworks.com>

This patch adds kernel and userspace support for the Ubiquiti Networks airGateway Pro.

Signed-off-by: Matthew Reeve <mreeve at tenxnetworks.com>

--- /dev/null	2015-08-07 21:02:55.557188068 -0600
+++ target/linux/ar71xx/patches-4.1/610-MIPS-ath79-UBNT-add-airGateway-pro-support.patch	2015-08-20 17:20:09.149209987 -0600
@@ -0,0 +1,62 @@
+--- a/arch/mips/ath79/mach-ubnt-xm.c	2015-08-19 21:26:47.694157530 -0600
++++ b/arch/mips/ath79/mach-ubnt-xm.c	2015-08-20 16:24:06.908537535 -0600
+@@ -642,3 +642,59 @@ static void __init ubnt_airgateway_setup
+ MIPS_MACHINE(ATH79_MACH_UBNT_AIRGW, "UBNT-AGW", "Ubiquiti AirGateway",
+ 	     ubnt_airgateway_setup);
+ 
++static struct gpio_led ubnt_airgateway_pro_gpio_leds[] __initdata = {
++	{
++		.name	   = "ubnt:blue:wlan",
++		.gpio	   = 13,
++	}, {
++		.name	   = "ubnt:white:status",
++		.gpio	   = 17,
++	},
++};
++
++
++static struct gpio_keys_button airgateway_pro_gpio_keys[] __initdata = {
++	{
++		.desc		= "reset",
++		.type		= EV_KEY,
++		.code		= KEY_RESTART,
++		.debounce_interval	= UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= 12,
++		.active_low	= 1,
++	}
++};
++
++static void __init ubnt_airgateway_pro_setup(void)
++{
++	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
++	u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_pro_gpio_leds),
++				 ubnt_airgateway_pro_gpio_leds);
++
++	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(airgateway_pro_gpio_keys),
++					airgateway_pro_gpio_keys);
++
++	ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
++	ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
++
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* GMAC0 is left unused in this configuration */
++
++	/* GMAC1 is connected to MAC0 on the internal switch */
++	/* The PoE/WAN port connects to port 5 on the internal switch */
++	/* The LAN port connects to port 4 on the internal switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_register_eth(1);
++
++}
++
++MIPS_MACHINE(ATH79_MACH_UBNT_AIRGWP, "UBNT-AGWP", "Ubiquiti AirGateway Pro",
++	     ubnt_airgateway_pro_setup);
--- target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch	2015-08-19 21:57:36.415324864 -0600
+++ target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch	2015-08-20 17:36:24.402046004 -0600
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,24 +16,207 @@
+@@ -16,24 +16,208 @@
  
  enum ath79_mach_type {
  	ATH79_MACH_GENERIC = 0,
@@ -159,6 +159,7 @@
 +	ATH79_MACH_TL_WR941ND_V5,	/* TP-LINK TL-WR941ND v5 */
 +	ATH79_MACH_TUBE2H,		/* Alfa Network Tube2H */
 +	ATH79_MACH_UBNT_AIRGW,		/* Ubiquiti AirGateway */
++	ATH79_MACH_UBNT_AIRGWP,		/* Ubiquiti AirGateway Pro */
  	ATH79_MACH_UBNT_AIRROUTER,	/* Ubiquiti AirRouter */
  	ATH79_MACH_UBNT_BULLET_M,	/* Ubiquiti Bullet M */
 +	ATH79_MACH_UBNT_LOCO_M_XW, 	/* Ubiquiti Loco M XW */
--- target/linux/ar71xx/base-files/lib/ar71xx.sh	2015-08-19 22:04:31.601383634 -0600
+++ target/linux/ar71xx/base-files/lib/ar71xx.sh	2015-08-20 17:21:07.789500768 -0600
@@ -326,6 +326,9 @@ ar71xx_board_detect() {
 	*"AirGateway")
 		name="airgateway"
 		;;
+	*"AirGateway Pro")
+		name="airgatewaypro"
+		;;
 	*"AirRouter")
 		name="airrouter"
 		;;
--- target/linux/ar71xx/base-files/lib/upgrade/platform.sh	2015-08-19 22:06:58.438111803 -0600
+++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh	2015-08-20 17:21:21.997571222 -0600
@@ -226,6 +226,7 @@ platform_check_image() {
 	tew-732br | \
 	wrt400n | \
 	airgateway | \
+	airgatewaypro | \
 	airrouter | \
 	bullet-m | \
 	loco-m-xw | \
--- target/linux/ar71xx/image/Makefile	2015-08-19 22:07:52.094377841 -0600
+++ target/linux/ar71xx/image/Makefile	2015-08-20 17:22:34.965933053 -0600
@@ -840,6 +840,15 @@ define Device/ubnt-air-gateway
 endef
 TARGET_DEVICES += ubnt-air-gateway
 
+define Device/ubnt-air-gateway-pro
+  $(Device/ubnt-xm)
+  BOARDNAME := UBNT-AGWP
+  UBNT_TYPE := AirGWP
+  UBNT_CHIP := ar934x
+  CONSOLE = ttyS0,115200
+endef
+TARGET_DEVICES += ubnt-air-gateway-pro
+
 define Device/ubdev01
   $(Device/ubnt-xm)
   MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
--- target/linux/ar71xx/base-files/etc/diag.sh	2015-08-20 16:48:36.539825043 -0600
+++ target/linux/ar71xx/base-files/etc/diag.sh	2015-08-20 17:22:55.610035421 -0600
@@ -304,7 +304,8 @@ get_status_led() {
 	unifi-outdoor-plus)
 		status_led="ubnt:white:front"
 		;;
-	airgateway)
+	airgateway | \
+	airgatewaypro)
 		status_led="ubnt:white:status"
 		;;
 	whr-g301n | \
--- target/linux/ar71xx/base-files/etc/uci-defaults/01_leds	2015-08-20 16:48:56.323923147 -0600
+++ target/linux/ar71xx/base-files/etc/uci-defaults/01_leds	2015-08-20 17:23:16.790140448 -0600
@@ -9,7 +9,8 @@
 board=$(ar71xx_board_name)
 
 case "$board" in
-airgateway)
+airgateway | \
+airgatewaypro)
 	ucidef_set_led_wlan "wlan" "WLAN" "ubnt:blue:wlan" "phy0tpt"
 	;;
 alfa-nx)
--- target/linux/ar71xx/base-files/etc/uci-defaults/02_network	2015-08-20 16:49:32.100100552 -0600
+++ target/linux/ar71xx/base-files/etc/uci-defaults/02_network	2015-08-20 17:24:34.674526656 -0600
@@ -86,6 +86,13 @@ cpe510)
 	ucidef_add_switch_vlan "switch0" "2" "0t 4"
 	;;
 
+airgatewaypro)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 4"
+	ucidef_add_switch_vlan "switch0" "2" "0t 5"
+	;;
+
 db120 |\
 rb-2011l | \
 rb-2011uas |\
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Thu Aug 20 21:34:26 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Thu, 20 Aug 2015 18:34:26 -0700
Subject: [OpenWrt-Devel] [PATCH 1/2] include: add a new ubinize-image build
	target
Message-ID: <1440120867-11871-1-git-send-email-mathieu@codeaurora.org>

This new build target can be used to generate a ubinized.bin file,
including the kernel and the FS specified as an argument.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 include/image.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 73fc805..f98d871 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -380,6 +380,12 @@ define Build/combined-image
 	@mv $@.new $@
 endef
 
+define Build/ubinize-image
+	$(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
+		$(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel $(word 1,$^),$(1),$(UBINIZE_OPTS)); \
+		cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
+endef
+
 define Device/Init
   PROFILES := $(PROFILE)
   DEVICE_NAME := $(1)
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mathieu at codeaurora.org  Thu Aug 20 21:34:27 2015
From: mathieu at codeaurora.org (Mathieu Olivari)
Date: Thu, 20 Aug 2015 18:34:27 -0700
Subject: [OpenWrt-Devel] [PATCH 2/2] ipq806x: add UBI image generation
In-Reply-To: <1440120867-11871-1-git-send-email-mathieu@codeaurora.org>
References: <1440120867-11871-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <1440120867-11871-2-git-send-email-mathieu@codeaurora.org>

UBI image will be used to flash in NAND.

Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 target/linux/ipq806x/image/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index b64d629..698aeb9 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -34,6 +34,8 @@ define Device/Default
 	KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
 	DEVICE_DTS :=
 	KERNEL_PREFIX := $$(IMAGE_PREFIX)
+	IMAGES:= ubinized.bin
+	IMAGE/ubinized.bin := ubinize-image squashfs
 endef
 DEVICE_VARS += DEVICE_DTS
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From yszhou4tech at gmail.com  Thu Aug 20 22:11:56 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Fri, 21 Aug 2015 10:11:56 +0800
Subject: [OpenWrt-Devel] [netifd][PATCH v2 1/2] Changes for more readability.
Message-ID: <1440123118-28986-1-git-send-email-yszhou4tech@gmail.com>

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 device.h    |    3 +++
 interface.c |    4 ++--
 interface.h |    1 +
 ubus.c      |    2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/device.h b/device.h
index ce135ba..798e19e 100644
--- a/device.h
+++ b/device.h
@@ -160,8 +160,11 @@ struct device {
 	struct blob_attr *config;
 	bool config_pending;
 	bool sys_present;
+	/* DEV_EVENT_ADD */
 	bool present;
+	/* DEV_EVENT_UP */
 	int active;
+	/* DEV_EVENT_LINK_UP */
 	bool link_active;
 
 	bool external;
diff --git a/interface.c b/interface.c
index 848990e..ffe7988 100644
--- a/interface.c
+++ b/interface.c
@@ -649,7 +649,7 @@ interface_handle_config_change(struct interface *iface)
 }
 
 static void
-interface_proto_cb(struct interface_proto_state *state, enum interface_proto_event ev)
+interface_proto_event_cb(struct interface_proto_state *state, enum interface_proto_event ev)
 {
 	struct interface *iface = state->iface;
 
@@ -708,7 +708,7 @@ void interface_set_proto_state(struct interface *iface, struct interface_proto_s
 	if (!state)
 		return;
 
-	state->proto_event = interface_proto_cb;
+	state->proto_event = interface_proto_event_cb;
 	state->iface = iface;
 }
 
diff --git a/interface.h b/interface.h
index 8eeb7db..6f9112c 100644
--- a/interface.h
+++ b/interface.h
@@ -120,6 +120,7 @@ struct interface {
 
 	struct list_head users;
 
+	/* for alias interface */
 	const char *parent_ifname;
 	struct interface_user parent_iface;
 
diff --git a/ubus.c b/ubus.c
index 56f7bdd..c834d11 100644
--- a/ubus.c
+++ b/ubus.c
@@ -817,7 +817,7 @@ netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
 
 	cur = tb[DEV_LINK_EXT];
 	if (cur)
-		link_ext = !!blobmsg_get_u8(cur);
+		link_ext = blobmsg_get_bool(cur);
 
 	return interface_handle_link(iface, blobmsg_data(tb[DEV_LINK_NAME]), add, link_ext);
 }
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From yszhou4tech at gmail.com  Thu Aug 20 22:11:57 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Fri, 21 Aug 2015 10:11:57 +0800
Subject: [OpenWrt-Devel] [netifd][PATCH v2 2/2] proto-shell: add checkup
	timeout to restart interface.
In-Reply-To: <1440123118-28986-1-git-send-email-yszhou4tech@gmail.com>
References: <1440123118-28986-1-git-send-email-yszhou4tech@gmail.com>
Message-ID: <1440123118-28986-2-git-send-email-yszhou4tech@gmail.com>

This is mainly for protocols with no_proto_task set.  L2TP with xl2tpd
is such a case and the issue this commit tries to address is that xl2tpd
could fail redialing the connection (segfault or abort) without the
notice of netifd causing the concerned interface being left down.

This patch solves it by allowing users to configure an timeout value
instructing netifd to check if the interface is in up state after its
last attempt to setup it and try again if that is not the case.

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
v2 <- v1

	- Cancel checkup_timeout when a) interface goes to S_IDLE state; b)
	  interface free() was called.
	- Set checkup_timeout only when interface is in S_SETUP state.
	- Added a few comments.

 proto-shell.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/proto-shell.c b/proto-shell.c
index e2e765f..8a3ff69 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -69,6 +69,15 @@ struct proto_shell_state {
 
 	struct uloop_timeout teardown_timeout;
 
+	/*
+	 * Teardown and setup interface again if it is still not up (IFS_UP)
+	 * after checkup_interval seconds since previous attempt.  This check
+	 * will be disabled when the config option "checkup_interval" is
+	 * missing or has a negative value
+	 */
+	int checkup_interval;
+	struct uloop_timeout checkup_timeout;
+
 	struct netifd_process script_task;
 	struct netifd_process proto_task;
 
@@ -303,6 +312,12 @@ proto_shell_task_finish(struct proto_shell_state *state,
 				proto_shell_handler(&state->proto,
 						    PROTO_CMD_TEARDOWN,
 						    false);
+
+			/* check up status after setup attempt by this script_task */
+			if (state->sm == S_SETUP && state->checkup_interval > 0) {
+				uloop_timeout_set(&state->checkup_timeout,
+						  state->checkup_interval * 1000);
+			}
 		}
 		break;
 
@@ -311,7 +326,9 @@ proto_shell_task_finish(struct proto_shell_state *state,
 		    state->proto_task.uloop.pending)
 			break;
 
+		/* completed aborting all tasks, now idle */
 		uloop_timeout_cancel(&state->teardown_timeout);
+		uloop_timeout_cancel(&state->checkup_timeout);
 		state->sm = S_IDLE;
 		proto_shell_handler(&state->proto, PROTO_CMD_TEARDOWN, false);
 		break;
@@ -326,7 +343,9 @@ proto_shell_task_finish(struct proto_shell_state *state,
 			break;
 		}
 
+		/* completed tearing down all tasks, now idle */
 		uloop_timeout_cancel(&state->teardown_timeout);
+		uloop_timeout_cancel(&state->checkup_timeout);
 		state->sm = S_IDLE;
 		state->proto.proto_event(&state->proto, IFPEV_DOWN);
 		break;
@@ -374,6 +393,7 @@ proto_shell_free(struct interface_proto_state *proto)
 
 	state = container_of(proto, struct proto_shell_state, proto);
 	uloop_timeout_cancel(&state->teardown_timeout);
+	uloop_timeout_cancel(&state->checkup_timeout);
 	proto_shell_clear_host_dep(state);
 	netifd_kill_process(&state->script_task);
 	netifd_kill_process(&state->proto_task);
@@ -768,6 +788,45 @@ proto_shell_notify(struct interface_proto_state *proto, struct blob_attr *attr)
 	}
 }
 
+static void
+proto_shell_checkup_timeout_cb(struct uloop_timeout *timeout)
+{
+	struct proto_shell_state *state = container_of(timeout, struct
+			proto_shell_state, checkup_timeout);
+	struct interface_proto_state *proto = &state->proto;
+	struct interface *iface = proto->iface;
+
+	if (!iface->autostart)
+		return;
+
+	if (iface->state == IFS_UP)
+		return;
+
+	D(INTERFACE, "Interface '%s' is not up after %d sec\n",
+			iface->name, state->checkup_interval);
+	proto_shell_handler(proto, PROTO_CMD_TEARDOWN, false);
+}
+
+static void
+proto_shell_checkup_attach(struct proto_shell_state *state,
+		const struct blob_attr *attr)
+{
+	struct blob_attr *tb;
+	struct blobmsg_policy checkup_policy = {
+		.name = "checkup_interval",
+		.type = BLOBMSG_TYPE_INT32
+	};
+
+	blobmsg_parse(&checkup_policy, 1, &tb, blob_data(attr), blob_len(attr));
+	if (!tb) {
+		state->checkup_interval = -1;
+		state->checkup_timeout.cb = NULL;
+	} else {
+		state->checkup_interval = blobmsg_get_u32(tb);
+		state->checkup_timeout.cb = proto_shell_checkup_timeout_cb;
+	}
+}
+
 static struct interface_proto_state *
 proto_shell_attach(const struct proto_handler *h, struct interface *iface,
 		   struct blob_attr *attr)
@@ -782,6 +841,7 @@ proto_shell_attach(const struct proto_handler *h, struct interface *iface,
 		goto error;
 
 	memcpy(state->config, attr, blob_pad_len(attr));
+	proto_shell_checkup_attach(state, state->config);
 	state->proto.free = proto_shell_free;
 	state->proto.notify = proto_shell_notify;
 	state->proto.cb = proto_shell_handler;
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Fri Aug 21 02:55:20 2015
From: blogic at openwrt.org (John Crispin)
Date: Fri, 21 Aug 2015 08:55:20 +0200
Subject: [OpenWrt-Devel] [PATCH] ar71xx: Add UBNT airGateway Pro support
In-Reply-To: <55D67C86.8070108@tenxnetworks.com>
References: <55D67C86.8070108@tenxnetworks.com>
Message-ID: <55D6CB58.2080601@openwrt.org>

Hi Mathew,

patch content is fine however the patch is generated against the wrong
basee. please use git to respin the patch and resend it.

	John


On 21/08/2015 03:19, Matthew Reeve wrote:
> This patch adds kernel and userspace support for the Ubiquiti Networks airGateway Pro.
> 
> Signed-off-by: Matthew Reeve <mreeve at tenxnetworks.com>
> 
> --- /dev/null	2015-08-07 21:02:55.557188068 -0600
> +++ target/linux/ar71xx/patches-4.1/610-MIPS-ath79-UBNT-add-airGateway-pro-support.patch	2015-08-20 17:20:09.149209987 -0600
> @@ -0,0 +1,62 @@
> +--- a/arch/mips/ath79/mach-ubnt-xm.c	2015-08-19 21:26:47.694157530 -0600
> ++++ b/arch/mips/ath79/mach-ubnt-xm.c	2015-08-20 16:24:06.908537535 -0600
> +@@ -642,3 +642,59 @@ static void __init ubnt_airgateway_setup
> + MIPS_MACHINE(ATH79_MACH_UBNT_AIRGW, "UBNT-AGW", "Ubiquiti AirGateway",
> + 	     ubnt_airgateway_setup);
> + 
> ++static struct gpio_led ubnt_airgateway_pro_gpio_leds[] __initdata = {
> ++	{
> ++		.name	   = "ubnt:blue:wlan",
> ++		.gpio	   = 13,
> ++	}, {
> ++		.name	   = "ubnt:white:status",
> ++		.gpio	   = 17,
> ++	},
> ++};
> ++
> ++
> ++static struct gpio_keys_button airgateway_pro_gpio_keys[] __initdata = {
> ++	{
> ++		.desc		= "reset",
> ++		.type		= EV_KEY,
> ++		.code		= KEY_RESTART,
> ++		.debounce_interval	= UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
> ++		.gpio		= 12,
> ++		.active_low	= 1,
> ++	}
> ++};
> ++
> ++static void __init ubnt_airgateway_pro_setup(void)
> ++{
> ++	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
> ++	u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
> ++
> ++	ath79_register_m25p80(NULL);
> ++	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_pro_gpio_leds),
> ++				 ubnt_airgateway_pro_gpio_leds);
> ++
> ++	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
> ++					ARRAY_SIZE(airgateway_pro_gpio_keys),
> ++					airgateway_pro_gpio_keys);
> ++
> ++	ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
> ++	ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
> ++
> ++
> ++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
> ++
> ++	ath79_register_mdio(1, 0x0);
> ++
> ++	/* GMAC0 is left unused in this configuration */
> ++
> ++	/* GMAC1 is connected to MAC0 on the internal switch */
> ++	/* The PoE/WAN port connects to port 5 on the internal switch */
> ++	/* The LAN port connects to port 4 on the internal switch */
> ++	ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
> ++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
> ++	ath79_register_eth(1);
> ++
> ++}
> ++
> ++MIPS_MACHINE(ATH79_MACH_UBNT_AIRGWP, "UBNT-AGWP", "Ubiquiti AirGateway Pro",
> ++	     ubnt_airgateway_pro_setup);
> --- target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch	2015-08-19 21:57:36.415324864 -0600
> +++ target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch	2015-08-20 17:36:24.402046004 -0600
> @@ -1,6 +1,6 @@
>  --- a/arch/mips/ath79/machtypes.h
>  +++ b/arch/mips/ath79/machtypes.h
> -@@ -16,24 +16,207 @@
> +@@ -16,24 +16,208 @@
>   
>   enum ath79_mach_type {
>   	ATH79_MACH_GENERIC = 0,
> @@ -159,6 +159,7 @@
>  +	ATH79_MACH_TL_WR941ND_V5,	/* TP-LINK TL-WR941ND v5 */
>  +	ATH79_MACH_TUBE2H,		/* Alfa Network Tube2H */
>  +	ATH79_MACH_UBNT_AIRGW,		/* Ubiquiti AirGateway */
> ++	ATH79_MACH_UBNT_AIRGWP,		/* Ubiquiti AirGateway Pro */
>   	ATH79_MACH_UBNT_AIRROUTER,	/* Ubiquiti AirRouter */
>   	ATH79_MACH_UBNT_BULLET_M,	/* Ubiquiti Bullet M */
>  +	ATH79_MACH_UBNT_LOCO_M_XW, 	/* Ubiquiti Loco M XW */
> --- target/linux/ar71xx/base-files/lib/ar71xx.sh	2015-08-19 22:04:31.601383634 -0600
> +++ target/linux/ar71xx/base-files/lib/ar71xx.sh	2015-08-20 17:21:07.789500768 -0600
> @@ -326,6 +326,9 @@ ar71xx_board_detect() {
>  	*"AirGateway")
>  		name="airgateway"
>  		;;
> +	*"AirGateway Pro")
> +		name="airgatewaypro"
> +		;;
>  	*"AirRouter")
>  		name="airrouter"
>  		;;
> --- target/linux/ar71xx/base-files/lib/upgrade/platform.sh	2015-08-19 22:06:58.438111803 -0600
> +++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh	2015-08-20 17:21:21.997571222 -0600
> @@ -226,6 +226,7 @@ platform_check_image() {
>  	tew-732br | \
>  	wrt400n | \
>  	airgateway | \
> +	airgatewaypro | \
>  	airrouter | \
>  	bullet-m | \
>  	loco-m-xw | \
> --- target/linux/ar71xx/image/Makefile	2015-08-19 22:07:52.094377841 -0600
> +++ target/linux/ar71xx/image/Makefile	2015-08-20 17:22:34.965933053 -0600
> @@ -840,6 +840,15 @@ define Device/ubnt-air-gateway
>  endef
>  TARGET_DEVICES += ubnt-air-gateway
>  
> +define Device/ubnt-air-gateway-pro
> +  $(Device/ubnt-xm)
> +  BOARDNAME := UBNT-AGWP
> +  UBNT_TYPE := AirGWP
> +  UBNT_CHIP := ar934x
> +  CONSOLE = ttyS0,115200
> +endef
> +TARGET_DEVICES += ubnt-air-gateway-pro
> +
>  define Device/ubdev01
>    $(Device/ubnt-xm)
>    MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
> --- target/linux/ar71xx/base-files/etc/diag.sh	2015-08-20 16:48:36.539825043 -0600
> +++ target/linux/ar71xx/base-files/etc/diag.sh	2015-08-20 17:22:55.610035421 -0600
> @@ -304,7 +304,8 @@ get_status_led() {
>  	unifi-outdoor-plus)
>  		status_led="ubnt:white:front"
>  		;;
> -	airgateway)
> +	airgateway | \
> +	airgatewaypro)
>  		status_led="ubnt:white:status"
>  		;;
>  	whr-g301n | \
> --- target/linux/ar71xx/base-files/etc/uci-defaults/01_leds	2015-08-20 16:48:56.323923147 -0600
> +++ target/linux/ar71xx/base-files/etc/uci-defaults/01_leds	2015-08-20 17:23:16.790140448 -0600
> @@ -9,7 +9,8 @@
>  board=$(ar71xx_board_name)
>  
>  case "$board" in
> -airgateway)
> +airgateway | \
> +airgatewaypro)
>  	ucidef_set_led_wlan "wlan" "WLAN" "ubnt:blue:wlan" "phy0tpt"
>  	;;
>  alfa-nx)
> --- target/linux/ar71xx/base-files/etc/uci-defaults/02_network	2015-08-20 16:49:32.100100552 -0600
> +++ target/linux/ar71xx/base-files/etc/uci-defaults/02_network	2015-08-20 17:24:34.674526656 -0600
> @@ -86,6 +86,13 @@ cpe510)
>  	ucidef_add_switch_vlan "switch0" "2" "0t 4"
>  	;;
>  
> +airgatewaypro)
> +	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
> +	ucidef_add_switch "switch0" "1" "1"
> +	ucidef_add_switch_vlan "switch0" "1" "0t 4"
> +	ucidef_add_switch_vlan "switch0" "2" "0t 5"
> +	;;
> +
>  db120 |\
>  rb-2011l | \
>  rb-2011uas |\
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From banglang.huang at foxmail.com  Fri Aug 21 02:58:34 2015
From: banglang.huang at foxmail.com (tymon.huang)
Date: Fri, 21 Aug 2015 14:58:34 +0800
Subject: [OpenWrt-Devel] [PATCH] add hostname validation check for netifd
	dhcp script
Message-ID: <1440140314-29845-1-git-send-email-banglang.huang@foxmail.com>

Signed-off-by: tymon.huang <banglang.huang at foxmail.com>
---
 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 0e88af9..bf91c29 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -47,6 +47,7 @@ proto_dhcp_setup() {
 	[ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd"
 	[ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes"
 	[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
+	[ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)"
 
 	proto_export "INTERFACE=$config"
 	proto_run_command "$config" udhcpc \
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From banglang.huang at foxmail.com  Fri Aug 21 03:00:29 2015
From: banglang.huang at foxmail.com (tymon.huang)
Date: Fri, 21 Aug 2015 15:00:29 +0800
Subject: [OpenWrt-Devel] [netifd][PATCH] proto-shell: add hostname
	validation check for netifd dhcp script
Message-ID: <1440140429-29953-1-git-send-email-banglang.huang@foxmail.com>

Signed-off-by: tymon.huang <banglang.huang at foxmail.com>
---
 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 0e88af9..bf91c29 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -47,6 +47,7 @@ proto_dhcp_setup() {
 	[ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd"
 	[ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes"
 	[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
+	[ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)"
 
 	proto_export "INTERFACE=$config"
 	proto_run_command "$config" udhcpc \
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Fri Aug 21 03:00:31 2015
From: blogic at openwrt.org (John Crispin)
Date: Fri, 21 Aug 2015 09:00:31 +0200
Subject: [OpenWrt-Devel] [PATCH v3] Add Minibox v1.0 support
In-Reply-To: <1439927069-2780-1-git-send-email-francesco.borromini@inventati.org>
References: <1439927069-2780-1-git-send-email-francesco.borromini@inventati.org>
Message-ID: <55D6CC8F.2020909@openwrt.org>

Hi,

Patch looks fine now, however the subject is missing the "ar71xx:" prefix

	John

On 18/08/2015 21:44, Stijn Segers wrote:
> This patch adds Gainstrong Minibox v1.0 into trunk. I have addressed the
> following issues:
> - all caps prefix
> - added vendor
> 
> I have built images and asked for testing on the forums, the image has
> been confirmed working but the LED is off during normal operation (I assume
> this is the possible LED polarity issue Karl Palsson was talking about?)
> 
> Questions:
> 
> - Can I simply set gpio_led minibox_v1_leds_gpio to active.low = 1 or isn't
>   that how it works?
> - Should I give the 799 minibox kernel support patch a number that follows
>   the existing patches more closely (e.g. 750) or doesn't that matter?
> 
> Thanks
> 
> Signed-off by: Stijn Segers <francesco.borromini at inventati.org>
> 
> ---
>  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       |  6 ++
>  .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
>  target/linux/ar71xx/config-4.1                     |  1 +
>  .../ar71xx/files/arch/mips/ath79/mach-minibox-v1.c | 84 ++++++++++++++++++++++
>  target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +++++
>  target/linux/ar71xx/image/Makefile                 |  9 +++
>  .../799-MIPS-ath79-add-minibox-v1-support.patch    | 39 ++++++++++
>  9 files changed, 161 insertions(+)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>  create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk
>  create mode 100644 target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> 
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
> index 36de775..342c68c 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -219,6 +219,9 @@ get_status_led() {
>  	smart-300)
>  		status_led="nc-link:green:system"
>  		;;
> +	minibox-v1)
> +		status_led="minibox-v1:green:system"
> +		;;
>  	oolite)
>  		status_led="oolite:red:system"
>  		;;
> 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 686fce9..49f6b55 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -425,6 +425,7 @@ dir-615-e4 |\
>  hiwifi-hc6361 |\
>  ja76pf |\
>  mc-mac1200r|\
> +minibox-v1 |\
>  mynet-n600 |\
>  oolite |\
>  qihoo-c301 |\
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index e1f345e..4f9735f 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -119,6 +119,9 @@ tplink_board_detect() {
>  	"3C0001"*)
>  		model="OOLITE"
>  		;;
> +	"3C0002"*)
> +		model="Minibox_v1"
> +		;;
>  	"070300"*)
>  		model="TP-Link TL-WR703N"
>  		;;
> @@ -502,6 +505,9 @@ ar71xx_board_detect() {
>  	*"MAC1200R")
>  		name="mc-mac1200r"
>  		;;
> +	*"Minibox v1.0")
> +		name="minibox-v1"
> +		;;
>  	*MR12)
>  		name="mr12"
>  		;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index c1962e4..0b7b84c 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -314,6 +314,7 @@ platform_check_image() {
>  	el-mini | \
>  	gl-inet | \
>  	mc-mac1200r | \
> +	minibox-v1 |\
>  	onion-omega | \
>  	oolite | \
>  	smart-300 | \
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index 21c4601..49f2ac1 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -79,6 +79,7 @@ CONFIG_ATH79_MACH_HORNET_UB=y
>  CONFIG_ATH79_MACH_JA76PF=y
>  CONFIG_ATH79_MACH_JWAP003=y
>  CONFIG_ATH79_MACH_MC_MAC1200R=y
> +CONFIG_ATH79_MACH_MINIBOX_V1=y
>  CONFIG_ATH79_MACH_MR12=y
>  CONFIG_ATH79_MACH_MR16=y
>  CONFIG_ATH79_MACH_MR600=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> new file mode 100644
> index 0000000..7c26cab
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> @@ -0,0 +1,84 @@
> +/*
> + *  Minibox v1.0 board support
> + *
> + *
> + *  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.
> + */
> +
> +#include <linux/gpio.h>
> +
> +#include <asm/mach-ath79/ath79.h>
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-usb.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +
> +#define MINIBOX_V1_GPIO_BTN_RESET	11
> +
> +#define MINIBOX_V1_GPIO_LED_SYSTEM	1
> +
> +#define MINIBOX_V1_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL (3 * MINIBOX_V1_KEYS_POLL_INTERVAL)
> +
> +static const char *minibox_v1_part_probes[] = {
> +	"tp-link",
> +	NULL,
> +};
> +
> +static struct flash_platform_data minibox_v1_flash_data = {
> +	.part_probes	= minibox_v1_part_probes,
> +};
> +
> +static struct gpio_led minibox_v1_leds_gpio[] __initdata = {
> +	{
> +		.name		= "minibox-v1:green:system",
> +		.gpio		= MINIBOX_V1_GPIO_LED_SYSTEM,
> +		.active_low	= 0,
> +	},
> +};
> +
> +static struct gpio_keys_button minibox_v1_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "reset",
> +		.type		= EV_KEY,
> +		.code		= KEY_RESTART,
> +		.debounce_interval = MINIBOX_V1_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= MINIBOX_V1_GPIO_BTN_RESET,
> +		.active_low	= 0,
> +	},
> +};
> +
> +static void __init minibox_v1_setup(void)
> +{
> +	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
> +	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(minibox_v1_leds_gpio),
> +				 minibox_v1_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, MINIBOX_V1_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(minibox_v1_gpio_keys),
> +					minibox_v1_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +	ath79_register_m25p80(&minibox_v1_flash_data);
> +	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
> +
> +	ath79_register_mdio(0, 0x0);
> +	ath79_register_eth(1);
> +	ath79_register_eth(0);
> +
> +	ath79_register_wmac(ee, mac);
> +}
> +
> +MIPS_MACHINE(ATH79_MACH_MINIBOX_V1, "MINIBOX-V1", "MiniBox V1.0", minibox_v1_setup);
> diff --git a/target/linux/ar71xx/generic/profiles/minibox-v1.mk b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> new file mode 100644
> index 0000000..cbdb123
> --- /dev/null
> +++ b/target/linux/ar71xx/generic/profiles/minibox-v1.mk
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/Miniboxv1
> +	NAME:=Minibox v1.0
> +	PACKAGES:=kmod-usb-core kmod-usb2  kmod-ledtrig-usbdev
> +endef
> +
> +
> +define Profile/Miniboxv1/Description
> +	Package set optimized for the Gainstrong Minibox v1.0
> +endef
> +$(eval $(call Profile,Miniboxv1))
> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
> index 8f609de..4a2a45e 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -397,6 +397,15 @@ define Device/mc-mac1200r
>  endef
>  TARGET_DEVICES += mc-mac1200r
>  
> +define Device/minibox-v1
> +    $(Device/tplink-16mlzma)
> +    BOARDNAME := Minibox-v1
> +    DEVICE_PROFILE := Miniboxv1
> +    TPLINK_HWID := 0x3C000201
> +    CONSOLE := ttyATH0,115200
> +endef
> +TARGET_DEVICES += minibox-v1
> +
>  define Device/onion-omega
>      $(Device/tplink-16mlzma)
>      BOARDNAME := ONION-OMEGA
> diff --git a/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> new file mode 100644
> index 0000000..75be5fe
> --- /dev/null
> +++ b/target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> @@ -0,0 +1,39 @@
> +--- a/arch/mips/ath79/machtypes.h
> ++++ b/arch/mips/ath79/machtypes.h
> +@@ -74,6 +74,7 @@ enum ath79_mach_type {
> +	ATH79_MACH_JA76PF2,		/* jjPlus JA76PF2 */
> +	ATH79_MACH_JWAP003,		/* jjPlus JWAP003 */
> +	ATH79_MACH_HORNET_UB,		/* ALFA Networks Hornet-UB */
> ++	ATH79_MACH_MINIBOX_V1,		/* Gainstrong Minibox v1.0 */
> +	ATH79_MACH_MR12,		/* Cisco Meraki MR12 */
> +	ATH79_MACH_MR16,		/* Cisco Meraki MR16 */
> +	ATH79_MACH_MR600V2,		/* OpenMesh MR600v2 */
> +--- a/arch/mips/ath79/Kconfig
> ++++ b/arch/mips/ath79/Kconfig
> +@@ -596,6 +596,16 @@
> +	select ATH79_DEV_M25P80
> +	select ATH79_DEV_USB
> +
> ++config ATH79_MACH_MINIBOX_V1
> ++	bool "Minibox v1.0 support"
> ++	select SOC_AR933X
> ++	select ARH79_DEV_ETH
> ++	select ARH79_DEV_GPIO_BUTTONS
> ++	select ATH79_DEV_LEDS_GPIO
> ++	select ATH79_DEV_M25P80
> ++	select ATH79_DEV_USB
> ++	select ATH79_DEV_WMAC
> ++
> + config ATH79_MACH_WRT160NL
> +	bool "Linksys WRT160NL board support"
> +	select SOC_AR913X
> +--- a/arch/mips/ath79/Makefile	2015-08-10 23:27:44.599500173 +0200
> ++++ b/arch/mips/ath79/Makefile	2015-08-10 23:29:25.090929262 +0200
> +@@ -85,6 +85,7 @@
> + obj-$(CONFIG_ATH79_MACH_JWAP003)	+= mach-jwap003.o
> + obj-$(CONFIG_ATH79_MACH_HORNET_UB)	+= mach-hornet-ub.o
> + obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)     += mach-mc-mac1200r.o
> ++obj-$(CONFIG_ATH79_MACH_MINIBOX_V1)	+= mach-minibox-v1.o
> + obj-$(CONFIG_ATH79_MACH_MR12)		+= mach-mr12.o
> + obj-$(CONFIG_ATH79_MACH_MR16)		+= mach-mr16.o
> + obj-$(CONFIG_ATH79_MACH_MR600)		+= mach-mr600.o
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From banglang.huang at foxmail.com  Fri Aug 21 03:12:52 2015
From: banglang.huang at foxmail.com (tymon.huang)
Date: Fri, 21 Aug 2015 15:12:52 +0800
Subject: [OpenWrt-Devel] [netifd][PATCH v3] proto-shell: add hostname
	validation check for netifd dhcp script
Message-ID: <1440141172-30455-1-git-send-email-banglang.huang@foxmail.com>

This patch can fix the issue that luci web shows '?' sign when WAN port work on DHCP-client mode without
setting hostname. After adding the hostname check, the udhcpc can work with '-H' parameter correctly and
send hostname to dhcp server.

Signed-off-by: tymon.huang <banglang.huang at foxmail.com>
---
 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 0e88af9..bf91c29 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -47,6 +47,7 @@ proto_dhcp_setup() {
 	[ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd"
 	[ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes"
 	[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
+	[ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)"
 
 	proto_export "INTERFACE=$config"
 	proto_run_command "$config" udhcpc \
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mreeve at tenxnetworks.com  Fri Aug 21 03:27:27 2015
From: mreeve at tenxnetworks.com (Matthew Reeve)
Date: Fri, 21 Aug 2015 01:27:27 -0600
Subject: [OpenWrt-Devel] [PATCH v2] ar71xx: Add UBNT airGateway Pro support
Message-ID: <55D6D2DF.1010503@tenxnetworks.com>

This patch adds kernel and userspace support for the Ubiquiti Networks airGateway Pro.

v2: Modify file bases so that git apply will apply it.

Signed-off-by: Matthew Reeve <mreeve at tenxnetworks.com>

--- /dev/null	2015-08-07 21:02:55.557188068 -0600
+++ b/target/linux/ar71xx/patches-4.1/610-MIPS-ath79-UBNT-add-airGateway-pro-support.patch	2015-08-20 17:20:09.149209987 -0600
@@ -0,0 +1,62 @@ 
+--- a/arch/mips/ath79/mach-ubnt-xm.c	2015-08-19 21:26:47.694157530 -0600
++++ b/arch/mips/ath79/mach-ubnt-xm.c	2015-08-20 16:24:06.908537535 -0600
+@@ -642,3 +642,59 @@ static void __init ubnt_airgateway_setup
+ MIPS_MACHINE(ATH79_MACH_UBNT_AIRGW, "UBNT-AGW", "Ubiquiti AirGateway",
+ 	     ubnt_airgateway_setup);
+ 
++static struct gpio_led ubnt_airgateway_pro_gpio_leds[] __initdata = {
++	{
++		.name	   = "ubnt:blue:wlan",
++		.gpio	   = 13,
++	}, {
++		.name	   = "ubnt:white:status",
++		.gpio	   = 17,
++	},
++};
++
++
++static struct gpio_keys_button airgateway_pro_gpio_keys[] __initdata = {
++	{
++		.desc		= "reset",
++		.type		= EV_KEY,
++		.code		= KEY_RESTART,
++		.debounce_interval	= UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= 12,
++		.active_low	= 1,
++	}
++};
++
++static void __init ubnt_airgateway_pro_setup(void)
++{
++	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
++	u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_pro_gpio_leds),
++				 ubnt_airgateway_pro_gpio_leds);
++
++	ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(airgateway_pro_gpio_keys),
++					airgateway_pro_gpio_keys);
++
++	ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
++	ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
++
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(1, 0x0);
++
++	/* GMAC0 is left unused in this configuration */
++
++	/* GMAC1 is connected to MAC0 on the internal switch */
++	/* The PoE/WAN port connects to port 5 on the internal switch */
++	/* The LAN port connects to port 4 on the internal switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_register_eth(1);
++
++}
++
++MIPS_MACHINE(ATH79_MACH_UBNT_AIRGWP, "UBNT-AGWP", "Ubiquiti AirGateway Pro",
++	     ubnt_airgateway_pro_setup);
--- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch	2015-08-19 21:57:36.415324864 -0600
+++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch	2015-08-20 17:36:24.402046004 -0600
@@ -1,6 +1,6 @@ 
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,24 +16,207 @@
+@@ -16,24 +16,208 @@
  
  enum ath79_mach_type {
  	ATH79_MACH_GENERIC = 0,
@@ -159,6 +159,7 @@ 
 +	ATH79_MACH_TL_WR941ND_V5,	/* TP-LINK TL-WR941ND v5 */
 +	ATH79_MACH_TUBE2H,		/* Alfa Network Tube2H */
 +	ATH79_MACH_UBNT_AIRGW,		/* Ubiquiti AirGateway */
++	ATH79_MACH_UBNT_AIRGWP,		/* Ubiquiti AirGateway Pro */
  	ATH79_MACH_UBNT_AIRROUTER,	/* Ubiquiti AirRouter */
  	ATH79_MACH_UBNT_BULLET_M,	/* Ubiquiti Bullet M */
 +	ATH79_MACH_UBNT_LOCO_M_XW, 	/* Ubiquiti Loco M XW */
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh	2015-08-19 22:04:31.601383634 -0600
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh	2015-08-20 17:21:07.789500768 -0600
@@ -326,6 +326,9 @@  ar71xx_board_detect() {
 	*"AirGateway")
 		name="airgateway"
 		;;
+	*"AirGateway Pro")
+		name="airgatewaypro"
+		;;
 	*"AirRouter")
 		name="airrouter"
 		;;
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh	2015-08-19 22:06:58.438111803 -0600
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh	2015-08-20 17:21:21.997571222 -0600
@@ -226,6 +226,7 @@  platform_check_image() {
 	tew-732br | \
 	wrt400n | \
 	airgateway | \
+	airgatewaypro | \
 	airrouter | \
 	bullet-m | \
 	loco-m-xw | \
--- a/target/linux/ar71xx/image/Makefile	2015-08-19 22:07:52.094377841 -0600
+++ b/target/linux/ar71xx/image/Makefile	2015-08-20 17:22:34.965933053 -0600
@@ -840,6 +840,15 @@  define Device/ubnt-air-gateway
 endef
 TARGET_DEVICES += ubnt-air-gateway
 
+define Device/ubnt-air-gateway-pro
+  $(Device/ubnt-xm)
+  BOARDNAME := UBNT-AGWP
+  UBNT_TYPE := AirGWP
+  UBNT_CHIP := ar934x
+  CONSOLE = ttyS0,115200
+endef
+TARGET_DEVICES += ubnt-air-gateway-pro
+
 define Device/ubdev01
   $(Device/ubnt-xm)
   MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
--- a/target/linux/ar71xx/base-files/etc/diag.sh	2015-08-20 16:48:36.539825043 -0600
+++ b/target/linux/ar71xx/base-files/etc/diag.sh	2015-08-20 17:22:55.610035421 -0600
@@ -304,7 +304,8 @@  get_status_led() {
 	unifi-outdoor-plus)
 		status_led="ubnt:white:front"
 		;;
-	airgateway)
+	airgateway | \
+	airgatewaypro)
 		status_led="ubnt:white:status"
 		;;
 	whr-g301n | \
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds	2015-08-20 16:48:56.323923147 -0600
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds	2015-08-20 17:23:16.790140448 -0600
@@ -9,7 +9,8 @@ 
 board=$(ar71xx_board_name)
 
 case "$board" in
-airgateway)
+airgateway | \
+airgatewaypro)
 	ucidef_set_led_wlan "wlan" "WLAN" "ubnt:blue:wlan" "phy0tpt"
 	;;
 alfa-nx)
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network	2015-08-20 16:49:32.100100552 -0600
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network	2015-08-20 17:24:34.674526656 -0600
@@ -86,6 +86,13 @@  cpe510)
 	ucidef_add_switch_vlan "switch0" "2" "0t 4"
 	;;
 
+airgatewaypro)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 4"
+	ucidef_add_switch_vlan "switch0" "2" "0t 5"
+	;;
+
 db120 |\
 rb-2011l | \
 rb-2011uas |\
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Fri Aug 21 04:44:05 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Fri, 21 Aug 2015 10:44:05 +0200
Subject: [OpenWrt-Devel] [PATCH] Added WIZnet WizFi630A Platform based
 on Ralink RT5350
In-Reply-To: <55D24874.9090500@wiznet.eu>
References: <55D1C472.90109@openwrt.org>
	<55D24874.9090500@wiznet.eu>
Message-ID: <CAMTkhzObfiNnzydxbbd-OpteztQV-MKueSRfg+Yt8DGfi+WWcw@mail.gmail.com>

Hello Tobias,

I saw on patchwork that your patch is already marked as accepted, but
I have a lot of comments, please see them inline, below.

PS. Sorry for being so pedantic, but it took me lot of time to clean
ramips target few weeks ago.

2015-08-17 22:47 GMT+02:00 Tobias Welz <tw at wiznet.eu>:
> From: Tobias Welz <tw at wiznet.eu>

Your patch message should have "ramips:" prefix.
It would be also nice to place a small description about the hardware
you are adding support for and this is the right place for it.

>
>
> Signed-off-by: Tobias Welz <tw at wiznet.eu>
> ---
>  .../linux/ramips/base-files/etc/board.d/02_network |    5 +
>  target/linux/ramips/base-files/etc/diag.sh         |    3 +
>  target/linux/ramips/base-files/lib/ramips.sh       |    3 +
>  .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
>  target/linux/ramips/dts/WIZFI630A.dts              |  294
> ++++++++++++++++++++
>  target/linux/ramips/image/Makefile                 |    4 +-
>  target/linux/ramips/rt305x/profiles/wizfi630a.mk   |   18 ++
>  7 files changed, 327 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
>  create mode 100644 target/linux/ramips/rt305x/profiles/wizfi630a.mk
>
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
> b/target/linux/ramips/base-files/etc/board.d/02_network
> index 6a2f042..cfd0b26 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -217,6 +217,7 @@ ramips_setup_interfaces()
>                 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
>                 ucidef_add_switch_vlan "switch0" "2" "5 6t"
>                 ;;
> +       wizfi630a | \

Please, follow the general convention in this file and use "|\"
instead of " | \".

>         y1s)
>                 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>                 ucidef_add_switch "switch0" "1" "1"
> @@ -320,6 +321,10 @@ ramips_setup_macs()
>         wcr-150gn)
>                 wan_mac=$(mtd_get_mac_binary factory 40)
>                 ;;
> +       wizfi630a)
> +               lan_mac=$(mtd_get_mac_binary factory 4)
> +               wan_mac=$(mtd_get_mac_binary factory 40)
> +               ;;

Please, follow the general convention and keep boards in alphabetical
order (board are sorted in two passes: in file and in common blocks):

[...]
wcr-150gn)
[...]
whr-1166d|\
whr-300hp2|\
whr-600d|\
wsr-600)
[...]

--> this is the right place for your board

wsr-1166)
[...]

>         whr-1166d|\
>         whr-300hp2|\
>         whr-600d|\
> diff --git a/target/linux/ramips/base-files/etc/diag.sh
> b/target/linux/ramips/base-files/etc/diag.sh
> index a4911b0..54b84e5 100644
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -143,6 +143,9 @@ get_status_led() {
>         whr-600d)
>                 status_led="$board:orange:wifi"
>                 ;;
> +       wizfi630a)
> +               status_led="wizfi630a::run"
> +               ;;

Same as above, please keep boards in alphabetical order:

[...]
wcr-150gn|\
wl-351)
[...]
whr-g300n|\
wzr-agl300nh)
[...]

--> this is the right place for your board

wsr-1166|\
wsr-600)

>         rt-n10-plus|\
>         tew-691gr|\
>         tew-692gr|\
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh
> b/target/linux/ramips/base-files/lib/ramips.sh
> index 5cafd45..b6d1023 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -367,6 +367,9 @@ ramips_board_detect() {
>         *"WIZARD 8800")
>                 name="wizard8800"
>                 ;;
> +       *"WIZnet WizFi630A")
> +               name="wizfi630a"
> +               ;;

I don't see any reason here to use whole name of the device, including
manufacturer name (WIZnet WizFi630A) - there are no other similar
models on the list and as you can see we use here *"..." pattern.
Please, follow the general convention in this file and use only
board/model (WizFi630A) name and keep boards in alphabetical order.

>         *"WL-330N")
>                 name="wl-330n"
>                 ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 53e7070..947a328 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -107,6 +107,7 @@ platform_check_image() {
>         whr-300hp2|\
>         whr-600d|\
>         whr-g300n|\
> +       wizfi630a |\

Please, follow the general convention in this file and use "|\"
instead of " |\".

>         wl-330n|\
>         wl-330n3g|\
>         wl-341v3|\
> diff --git a/target/linux/ramips/dts/WIZFI630A.dts
> b/target/linux/ramips/dts/WIZFI630A.dts
> new file mode 100644
> index 0000000..0d44c71
> --- /dev/null
> +++ b/target/linux/ramips/dts/WIZFI630A.dts
> @@ -0,0 +1,294 @@
>
> +/dts-v1/;
> +
> +/include/ "rt5350.dtsi"
> +
> +/ {
> +       compatible = "wizfi630a", "ralink,rt5350-soc";
> +       model = "WIZnet WizFi630A";
> +
> +       chosen {
> +               bootargs = "console=ttyS1,115200";
> +       };
> +
> +       palmbus at 10000000 {
> +               gpio1: gpio at 660 {
> +                       status = "okay";
> +               };
> +
> +               spi at b00 {
> +                       status = "okay";
> +
> +                       m25p80 at 0 {
> +                               #address-cells = <1>;
> +                               #size-cells = <1>;
> +                               compatible = "w25q128";
> +                               reg = <0>;
> +                               linux,modalias = "m25p80", "w25q128";
> +                               spi-max-frequency = <10000000>;
> +
> +                               partition at 0 {
> +                                       label = "uboot";
> +                                       reg = <0x0 0x30000>;
> +                                       read-only;
> +                               };
> +
> +                               partition at 30000 {
> +                                       label = "uboot-env";
> +                                       reg = <0x30000 0x10000>;
> +                                       read-only;
> +                               };
> +
> +                               factory: partition at 40000 {
> +                                       label = "factory";
> +                                       reg = <0x40000 0x10000>;
> +                                       read-only;
> +                               };
> +
> +                               partition at 50000 {
> +                                       label = "firmware";
> +                                       reg = <0x50000 0xfb0000>;
> +                               };
> +                       };
> +               };
> +
> +               uart at 500 {
> +                       compatible = "ralink,mt7620a-uart",
> "ralink,rt2880-uart", "ns16550a";
> +                       reg = <0x500 0x100>;
> +
> +                       resets = <&rstctrl 12>;
> +                       reset-names = "uart";
> +
> +                       interrupt-parent = <&intc>;
> +                       interrupts = <5>;
> +
> +                       reg-shift = <2>;
> +
> +                       status = "okay";

Are these empty lines really needed here?

> +               };
> +
> +

Keep only one empty line here, please.

> +               uartlite at c00 {
> +                       compatible = "ralink,mt7620a-uart",
> "ralink,rt2880-uart", "ns16550a";
> +                       reg = <0xc00 0x100>;
> +
> +                       resets = <&rstctrl 19>;
> +                       reset-names = "uartl";
> +
> +                       interrupt-parent = <&intc>;
> +                       interrupts = <12>;
> +
> +                       reg-shift = <2>;
> +
> +                       pinctrl-names = "default";
> +                       pinctrl-0 = <&uartlite_pins>;

Are these empty lines really needed here too?

> +               };
> +       };
> +
> +       pinctrl {
> +               state_default: pinctrl0 {
> +                       gpio {
> +                               ralink,group = "i2c", "jtag" ;
> +                               ralink,function = "gpio";
> +                       };
> +               };
> +
> +               uartf_gpio_pins: uartf_gpio {
> +                       uartf_gpio {
> +                               ralink,group = "uartf";
> +                               ralink,function = "uartf";
>
> +                       };
> +               };
> +
> +               uartlite_pins: uartlite {
> +                       uart {
> +                               ralink,group = "uartlite";
> +                               ralink,function = "uartlite";
> +                       };
> +               };
> +       };
> +
> +       ethernet at 10100000 {
> +               mtd-mac-address = <&factory 0x4>;
> +       };
> +
> +       esw at 10110000 {
> +               ralink,portmap = <0x17>;
> +       };
> +
> +       wmac at 10180000 {
> +               ralink,mtd-eeprom = <&factory 0>;
> +       };
> +
> +       ehci at 101c0000 {
> +               status = "okay";
> +       };
> +
> +       ohci at 101c1000 {
> +               status = "okay";
> +       };
> +
> +       gpio-export {
>
> +               compatible = "gpio-export";
> +               #size-cells = <0>;

Empty line here, please.

> +/*
> +               gpio22 {
> +                       // WAN +                        gpio-export,name =
> "gpio22";

This line looks broken (missing new line after comment line).

> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio1 0 0>; // path lfd dir
> +               };

Empty line here, please.

> +               gpio23 {
> +                       // LAN1 +                       gpio-export,name =
> "gpio23";

This line looks broken (missing new line after comment line).

> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio1 1 0>;
> +               };

Empty line here, please.

> +               gpio24 {
> +                       // LAN2 +                       gpio-export,name =
> "gpio24";

This line looks broken (missing new line after comment line).

> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio1 2 0>;
> +               };
> +
> +               // UARTF - UART1 +              gpio7 {

This line looks broken (missing new line after comment line).

> +                       // UARTF_RTS_N - HW Pin 6
> +                       gpio-export,name = "gpio7";
> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 7 0>;
> +               };

Empty line here, please.

> +               gpio8 {
> +                       // UARTF_TXD - HW Pin 10 +
> gpio-export,name = "gpio8";

This line looks broken (missing new line after comment line).

> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 8 0>;
> +               };

Empty line here, please.

> +               gpio9 {
> +                       // UARTF_CTS_N - HW Pin 5
> +                       gpio-export,name = "gpio9";
> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 9 0>;
> +               };

Empty line here, please.

> +               gpio10 {
> +                       // UARTF_RXD - HW Pin 9
> +                       gpio-export,name = "gpio10";
> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 10 0>;
> +               };

Empty line here, please.

> +               gpio11 {
> +                       // UARTF_DTR_N - HW Pin 8
> +                       gpio-export,name = "gpio11";
> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 11 0>;
> +               };

Empty line here, please.

> +               gpio12 {
> +                       // UARTF_DCD_N - HW Pin 12 +
> gpio-export,name = "gpio12";

This line looks broken (missing new line).

> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 12 0>;
> +               };

Empty line here, please.

> +               gpio13 {
> +                       // UARTF_DSR_N - HW Pin 11
> +                       gpio-export,name = "gpio13";
> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 13 0>;
> +               };

Empty line here, please.

> +               gpio14 {
> +                       // UARTF_RIN - HW Pin 7 +
> gpio-export,name = "gpio14";

This line looks broken (missing new line after comment line).

> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 14 0>;
> +               };
> +
> +               // UARTLITE - UART2 +           gpio15 {

This line looks broken (missing new line after comment line).

> +                       // UART2_TXD  - HW Pin 20 +
> gpio-export,name = "gpio15";

This line looks broken (missing new line after comment line).

> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 15 0>;
> +               };

Empty line here, please.

> +               gpio16 {
> +                       // UART2_RXD  - HW Pin 18 +
> gpio-export,name = "gpio16";

This line looks broken (missing new line after comment line).

> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 16 0>;
> +               };
> +

Move this empty line...

> +*/

... here, please.

> +/*
> +               // If you want to use this comment out the corrosponding
> gpio-keys-polled
> +               gpio0 {
> +                       // wps btn
> +                       gpio-export,name = "gpio0";
> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 0 1>;
> +               };
> +*/
> +
> +               gpio19 {
> +                       // SCM1
> +                       gpio-export,name = "gpio19";
> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 19 1>;
> +               };

Empty line here, please.

> +               gpio2 {
> +                       // SCM2
> +                       gpio-export,name = "gpio2";
> +                       gpio-export,direction_may_change = <1>;
> +                       gpios = <&gpio0 2 1>;
> +               };
> +

This empty line is unnecessary here.

> +       };
> +
> +       gpio-leds {
> +               compatible = "gpio-leds";

Empty line here, please.

> +               run {
> +                       label = "wizfi630a::run";
> +                       gpios = <&gpio0 1 1>;
> +               };

Empty line here, please.

> +               uart1 {
> +                       label = "wizfi630a::uart1";
> +                       gpios = <&gpio0 18 1>;
> +               };

Empty line here, please.

> +               uart2 {
> +                       label = "wizfi630a::uart2";
> +                       gpios = <&gpio0 21 1>;
> +               };

Empty line here, please.

> +               wps {
> +                       label = "wizfi630a::wps";
> +                       gpios = <&gpio0 20 1>;
> +               };
> +       };
> +
> +       gpio-keys-polled {
>
> +               compatible = "gpio-keys-polled";
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               poll-interval = <20>;

Empty line here, please.

> +               reset {
> +                       label = "reset";
> +                       gpios = <&gpio0 17 1>;
> +                       linux,code = <0x198>;
> +               };
> +
> +               wps {
> +                       label = "wps";
> +                       gpios = <&gpio0 0 1>;
> +                       linux,code = <0x211>;
> +               };

Empty line here, please.

> +/*
> +               // If you want to use this comment out the corrosponding
> export
> +               scm1 {
> +                       label = "SCM1";
> +                       gpios = <&gpio0 19 1>;
> +                       linux,code = <0x100>;
> +               };
> +
> +               scm2 {
> +                       label = "SCM2";
> +                       gpios = <&gpio0 2 1>;
> +                       linux,code = <0x101>;
> +               };
> +*/
> +       };
> +};
> diff --git a/target/linux/ramips/image/Makefile
> b/target/linux/ramips/image/Makefile
> index 2f4d4cb..ac2e83c 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -608,7 +608,6 @@ Image/Build/Profile/W502U=$(call
> BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
>   Image/Build/Profile/WCR150GN=$(call
> BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
>  -
>  Image/Build/Profile/MZK-DP150N=$(call
> BuildFirmware/Default4M/$(1),$(1),mzk-dp150n,MZK-DP150N)
>   buffalo_whrg300n_mtd_size=3801088
> @@ -631,6 +630,8 @@ Image/Build/Profile/WHRG300N=$(call
> BuildFirmware/WHRG300N/$(1),$(1))
>   Image/Build/Profile/WIZARD8800=$(call
> BuildFirmware/Default8M/$(1),$(1),wizard-8800,WIZARD8800,Linux Kernel Image)
>  +Image/Build/Profile/WIZFI630A=$(call
> BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
> +
>  Image/Build/Profile/WL-330N=$(call
> BuildFirmware/Default4M/$(1),$(1),wl-330n,WL-330N)
>   Image/Build/Profile/WL-330N3G=$(call
> BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL-330N3G)
> @@ -763,6 +764,7 @@ define Image/Build/Profile/Default
>         $(call Image/Build/Profile/WCR150GN,$(1))
>         $(call Image/Build/Profile/WHRG300N,$(1))
>         $(call Image/Build/Profile/WIZARD8800,$(1))
> +       $(call Image/Build/Profile/WIZFI630A,$(1))
>         $(call Image/Build/Profile/WL-330N,$(1))
>         $(call Image/Build/Profile/WL-330N3G,$(1))
>         $(call Image/Build/Profile/WL-341V3,$(1))
> diff --git a/target/linux/ramips/rt305x/profiles/wizfi630a.mk
> b/target/linux/ramips/rt305x/profiles/wizfi630a.mk

This filename is wrong, please follow the general convention and:
- keep all boards from same manufacturer in file "manufacturer.mk" (in
this case: wiznet.mk)
- keep all profiles inside this file in alphabetical order
- follow the general structure, see below

> new file mode 100644
> index 0000000..2d2c001
> --- /dev/null
> +++ b/target/linux/ramips/rt305x/profiles/wizfi630a.mk
> @@ -0,0 +1,18 @@
> +#
> +# Copyright (C) 2014 OpenWrt.org

Shouldn't it be 2015? :)

> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/WIZFI630A
> +       NAME:=WIZnet WizFi630A
> +       PACKAGES:=\
> +               kmod-usb2 +endef
>
> +
> +define Profile/WIZFI630A/Description
> +       Package set for WIZnet WizFi630A board
> +endef
> +

This empty line is unnecessary here.
Please, see other *.mk profile files structure.

> +$(eval $(call Profile,WIZFI630A))
> --
> 1.7.10.4
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 05:49:07 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 11:49:07 +0200
Subject: [OpenWrt-Devel] [PATCH 1/2] include: add a new ubinize-image
 build target
In-Reply-To: <1440120867-11871-1-git-send-email-mathieu@codeaurora.org>
References: <1440120867-11871-1-git-send-email-mathieu@codeaurora.org>
Message-ID: <CAOiHx=m-k9An7oOxa29wKBsW+FbPMPB2yS8S-ODjAy=fs81FeA@mail.gmail.com>

On Fri, Aug 21, 2015 at 3:34 AM, Mathieu Olivari <mathieu at codeaurora.org> wrote:
> This new build target can be used to generate a ubinized.bin file,
> including the kernel and the FS specified as an argument.
>
> Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>

I have a slightly different approach in my queue that uses
scripts/ubinize-image.sh which allows using per device block- and
pagesizes, and control whether the kernel should be included on a per
device basis. E.g. the Netgear R7500 has the kernel raw on the flash,
so the kernel should not be included there. I plan to push it today,
if that approach is okay with you.

I also have a buildstep for wrapping the ubi in a itb file so
qsdk-sysupgrade accepts it, but when I did this it seemed to flashed
correctly, and u-boot was able to load the kenrel, but openwrt then
failed to mount the on flash ubi. Unfortunately I forgot to backup the
original firmware, so I will need to free up some space for qsdk to
reproduce it. Sysupgrade from within OpenWrt is working fine though.


Jonas

> ---
>  include/image.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/include/image.mk b/include/image.mk
> index 73fc805..f98d871 100644
> --- a/include/image.mk
> +++ b/include/image.mk
> @@ -380,6 +380,12 @@ define Build/combined-image
>         @mv $@.new $@
>  endef
>
> +define Build/ubinize-image
> +       $(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
> +               $(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel $(word 1,$^),$(1),$(UBINIZE_OPTS)); \
> +               cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
> +endef
> +
>  define Device/Init
>    PROFILES := $(PROFILE)
>    DEVICE_NAME := $(1)
> --
> 2.1.4
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Fri Aug 21 06:44:08 2015
From: blogic at openwrt.org (John Crispin)
Date: Fri, 21 Aug 2015 12:44:08 +0200
Subject: [OpenWrt-Devel] [PATCH 1/2] include: add a new ubinize-image
 build target
In-Reply-To: <CAOiHx=m-k9An7oOxa29wKBsW+FbPMPB2yS8S-ODjAy=fs81FeA@mail.gmail.com>
References: <1440120867-11871-1-git-send-email-mathieu@codeaurora.org>
 <CAOiHx=m-k9An7oOxa29wKBsW+FbPMPB2yS8S-ODjAy=fs81FeA@mail.gmail.com>
Message-ID: <55D700F8.8090904@openwrt.org>



On 21/08/2015 11:49, Jonas Gorski wrote:
> On Fri, Aug 21, 2015 at 3:34 AM, Mathieu Olivari <mathieu at codeaurora.org> wrote:
>> This new build target can be used to generate a ubinized.bin file,
>> including the kernel and the FS specified as an argument.
>>
>> Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
> 
> I have a slightly different approach in my queue that uses
> scripts/ubinize-image.sh which allows using per device block- and
> pagesizes, and control whether the kernel should be included on a per
> device basis. E.g. the Netgear R7500 has the kernel raw on the flash,
> so the kernel should not be included there. I plan to push it today,
> if that approach is okay with you.
> 
> I also have a buildstep for wrapping the ubi in a itb file so
> qsdk-sysupgrade accepts it, but when I did this it seemed to flashed
> correctly, and u-boot was able to load the kenrel, but openwrt then
> failed to mount the on flash ubi. Unfortunately I forgot to backup the
> original firmware, so I will need to free up some space for qsdk to
> reproduce it. Sysupgrade from within OpenWrt is working fine though.
> 
> 

can you post your patches please ? i had already pulled these 2 into my
queue but am happy to drop them again in favour of a different solution

	John


> Jonas
> 
>> ---
>>  include/image.mk | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/include/image.mk b/include/image.mk
>> index 73fc805..f98d871 100644
>> --- a/include/image.mk
>> +++ b/include/image.mk
>> @@ -380,6 +380,12 @@ define Build/combined-image
>>         @mv $@.new $@
>>  endef
>>
>> +define Build/ubinize-image
>> +       $(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
>> +               $(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel $(word 1,$^),$(1),$(UBINIZE_OPTS)); \
>> +               cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
>> +endef
>> +
>>  define Device/Init
>>    PROFILES := $(PROFILE)
>>    DEVICE_NAME := $(1)
>> --
>> 2.1.4
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From john at szakmeister.net  Fri Aug 21 07:13:03 2015
From: john at szakmeister.net (John Szakmeister)
Date: Fri, 21 Aug 2015 07:13:03 -0400
Subject: [OpenWrt-Devel] Broken GCC 4.9 (and 5.2) on ARM - asking for
	review/test
In-Reply-To: <CAOiHx=ktBb5OG3134ROPPOmfPy9BpXUwQeJXurZWxGKyWB5s+A@mail.gmail.com>
References: <55D5A07C.6070707@web.de>
 <CAOiHx=ktBb5OG3134ROPPOmfPy9BpXUwQeJXurZWxGKyWB5s+A@mail.gmail.com>
Message-ID: <CAEBDL5XmyM8zeG0LuXvPzgTpnhBv-YV5DymuUcpvSqFCNhaMpQ@mail.gmail.com>

On Thu, Aug 20, 2015 at 6:57 AM, Jonas Gorski <jogo at openwrt.org> wrote:
> Hi,
>
> On Thu, Aug 20, 2015 at 11:40 AM, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
>> GCC 4.9 was marked BROKEN with r46089. Recently GCC 5.2 was added (marked as broken too)
>>
>> commit msg: " toolchain: mark gcc 4.9 as broken, it miscompiles some code especially on ARM"
>>
>> Looking through some GCC 5 serious regressions I found:
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932
>>
>> I cannot replicate the ARM issue because of missing details and I dont have ARM hw where it occurs (arch: malta seems fine)
>>  - but there was an open ticket from a dev on github regarding the boot problem, which might be a symptom of code miscompile
>>
>> https://github.com/wongsyrone/openwrt-1/issues/44
>>
>> According to his tests GCC4.9 and GCC5.2 now work with this 2 changes:
>>
>> adding -fno-ipa-sra to Kernel/CPU CFLAGS
>>
>> https://github.com/wongsyrone/openwrt-1/commit/35308f2435ec75192324d68817e7702e3b257e71
>> https://github.com/wongsyrone/openwrt-1/commit/93c0a5173414cfa7684547de3c3a1f3dc4240383
>
> Readin the bug ticket, it seems that
>
> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35775&action=diff
>
> should fix the issue at the root cause, but with the "disadvantage" of
> breaking some testcases relying on the (mis-?)behaviour, which sounds
> like the "blocker" for this change.
>
> So I wonder if adding that wouldn't be a better solution.

I don't think that's the only bug affecting ARM.  At least for us,
against an ARM11, we found that there is some other optimization that
results in broken code generation (numbers where being converted to
unsigned, and the optimization failed to convert them back to signed
correctly).  We reported it several months ago, but haven't heard
anything.  I'm not sure what else it broke, but the kernel logging was
the most noticeable.

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


From jogo at openwrt.org  Fri Aug 21 07:17:29 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:29 +0200
Subject: [OpenWrt-Devel] [PATCH 00/10] ipq806x: implement sysupgrade for
	AP148
Message-ID: <1440155859-910-1-git-send-email-jogo@openwrt.org>

This patchset adds sysupgrade support and and builds images for AP148.

This has been tested on AP148.

sysupgrade from original QSDK should work in theory, but in practice
either ubiformat or something else in QSDK writes the ubi image in a way
that makes OpenWrt fail to mount the image. U-Boot is able to read from
it.

Therefore the last two patches that create an "sysupgradeable" image are
marked as RFC.

Jonas Gorski (10):
  ipq806x: enable ubiblock support
  image: add a build step for building and appending an ubinized rootfs
  build: add a build step for generic sysupgrade nand image
  ipq806x: enable smem-parser for nand on AP148
  ipq806x: rename "rootfs" to "ubi" on nand
  ipq806x: wrap legacy image in uImage
  ipq806x: clear IMAGES for devices
  ipq806x: build images and add sysupgrade support for AP148
  image: add a build recipe to wrap an ubi image in a itb file
  ipq806x: wrap ubi in itb

 include/image.mk                                   | 25 +++++++
 scripts/mkits-ubi.sh                               | 79 ++++++++++++++++++++++
 scripts/sysupgrade-nand.sh                         | 68 +++++++++++++++++++
 .../ipq806x/base-files/lib/upgrade/platform.sh     | 18 +++++
 target/linux/ipq806x/config-3.18                   |  2 +-
 target/linux/ipq806x/config-4.1                    |  2 +-
 target/linux/ipq806x/image/Makefile                | 25 +++++--
 ...h-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch | 11 +++
 .../302-mtd-qcom-smem-rename-rootfs-ubi.patch      | 13 ++++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 ...h-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch | 11 +++
 .../302-mtd-qcom-smem-rename-rootfs-ubi.patch      | 13 ++++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 15 files changed, 268 insertions(+), 15 deletions(-)
 create mode 100755 scripts/mkits-ubi.sh
 create mode 100755 scripts/sysupgrade-nand.sh
 create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/platform.sh
 create mode 100644 target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch

-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:30 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:30 +0200
Subject: [OpenWrt-Devel] [PATCH 01/10] ipq806x: enable ubiblock support
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-2-git-send-email-jogo@openwrt.org>

To allow squashfs on ubi, enable ubiblock support in the kernel.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 target/linux/ipq806x/config-3.18 | 2 +-
 target/linux/ipq806x/config-4.1  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 3d4f8bb..7b4c2d3 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -267,7 +267,7 @@ CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
-# CONFIG_MTD_UBI_BLOCK is not set
+CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_FASTMAP is not set
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index d48943c..6fff6d2 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -274,7 +274,7 @@ CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
-# CONFIG_MTD_UBI_BLOCK is not set
+CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_FASTMAP is not set
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:31 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:31 +0200
Subject: [OpenWrt-Devel] [PATCH 02/10] image: add a build step for building
	and appending an ubinized rootfs
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-3-git-send-email-jogo@openwrt.org>

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 include/image.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 73fc805..fb89ed1 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -345,6 +345,16 @@ define Build/append-rootfs
 	dd if=$(word 2,$^) $(if $(1),bs=$(1) conv=sync) >> $@
 endef
 
+define Build/append-ubi
+	sh $(TOPDIR)/scripts/ubinize-image.sh \
+		$(if $(KERNEL_IN_UBI),--kernel $(word 1,$^)) \
+		$(word 2,$^) \
+		$@.tmp \
+		-p $(BLOCKSIZE) -m $(PAGESIZE) -E 5
+	cat $@.tmp >> $@
+	rm $@.tmp
+endef
+
 define Build/pad-to
 	dd if=$@ of=$@.new bs=$(1) conv=sync
 	mv $@.new $@
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:32 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:32 +0200
Subject: [OpenWrt-Devel] [PATCH 03/10] build: add a build step for generic
	sysupgrade nand image
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-4-git-send-email-jogo@openwrt.org>

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 include/image.mk           |  8 ++++++
 scripts/sysupgrade-nand.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)
 create mode 100755 scripts/sysupgrade-nand.sh

diff --git a/include/image.mk b/include/image.mk
index fb89ed1..8ac3593 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -390,6 +390,14 @@ define Build/combined-image
 	@mv $@.new $@
 endef
 
+define Build/sysupgrade-nand
+	sh $(TOPDIR)/scripts/sysupgrade-nand.sh \
+		--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
+		--kernel $(word 1,$^) \
+		--rootfs $(word 2,$^) \
+		$@
+endef
+
 define Device/Init
   PROFILES := $(PROFILE)
   DEVICE_NAME := $(1)
diff --git a/scripts/sysupgrade-nand.sh b/scripts/sysupgrade-nand.sh
new file mode 100755
index 0000000..92b326c
--- /dev/null
+++ b/scripts/sysupgrade-nand.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+board=""
+kernel=""
+rootfs=""
+outfile=""
+err=""
+
+while [ "$1" ]; do
+	case "$1" in
+	"--board")
+		board="$2"
+		shift
+		shift
+		continue
+		;;
+	"--kernel")
+		kernel="$2"
+		shift
+		shift
+		continue
+		;;
+	"--rootfs")
+		rootfs="$2"
+		shift
+		shift
+		continue
+		;;
+	*)
+		if [ ! "$outfile" ]; then
+			outfile=$1
+			shift
+			continue
+		fi
+		;;
+	esac
+done
+
+if [ ! -n "$board" -o ! -r "$kernel" -a  ! -r "$rootfs" -o ! "$outfile" ]; then
+	echo "syntax: $0 [--board boardname] [--kernel kernelimage] [--rootfs rootfs] out"
+	exit 1
+fi
+
+tmpdir="$( mktemp -d 2> /dev/null )"
+if [ -z "$tmpdir" ]; then
+	# try OSX signature
+	tmpdir="$( mktemp -t 'ubitmp' -d )"
+fi
+
+if [ -z "$tmpdir" ]; then
+	exit 1
+fi
+
+mkdir -p "${tmpdir}/sysupgrade-${board}"
+echo "BOARD=${board}" > "${tmpdir}/sysupgrade-${board}/CONTROL"
+[ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
+[ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel"
+
+(cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board})
+err="$?"
+if [ -e "$tmpdir/sysupgrade.tar" ]; then
+	cp "$tmpdir/sysupgrade.tar" "$outfile"
+else
+	err=2
+fi
+rm -rf "$tmpdir"
+
+exit $err
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:33 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:33 +0200
Subject: [OpenWrt-Devel] [PATCH 04/10] ipq806x: enable smem-parser for nand
	on AP148
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-5-git-send-email-jogo@openwrt.org>

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 .../166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch    | 11 +++++++++++
 .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch      |  6 +++---
 ...708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 .../166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch    | 11 +++++++++++
 .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch      |  6 +++---
 ...708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 6 files changed, 30 insertions(+), 8 deletions(-)
 create mode 100644 target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch

diff --git a/target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch b/target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
new file mode 100644
index 0000000..cae7f15
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
@@ -0,0 +1,11 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -181,6 +181,8 @@
+ 
+ 			nand-ecc-strength = <4>;
+ 			nand-bus-width = <8>;
++
++			linux,part-probe = "qcom-smem";
+ 		};
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index a4a6a60..fe28942 100644
--- a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,9 +38,9 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -182,6 +192,34 @@
- 			nand-ecc-strength = <4>;
- 			nand-bus-width = <8>;
+@@ -184,6 +194,34 @@
+ 
+ 			linux,part-probe = "qcom-smem";
  		};
 +
 +		mdio0: mdio {
diff --git a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index fda1b86..3455d45 100644
--- a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -220,6 +230,27 @@
+@@ -222,6 +232,27 @@
  				reg = <4>;
  			};
  		};
diff --git a/target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch b/target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
new file mode 100644
index 0000000..16df418
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
@@ -0,0 +1,11 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -154,6 +154,8 @@
+ 
+ 			nand-ecc-strength = <4>;
+ 			nand-bus-width = <8>;
++
++			linux,part-probe = "qcom-smem";
+ 		};
+ 	};
+ };
diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 394f378..0e2b305 100644
--- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,9 +38,9 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -155,6 +165,34 @@
- 			nand-ecc-strength = <4>;
- 			nand-bus-width = <8>;
+@@ -157,6 +167,34 @@
+ 
+ 			linux,part-probe = "qcom-smem";
  		};
 +
 +		mdio0: mdio {
diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 9b7eacb..0918634 100644
--- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
  		};
  
  		gsbi at 16300000 {
-@@ -193,6 +203,27 @@
+@@ -195,6 +205,27 @@
  				reg = <4>;
  			};
  		};
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:34 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:34 +0200
Subject: [OpenWrt-Devel] [PATCH 05/10] ipq806x: rename "rootfs" to "ubi" on
	nand
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-6-git-send-email-jogo@openwrt.org>

OpenWrt expects the ubi paritition to be named "ubi", not "rootfs".

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 .../patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch  | 13 +++++++++++++
 .../patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch   | 13 +++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch

diff --git a/target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch b/target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch
new file mode 100644
index 0000000..471a87b
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch
@@ -0,0 +1,13 @@
+--- a/drivers/mtd/qcom_smem_part.c
++++ b/drivers/mtd/qcom_smem_part.c
+@@ -192,6 +192,10 @@ static int parse_qcom_smem_partitions(st
+ 		m_part->size = le32_to_cpu(s_part->size) * (*smem_blksz);
+ 		m_part->offset = le32_to_cpu(s_part->start) * (*smem_blksz);
+ 
++		/* "rootfs" conflicts with OpenWrt auto mounting */
++		if (mtd_type_is_nand(master) && !strcmp(m_part->name, "rootfs"))
++			m_part->name = "ubi";
++
+ 		/*
+ 		 * The last SMEM partition may have its size marked as
+ 		 * something like 0xffffffff, which means "until the end of the
diff --git a/target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch b/target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch
new file mode 100644
index 0000000..471a87b
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch
@@ -0,0 +1,13 @@
+--- a/drivers/mtd/qcom_smem_part.c
++++ b/drivers/mtd/qcom_smem_part.c
+@@ -192,6 +192,10 @@ static int parse_qcom_smem_partitions(st
+ 		m_part->size = le32_to_cpu(s_part->size) * (*smem_blksz);
+ 		m_part->offset = le32_to_cpu(s_part->start) * (*smem_blksz);
+ 
++		/* "rootfs" conflicts with OpenWrt auto mounting */
++		if (mtd_type_is_nand(master) && !strcmp(m_part->name, "rootfs"))
++			m_part->name = "ubi";
++
+ 		/*
+ 		 * The last SMEM partition may have its size marked as
+ 		 * something like 0xffffffff, which means "until the end of the
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:35 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:35 +0200
Subject: [OpenWrt-Devel] [PATCH 06/10] ipq806x: wrap legacy image in uImage
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-7-git-send-email-jogo@openwrt.org>

Wrap the zImage in a uImage header so we can easily boot it from legacy
u-boots.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 target/linux/ipq806x/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index b64d629..2369762 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -38,8 +38,8 @@ endef
 DEVICE_VARS += DEVICE_DTS
 
 define Device/LegacyImage
-	KERNEL_SUFFIX := -zImage
-	KERNEL = kernel-bin | append-dtb
+	KERNEL_SUFFIX := -uImage
+	KERNEL = kernel-bin | append-dtb | uImage none
 	KERNEL_NAME := zImage
 	KERNEL_INSTALL := 1
 endef
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:36 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:36 +0200
Subject: [OpenWrt-Devel] [PATCH 07/10] ipq806x: clear IMAGES for devices
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-8-git-send-email-jogo@openwrt.org>

Ensure that IMAGE-less devices won't keep the IMAGES of any previous
devices.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 target/linux/ipq806x/image/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index 2369762..dad6ee3 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -34,6 +34,7 @@ define Device/Default
 	KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
 	DEVICE_DTS :=
 	KERNEL_PREFIX := $$(IMAGE_PREFIX)
+	IMAGES :=
 endef
 DEVICE_VARS += DEVICE_DTS
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:37 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:37 +0200
Subject: [OpenWrt-Devel] [PATCH 08/10] ipq806x: build images and add
	sysupgrade support for AP148
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-9-git-send-email-jogo@openwrt.org>

Add full ubi and sysupgrade images for AP148 and add sysupgrade support
for ipq806x to allow updating the current installation.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 .../linux/ipq806x/base-files/lib/upgrade/platform.sh | 18 ++++++++++++++++++
 target/linux/ipq806x/image/Makefile                  | 20 +++++++++++++++++---
 2 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/platform.sh

diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000..e834ead
--- /dev/null
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,18 @@
+. /lib/ipq806x.sh
+
+PART_NAME=firmware
+
+platform_check_image() {
+	local board=$(ipq806x_board_name)
+
+	case "$board" in
+	AP148)
+		nand_do_platform_check $board $1
+		return $?;
+		;;
+	*)
+		return 1;
+	esac
+}
+
+# use default for platform_do_upgrade()
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index dad6ee3..ac0fc84 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -35,36 +35,50 @@ define Device/Default
 	DEVICE_DTS :=
 	KERNEL_PREFIX := $$(IMAGE_PREFIX)
 	IMAGES :=
+	KERNEL_IN_UBI :=
 endef
-DEVICE_VARS += DEVICE_DTS
+DEVICE_VARS += DEVICE_DTS KERNEL_IN_UBI
 
 define Device/LegacyImage
 	KERNEL_SUFFIX := -uImage
 	KERNEL = kernel-bin | append-dtb | uImage none
 	KERNEL_NAME := zImage
-	KERNEL_INSTALL := 1
 endef
 
 define Device/FitImage
 	KERNEL_SUFFIX := -fit-uImage.itb
 	KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
 	KERNEL_NAME := Image
-	KERNEL_INSTALL := 1
+endef
+
+define Device/UbiFit
+	KERNEL_IN_UBI := 1
+	IMAGES := nand-factory.ubi nand-sysupgrade.tar
+	IMAGE/nand-factory.ubi := append-ubi
+	IMAGE/nand-sysupgrade.tar := sysupgrade-nand
 endef
 
 define Device/AP148
 	$(call Device/FitImage)
+	$(call Device/UbiFit)
 	DEVICE_DTS := qcom-ipq8064-ap148
+	BLOCKSIZE := 128KiB
+	PAGESIZE := 2048
 endef
 
 define Device/AP148-legacy
 	$(call Device/LegacyImage)
+	$(call Device/UbiFit)
 	DEVICE_DTS := qcom-ipq8064-ap148
+	BLOCKSIZE := 128KiB
+	PAGESIZE := 2048
+	BOARD_NAME := AP148
 endef
 
 define Device/DB149
 	$(call Device/FitImage)
 	DEVICE_DTS := qcom-ipq8064-db149
+	KERNEL_INSTALL := 1
 endef
 
 TARGET_DEVICES += AP148 AP148-legacy DB149
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:38 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:38 +0200
Subject: [OpenWrt-Devel] [PATCH RFC 09/10] image: add a build recipe to wrap
	an ubi image in a itb file
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-10-git-send-email-jogo@openwrt.org>

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 include/image.mk     |  7 +++++
 scripts/mkits-ubi.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+)
 create mode 100755 scripts/mkits-ubi.sh

diff --git a/include/image.mk b/include/image.mk
index 8ac3593..261cbb2 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -318,6 +318,13 @@ define Build/fit
 	@mv $@.new $@
 endef
 
+define Build/ubi-fit
+	$(TOPDIR)/scripts/mkits-ubi.sh \
+		-D $(DEVICE_NAME) -o $@.its -u $@ -A $(ARCH)
+	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+	@mv $@.new $@
+endef
+
 define Build/lzma
 	$(STAGING_DIR_HOST)/bin/lzma e $@ -lc1 -lp2 -pb2 $(1) $@.new
 	@mv $@.new $@
diff --git a/scripts/mkits-ubi.sh b/scripts/mkits-ubi.sh
new file mode 100755
index 0000000..e84a3fa
--- /dev/null
+++ b/scripts/mkits-ubi.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+#
+# Licensed under the terms of the GNU GPL License version 2 or later.
+#
+# Author: Peter Tyser <ptyser at xes-inc.com>
+#
+# U-Boot firmware supports the booting of images in the Flattened Image
+# Tree (FIT) format.  The FIT format uses a device tree structure to
+# describe a kernel image, device tree blob, ramdisk, etc.  This script
+# creates an Image Tree Source (.its file) which can be passed to the
+# 'mkimage' utility to generate an Image Tree Blob (.itb file).  The .itb
+# file can then be booted by U-Boot (or other bootloaders which support
+# FIT images).  See doc/uImage.FIT/howto.txt in U-Boot source code for
+# additional information on FIT images.
+#
+
+usage() {
+	echo "Usage: `basename $0` -A arch -D name -u ubi -o its_file"
+	echo -e "\t-A ==> set architecture to 'arch'"
+	echo -e "\t-u ==> include ubi image 'kernel'"
+	echo -e "\t-D ==> human friendly UBI 'name'"
+	echo -e "\t-o ==> create output file 'its_file'"
+	exit 1
+}
+
+while getopts ":A:D:o:u:v:" OPTION
+do
+	case $OPTION in
+		A ) ARCH=$OPTARG;;
+		D ) DEVICE=$OPTARG;;
+		u ) UBI=$OPTARG;;
+		o ) OUTPUT=$OPTARG;;
+		* ) echo "Invalid option passed to '$0' (options:$@)"
+		usage;;
+	esac
+done
+
+# Make sure user entered all required parameters
+if [ -z "${ARCH}" ] || [ -z "${UBI}" ] || [ -z "${OUTPUT}" ]; then
+	usage
+fi
+
+ARCH_UPPER=`echo $ARCH | tr '[:lower:]' '[:upper:]'`
+
+# Create a default, fully populated DTS file
+DATA="/dts-v1/;
+
+/ {
+	description = \"${ARCH_UPPER} OpenWrt FIT (Flattened Image Tree)\";
+	#address-cells = <1>;
+
+	images {
+		ubi at 1 {
+			description = \"${ARCH_UPPER} OpenWrt ${DEVICE} ubi rootfs\";
+			data = /incbin/(\"${UBI}\");
+			type = \"firmware\";
+			arch = \"${ARCH}\";
+			compression = \"none\";
+			hash at 1 {
+				algo = \"crc32\";
+			};
+			hash at 2 {
+				algo = \"sha1\";
+			};
+		};
+
+	};
+
+	configurations {
+		default = \"config at 1\";
+		config at 1 {
+			description = \"OpenWrt\";
+			ubi = \"ubi at 1\";
+		};
+	};
+};"
+
+# Write .its file to disk
+echo "$DATA" > ${OUTPUT}
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:17:39 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:17:39 +0200
Subject: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb
In-Reply-To: <1440155859-910-1-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440155859-910-11-git-send-email-jogo@openwrt.org>

The stock QSDK expects the ubi to be wrapped in an itb image, so
provide one for easy sysupgrade from QSDK.

FIXME: currently does not work? Seems to flash fine, but ubi cannot
be mounted by OpenWrt and needs to be flashed a second time.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 target/linux/ipq806x/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index ac0fc84..2fdaab5 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -53,8 +53,8 @@ endef
 
 define Device/UbiFit
 	KERNEL_IN_UBI := 1
-	IMAGES := nand-factory.ubi nand-sysupgrade.tar
-	IMAGE/nand-factory.ubi := append-ubi
+	IMAGES := nand-factory.itb nand-sysupgrade.tar
+	IMAGE/nand-factory.itb := append-ubi | ubi-fit
 	IMAGE/nand-sysupgrade.tar := sysupgrade-nand
 endef
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Fri Aug 21 07:24:55 2015
From: blogic at openwrt.org (John Crispin)
Date: Fri, 21 Aug 2015 13:24:55 +0200
Subject: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb
In-Reply-To: <1440155859-910-11-git-send-email-jogo@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
 <1440155859-910-11-git-send-email-jogo@openwrt.org>
Message-ID: <55D70A87.9020405@openwrt.org>



On 21/08/2015 13:17, Jonas Gorski wrote:
> The stock QSDK expects the ubi to be wrapped in an itb image, so
> provide one for easy sysupgrade from QSDK.
> 
> FIXME: currently does not work? Seems to flash fine, but ubi cannot
> be mounted by OpenWrt and needs to be flashed a second time.

how do you flash it the second time ? using the same process ?

> 
> Signed-off-by: Jonas Gorski <jogo at openwrt.org>
> ---
>  target/linux/ipq806x/image/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
> index ac0fc84..2fdaab5 100644
> --- a/target/linux/ipq806x/image/Makefile
> +++ b/target/linux/ipq806x/image/Makefile
> @@ -53,8 +53,8 @@ endef
>  
>  define Device/UbiFit
>  	KERNEL_IN_UBI := 1
> -	IMAGES := nand-factory.ubi nand-sysupgrade.tar
> -	IMAGE/nand-factory.ubi := append-ubi
> +	IMAGES := nand-factory.itb nand-sysupgrade.tar
> +	IMAGE/nand-factory.itb := append-ubi | ubi-fit
>  	IMAGE/nand-sysupgrade.tar := sysupgrade-nand
>  endef
>  
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:28:13 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:28:13 +0200
Subject: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb
In-Reply-To: <55D70A87.9020405@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
 <1440155859-910-11-git-send-email-jogo@openwrt.org>
 <55D70A87.9020405@openwrt.org>
Message-ID: <55D70B4D.3040505@openwrt.org>

On 21.08.2015 13:24, John Crispin wrote:
> 
> 
> On 21/08/2015 13:17, Jonas Gorski wrote:
>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>> provide one for easy sysupgrade from QSDK.
>>
>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>> be mounted by OpenWrt and needs to be flashed a second time.
> 
> how do you flash it the second time ? using the same process ?

Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which didn't seem to differ from what the preinstalled QSDK did, but somehow works.

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


From blogic at openwrt.org  Fri Aug 21 07:39:57 2015
From: blogic at openwrt.org (John Crispin)
Date: Fri, 21 Aug 2015 13:39:57 +0200
Subject: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb
In-Reply-To: <55D70B4D.3040505@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
 <1440155859-910-11-git-send-email-jogo@openwrt.org>
 <55D70A87.9020405@openwrt.org> <55D70B4D.3040505@openwrt.org>
Message-ID: <55D70E0D.2080008@openwrt.org>



On 21/08/2015 13:28, Jonas Gorski wrote:
> On 21.08.2015 13:24, John Crispin wrote:
>>
>>
>> On 21/08/2015 13:17, Jonas Gorski wrote:
>>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>>> provide one for easy sysupgrade from QSDK.
>>>
>>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>>> be mounted by OpenWrt and needs to be flashed a second time.
>>
>> how do you flash it the second time ? using the same process ?
> 
> Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which didn't seem to differ from what the preinstalled QSDK did, but somehow works.
> 
> Jonas
> 

does sysupgrade work from owrt->owrt ?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:43:19 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:43:19 +0200
Subject: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb
In-Reply-To: <55D70E0D.2080008@openwrt.org>
References: <1440155859-910-1-git-send-email-jogo@openwrt.org>
 <1440155859-910-11-git-send-email-jogo@openwrt.org>
 <55D70A87.9020405@openwrt.org> <55D70B4D.3040505@openwrt.org>
 <55D70E0D.2080008@openwrt.org>
Message-ID: <55D70ED7.7050602@openwrt.org>

On 21.08.2015 13:39, John Crispin wrote:
> 
> 
> On 21/08/2015 13:28, Jonas Gorski wrote:
>> On 21.08.2015 13:24, John Crispin wrote:
>>>
>>>
>>> On 21/08/2015 13:17, Jonas Gorski wrote:
>>>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>>>> provide one for easy sysupgrade from QSDK.
>>>>
>>>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>>>> be mounted by OpenWrt and needs to be flashed a second time.
>>>
>>> how do you flash it the second time ? using the same process ?
>>
>> Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which didn't seem to differ from what the preinstalled QSDK did, but somehow works.
>>
>> Jonas
>>
> 
> does sysupgrade work from owrt->owrt ?

Yes, even without the last two patches. The last two are only for "easy" sysupgrade from QSDK (in theory). Therefore also as RFC.


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


From jogo at openwrt.org  Fri Aug 21 07:45:14 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:45:14 +0200
Subject: [OpenWrt-Devel] [PATCH 0/7] ipq806x: add support for Netgear
	Nighthawk X4 R7500
Message-ID: <1440157521-525-1-git-send-email-jogo@openwrt.org>

This patchset adds support for the Netgear Nighthawk X4 R7500.

This patchset depends on patches 1 to 8 from "ipq806x: implement
sysupgrade for AP148".

Most things are working, except for the following:

* One of the usb ports is non functional. This is also the case on AP148,
  so likely driver related.
* 5 GHz wifi is not available. This uses a Quantenna wifi for 5 GHz, for
  which there is no driver in mainline linux or OpenWrt.

What does work is:

* Flashing from original webui using the factory image
* Sysupgrading from within OpenWrt.
* Using the 2.4 GHz wifi.
* Using the working usb port.

Untested is:

* Using the esata port.

Special shout-out to Delta Networks for thinking having both kernel and
a squashfs rootfs raw on NAND flash is a good idea, without *any* wear
leveling or even working bad block handling.

Luckily we can make u-boot think the rootfs has a length of 0, so it's
only the kernel that is affected.



Jonas Gorski (7):
  ar71xx: rename NETGEAR_ variables to their netgear names
  image: move netgear-image to top and rename to -dni
  image: allow exactly KERNEL_SIZE sized kernels
  ipq806x: add support for retrieving macs from mtd
  base-files: allow setting ide-disk led trigger
  ipq806x: enable ide led trigger
  ipq806x: add support for Netgear Nighthawk X4 R7500

 include/image.mk                                   |  13 +-
 .../base-files/files/lib/functions/uci-defaults.sh |  16 +
 target/linux/ar71xx/image/Makefile                 |  31 +-
 .../linux/ipq806x/base-files/etc/uci-defaults/leds |  26 ++
 .../ipq806x/base-files/etc/uci-defaults/network    |   3 +-
 target/linux/ipq806x/base-files/lib/ipq806x.sh     |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh     |   3 +-
 target/linux/ipq806x/config-3.18                   |   1 +
 target/linux/ipq806x/config-4.1                    |   1 +
 target/linux/ipq806x/image/Makefile                |  40 ++-
 ...dd-Netgear-Nighthawk-X4-R7500-device-tree.patch | 387 +++++++++++++++++++++
 ...orm-add-support-for-retreiving-mac-from-m.patch |  35 ++
 ...dd-Netgear-Nighthawk-X4-R7500-device-tree.patch | 387 +++++++++++++++++++++
 ...orm-add-support-for-retreiving-mac-from-m.patch |  35 ++
 target/linux/ipq806x/profiles/netgear.mk           |  20 ++
 15 files changed, 976 insertions(+), 25 deletions(-)
 create mode 100644 target/linux/ipq806x/base-files/etc/uci-defaults/leds
 create mode 100644 target/linux/ipq806x/patches-3.18/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
 create mode 100644 target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
 create mode 100644 target/linux/ipq806x/profiles/netgear.mk

-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:45:15 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:45:15 +0200
Subject: [OpenWrt-Devel] [PATCH 1/7] ar71xx: rename NETGEAR_ variables to
	their netgear names
In-Reply-To: <1440157521-525-1-git-send-email-jogo@openwrt.org>
References: <1440157521-525-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440157521-525-2-git-send-email-jogo@openwrt.org>

Netgear names them BOARD_ID and HW_ID, so we should do the same.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 target/linux/ar71xx/image/Makefile | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 8f609de..04597f2 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -14,7 +14,7 @@ IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
 
 KERNEL_LOADADDR = 0x80060000
 
-DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD NETGEAR_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
+DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
 
 define Build/netgear-squashfs
 	rm -rf $@.fs $@.squashfs
@@ -39,8 +39,8 @@ endef
 
 define Build/netgear-image
 	$(STAGING_DIR_HOST)/bin/mkdniimg \
-		-B $(NETGEAR_BOARD) -v OpenWrt.$(REVISION) \
-		$(if $(NETGEAR_ID),-H $(NETGEAR_ID)) \
+		-B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \
+		$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
 		-r "$(1)" \
 		-i $@ -o $@.new
 	mv $@.new $@
@@ -191,7 +191,7 @@ TARGET_DEVICES += carambola2
 define Device/wndr3700
   BOARDNAME = WNDR3700
   NETGEAR_KERNEL_MAGIC = 0x33373030
-  NETGEAR_BOARD = WNDR3700
+  NETGEAR_BOARD_ID = WNDR3700
   IMAGE_SIZE = 7680k
   MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
   IMAGES := sysupgrade.bin factory.img factory-NA.img
@@ -204,9 +204,9 @@ endef
 
 define Device/wndr3700v2
 $(Device/wndr3700)
-  NETGEAR_BOARD = WNDR3700v2
+  NETGEAR_BOARD_ID = WNDR3700v2
   NETGEAR_KERNEL_MAGIC = 0x33373031
-  NETGEAR_ID = 29763654+16+64
+  NETGEAR_HW_ID = 29763654+16+64
   IMAGE_SIZE = 15872k
   MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro
   IMAGES := sysupgrade.bin factory.img
@@ -214,23 +214,23 @@ endef
 
 define Device/wndr3800
 $(Device/wndr3700v2)
-  NETGEAR_BOARD = WNDR3800
-  NETGEAR_ID = 29763654+16+128
+  NETGEAR_BOARD_ID = WNDR3800
+  NETGEAR_HW_ID = 29763654+16+128
 endef
 
 define Device/wndr3800ch
 $(Device/wndr3800)
-  NETGEAR_BOARD = WNDR3800CH
+  NETGEAR_BOARD_ID = WNDR3800CH
 endef
 
 define Device/wndrmac
 $(Device/wndr3700v2)
-  NETGEAR_BOARD = WNDRMAC
+  NETGEAR_BOARD_ID = WNDRMAC
 endef
 
 define Device/wndrmacv2
 $(Device/wndr3800)
-  NETGEAR_BOARD = WNDRMACv2
+  NETGEAR_BOARD_ID = WNDRMACv2
 endef
 
 TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:45:16 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:45:16 +0200
Subject: [OpenWrt-Devel] [PATCH 2/7] image: move netgear-image to top and
	rename to -dni
In-Reply-To: <1440157521-525-1-git-send-email-jogo@openwrt.org>
References: <1440157521-525-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440157521-525-3-git-send-email-jogo@openwrt.org>

Use the same naming as netgear-chk.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 include/image.mk                   |  9 +++++++++
 target/linux/ar71xx/image/Makefile | 13 ++-----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 261cbb2..d4ebdef 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -308,6 +308,15 @@ define Build/netgear-chk
 	mv $@.new $@
 endef
 
+define Build/netgear-dni
+	$(STAGING_DIR_HOST)/bin/mkdniimg \
+		-B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \
+		$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
+		-r "$(1)" \
+		-i $@ -o $@.new
+	mv $@.new $@
+endef
+
 define Build/fit
 	$(TOPDIR)/scripts/mkits.sh \
 		-D $(DEVICE_NAME) -o $@.its -k $@ \
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 04597f2..e6fe36a 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -37,15 +37,6 @@ define Build/netgear-uImage
 	$(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC))
 endef
 
-define Build/netgear-image
-	$(STAGING_DIR_HOST)/bin/mkdniimg \
-		-B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \
-		$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
-		-r "$(1)" \
-		-i $@ -o $@.new
-	mv $@.new $@
-endef
-
 # combine kernel and rootfs into one image
 # -a align the rootfs start on an <align> bytes boundary
 # -j add jffs2 end-of-filesystem markers
@@ -198,8 +189,8 @@ define Device/wndr3700
   KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
   IMAGE/default = append-kernel $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
   IMAGE/sysupgrade.bin = $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
-  IMAGE/factory.img = $$(IMAGE/default) | netgear-image | check-size $$$$(IMAGE_SIZE)
-  IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-image NA | check-size $$$$(IMAGE_SIZE)
+  IMAGE/factory.img = $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
+  IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
 endef
 
 define Device/wndr3700v2
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:45:17 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:45:17 +0200
Subject: [OpenWrt-Devel] [PATCH 3/7] image: allow exactly KERNEL_SIZE sized
	kernels
In-Reply-To: <1440157521-525-1-git-send-email-jogo@openwrt.org>
References: <1440157521-525-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440157521-525-4-git-send-email-jogo@openwrt.org>

The KERNEL_SIZE should be the maximum size, inclusive, so we need to
check for greater equal, not just greater.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 include/image.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index d4ebdef..400dce8 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -392,7 +392,7 @@ define Build/pad-offset
 endef
 
 define Build/check-size
-	@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -gt "$$(stat -c%s $@)" ] || { \
+	@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
 		echo "WARNING: Image file $@ is too big" >&2; \
 		rm -f $@; \
 	}
@@ -466,7 +466,7 @@ endef
 endif
 
 define Device/Build/check_size
-	@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -gt "$$(stat -c%s $@)" ] || { \
+	@[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
 		echo "WARNING: Image file $@ is too big" >&2; \
 		rm -f $@; \
 	}
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:45:18 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:45:18 +0200
Subject: [OpenWrt-Devel] [PATCH 4/7] ipq806x: add support for retrieving
	macs from mtd
In-Reply-To: <1440157521-525-1-git-send-email-jogo@openwrt.org>
References: <1440157521-525-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440157521-525-5-git-send-email-jogo@openwrt.org>

Add support for mtd-mac-address for stmac.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 ...orm-add-support-for-retreiving-mac-from-m.patch | 35 ++++++++++++++++++++++
 ...orm-add-support-for-retreiving-mac-from-m.patch | 35 ++++++++++++++++++++++
 2 files changed, 70 insertions(+)
 create mode 100644 target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch

diff --git a/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch b/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
new file mode 100644
index 0000000..68222ce
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
@@ -0,0 +1,35 @@
+From 5bf2dabde1fa3af0c9082b42b6847ef3fd198b13 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo at openwrt.org>
+Date: Sun, 9 Aug 2015 12:53:55 +0200
+Subject: [PATCH] stmac: platform: add support for retreiving mac from mtd
+
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -284,6 +284,7 @@ static int stmmac_pltfr_probe(struct pla
+ 	struct stmmac_priv *priv = NULL;
+ 	struct plat_stmmacenet_data *plat_dat = NULL;
+ 	const char *mac = NULL;
++	u8 mtd_mac[ETH_ALEN] = { };
+ 
+ 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ 	addr = devm_ioremap_resource(dev, res);
+@@ -313,6 +314,15 @@ static int stmmac_pltfr_probe(struct pla
+ 			pr_err("%s: main dt probe failed", __func__);
+ 			return ret;
+ 		}
++
++		if (!mac) {
++			ret = of_get_mac_address_mtd(dev->of_node, &mtd_mac);
++			if (ret == -EPROBE_DEFER)
++				return ret;
++
++			if (is_valid_ether_addr(&mtd_mac))
++				mac = mtd_mac;
++		}
+ 	}
+ 
+ 	/* Custom setup (if needed) */
diff --git a/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
new file mode 100644
index 0000000..84c15c7
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
@@ -0,0 +1,35 @@
+From 5bf2dabde1fa3af0c9082b42b6847ef3fd198b13 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo at openwrt.org>
+Date: Sun, 9 Aug 2015 12:53:55 +0200
+Subject: [PATCH] stmac: platform: add support for retreiving mac from mtd
+
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -302,6 +302,7 @@ static int stmmac_pltfr_probe(struct pla
+ 	struct stmmac_priv *priv = NULL;
+ 	struct plat_stmmacenet_data *plat_dat = NULL;
+ 	const char *mac = NULL;
++	u8 mtd_mac[ETH_ALEN] = { };
+ 	int irq, wol_irq, lpi_irq;
+ 
+ 	/* Get IRQ information early to have an ability to ask for deferred
+@@ -362,6 +363,15 @@ static int stmmac_pltfr_probe(struct pla
+ 			pr_err("%s: main dt probe failed", __func__);
+ 			return ret;
+ 		}
++
++		if (!mac) {
++			ret = of_get_mac_address_mtd(dev->of_node, &mtd_mac);
++			if (ret == -EPROBE_DEFER)
++				return ret;
++
++			if (is_valid_ether_addr(&mtd_mac))
++				mac = mtd_mac;
++		}
+ 	}
+ 
+ 	/* Custom setup (if needed) */
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:45:19 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:45:19 +0200
Subject: [OpenWrt-Devel] [PATCH 5/7] base-files: allow setting ide-disk led
	trigger
In-Reply-To: <1440157521-525-1-git-send-email-jogo@openwrt.org>
References: <1440157521-525-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440157521-525-6-git-send-email-jogo@openwrt.org>

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 package/base-files/files/lib/functions/uci-defaults.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 8ba95a2..2658d43 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -178,6 +178,22 @@ EOF
 	UCIDEF_LEDS_CHANGED=1
 }
 
+ucidef_set_led_ide_disk() {
+	local cfg="led_$1"
+	local name=$2
+	local sysfs=$3
+
+	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='ide-disk'
+EOF
+	UCIDEF_LEDS_CHANGED=1
+}
+
 ucidef_set_rssimon() {
 	local dev="$1"
 	local refresh="$2"
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:45:20 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:45:20 +0200
Subject: [OpenWrt-Devel] [PATCH 6/7] ipq806x: enable ide led trigger
In-Reply-To: <1440157521-525-1-git-send-email-jogo@openwrt.org>
References: <1440157521-525-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440157521-525-7-git-send-email-jogo@openwrt.org>

To use gpio leds as ide leds, we need to enable the trigger to be
included in the kernel.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 target/linux/ipq806x/config-3.18 | 1 +
 target/linux/ipq806x/config-4.1  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 7b4c2d3..cb3dcfc 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -234,6 +234,7 @@ CONFIG_KRAITCC=y
 CONFIG_KRAIT_CLOCKS=y
 CONFIG_KRAIT_L2_ACCESSORS=y
 # CONFIG_LEDS_REGULATOR is not set
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LZO_COMPRESS=y
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index 6fff6d2..4ead455 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -241,6 +241,7 @@ CONFIG_KPSS_XCC=y
 CONFIG_KRAITCC=y
 CONFIG_KRAIT_CLOCKS=y
 CONFIG_KRAIT_L2_ACCESSORS=y
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Fri Aug 21 07:45:21 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Fri, 21 Aug 2015 13:45:21 +0200
Subject: [OpenWrt-Devel] [PATCH 7/7] ipq806x: add support for Netgear
	Nighthawk X4 R7500
In-Reply-To: <1440157521-525-1-git-send-email-jogo@openwrt.org>
References: <1440157521-525-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440157521-525-8-git-send-email-jogo@openwrt.org>

Add support for the Netgear Nighthawk X4 R7500 and build
appropariate sysupgrade and factory images.

Known issues:
 * 5 GHz wifi not working - there is no quantenna driver
 * One of the USB ports is not working

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 .../linux/ipq806x/base-files/etc/uci-defaults/leds |  26 ++
 .../ipq806x/base-files/etc/uci-defaults/network    |   3 +-
 target/linux/ipq806x/base-files/lib/ipq806x.sh     |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh     |   3 +-
 target/linux/ipq806x/image/Makefile                |  40 ++-
 ...dd-Netgear-Nighthawk-X4-R7500-device-tree.patch | 387 +++++++++++++++++++++
 ...dd-Netgear-Nighthawk-X4-R7500-device-tree.patch | 387 +++++++++++++++++++++
 target/linux/ipq806x/profiles/netgear.mk           |  20 ++
 8 files changed, 866 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ipq806x/base-files/etc/uci-defaults/leds
 create mode 100644 target/linux/ipq806x/patches-3.18/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
 create mode 100644 target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
 create mode 100644 target/linux/ipq806x/profiles/netgear.mk

diff --git a/target/linux/ipq806x/base-files/etc/uci-defaults/leds b/target/linux/ipq806x/base-files/etc/uci-defaults/leds
new file mode 100644
index 0000000..362c5b6
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/uci-defaults/leds
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/ipq806x.sh
+
+board=$(ipq806x_board_name)
+
+case "$board" in
+r7500)
+	ucidef_set_led_usbdev "usb1" "USB 1" "r7500:white:usb1" "1-1"
+	ucidef_set_led_usbdev "usb2" "USB 2" "r7500:white:usb3" "3-1"
+	ucidef_set_led_netdev "wan" "WAN" "r7500:white:wan" "eth0"
+	ucidef_set_led_ide_disk "esata" "eSATA" "r7500:amber:esata"
+	ucidef_set_led_default "wps" "WPS" "r7500:white:wps" "0"
+	ucidef_set_led_default "rfkill" "rfkill" "r7500:white:rfkill" "0"
+	;;
+*)
+	;;
+esac
+
+ucidef_commit_leds
+
+exit 0
diff --git a/target/linux/ipq806x/base-files/etc/uci-defaults/network b/target/linux/ipq806x/base-files/etc/uci-defaults/network
index 354cea9..7742b73 100755
--- a/target/linux/ipq806x/base-files/etc/uci-defaults/network
+++ b/target/linux/ipq806x/base-files/etc/uci-defaults/network
@@ -16,7 +16,8 @@ ucidef_set_interface_loopback
 board=$(ipq806x_board_name)
 
 case "$board" in
-ap148)
+ap148 |\
+r7500)
 	ucidef_set_interfaces_lan_wan "eth1" "eth0"
 	ucidef_add_switch "switch0" "1" "1"
 	ucidef_add_switch_vlan "switch0" "1" "6 1 2 3 4"
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh b/target/linux/ipq806x/base-files/lib/ipq806x.sh
index 2790f3f..5b27bde 100644
--- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
+++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
@@ -20,6 +20,9 @@ ipq806x_board_detect() {
 	*"DB149")
 		name="db149"
 		;;
+	*"R7500")
+		name="r7500"
+		;;
 	esac
 
 	[ -z "$name" ] && name="unknown"
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index e834ead..75a01b7 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -6,7 +6,8 @@ platform_check_image() {
 	local board=$(ipq806x_board_name)
 
 	case "$board" in
-	AP148)
+	AP148 |\
+	r7500)
 		nand_do_platform_check $board $1
 		return $?;
 		;;
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index 2fdaab5..8c17bbc 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -10,6 +10,12 @@ KERNEL_LOADADDR := 0x42208000
 
 define Image/Prepare
 	$(CP) $(LINUX_DIR)/vmlinux $(KDIR)/$(IMG_PREFIX)-vmlinux.elf
+	mkimage -A arm -O linux -T filesystem -C none \
+		-a $(KERNEL_LOADADDR) -e $(KERNEL_LOADADDR) \
+		-n 'ARM OpenWrt fakeroot' \
+		-s $(KDIR_TMP)/root.dummy-uImage.tmp
+	echo -ne '\xff' > $(KDIR_TMP)/root.dummy
+	cat $(KDIR_TMP)/root.dummy $(KDIR_TMP)/root.dummy-uImage.tmp > $(KDIR)/root.dummy
 endef
 
 define Image/BuildKernel
@@ -17,6 +23,7 @@ define Image/BuildKernel
 endef
 
 define Image/Build/squashfs
+	cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
 	$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
 endef
 
@@ -29,6 +36,10 @@ define Build/append-dtb
 	cat $(DTS_DIR)/$(DEVICE_DTS).dtb >> $@
 endef
 
+define Build/append-file
+	cat $(1) >> $@
+endef
+
 define Device/Default
 	PROFILES := Default
 	KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
@@ -58,6 +69,22 @@ define Device/UbiFit
 	IMAGE/nand-sysupgrade.tar := sysupgrade-nand
 endef
 
+define Device/DniImage
+	PROFILES += $$(DEVICE_NAME)
+	FILESYSTEMS := squashfs
+	KERNEL_SUFFIX := -uImage
+	KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
+	KERNEL = kernel-bin | append-dtb | pad-to $$$$(($$(KERNEL_SIZE)-2*64-1)) | append-file $(KDIR)/root.dummy | uImage none
+	KERNEL_NAME := zImage
+	NETGEAR_BOARD_ID :=
+	NETGEAR_HW_ID :=
+	BOARD_NAME :=
+	IMAGES := factory.img sysupgrade.tar
+	IMAGE/factory.img := append-kernel | append-ubi | netgear-dni
+	IMAGE/sysupgrade.tar = sysupgrade-nand
+endef
+DEVICE_VARS += KERNEL_SIZE NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_BLOCK_SIZE DEVICE_PAGE_SIZE BOARD_NAME
+
 define Device/AP148
 	$(call Device/FitImage)
 	$(call Device/UbiFit)
@@ -81,6 +108,17 @@ define Device/DB149
 	KERNEL_INSTALL := 1
 endef
 
-TARGET_DEVICES += AP148 AP148-legacy DB149
+define Device/R7500
+	$(call Device/DniImage)
+	DEVICE_DTS := qcom-ipq8064-r7500
+	KERNEL_SIZE := 2097152
+	NETGEAR_BOARD_ID := R7500
+	NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
+	BLOCKSIZE := 128KiB
+	PAGESIZE := 2048
+	BOARD_NAME := r7500
+endef
+
+TARGET_DEVICES += AP148 AP148-legacy DB149 R7500
 
 $(eval $(call BuildImage))
diff --git a/target/linux/ipq806x/patches-3.18/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch b/target/linux/ipq806x/patches-3.18/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
new file mode 100644
index 0000000..a9b83a1
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
@@ -0,0 +1,387 @@
+From 7e77aa188a7a7c4391856a9e5ef5ef58f769e679 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo at openwrt.org>
+Date: Sun, 9 Aug 2015 13:02:38 +0200
+Subject: [PATCH] ARM: qcom: add Netgear Nighthawk X4 R7500 device tree
+
+Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+---
+ arch/arm/boot/dts/Makefile               |   1 +
+ arch/arm/boot/dts/qcom-ipq8064-r7500.dts | 370 +++++++++++++++++++++++++++++++
+ 2 files changed, 371 insertions(+)
+ create mode 100644 arch/arm/boot/dts/qcom-ipq8064-r7500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -361,6 +361,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+ 	qcom-apq8084-mtp.dtb \
+ 	qcom-ipq8064-ap148.dtb \
+ 	qcom-ipq8064-db149.dtb \
++	qcom-ipq8064-r7500.dtb \
+ 	qcom-msm8660-surf.dtb \
+ 	qcom-msm8960-cdp.dtb \
+ 	qcom-msm8974-sony-xperia-honami.dtb
+--- /dev/null
++++ b/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
+@@ -0,0 +1,362 @@
++#include "qcom-ipq8064-v1.0.dtsi"
++
++#include <dt-bindings/input/input.h>
++
++/ {
++	model = "Netgear Nighthawk X4 R7500";
++	compatible = "netgear,r7500", "qcom,ipq8064";
++
++	memory at 0 {
++		reg = <0x42000000 0xe000000>;
++		device_type = "memory";
++	};
++
++	reserved-memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges;
++		rsvd at 41200000 {
++			reg = <0x41200000 0x300000>;
++			no-map;
++		};
++	};
++
++	aliases {
++		serial0 = &uart4;
++		mdio-gpio0 = &mdio0;
++	};
++
++	chosen {
++		bootargs = "rootfstype=squashfs noinitrd";
++		linux,stdout-path = "serial0:115200n8";
++	};
++
++	soc {
++		pinmux at 800000 {
++			i2c4_pins: i2c4_pinmux {
++				pins = "gpio12", "gpio13";
++				function = "gsbi4";
++				bias-disable;
++			};
++
++			pcie0_pins: pcie0_pinmux {
++				mux {
++					pins = "gpio3";
++					function = "pcie1_rst";
++					drive-strength = <12>;
++					bias-disable;
++				};
++			};
++
++			pcie1_pins: pcie1_pinmux {
++				mux {
++					pins = "gpio48";
++					function = "pcie2_rst";
++					drive-strength = <12>;
++					bias-disable;
++				};
++			};
++
++			nand_pins: nand_pins {
++				mux {
++					pins = "gpio34", "gpio35", "gpio36",
++					       "gpio37", "gpio38", "gpio39",
++					       "gpio40", "gpio41", "gpio42",
++					       "gpio43", "gpio44", "gpio45",
++					       "gpio46", "gpio47";
++					function = "nand";
++					drive-strength = <10>;
++					bias-disable;
++				};
++				pullups {
++					pins = "gpio39";
++					bias-pull-up;
++				};
++				hold {
++					pins = "gpio40", "gpio41", "gpio42",
++					       "gpio43", "gpio44", "gpio45",
++					       "gpio46", "gpio47";
++					bias-bus-hold;
++				};
++			};
++
++			mdio0_pins: mdio0_pins {
++				mux {
++					pins = "gpio0", "gpio1";
++					function = "gpio";
++					drive-strength = <8>;
++					bias-disable;
++				};
++			};
++
++			rgmii2_pins: rgmii2_pins {
++				mux {
++					pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
++					       "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
++					function = "rgmii2";
++					drive-strength = <8>;
++					bias-disable;
++				};
++			};
++		};
++
++		gsbi at 16300000 {
++			qcom,mode = <GSBI_PROT_I2C_UART>;
++			status = "ok";
++			serial at 16340000 {
++				status = "ok";
++			};
++			/*
++			 * The i2c device on gsbi4 should not be enabled.
++			 * On ipq806x designs gsbi4 i2c is meant for exclusive
++			 * RPM usage. Turning this on in kernel manifests as
++			 * i2c failure for the RPM.
++			 */
++		};
++
++		sata-phy at 1b400000 {
++			status = "ok";
++		};
++
++		sata at 29000000 {
++			status = "ok";
++		};
++
++		phy at 100f8800 {		/* USB3 port 1 HS phy */
++			status = "ok";
++		};
++
++		phy at 100f8830 {		/* USB3 port 1 SS phy */
++			status = "ok";
++		};
++
++		phy at 110f8800 {		/* USB3 port 0 HS phy */
++			status = "ok";
++		};
++
++		phy at 110f8830 {		/* USB3 port 0 SS phy */
++			status = "ok";
++		};
++
++		usb30 at 0 {
++			status = "ok";
++		};
++
++		usb30 at 1 {
++			status = "ok";
++		};
++
++		pcie0: pci at 1b500000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 3 0>;
++			pinctrl-0 = <&pcie0_pins>;
++			pinctrl-names = "default";
++		};
++
++		pcie1: pci at 1b700000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 48 0>;
++			pinctrl-0 = <&pcie1_pins>;
++			pinctrl-names = "default";
++		};
++
++		nand at 1ac00000 {
++			status = "ok";
++
++			pinctrl-0 = <&nand_pins>;
++			pinctrl-names = "default";
++
++			nand-ecc-strength = <4>;
++			nand-bus-width = <8>;
++
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			qcadata at 0 {
++				label = "qcadata";
++				reg = <0x0000000 0x0c80000>;
++				read-only;
++			};
++
++			APPSBL at c80000 {
++				label = "APPSBL";
++				reg = <0x0c80000 0x0500000>;
++				read-only;
++			};
++
++			APPSBLENV at 1180000 {
++				label = "APPSBLENV";
++				reg = <0x1180000 0x0080000>;
++				read-only;
++			};
++
++			art: art at 1200000 {
++				label = "art";
++				reg = <0x1200000 0x0140000>;
++				read-only;
++			};
++
++			kernel at 1340000 {
++				label = "kernel";
++				reg = <0x1340000 0x0200000>;
++			};
++
++			ubi at 1540000 {
++				label = "ubi";
++				reg = <0x1540000 0x1800000>;
++			};
++
++			netgear at 2d40000 {
++				label = "netgear";
++				reg = <0x2d40000 0x0c00000>;
++				read-only;
++			};
++
++			reserve at 3940000 {
++				label = "reserve";
++				reg = <0x3940000 0x46c0000>;
++				read-only;
++			};
++
++			firmware at 1340000 {
++				label = "firmware";
++				reg = <0x1340000 0x1a00000>;
++			};
++
++		};
++
++		mdio0: mdio {
++			compatible = "virtual,mdio-gpio";
++			#address-cells = <1>;
++			#size-cells = <0>;
++			gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
++			pinctrl-0 = <&mdio0_pins>;
++			pinctrl-names = "default";
++
++			phy0: ethernet-phy at 0 {
++				device_type = "ethernet-phy";
++				reg = <0>;
++				qca,ar8327-initvals = <
++					0x00004 0x7600000   /* PAD0_MODE */
++					0x00008 0x1000000   /* PAD5_MODE */
++					0x0000c 0x80        /* PAD6_MODE */
++					0x000e4 0xaa545     /* MAC_POWER_SEL */
++					0x000e0 0xc74164de  /* SGMII_CTRL */
++					0x0007c 0x4e        /* PORT0_STATUS */
++					0x00094 0x4e        /* PORT6_STATUS */
++					>;
++			};
++
++			phy4: ethernet-phy at 4 {
++				device_type = "ethernet-phy";
++				reg = <4>;
++			};
++		};
++
++		gmac1: ethernet at 37200000 {
++			status = "ok";
++			phy-mode = "rgmii";
++			phy-handle = <&phy4>;
++			qcom,id = <1>;
++
++			pinctrl-0 = <&rgmii2_pins>;
++			pinctrl-names = "default";
++
++			mtd-mac-address = <&art 6>;
++		};
++
++		gmac2: ethernet at 37400000 {
++			status = "ok";
++			phy-mode = "sgmii";
++			qcom,id = <2>;
++
++			mtd-mac-address = <&art 0>;
++
++			fixed-link {
++				speed = <1000>;
++				full-duplex;
++			};
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		wifi {
++			label = "wifi";
++			gpios = <&qcom_pinmux 6 1>;
++			linux,code = <KEY_WLAN>;
++		};
++
++		reset {
++			label = "reset";
++			gpios = <&qcom_pinmux 54 1>;
++			linux,code = <KEY_RESTART>;
++		};
++
++		wps {
++			label = "wps";
++			gpios = <&qcom_pinmux 65 1>;
++			linux,code = <KEY_WPS_BUTTON>;
++		};
++	};
++
++	gpio-leds {
++		compatible = "gpio-leds";
++
++		usb1 {
++			label = "r7500:amber:usb1";
++			gpios = <&qcom_pinmux 7 0>;
++		};
++
++		usb3 {
++			label = "r7500:amber:usb3";
++			gpios = <&qcom_pinmux 8 0>;
++		};
++
++		status {
++			label = "r7500:amber:status";
++			gpios = <&qcom_pinmux 9 0>;
++		};
++
++		internet {
++			label = "r7500:white:internet";
++			gpios = <&qcom_pinmux 22 0>;
++		};
++
++		wan {
++			label = "r7500:white:wan";
++			gpios = <&qcom_pinmux 23 0>;
++		};
++
++		wps {
++			label = "r7500:white:wps";
++			gpios = <&qcom_pinmux 24 0>;
++		};
++
++		esata {
++			label = "r7500:white:esata";
++			gpios = <&qcom_pinmux 26 0>;
++		};
++
++		power {
++			label = "r7500:white:power";
++			gpios = <&qcom_pinmux 53 0>;
++			default-state = "on";
++		};
++
++		rfkill {
++			label = "r7500:white:rfkill";
++			gpios = <&qcom_pinmux 64 0>;
++		};
++
++		wifi5g {
++			label = "r7500:white:wifi5g";
++			gpios = <&qcom_pinmux 67 0>;
++		};
++	};
++};
++
++&adm_dma {
++	status = "ok";
++};
diff --git a/target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch b/target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
new file mode 100644
index 0000000..12e06d2
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
@@ -0,0 +1,387 @@
+From 7e77aa188a7a7c4391856a9e5ef5ef58f769e679 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo at openwrt.org>
+Date: Sun, 9 Aug 2015 13:02:38 +0200
+Subject: [PATCH] ARM: qcom: add Netgear Nighthawk X4 R7500 device tree
+
+Signed-off-by: Jonas Gorski <jogo at openwrt.org>
+---
+ arch/arm/boot/dts/Makefile               |   1 +
+ arch/arm/boot/dts/qcom-ipq8064-r7500.dts | 370 +++++++++++++++++++++++++++++++
+ 2 files changed, 371 insertions(+)
+ create mode 100644 arch/arm/boot/dts/qcom-ipq8064-r7500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -452,6 +452,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+ 	qcom-apq8084-mtp.dtb \
+ 	qcom-ipq8064-ap148.dtb \
+ 	qcom-ipq8064-db149.dtb \
++	qcom-ipq8064-r7500.dtb \
+ 	qcom-msm8660-surf.dtb \
+ 	qcom-msm8960-cdp.dtb \
+ 	qcom-msm8974-sony-xperia-honami.dtb
+--- /dev/null
++++ b/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
+@@ -0,0 +1,362 @@
++#include "qcom-ipq8064-v1.0.dtsi"
++
++#include <dt-bindings/input/input.h>
++
++/ {
++	model = "Netgear Nighthawk X4 R7500";
++	compatible = "netgear,r7500", "qcom,ipq8064";
++
++	memory at 0 {
++		reg = <0x42000000 0xe000000>;
++		device_type = "memory";
++	};
++
++	reserved-memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges;
++		rsvd at 41200000 {
++			reg = <0x41200000 0x300000>;
++			no-map;
++		};
++	};
++
++	aliases {
++		serial0 = &uart4;
++		mdio-gpio0 = &mdio0;
++	};
++
++	chosen {
++		bootargs = "rootfstype=squashfs noinitrd";
++		linux,stdout-path = "serial0:115200n8";
++	};
++
++	soc {
++		pinmux at 800000 {
++			i2c4_pins: i2c4_pinmux {
++				pins = "gpio12", "gpio13";
++				function = "gsbi4";
++				bias-disable;
++			};
++
++			pcie0_pins: pcie0_pinmux {
++				mux {
++					pins = "gpio3";
++					function = "pcie1_rst";
++					drive-strength = <12>;
++					bias-disable;
++				};
++			};
++
++			pcie1_pins: pcie1_pinmux {
++				mux {
++					pins = "gpio48";
++					function = "pcie2_rst";
++					drive-strength = <12>;
++					bias-disable;
++				};
++			};
++
++			nand_pins: nand_pins {
++				mux {
++					pins = "gpio34", "gpio35", "gpio36",
++					       "gpio37", "gpio38", "gpio39",
++					       "gpio40", "gpio41", "gpio42",
++					       "gpio43", "gpio44", "gpio45",
++					       "gpio46", "gpio47";
++					function = "nand";
++					drive-strength = <10>;
++					bias-disable;
++				};
++				pullups {
++					pins = "gpio39";
++					bias-pull-up;
++				};
++				hold {
++					pins = "gpio40", "gpio41", "gpio42",
++					       "gpio43", "gpio44", "gpio45",
++					       "gpio46", "gpio47";
++					bias-bus-hold;
++				};
++			};
++
++			mdio0_pins: mdio0_pins {
++				mux {
++					pins = "gpio0", "gpio1";
++					function = "gpio";
++					drive-strength = <8>;
++					bias-disable;
++				};
++			};
++
++			rgmii2_pins: rgmii2_pins {
++				mux {
++					pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
++					       "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
++					function = "rgmii2";
++					drive-strength = <8>;
++					bias-disable;
++				};
++			};
++		};
++
++		gsbi at 16300000 {
++			qcom,mode = <GSBI_PROT_I2C_UART>;
++			status = "ok";
++			serial at 16340000 {
++				status = "ok";
++			};
++			/*
++			 * The i2c device on gsbi4 should not be enabled.
++			 * On ipq806x designs gsbi4 i2c is meant for exclusive
++			 * RPM usage. Turning this on in kernel manifests as
++			 * i2c failure for the RPM.
++			 */
++		};
++
++		sata-phy at 1b400000 {
++			status = "ok";
++		};
++
++		sata at 29000000 {
++			status = "ok";
++		};
++
++		phy at 100f8800 {		/* USB3 port 1 HS phy */
++			status = "ok";
++		};
++
++		phy at 100f8830 {		/* USB3 port 1 SS phy */
++			status = "ok";
++		};
++
++		phy at 110f8800 {		/* USB3 port 0 HS phy */
++			status = "ok";
++		};
++
++		phy at 110f8830 {		/* USB3 port 0 SS phy */
++			status = "ok";
++		};
++
++		usb30 at 0 {
++			status = "ok";
++		};
++
++		usb30 at 1 {
++			status = "ok";
++		};
++
++		pcie0: pci at 1b500000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 3 0>;
++			pinctrl-0 = <&pcie0_pins>;
++			pinctrl-names = "default";
++		};
++
++		pcie1: pci at 1b700000 {
++			status = "ok";
++			reset-gpio = <&qcom_pinmux 48 0>;
++			pinctrl-0 = <&pcie1_pins>;
++			pinctrl-names = "default";
++		};
++
++		nand at 1ac00000 {
++			status = "ok";
++
++			pinctrl-0 = <&nand_pins>;
++			pinctrl-names = "default";
++
++			nand-ecc-strength = <4>;
++			nand-bus-width = <8>;
++
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			qcadata at 0 {
++				label = "qcadata";
++				reg = <0x0000000 0x0c80000>;
++				read-only;
++			};
++
++			APPSBL at c80000 {
++				label = "APPSBL";
++				reg = <0x0c80000 0x0500000>;
++				read-only;
++			};
++
++			APPSBLENV at 1180000 {
++				label = "APPSBLENV";
++				reg = <0x1180000 0x0080000>;
++				read-only;
++			};
++
++			art: art at 1200000 {
++				label = "art";
++				reg = <0x1200000 0x0140000>;
++				read-only;
++			};
++
++			kernel at 1340000 {
++				label = "kernel";
++				reg = <0x1340000 0x0200000>;
++			};
++
++			ubi at 1540000 {
++				label = "ubi";
++				reg = <0x1540000 0x1800000>;
++			};
++
++			netgear at 2d40000 {
++				label = "netgear";
++				reg = <0x2d40000 0x0c00000>;
++				read-only;
++			};
++
++			reserve at 3940000 {
++				label = "reserve";
++				reg = <0x3940000 0x46c0000>;
++				read-only;
++			};
++
++			firmware at 1340000 {
++				label = "firmware";
++				reg = <0x1340000 0x1a00000>;
++			};
++
++		};
++
++		mdio0: mdio {
++			compatible = "virtual,mdio-gpio";
++			#address-cells = <1>;
++			#size-cells = <0>;
++			gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
++			pinctrl-0 = <&mdio0_pins>;
++			pinctrl-names = "default";
++
++			phy0: ethernet-phy at 0 {
++				device_type = "ethernet-phy";
++				reg = <0>;
++				qca,ar8327-initvals = <
++					0x00004 0x7600000   /* PAD0_MODE */
++					0x00008 0x1000000   /* PAD5_MODE */
++					0x0000c 0x80        /* PAD6_MODE */
++					0x000e4 0xaa545     /* MAC_POWER_SEL */
++					0x000e0 0xc74164de  /* SGMII_CTRL */
++					0x0007c 0x4e        /* PORT0_STATUS */
++					0x00094 0x4e        /* PORT6_STATUS */
++					>;
++			};
++
++			phy4: ethernet-phy at 4 {
++				device_type = "ethernet-phy";
++				reg = <4>;
++			};
++		};
++
++		gmac1: ethernet at 37200000 {
++			status = "ok";
++			phy-mode = "rgmii";
++			phy-handle = <&phy4>;
++			qcom,id = <1>;
++
++			pinctrl-0 = <&rgmii2_pins>;
++			pinctrl-names = "default";
++
++			mtd-mac-address = <&art 6>;
++		};
++
++		gmac2: ethernet at 37400000 {
++			status = "ok";
++			phy-mode = "sgmii";
++			qcom,id = <2>;
++
++			mtd-mac-address = <&art 0>;
++
++			fixed-link {
++				speed = <1000>;
++				full-duplex;
++			};
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		wifi {
++			label = "wifi";
++			gpios = <&qcom_pinmux 6 1>;
++			linux,code = <KEY_WLAN>;
++		};
++
++		reset {
++			label = "reset";
++			gpios = <&qcom_pinmux 54 1>;
++			linux,code = <KEY_RESTART>;
++		};
++
++		wps {
++			label = "wps";
++			gpios = <&qcom_pinmux 65 1>;
++			linux,code = <KEY_WPS_BUTTON>;
++		};
++	};
++
++	gpio-leds {
++		compatible = "gpio-leds";
++
++		usb1 {
++			label = "r7500:amber:usb1";
++			gpios = <&qcom_pinmux 7 0>;
++		};
++
++		usb3 {
++			label = "r7500:amber:usb3";
++			gpios = <&qcom_pinmux 8 0>;
++		};
++
++		status {
++			label = "r7500:amber:status";
++			gpios = <&qcom_pinmux 9 0>;
++		};
++
++		internet {
++			label = "r7500:white:internet";
++			gpios = <&qcom_pinmux 22 0>;
++		};
++
++		wan {
++			label = "r7500:white:wan";
++			gpios = <&qcom_pinmux 23 0>;
++		};
++
++		wps {
++			label = "r7500:white:wps";
++			gpios = <&qcom_pinmux 24 0>;
++		};
++
++		esata {
++			label = "r7500:white:esata";
++			gpios = <&qcom_pinmux 26 0>;
++		};
++
++		power {
++			label = "r7500:white:power";
++			gpios = <&qcom_pinmux 53 0>;
++			default-state = "on";
++		};
++
++		rfkill {
++			label = "r7500:white:rfkill";
++			gpios = <&qcom_pinmux 64 0>;
++		};
++
++		wifi5g {
++			label = "r7500:white:wifi5g";
++			gpios = <&qcom_pinmux 67 0>;
++		};
++	};
++};
++
++&adm_dma {
++	status = "ok";
++};
diff --git a/target/linux/ipq806x/profiles/netgear.mk b/target/linux/ipq806x/profiles/netgear.mk
new file mode 100644
index 0000000..0cab97f
--- /dev/null
+++ b/target/linux/ipq806x/profiles/netgear.mk
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2014 The Linux Foundation. All rights reserved.
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/R7500
+	NAME:=Netgear Nighthawk X4 R7500
+	PACKAGES:= \
+		kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev \
+		kmod-usb3 kmod-usb-dwc3-qcom kmod-usb-phy-qcom-dwc3 \
+		kmod-ath10k kmod-wpad-mini
+endef
+
+define Profile/R7500/Description
+	Package set for the Netgear Nighthawk X4 R7500.
+endef
+$(eval $(call Profile,R7500))
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From wigyori at uid0.hu  Fri Aug 21 09:42:34 2015
From: wigyori at uid0.hu (wigyori at uid0.hu)
Date: Fri, 21 Aug 2015 15:42:34 +0200
Subject: [OpenWrt-Devel] [PATCH 2/7] modules: move libahci to
 kmod-ata-core
In-Reply-To: <55BBCD4C.9030203@uid0.hu>
References: <20150730013835.GA16528@makrotopia.org> <55BBCD4C.9030203@uid0.hu>
Message-ID: <5741548a057c7e63a086f81c7be32b46@uid0.hu>

2015-07-31 21:32 id?pontban Zoltan HERPAI ezt ?rta:
> Daniel Golle wrote:
>> Newer kernels make use of libahci in ahci-platform, ie. also on 
>> non-PCI
>> platforms.
>> As there is no single config symbol deciding whether libahci.ko is
>> being built or not it seems the most sensitive thing to package it in
>> kmod-ata-core.
>> 
>> Signed-off-by: Daniel Golle <daniel at makrotopia.org>
>> ---
>>   [snip]
> 
> We'll discuss this with blogic/Kaloz if they're OK with it.

Hi Daniel,

I've added this in r46701, thanks,

Regards,
-w-
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From chunkeey at googlemail.com  Fri Aug 21 10:07:39 2015
From: chunkeey at googlemail.com (Christian Lamparter)
Date: Fri, 21 Aug 2015 16:07:39 +0200
Subject: [OpenWrt-Devel] [musl] SuperH conflict of
	arch/sh/__set_thread_area vs thread/__set_thread_area
In-Reply-To: <4450715.CJV8mqCvIO@debian64>
References: <5769061.FLTLqujSyv@debian64>
 <20150820030402.GT32742@brightrain.aerifal.cx> <4450715.CJV8mqCvIO@debian64>
Message-ID: <6159471.3UQWOnjUZP@debian64>

(Added Openwrt-dev - since this isn't a musl issue)

On Thursday, August 20, 2015 12:21:55 PM Christian Lamparter wrote:
> On Wednesday, August 19, 2015 11:04:02 PM Rich Felker wrote:
> > On Thu, Aug 20, 2015 at 02:44:11AM +0200, Christian Lamparter wrote:
> > > I'm trying to add a port for a SH4-like ARCH to OpenWRT, which uses the latest
> > > musl-1.1.10 as the default libc. I'm having the following problem when building
> > > the toolchain:
> > > 
> > > During the final linker-step, the symbol "__set_thread_area"  declared twice.
> > > This is because the SH architecture provides a separate __set_thread_area [0],
> > > (other archs use the standard syscall wrapper from [1]).
> > > 
> > > Obviously, I want this issue fixed. However I'm new to SuperH and musl, that's
> > > why I need advise :-D. For now, I defined the src/thread/__set_thread_area as
> > > a weak symbol. Now, that's just a crude hack, what would be better solution?
> > > (I can make and post the patch if necessary - But sadly, I can't test it on the
> > > hardware yet)?
> > 
> > Bobby Bingham's reply explains what the issue is. Did you make a new
> > arch name rather than using the existing sh arch for your port? 
> Initially, yes I did. I had the ARCH at "sh4". This was because OpenWRT 
> already had infrastructure for some sh-(sub)targets (sh3, sh3eb, sh4, sh4eb)
> in place. But they seem to be unused and untested. The only target which has
> support for SuperH is UserModeLinux. However, it will probably run into the
> same issue.
> 
> Now, I've changed ARCH to "sh" and set the CPU_TYPE to sh4 [toolchain
> dir changed to toolchain-sh_sh4_gcc-5.2.0_musl-1.1.10]. But still no 
> luck, the original error code remains the same.
> 
> src/thread/__set_thread_area.lo: In function `__set_thread_area':
> __set_thread_area.c:(.text+0x0): multiple definition of `__set_thread_area'
> arch/sh/src/__set_thread_area.lo:__set_thread_area.c:(.text+0x0): first defined here
> collect2: error: ld returned 1 exit status
> Makefile:142: recipe for target 'lib/libc.so' failed

Ok, I have a update and I fixed this issue with __set_thread_area.s.
The reason why this didn't work and was harder to debug than usual is
because of the involvement of the "patch" utility with the -E flag
(--remove-empty-files).

Openwrt adds a number of patches to the musl-1.1.10.tar.gz [0] (actually
they seem to be cherry-picked from musl git). Now, one of the patches 
"001-git-2015-07-22.patch" contains:

commit f9d84554bae0fa17c9a1d724549c4408022228a5 [1]
Author: Rich Felker <dalias at aerifal.cx>
Date:   Tue Jun 16 14:28:30 2015 +0000

    add support for sh2 interrupt-masking-based atomics to sh port
 
This commit reduces the "src/thread/sh/__set_thread_area.s" to an empty
file (but it doesn't remove it). But due to bad luck, the script that
patches the file [2] (it's called patch-kernel.sh, but it's used to patch
the toolchain as well) uses the pesky "-E" flag (line 40):
 [...] ${PATCH:-patch} -f -p1 -E -d ${targetdir} 
                              ^^

==> And that's why the __set_thread_area.s file disappears.

I came up with two possible fixes for OpenWRT, unless you want to
fix this in musl (via non-empty __set_thread_area) instead: 

1. have some content in __set_thread_area.s to prevent it from being
   removed.

---

--- a/src/thread/sh/__set_thread_area.s
+++ b/src/thread/sh/__set_thread_area.s
@@ -0,0 +1,1 @@
+/* the patch utility might remove empty files */

---


2. patch patch-kernel.sh

---
--- a/scripts/patch-kernel.sh
+++ b/scripts/patch-kernel.sh
@@ -37,7 +37,7 @@ for i in ${patchdir}/${patchpattern} ; do
     [ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue	
     echo ""
     echo "Applying ${i} using ${type}: " 
-    ${uncomp} ${i} | ${PATCH:-patch} -f -p1 -E -d ${targetdir} 
+    ${uncomp} ${i} | ${PATCH:-patch} -f -p1 -d ${targetdir}
     if [ $? != 0 ] ; then
         echo "Patch failed!  Please fix $i!"
 	exit 1

---

Does anyone have any preferences? I'm opting for "patch patch-kernel"
(and I will send a proper patch next week to OpenWRT even if no one
cares now :-D ) 

Regards,
Christian

[0] <https://dev.openwrt.org/browser/trunk/toolchain/musl/patches>
[1] <http://git.musl-libc.org/cgit/musl/commit/?id=f9d84554bae0fa17c9a1d724549c4408022228a5>
[2] <https://dev.openwrt.org/browser/trunk/scripts/patch-kernel.sh>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Fri Aug 21 14:03:46 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Fri, 21 Aug 2015 20:03:46 +0200
Subject: [OpenWrt-Devel] [PATCH 1/1] [kernel] Fix kmod-v4l2 modules have
 missing symbols due to lack of clk support
In-Reply-To: <55D51194.7090008@daniel.thecshore.com>
References: <20150810153018.6240123A1534@danielcent.thecshore.com>
 <55CF4DF8.4070207@hauke-m.de> <55D51194.7090008@daniel.thecshore.com>
Message-ID: <55D76802.6000908@hauke-m.de>



On 08/20/2015 01:30 AM, Daniel Dickinson wrote:
> Your patch resolves the issue of compiling - I have not yet tested the
> functionality of the resulting v4l module.  I suspect the disadvantage
> of this patch is that it will silently fail to work for the types of
> devices (DV primarily) that depend on clock support whereas my patch
> omits building code/modules for devices that depend on clock support a
> kernel config option that prevents building useless modules (although I
> realized the DV_SUPPORT should depend on CLK_COMMON since that's the
> whole reason for making that a config option) and (and of course
> #ifdef's out the code and dependencies on clk support when it's not
> present).
> 
> Regards,
> 
> Daniel

Hi Daniel,

I do not know if they will still work, but if some driver has to change
some clock of the SoC and the SoC does not support this it should fail.
The problem not only exist with ar71xx, but with all SoC in the mainline
kernel, so I assume that this is already handled. If we return the wrong
number in the ar71xx code it should be changed, different SoC code
returned different values in the same cases so I was unsure.

Have you experienced any runtime problems with the clocks with the
current trunk version?

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Fri Aug 21 14:04:25 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Fri, 21 Aug 2015 20:04:25 +0200
Subject: [OpenWrt-Devel] [PATCH 1/1] [kernel] Fix kmod-v4l2 modules have
 missing symbols due to lack of clk support
In-Reply-To: <55D51194.7090008@daniel.thecshore.com>
References: <20150810153018.6240123A1534@danielcent.thecshore.com>
 <55CF4DF8.4070207@hauke-m.de> <55D51194.7090008@daniel.thecshore.com>
Message-ID: <55D76829.7060400@hauke-m.de>



On 08/20/2015 01:30 AM, Daniel Dickinson wrote:
> Your patch resolves the issue of compiling - I have not yet tested the
> functionality of the resulting v4l module.  I suspect the disadvantage
> of this patch is that it will silently fail to work for the types of
> devices (DV primarily) that depend on clock support whereas my patch
> omits building code/modules for devices that depend on clock support a
> kernel config option that prevents building useless modules (although I
> realized the DV_SUPPORT should depend on CLK_COMMON since that's the
> whole reason for making that a config option) and (and of course
> #ifdef's out the code and dependencies on clk support when it's not
> present).
> 
> Regards,
> 
> Daniel

Hi Daniel,

I do not know if they will still work, but if some driver has to change
some clock of the SoC and the SoC does not support this it should fail.
The problem not only exist with ar71xx, but with all SoC in the mainline
kernel, so I assume that this is already handled. If we return the wrong
number in the ar71xx code it should be changed, different SoC code
returned different values in the same cases so I was unsure.

Have you experienced any runtime problems with the clocks with the
current trunk version?

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Fri Aug 21 14:17:00 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Fri, 21 Aug 2015 20:17:00 +0200
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <1439698749.2972.17.camel@perseus.themaw.net>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>	
 <20150310033038.9542.63440.stgit@perseus.themaw.net>	
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>
 <1439698749.2972.17.camel@perseus.themaw.net>
Message-ID: <55D76B1C.7000105@hauke-m.de>



On 08/16/2015 06:19 AM, Ian Kent wrote:
> On Tue, 2015-06-23 at 07:58 +0800, Ian Kent wrote:
>> On Mon, 2015-06-22 at 18:42 +0200, Hauke Mehrtens wrote:
>>>
>>> On 03/10/2015 04:30 AM, Ian Kent wrote:
>>>> The Netgear R8000 has a PEX8603 connected to the BCM53012 and if
>>>> it isn't configured during the bus scan the PCI layer goes crazy
>>>> trying to configure phantom devices.
>>>
>>> Could you provide some diagram how this is connected?
>>
>> I could try, when I get a chance, ascii art isn't my strong suit.
>>
>>>
>>> My current assumption is that on one of the 3 PCIe ports is this switch,
>>> so the scan will find this switch as a PCIe device, bu how does it go
>>> from there?
>>
>> I can only infer from looking at sysfs, which is what I have done.
>>
>> Perhaps I'm not correct but it looks to me that there are is a BCM53012
>> connected with two legs, one has one wireless device, and the other has
>> a PEX8603 bridge which has two legs, each with a wireless device.
>>
>>> From the vendor driver I would assume that that the two devices behind
>>> the switch are device function 0x08 and 0x10 on the switch device.
>>
>> I'll have to reacquaint myself with the code before I respond to the
>> comments below, its been a while.
>>  
>>>
>>> Can you also post the output of lspci on your device?
>>
>> Don't think I have lspci in the build I was using, I'll need to add it
>> and rebuild. That probably won't be until the weekend.
> 
> OK, I've been able get a build.

I think we do not get this into OpenWrt CC any more. You should probably
base your work on top of the new PCIe host driver in the trunk used with
kernel 4.1.

Will you send a new Version or should I look into this?

> My updated patch doesn't yet function so I've used the driver we're
> discussing here to get info.
> 
> TBH, looking at this, I'm not so sure the patch is wrong now.
> 
> lspci gives:
> 0000:00:00.0 PCI bridge: Broadcom Corporation Device 8012 (rev 01)
> 0000:01:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> 0001:00:00.0 PCI bridge: Broadcom Corporation Device 8012 (rev 01)
> 0001:01:00.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> 0001:02:01.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> 0001:02:02.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> 0001:03:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> 0001:04:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> 
> and a list of /sys/bus/pci/devices on a Vendor firmware install gives:
> 0000:00:00.0  0000:00:06.0  0000:00:0b.1  0000:00:11.0  0002:01:00.0
> 0000:00:01.0  0000:00:07.0  0000:00:0c.0  0000:00:12.0  0002:02:01.0
> 0000:00:02.0  0000:00:08.0  0000:00:0d.0  0000:00:13.0  0002:02:02.0
> 0000:00:03.0  0000:00:09.0  0000:00:0e.0  0001:00:00.0  0002:03:00.0
> 0000:00:04.0  0000:00:0a.0  0000:00:0f.0  0001:01:00.0  0002:04:00.0
> 0000:00:05.0  0000:00:0b.0  0000:00:10.0  0002:00:00.0

Thanks for these information.
Without your patch the PCI subsystem will find lots of strange devices
and will report broken data and does not only show nothing, is that
correct?

> which looks like the topology is the same.
> 
> So, possibly, my description of how I believe the devices are connected
> is accurate.
> 
> 	    bcm8012
> 	 ------------
> 	 |	    |
> 	aa52	 pex8603
> 		 -------
> 		 |     |
> 		aa52  aa52
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From raven at themaw.net  Sat Aug 22 21:14:22 2015
From: raven at themaw.net (Ian Kent)
Date: Sun, 23 Aug 2015 09:14:22 +0800
Subject: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch
In-Reply-To: <55D76B1C.7000105@hauke-m.de>
References: <20150310032704.9542.30856.stgit@perseus.themaw.net>
 <20150310033038.9542.63440.stgit@perseus.themaw.net>
 <55883B0F.9070603@hauke-m.de> <1435017535.2653.6.camel@pluto.fritz.box>
 <1439698749.2972.17.camel@perseus.themaw.net> <55D76B1C.7000105@hauke-m.de>
Message-ID: <1440292462.2694.11.camel@pluto.fritz.box>

On Fri, 2015-08-21 at 20:17 +0200, Hauke Mehrtens wrote:
> 
> On 08/16/2015 06:19 AM, Ian Kent wrote:
> > On Tue, 2015-06-23 at 07:58 +0800, Ian Kent wrote:
> >> On Mon, 2015-06-22 at 18:42 +0200, Hauke Mehrtens wrote:
> >>>
> >>> On 03/10/2015 04:30 AM, Ian Kent wrote:
> >>>> The Netgear R8000 has a PEX8603 connected to the BCM53012 and if
> >>>> it isn't configured during the bus scan the PCI layer goes crazy
> >>>> trying to configure phantom devices.
> >>>
> >>> Could you provide some diagram how this is connected?
> >>
> >> I could try, when I get a chance, ascii art isn't my strong suit.
> >>
> >>>
> >>> My current assumption is that on one of the 3 PCIe ports is this switch,
> >>> so the scan will find this switch as a PCIe device, bu how does it go
> >>> from there?
> >>
> >> I can only infer from looking at sysfs, which is what I have done.
> >>
> >> Perhaps I'm not correct but it looks to me that there are is a BCM53012
> >> connected with two legs, one has one wireless device, and the other has
> >> a PEX8603 bridge which has two legs, each with a wireless device.
> >>
> >>> From the vendor driver I would assume that that the two devices behind
> >>> the switch are device function 0x08 and 0x10 on the switch device.
> >>
> >> I'll have to reacquaint myself with the code before I respond to the
> >> comments below, its been a while.
> >>  
> >>>
> >>> Can you also post the output of lspci on your device?
> >>
> >> Don't think I have lspci in the build I was using, I'll need to add it
> >> and rebuild. That probably won't be until the weekend.
> > 
> > OK, I've been able get a build.
> 
> I think we do not get this into OpenWrt CC any more. You should probably
> base your work on top of the new PCIe host driver in the trunk used with
> kernel 4.1.
> 
> Will you send a new Version or should I look into this?

I will, have been and continue to be quite busy so it will need to be
done when I decide to have some "weekend time", ;)

> 
> > My updated patch doesn't yet function so I've used the driver we're
> > discussing here to get info.
> > 
> > TBH, looking at this, I'm not so sure the patch is wrong now.
> > 
> > lspci gives:
> > 0000:00:00.0 PCI bridge: Broadcom Corporation Device 8012 (rev 01)
> > 0000:01:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> > 0001:00:00.0 PCI bridge: Broadcom Corporation Device 8012 (rev 01)
> > 0001:01:00.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> > 0001:02:01.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> > 0001:02:02.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> > 0001:03:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> > 0001:04:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> > 
> > and a list of /sys/bus/pci/devices on a Vendor firmware install gives:
> > 0000:00:00.0  0000:00:06.0  0000:00:0b.1  0000:00:11.0  0002:01:00.0
> > 0000:00:01.0  0000:00:07.0  0000:00:0c.0  0000:00:12.0  0002:02:01.0
> > 0000:00:02.0  0000:00:08.0  0000:00:0d.0  0000:00:13.0  0002:02:02.0
> > 0000:00:03.0  0000:00:09.0  0000:00:0e.0  0001:00:00.0  0002:03:00.0
> > 0000:00:04.0  0000:00:0a.0  0000:00:0f.0  0001:01:00.0  0002:04:00.0
> > 0000:00:05.0  0000:00:0b.0  0000:00:10.0  0002:00:00.0
> 
> Thanks for these information.
> Without your patch the PCI subsystem will find lots of strange devices
> and will report broken data and does not only show nothing, is that
> correct?

That's exactly so.
And the bridge itself isn't recognised properly because of fixup needed
at initial probe.

> 
> > which looks like the topology is the same.
> > 
> > So, possibly, my description of how I believe the devices are connected
> > is accurate.
> > 
> > 	    bcm8012
> > 	 ------------
> > 	 |	    |
> > 	aa52	 pex8603
> > 		 -------
> > 		 |     |
> > 		aa52  aa52
> > 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 06:56:24 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 12:56:24 +0200
Subject: [OpenWrt-Devel] [PATCH 0/7] mac80211 experimental extensions and
	cleanup
Message-ID: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>

*Disclaimer: compile tested only*

This series first adds features that were requested by some users
but might be broken or does not support OpenWrt "intended" usage
- "experimental" hardware (rt2800-usb)
- new Intel Hardware (iwlmvm) according to web reports
  does not support AP mode in 5GHz on some cards
  so it can be regarded as broken.
  This seems to be badly documented.
see: http://www.spinics.net/lists/linux-wireless/msg137906.html
or: http://www.spinics.net/lists/linux-wireless/msg137861.html
as example

Intel has published updated firmware that is only working
with newer Kernels (since we use backports that shouldnt matter anyway)
but there might be new bugs so keep the old versions too

Last two patches are trying to clean up the Makefile.

Dirk Neukirchen (7):
  mac80211: iwlagn: enable iwlmvm
  mac80211: rt2800-usb: enable "unknown" USB IDs
  mac80211: update linux-firmware to 2014-07-14
  mac80211: refresh Intel firmware
  mac80211: add iwlagn debug options
  mac80211: cosmetic changes
  mac80211: rename iwlagn to iwlwifi

 package/kernel/mac80211/Makefile | 2707 ++++++++++++++++++++------------------
 1 file changed, 1425 insertions(+), 1282 deletions(-)

-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 06:56:25 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 12:56:25 +0200
Subject: [OpenWrt-Devel] [PATCH 1/7] mac80211: iwlagn: enable iwlmvm
In-Reply-To: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <1440327391-25355-2-git-send-email-dirkneukirchen@web.de>

- reported in forums
- Intel 7260 and 3160 need IWLMVM drivers/firmware

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/kernel/mac80211/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 04dfd3b..1cebf92 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -831,8 +831,9 @@ define KernelPackage/iwlagn
   TITLE:=Intel AGN Wireless support
   FILES:= \
 	$(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/iwlwifi.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/dvm/iwldvm.ko
-  AUTOLOAD:=$(call AutoProbe,iwlwifi iwldvm)
+	$(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/dvm/iwldvm.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/mvm/iwlmvm.ko
+  AUTOLOAD:=$(call AutoProbe,iwlwifi iwldvm iwlmvm)
   MENU:=1
 endef
 
@@ -1642,7 +1643,7 @@ config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX
 config-$(call config_package,iwl-legacy) += IWLEGACY
 config-$(call config_package,iwl3945) += IWL3945
 config-$(call config_package,iwl4965) += IWL4965
-config-$(call config_package,iwlagn) += IWLWIFI IWLDVM
+config-$(call config_package,iwlagn) += IWLWIFI IWLDVM IWLMVM
 
 config-$(call config_package,net-libipw) += LIBIPW
 config-$(call config_package,net-ipw2100) += IPW2100
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 06:56:26 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 12:56:26 +0200
Subject: [OpenWrt-Devel] [PATCH 2/7] mac80211: rt2800-usb: enable "unknown"
	USB IDs
In-Reply-To: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <1440327391-25355-3-git-send-email-dirkneukirchen@web.de>

- should fix issue: https://forum.openwrt.org/viewtopic.php?id=57315
- enable support of more USB stick with rt28xx chipsets
- experimental: USB-IDs not in vendor linux driver
- experimental: "exact chipset is unknown"
- experimental: "enabling these devices may or may not work"

only compile tested

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/kernel/mac80211/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 1cebf92..3037d79 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -1638,7 +1638,7 @@ config-$(call config_package,rt2800-pci) += RT2800PCI
 config-y += RT2800PCI_RT33XX RT2800PCI_RT35XX RT2800PCI_RT53XX RT2800PCI_RT3290
 
 config-$(call config_package,rt2800-usb) += RT2800USB
-config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX RT2800USB_RT55XX
+config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX RT2800USB_RT55XX RT2800USB_UNKNOWN
 
 config-$(call config_package,iwl-legacy) += IWLEGACY
 config-$(call config_package,iwl3945) += IWL3945
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 06:56:27 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 12:56:27 +0200
Subject: [OpenWrt-Devel] [PATCH 3/7] mac80211: update linux-firmware to
	2014-07-14
In-Reply-To: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <1440327391-25355-4-git-send-email-dirkneukirchen@web.de>

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/kernel/mac80211/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 3037d79..a3ecb5b 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -108,8 +108,8 @@ Generic IEEE 802.11 Networking Stack (mac80211)
 endef
 
 PKG_LINUX_FIRMWARE_NAME:=linux-firmware
-PKG_LINUX_FIRMWARE_VERSION:=f404336ba808cbd57547196e13367079a23b822c
-PKG_LINUX_FIRMWARE_SOURCE:=$(PKG_LINUX_FIRMWARE_NAME)-2015-03-20-$(PKG_LINUX_FIRMWARE_VERSION).tar.bz2
+PKG_LINUX_FIRMWARE_VERSION:=696403047a940c425c93cb8da1efcec6ffda0b6e
+PKG_LINUX_FIRMWARE_SOURCE:=$(PKG_LINUX_FIRMWARE_NAME)-2015-07-14-$(PKG_LINUX_FIRMWARE_VERSION).tar.bz2
 PKG_LINUX_FIRMWARE_PROTO:=git
 PKG_LINUX_FIRMWARE_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
 PKG_LINUX_FIRMWARE_SUBDIR:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION)
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 06:56:28 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 12:56:28 +0200
Subject: [OpenWrt-Devel] [PATCH 4/7] mac80211: refresh Intel firmware
In-Reply-To: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <1440327391-25355-5-git-send-email-dirkneukirchen@web.de>

- sort firmware
- add newer firmware for Intel chipsets
- newer Intel MVM require firmware
- ucode 13 requires Kernel 4.1+

only compile tested

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/kernel/mac80211/Makefile | 198 ++++++++++++++++++++++++++-------------
 1 file changed, 133 insertions(+), 65 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index a3ecb5b..f2ea123 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -838,12 +838,84 @@ define KernelPackage/iwlagn
 endef
 
 define KernelPackage/iwlagn/description
- iwlagn kernel module for Intel 5000/5150/1000/6000/6050/6005/6030/100 support
+ iwlagn kernel module for
+ Intel Wireless WiFi Link 6250AGN Adapter
+ Intel 6000 Series Wi-Fi Adapters (6200AGN and 6300AGN)
+ Intel WiFi Link 1000BGN
+ Intel Wireless WiFi 5150AGN
+ Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN
+ Intel 6005 Series Wi-Fi Adapters
+ Intel 6030 Series Wi-Fi Adapters
+ Intel Wireless WiFi Link 6150BGN 2 Adapter
+ Intel 100 Series Wi-Fi Adapters (100BGN and 130BGN)
+ Intel 2000 Series Wi-Fi Adapters
+ Intel 7260 Wi-Fi Adapter
+ Intel 3160 Wi-Fi Adapter
+ Intel 7265 Wi-Fi Adapter
+ Intel 8260 Wi-Fi Adapter
+ Intel 3165 Wi-Fi Adapter
 endef
 
 define KernelPackage/iwlagn/config
   if PACKAGE_kmod-iwlagn
 
+	config IWL100_FW
+		bool "Intel 100 Firmware"
+		default y
+		help
+		  Download and install firmware for:
+		    Intel Centrino Wireless-N 100
+
+	config IWL1000_FW
+		bool "Intel 1000 Firmware"
+		default y
+		help
+		  Download and install firmware for:
+		    Intel Centrino Wireless-N 1000
+
+	config IWL105_FW
+		bool "Intel 105 Firmware"
+		default y
+		help
+		  Download and install firmware for:
+		    Intel Centrino Wireless-N 105
+
+	config IWL135_FW
+		bool "Intel 135 Firmware"
+		default y
+		help
+		  Download and install firmware for:
+		    Intel Centrino Wireless-N 135
+
+	config IWL2000_FW
+		bool "Intel 2000 Firmware"
+		default y
+		help
+		  Download and install firmware for:
+		    Intel Centrino Wireless-N 2200
+
+	config IWL2030_FW
+		bool "Intel 2030 Firmware"
+		default y
+		help
+		  Download and install firmware for:
+		    Intel Centrino Wireless-N 2230
+
+	config IWL3160_FW
+		bool "Intel 3160 Firmware"
+		default y
+		help
+		  Download and install firmware for:
+		    Intel Wireless WiFi 3160
+
+	config IWL3160_13_FW
+		bool "Intel 3160 Firmware ucode 13 (4.1+)"
+		default y
+		depends on LINUX_4_1
+		help
+		  Download and install firmware for:
+		    Intel Wireless WiFi 3160
+
 	config IWL5000_FW
 		bool "Intel 5000 Firmware"
 		default y
@@ -858,13 +930,6 @@ define KernelPackage/iwlagn/config
 		  Download and install firmware for:
 		    Intel Wireless WiFi 5150AGN
 
-	config IWL1000_FW
-		bool "Intel 1000 Firmware"
-		default y
-		help
-		  Download and install firmware for:
-		    Intel Centrino Wireless-N 1000
-
 	config IWL6000_FW
 		bool "Intel 6000 Firmware"
 		default y
@@ -872,13 +937,6 @@ define KernelPackage/iwlagn/config
 		  Download and install firmware for:
 		    Intel Centrino Ultimate-N 6300 and Advanced-N 6200
 
-	config IWL6050_FW
-		bool "Intel 6050 Firmware"
-		default y
-		help
-		  Download and install firmware for:
-		    Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150
-
 	config IWL6005_FW
 		bool "Intel 6005 Firmware"
 		default y
@@ -893,61 +951,58 @@ define KernelPackage/iwlagn/config
 		  Download and install firmware for:
 		    Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235
 
-	config IWL7260_FW
-		bool "Intel 7260 Firmware"
+	config IWL6050_FW
+		bool "Intel 6050 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260
+		    Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150
 
-	config IWL7265_FW
-		bool "Intel 7265 Firmware"
+	config IWL7260_FW
+		bool "Intel 7260 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Wireless 7265
+		    Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260
 
-	config IWL100_FW
-		bool "Intel 100 Firmware"
+	config IWL7260_10_FW
+		bool "Intel 7260 Firmware ucode 10 (3.17+)"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 100
+		    Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260
 
-	config IWL2000_FW
-		bool "Intel 2000 Firmware"
+	config IWL7260_13_FW
+		bool "Intel 7260 Firmware ucode 13 (4.1+)"
 		default y
+		depends on LINUX_4_1
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 2200
+		    Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260
 
-	config IWL2030_FW
-		bool "Intel 2030 Firmware"
+	config IWL7265_FW
+		bool "Intel 7265 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 2230
+		    Intel Wireless 7265
 
-	config IWL105_FW
-		bool "Intel 105 Firmware"
+	config IWL7265_13_FW
+		bool "Intel 7265 Firmware ucode 13 (4.1+)"
 		default y
+		depends on LINUX_4_1
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 105
+		    Intel Wireless 7265, 7265D, 3165
 
-	config IWL135_FW
-		bool "Intel 135 Firmware"
+	config IWL8000_FW
+		bool "Intel 8000 Series Firmware ucode 13 (4.1+)"
 		default y
+		depends on LINUX_4_1
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 135
+		    Intel Wireless Series 8260, 4165
 
-	config IWL3160_FW
-		bool "Intel 3160 Firmware"
-		default y
-		help
-		  Download and install firmware for:
-		    Intel Wireless 3160
   endif
 endef
 
@@ -1930,50 +1985,63 @@ endef
 
 define KernelPackage/iwlagn/install
 	$(INSTALL_DIR) $(1)/lib/firmware
+ifneq ($(CONFIG_IWL100_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL1000_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL105_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-105-6.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL135_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-135-6.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL2000_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2000-6.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL2030_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2030-6.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL3160_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3160-9.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL3160_13_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3160-13.ucode $(1)/lib/firmware
+endif
 ifneq ($(CONFIG_IWL5000_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5000-5.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL5150_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5150-2.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL1000_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware
-endif
 ifneq ($(CONFIG_IWL6000_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000-4.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL6050_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware
-endif
 ifneq ($(CONFIG_IWL6005_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2a-6.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL6030_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2b-6.ucode $(1)/lib/firmware
 endif
+ifneq ($(CONFIG_IWL6050_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware
+endif
 ifneq ($(CONFIG_IWL7260_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-9.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL7265_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265-9.ucode $(1)/lib/firmware
-endif
-ifneq ($(CONFIG_IWL100_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
-endif
-ifneq ($(CONFIG_IWL2000_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2000-6.ucode $(1)/lib/firmware
-endif
-ifneq ($(CONFIG_IWL2030_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2030-6.ucode $(1)/lib/firmware
+ifneq ($(CONFIG_IWL7260_10_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-10.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL105_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-105-6.ucode $(1)/lib/firmware
+ifneq ($(CONFIG_IWL7260_13_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-13.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL135_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-135-6.ucode $(1)/lib/firmware
+ifneq ($(CONFIG_IWL7265_13_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265-13.ucode $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265D-13.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL3160_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3160-9.ucode $(1)/lib/firmware
+ifneq ($(CONFIG_IWL8000_13_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-8000C-13.ucode $(1)/lib/firmware
 endif
 endef
 
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 06:56:29 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 12:56:29 +0200
Subject: [OpenWrt-Devel] [PATCH 5/7] mac80211: add iwlagn debug options
In-Reply-To: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <1440327391-25355-6-git-send-email-dirkneukirchen@web.de>

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/kernel/mac80211/Makefile | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index f2ea123..b9042db 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -859,6 +859,40 @@ endef
 define KernelPackage/iwlagn/config
   if PACKAGE_kmod-iwlagn
 
+	config PACKAGE_IWLWIFI_DEBUG
+		bool "Enable full debugging output in the iwlagn driver"
+		default n
+		help
+		  This option will enable debug tracing output for the iwlwifi drivers
+
+		  This will result in the kernel module being ~100k larger.  You can
+		  control which debug output is sent to the kernel log by setting the
+		  value in
+
+			/sys/module/iwlwifi/parameters/debug
+
+		  This entry will only exist if this option is enabled.
+
+		  To set a value, simply echo an 8-byte hex value to the same file:
+
+			  % echo 0x43fff > /sys/module/iwlwifi/parameters/debug
+
+		  You can find the list of debug mask values in:
+			  drivers/net/wireless/iwlwifi/iwl-debug.h
+
+		  If this is your first time using this driver, you should say Y here
+		  as the debug information can assist others in helping you resolve
+		  any problems you may encounter.
+
+	config PACKAGE_IWLWIFI_DEBUGFS
+	        bool "iwlwifi debugfs support"
+		depends on PACKAGE_MAC80211_DEBUGFS
+		default n
+		help
+		  Enable creation of debugfs files for the iwlwifi drivers. This
+		  is a low-impact option that allows getting insight into the
+		  driver's state at runtime.
+
 	config IWL100_FW
 		bool "Intel 100 Firmware"
 		default y
@@ -1699,6 +1733,8 @@ config-$(call config_package,iwl-legacy) += IWLEGACY
 config-$(call config_package,iwl3945) += IWL3945
 config-$(call config_package,iwl4965) += IWL4965
 config-$(call config_package,iwlagn) += IWLWIFI IWLDVM IWLMVM
+config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG
+config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
 
 config-$(call config_package,net-libipw) += LIBIPW
 config-$(call config_package,net-ipw2100) += IPW2100
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 07:00:42 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 13:00:42 +0200
Subject: [OpenWrt-Devel] [PATCH 7/7] mac80211: rename iwlagn to iwlwifi
Message-ID: <1440327642-25695-1-git-send-email-dirkneukirchen@web.de>

follow upstream module rename
commit 3c607d27c818cf4a5d28f2c73b18a88f8fbdfa33

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/kernel/mac80211/Makefile | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 061f117..cb38ab0 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -28,7 +28,7 @@ PKG_DRIVERS = \
 	b43 b43legacy \
 	carl9170 \
 	hermes hermes-pci hermes-pcmcia hermes-plx \
-	iwl-legacy iwl3945 iwl4965 iwlagn \
+	iwl-legacy iwl3945 iwl4965 iwlwifi \
 	libipw ipw2100 ipw2200 \
 	libertas-usb libertas-sdio \
 	lib80211 \
@@ -904,7 +904,7 @@ define KernelPackage/ipw2200/description
 endef
 
 
-define KernelPackage/iwlagn
+define KernelPackage/iwlwifi
   $(call KernelPackage/mac80211/Default)
   DEPENDS:= +kmod-mac80211 @PCI_SUPPORT + at DRIVER_11N_SUPPORT
   TITLE:=Intel AGN Wireless support
@@ -916,8 +916,8 @@ define KernelPackage/iwlagn
   MENU:=1
 endef
 
-define KernelPackage/iwlagn/description
- iwlagn kernel module for
+define KernelPackage/iwlwifi/description
+ iwlwifi kernel module for
  Intel Wireless WiFi Link 6250AGN Adapter
  Intel 6000 Series Wi-Fi Adapters (6200AGN and 6300AGN)
  Intel WiFi Link 1000BGN
@@ -935,11 +935,11 @@ define KernelPackage/iwlagn/description
  Intel 3165 Wi-Fi Adapter
 endef
 
-define KernelPackage/iwlagn/config
-  if PACKAGE_kmod-iwlagn
+define KernelPackage/iwlwifi/config
+  if PACKAGE_kmod-iwlwifi
 
 	config PACKAGE_IWLWIFI_DEBUG
-		bool "Enable full debugging output in the iwlagn driver"
+		bool "Enable full debugging output in the iwlwif driver"
 		default n
 		help
 		  This option will enable debug tracing output for the iwlwifi drivers
@@ -1747,7 +1747,7 @@ config-$(call config_package,ipw2200) += IPW2200
 config-$(call config_package,iwl-legacy) += IWLEGACY
 config-$(call config_package,iwl3945) += IWL3945
 config-$(call config_package,iwl4965) += IWL4965
-config-$(call config_package,iwlagn) += IWLWIFI IWLDVM IWLMVM
+config-$(call config_package,iwlwifi) += IWLWIFI IWLDVM IWLMVM
 config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG
 config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
 
@@ -2001,7 +2001,7 @@ define KernelPackage/ipw2200/install
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware
 endef
 
-define KernelPackage/iwlagn/install
+define KernelPackage/iwlwifi/install
 	$(INSTALL_DIR) $(1)/lib/firmware
 ifneq ($(CONFIG_IWL100_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
@@ -2205,7 +2205,7 @@ $(eval $(call KernelPackage,carl9170))
 $(eval $(call KernelPackage,cfg80211))
 $(eval $(call KernelPackage,iwl3945))
 $(eval $(call KernelPackage,iwl4965))
-$(eval $(call KernelPackage,iwlagn))
+$(eval $(call KernelPackage,iwlwifi))
 $(eval $(call KernelPackage,iwl-legacy))
 $(eval $(call KernelPackage,lib80211))
 $(eval $(call KernelPackage,libertas-sdio))
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 07:02:14 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 13:02:14 +0200
Subject: [OpenWrt-Devel] [PATCH 6/7] mac80211: cosmetic changes
In-Reply-To: <1440327391-25355-2-git-send-email-dirkneukirchen@web.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
 <1440327391-25355-2-git-send-email-dirkneukirchen@web.de>
Message-ID: <55D9A836.4080800@web.de>


- remove net prefix from some modules
- try to sort alphabetically

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/kernel/mac80211/Makefile | 2494 +++++++++++++++++++-------------------
 1 file changed, 1266 insertions(+), 1228 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index b9042db..061f117 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -23,15 +23,28 @@ PKG_BUILD_PARALLEL:=1
 PKG_MAINTAINER:=Felix Fietkau <nbd at openwrt.org>
 
 PKG_DRIVERS = \
-	adm8211 ath5k libertas-usb libertas-sdio p54-common p54-pci p54-usb p54-spi \
-	rt2x00-lib rt2x00-pci rt2x00-usb rt2800-lib rt2400-pci rt2500-pci \
-	rt2500-usb rt61-pci rt73-usb rt2800-mmio rt2800-pci rt2800-usb rt2800-soc \
-	rtl8180 rtl8187 zd1211rw mac80211-hwsim carl9170 b43 b43legacy \
-	ath9k-common ath9k ath9k-htc ath10k ath net-libipw net-ipw2100 net-ipw2200 \
-	mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \
-	iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \
+	adm8211 \
+	ath ath5k ath9k ath9k-common ath9k-htc ath10k \
+	b43 b43legacy \
+	carl9170 \
+	hermes hermes-pci hermes-pcmcia hermes-plx \
+	iwl-legacy iwl3945 iwl4965 iwlagn \
+	libipw ipw2100 ipw2200 \
+	libertas-usb libertas-sdio \
+	lib80211 \
+	mac80211-hwsim \
+	mt7601u \
+	mwl8k mwifiex-pcie \
+	p54-common p54-pci p54-usb p54-spi \
+	rt2x00-lib rt2x00-pci rt2x00-usb \
+	rt2400-pci rt2500-pci rt2500-usb \
+	rt2800-lib rt2800-mmio rt2800-pci rt2800-usb rt2800-soc \
+	rt61-pci rt73-usb \
+	rtl8180 rtl8187 \
 	rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \
-	rtl8192de rtl8192cu mt7601u
+	rtl8192de rtl8192cu \
+	wlcore wl12xx wl18xx \
+	zd1211rw
 
 PKG_CONFIG_DEPENDS:= \
 	CONFIG_PACKAGE_kmod-mac80211 \
@@ -126,513 +139,652 @@ define Download/linux-firmware
 endef
 $(eval $(call Download,linux-firmware))
 
-PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware
-PKG_ATH10K_LINUX_FIRMWARE_VERSION:=b46f3e01a6c1f9150fb4612ef53611d714565842
-PKG_ATH10K_LINUX_FIRMWARE_SOURCE:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION).tar.bz2
-PKG_ATH10K_LINUX_FIRMWARE_PROTO:=git
-PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git
-PKG_ATH10K_LINUX_FIRMWARE_SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION)
-#PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM:=?
 
-define Download/ath10k-firmware
-  FILE:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE)
-  URL:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL)
-  PROTO:=$(PKG_ATH10K_LINUX_FIRMWARE_PROTO)
-  VERSION:=$(PKG_ATH10K_LINUX_FIRMWARE_VERSION)
-  SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)
-  #MIRROR_MD5SUM:=$(PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM)
+define KernelPackage/adm8211
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=ADMTek 8211 support
+  DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/adm8211.ko
+  AUTOLOAD:=$(call AutoProbe,adm8211)
 endef
-$(eval $(call Download,ath10k-firmware))
 
-# Prism54 drivers
-P54PCIFW:=2.13.12.0.arm
-P54USBFW:=2.13.24.0.lm87.arm
-P54SPIFW:=2.13.0.0.a.13.14.arm
 
-define Download/p54usb
-  FILE:=$(P54USBFW)
-  URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb
-  MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6
-endef
-$(eval $(call Download,p54usb))
+define KernelPackage/ath/config
+  if PACKAGE_kmod-ath
+	config ATH_USER_REGD
+		bool "Force Atheros drivers to respect the user's regdomain settings"
+		help
+		  Atheros' idea of regulatory handling is that the EEPROM of the card defines
+		  the regulatory limits and the user is only allowed to restrict the settings
+		  even further, even if the country allows frequencies or power levels that
+		  are forbidden by the EEPROM settings.
 
-define Download/p54pci
-  FILE:=$(P54PCIFW)
-  URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac
-  MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4
-endef
-$(eval $(call Download,p54pci))
+		  Select this option if you want the driver to respect the user's decision about
+		  regulatory settings.
 
-define Download/p54spi
-  FILE:=$(P54SPIFW)
-  URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560
-  MD5SUM:=42661f8ecbadd88012807493f596081d
-endef
-$(eval $(call Download,p54spi))
+	config PACKAGE_ATH_DEBUG
+		bool "Atheros wireless debugging"
+		help
+		  Say Y, if you want to debug atheros wireless drivers.
+		  Only ath9k & ath10k make use of this.
 
-define KernelPackage/p54/Default
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Prism54 Drivers
-endef
+	config PACKAGE_ATH_DFS
+		bool "Enable DFS support"
+		default y
+		help
+		  Dynamic frequency selection (DFS) is required for most of the 5 GHz band
+		  channels in Europe, US, and Japan.
 
-define KernelPackage/p54/description
-  Kernel module for Prism54 chipsets (mac80211)
+		  Select this option if you want to use such channels.
+
+  endif
 endef
 
-define KernelPackage/p54-common
-  $(call KernelPackage/p54/Default)
-  DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt
-  TITLE+= (COMMON)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko
+define KernelPackage/ath
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros common driver part
+  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 +kmod-mac80211
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
+  MENU:=1
 endef
 
-define KernelPackage/p54-pci
-  $(call KernelPackage/p54/Default)
-  TITLE+= (PCI)
-  DEPENDS+= @PCI_SUPPORT +kmod-p54-common
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko
-  AUTOLOAD:=$(call AutoProbe,p54pci)
+define KernelPackage/ath/description
+ This module contains some common parts needed by Atheros Wireless drivers.
 endef
 
-define KernelPackage/p54-usb
-  $(call KernelPackage/p54/Default)
-  TITLE+= (USB)
-  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko
-  AUTOLOAD:=$(call AutoProbe,p54usb)
+define KernelPackage/ath5k
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 5xxx wireless cards support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k
+  DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
+  AUTOLOAD:=$(call AutoProbe,ath5k)
 endef
 
-define KernelPackage/p54-spi
-  $(call KernelPackage/p54/Default)
-  TITLE+= (SPI)
-  DEPENDS+= @TARGET_omap24xx +kmod-p54-common
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko
-  AUTOLOAD:=$(call AutoProbe,p54spi)
+define KernelPackage/ath5k/description
+ This module adds support for wireless adapters based on
+ Atheros 5xxx chipset.
 endef
 
-define KernelPackage/rt2x00/Default
+define KernelPackage/ath9k
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Ralink Drivers for RT2x00 cards
+  TITLE:=Atheros 802.11n PCI wireless cards support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
+  DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
+  AUTOLOAD:=$(call AutoProbe,ath9k)
 endef
 
-define KernelPackage/rt2x00-lib
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t
-  TITLE+= (LIB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko
-  MENU:=1
+define KernelPackage/ath9k/description
+This module adds support for wireless adapters based on
+Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
 endef
 
-define KernelPackage/rt2x00-lib/config
-  if PACKAGE_kmod-rt2x00-lib
-
-	config PACKAGE_RT2X00_LIB_DEBUGFS
-		bool "Enable rt2x00 debugfs support"
-		depends on PACKAGE_MAC80211_DEBUGFS
-		help
-		  Enable creation of debugfs files for the rt2x00 drivers.
-		  These debugfs files support both reading and writing of the
-		  most important register types of the rt2x00 hardware.
+define KernelPackage/ath9k/config
 
-	config PACKAGE_RT2X00_DEBUG
-		bool "Enable rt2x00 debug output"
-		help
-		  Enable debugging output for all rt2x00 modules
+	config ATH9K_SUPPORT_PCOEM
+		bool "Support chips used in PC OEM cards"
+		depends on PACKAGE_kmod-ath9k
 
-  endif
 endef
 
-define KernelPackage/rt2x00-mmio
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6
-  HIDDEN:=1
-  TITLE+= (MMIO)
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00mmio.ko
+define KernelPackage/ath9k-common
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
+  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath + at DRIVER_11N_SUPPORT + at KERNEL_RELAY
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
 endef
 
-define KernelPackage/rt2x00-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib
-  HIDDEN:=1
-  TITLE+= (PCI)
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt2x00pci)
+define KernelPackage/ath9k-htc
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 802.11n USB device support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
+  DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
+  AUTOLOAD:=$(call AutoProbe,ath9k_htc)
 endef
 
-define KernelPackage/rt2x00-usb
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
-  HIDDEN:=1
-  TITLE+= (USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko
-  AUTOLOAD:=$(call AutoProbe,rt2x00usb)
+define KernelPackage/ath9k-htc/description
+This module adds support for wireless adapters based on
+Atheros USB AR9271 and AR7010 family of chipsets.
 endef
 
-define KernelPackage/rt2800-lib
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt + at DRIVER_11N_SUPPORT
-  HIDDEN:=1
-  TITLE+= (rt2800 LIB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko
-endef
 
-define KernelPackage/rt2400-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
-  TITLE+= (RT2400 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt2400pci)
-endef
+PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware
+PKG_ATH10K_LINUX_FIRMWARE_VERSION:=b46f3e01a6c1f9150fb4612ef53611d714565842
+PKG_ATH10K_LINUX_FIRMWARE_SOURCE:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION).tar.bz2
+PKG_ATH10K_LINUX_FIRMWARE_PROTO:=git
+PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git
+PKG_ATH10K_LINUX_FIRMWARE_SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION)
+#PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM:=?
 
-define KernelPackage/rt2500-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
-  TITLE+= (RT2500 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt2500pci)
+define Download/ath10k-firmware
+  FILE:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE)
+  URL:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL)
+  PROTO:=$(PKG_ATH10K_LINUX_FIRMWARE_PROTO)
+  VERSION:=$(PKG_ATH10K_LINUX_FIRMWARE_VERSION)
+  SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)
+  #MIRROR_MD5SUM:=$(PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM)
 endef
+$(eval $(call Download,ath10k-firmware))
 
-define KernelPackage/rt2500-usb
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
-  TITLE+= (RT2500 USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko
-  AUTOLOAD:=$(call AutoProbe,rt2500usb)
+define KernelPackage/ath10k
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 802.11ac wireless cards support
+  URL:=https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
+  DEPENDS+= @PCI_SUPPORT +kmod-ath + at DRIVER_11N_SUPPORT
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
+  AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci)
 endef
 
-define KernelPackage/rt61-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
-  TITLE+= (RT2x61 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt61pci)
+define KernelPackage/ath10k/description
+This module adds support for wireless adapters based on
+Atheros IEEE 802.11ac family of chipsets. For now only
+PCI is supported.
 endef
 
-define KernelPackage/rt73-usb
-  $(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
-  TITLE+= (RT73 USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko
-  AUTOLOAD:=$(call AutoProbe,rt73usb)
-endef
+define KernelPackage/ath10k/config
+  if PACKAGE_kmod-ath10k
 
-define KernelPackage/rt2800-mmio
-$(call KernelPackage/rt2x00/Default)
-  TITLE += (RT28xx/RT3xxx MMIO)
-  DEPENDS += +kmod-rt2800-lib +kmod-rt2x00-mmio
-  HIDDEN:=1
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800mmio.ko
-endef
+	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.
 
-define KernelPackage/rt2800-soc
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS += @(TARGET_ramips_rt288x||TARGET_ramips_rt305x||TARGET_ramips_rt3883||TARGET_ramips_mt7620) +kmod-rt2800-mmio +kmod-rt2800-lib
-  TITLE += (RT28xx/RT3xxx SoC)
-  FILES := \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800soc.ko
-  AUTOLOAD:=$(call AutoProbe,rt2800soc)
+  endif
 endef
 
-define KernelPackage/rt2800-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-rt2800-mmio
-  TITLE+= (RT2860 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt2800pci)
+
+#Broadcom firmware
+ifneq ($(CONFIG_B43_FW_6_30),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=6.30.163.46
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
+  PKG_B43_FWV4_MD5SUM:=6fe97e9368d25342a1ab943d3cf3496d
+else
+ifneq ($(CONFIG_B43_FW_5_10),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=5.10.56.27.3
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
+  PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac
+else
+ifneq ($(CONFIG_B43_FW_4_178),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=4.178.10.4
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
+  PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb
+else
+ifneq ($(CONFIG_B43_FW_5_100_138),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=5.100.138
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
+  PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
+else
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=4.150.10.5
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
+  PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60
+endif
+endif
+endif
+endif
+ifneq ($(CONFIG_B43_OPENFIRMWARE),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=5.2
+  PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION)
+  PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz
+  PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/
+  PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa
+endif
+
+
+PKG_B43_FWV3_NAME:=wl_apsta
+PKG_B43_FWV3_VERSION:=3.130.20.0
+PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
+PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
+PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
+
+define Download/b43
+  FILE:=$(PKG_B43_FWV4_SOURCE)
+  URL:=$(PKG_B43_FWV4_SOURCE_URL)
+  MD5SUM:=$(PKG_B43_FWV4_MD5SUM)
 endef
+$(eval $(call Download,b43))
 
-define KernelPackage/rt2800-usb
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt
-  TITLE+= (RT2870 USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko
-  AUTOLOAD:=$(call AutoProbe,rt2800usb)
+define Download/b43legacy
+  FILE:=$(PKG_B43_FWV3_SOURCE)
+  URL:=$(PKG_B43_FWV3_SOURCE_URL)
+  MD5SUM:=$(PKG_B43_FWV3_MD5SUM)
 endef
+$(eval $(call Download,b43legacy))
 
-define KernelPackage/rtl818x/Default
+
+define KernelPackage/b43
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek Drivers for RTL818x devices
-  URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187
-  DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211
+  TITLE:=Broadcom 43xx wireless support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
+  KCONFIG:= \
+  	CONFIG_HW_RANDOM=y
+  # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb
+  DEPENDS += \
+	@PCI_SUPPORT +kmod-mac80211 \
+	$(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \
+	$(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko
+  AUTOLOAD:=$(call AutoProbe,b43)
+  MENU:=1
 endef
 
-define KernelPackage/rtl8180
-  $(call KernelPackage/rtl818x/Default)
-  DEPENDS+= @PCI_SUPPORT
-  TITLE+= (RTL8180 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl818x_pci.ko
-  AUTOLOAD:=$(call AutoProbe,rtl818x_pci)
-endef
+define KernelPackage/b43/config
 
-define KernelPackage/rtl8187
-$(call KernelPackage/rtl818x/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-usb-core
-  TITLE+= (RTL8187 USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8187)
-endef
+config PACKAGE_B43_USE_SSB
+	select PACKAGE_kmod-ssb
+	tristate
+	depends on !TARGET_brcm47xx && !TARGET_brcm63xx
+	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
+	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB
 
-define KernelPackage/rtlwifi/config
-	config PACKAGE_RTLWIFI_DEBUG
-		bool "Realtek wireless debugging"
-		depends on PACKAGE_kmod-rtlwifi
+config PACKAGE_B43_USE_BCMA
+	select PACKAGE_kmod-bcma
+	tristate
+	depends on !TARGET_brcm47xx && !TARGET_bcm53xx
+	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
+	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA
+
+  if PACKAGE_kmod-b43
+
+	choice
+		prompt "b43 firmware version"
+		default B43_FW_5_100_138
 		help
-		  Say Y, if you want to debug realtek wireless drivers.
+		  This option allows you to select the version of the b43 firmware.
 
-endef
+	config B43_FW_4_150
+		bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)"
+		help
+		  Old stable firmware for BCM43xx devices.
 
-define KernelPackage/rtlwifi
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek common driver part
-  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 + at DRIVER_11N_SUPPORT
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtlwifi.ko
-  HIDDEN:=1
-endef
+		  If unsure, select this.
 
-define KernelPackage/rtlwifi-pci
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek common driver part (PCI support)
-  DEPENDS+= @PCI_SUPPORT +kmod-rtlwifi
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_pci.ko
-  AUTOLOAD:=$(call AutoProbe,rtl_pci)
-  HIDDEN:=1
-endef
+	config B43_FW_4_178
+		bool "Firmware 478.104 from driver 4.178.10.4"
+		help
+		  Older firmware for BCM43xx devices.
+
+		  If unsure, select the "stable" firmware.
+
+	config B43_FW_5_10
+		bool "Firmware 508.1084 from driver 5.10.56.27"
+		help
+		  Older firmware for BCM43xx devices.
+
+		  If unsure, select the "stable" firmware.
+
+	config B43_FW_5_100_138
+		bool "Firmware 666.2 from driver 5.100.138 (stable)"
+		help
+		  The currently default firmware for BCM43xx devices.
+
+		  This firmware currently gets most of the testing and is needed for some N-PHY devices.
+
+		  If unsure, select the this firmware.
+
+	config B43_FW_6_30
+		bool "Firmware 784.2 from driver 6.30.163.46 (experimental)"
+		help
+		  Newer experimental firmware for BCM43xx devices.
+
+		  This firmware is mostly untested.
+
+		  If unsure, select the "stable" firmware.
+
+	config B43_OPENFIRMWARE
+		bool "Open FirmWare for WiFi networks"
+		help
+		  Opensource firmware for BCM43xx devices.
+
+		  Do _not_ select this, unless you know what you are doing.
+		  The Opensource firmware is not suitable for embedded devices, yet.
+		  It does not support QoS, which is bad for AccessPoints.
+		  It does not support hardware crypto acceleration, which is a showstopper
+		  for embedded devices with low CPU resources.
+
+		  If unsure, select the "stable" firmware.
+
+	endchoice
+
+	config B43_FW_SQUASH
+		bool "Remove unnecessary firmware files"
+		depends on !B43_OPENFIRMWARE
+		default y
+		help
+		  This options allows you to remove unnecessary b43 firmware files
+		  from the final rootfs image. This can reduce the rootfs size by
+		  up to 200k.
+
+		  If unsure, say Y.
+
+	config B43_FW_SQUASH_COREREVS
+		string "Core revisions to include"
+		depends on B43_FW_SQUASH
+		default "5,6,7,8,9,10,11,13,15" if TARGET_brcm47xx_legacy
+		default "16,28,29,30" if TARGET_brcm47xx_mips74k
+		default "5,6,7,8,9,10,11,13,15,16,28,29,30"
+		help
+		  This is a comma seperated list of core revision numbers.
+
+		  Example (keep files for rev5 only):
+		    5
+
+		  Example (keep files for rev5 and rev11):
+		    5,11
+
+	config B43_FW_SQUASH_PHYTYPES
+		string "PHY types to include"
+		depends on B43_FW_SQUASH
+		default "G,N,LP" if TARGET_brcm47xx_legacy
+		default "N,HT" if TARGET_brcm47xx_mips74k
+		default "G,N,LP,HT"
+		help
+		  This is a comma seperated list of PHY types:
+		    A  => A-PHY
+		    AG => Dual A-PHY G-PHY
+		    G  => G-PHY
+		    LP => LP-PHY
+		    N  => N-PHY
+		    HT  => HT-PHY
+		    LCN  => LCN-PHY
+		    LCN40  => LCN40-PHY
+		    AC  => AC-PHY
+
+		  Example (keep files for G-PHY only):
+		    G
+
+		  Example (keep files for G-PHY and N-PHY):
+		    G,N
+
+	choice
+		prompt "Supported buses"
+		default PACKAGE_B43_BUSES_BCMA_AND_SSB
+		help
+		  This allows choosing buses that b43 should support.
+
+	config PACKAGE_B43_BUSES_BCMA_AND_SSB
+		depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
+		bool "BCMA and SSB"
+
+	config PACKAGE_B43_BUSES_BCMA
+		depends on !TARGET_brcm47xx_legacy
+		bool "BCMA only"
+
+	config PACKAGE_B43_BUSES_SSB
+		depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
+		bool "SSB only"
+
+	endchoice
+
+	config PACKAGE_B43_DEBUG
+		bool "Enable debug output and debugfs for b43"
+		default n
+		help
+		  Enable additional debug output and runtime sanity checks for b43
+		  and enables the debugfs interface.
+
+		  If unsure, say N.
+
+	config PACKAGE_B43_PIO
+		bool "Enable support for PIO transfer mode"
+		default n
+		help
+		  Enable support for using PIO instead of DMA. Unless you have DMA
+		  transfer problems you don't need this.
+
+		  If unsure, say N.
+
+	config PACKAGE_B43_PHY_G
+		bool "Enable support for G-PHYs"
+		default n if TARGET_brcm47xx_mips74k
+		default y
+		help
+		  Enable support for G-PHY. This includes support for the following devices:
+		  PCI: BCM4306, BCM4311, BCM4318
+		  SoC: BCM5352E, BCM4712
+
+		  If unsure, say Y.
+
+	config PACKAGE_B43_PHY_N
+		bool "Enable support for N-PHYs"
+		default y
+		help
+		  Enable support for N-PHY. This includes support for the following devices:
+		  PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225
+		  SoC: BCM4716, BCM4717, BCM4718
 
-define KernelPackage/rtlwifi-usb
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek common driver part (USB support)
-  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-rtlwifi
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_usb.ko
-  AUTOLOAD:=$(call AutoProbe,rtl_usb)
-  HIDDEN:=1
-endef
+		  Currently only 11g speed is available.
 
-define KernelPackage/rtl8192c-common
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192CE/RTL8192CU common support module
-  DEPENDS+= +kmod-rtlwifi
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
-  HIDDEN:=1
-endef
+		  If unsure, say Y.
 
-define KernelPackage/rtl8192ce
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192CE/RTL8188CE support
-  DEPENDS+= +kmod-rtlwifi-pci +kmod-rtl8192c-common
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192ce.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8192ce)
-endef
+	config PACKAGE_B43_PHY_LP
+		bool "Enable support for LP-PHYs"
+		default n if TARGET_brcm47xx_mips74k
+		default y
+		help
+		  Enable support for LP-PHY. This includes support for the following devices:
+		  PCI: BCM4312
+		  SoC: BCM5354
 
-define KernelPackage/rtl8192ce/install
-	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfw.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU_B.bin $(1)/lib/firmware/rtlwifi
-endef
+		  If unsure, say Y.
 
-define KernelPackage/rtl8192se
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192SE/RTL8191SE support
-  DEPENDS+= +kmod-rtlwifi-pci
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192se/rtl8192se.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8192se)
-endef
+	config PACKAGE_B43_PHY_HT
+		bool "Enable support for HT-PHYs"
+		default n if TARGET_brcm47xx_legacy
+		default y
+		help
+		  Enable support for HT-PHY. This includes support for the following devices:
+		  PCI: BCM4331
 
-define KernelPackage/rtl8192se/install
-	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192sefw.bin $(1)/lib/firmware/rtlwifi
-endef
+		  Currently only 11g speed is available.
 
-define KernelPackage/rtl8192de
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192DE/RTL8188DE support
-  DEPENDS+= +kmod-rtlwifi-pci
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192de/rtl8192de.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8192de)
-endef
+		  If unsure, say Y.
 
-define KernelPackage/rtl8192de/install
-	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192defw.bin $(1)/lib/firmware/rtlwifi
-endef
+	config PACKAGE_B43_PHY_LCN
+		bool "Enable support for LCN-PHYs"
+		depends on BROKEN
+		default n
+		help
+		  Currently broken.
 
-define KernelPackage/rtl8192cu
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192CU/RTL8188CU support
-  DEPENDS+= +kmod-rtlwifi-usb +kmod-rtl8192c-common
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8192cu)
-endef
+		  If unsure, say N.
 
-define KernelPackage/rtl8192cu/install
-	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_A.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_B.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_TMSC.bin $(1)/lib/firmware/rtlwifi
+  endif
 endef
 
-ZD1211FW_NAME:=zd1211-firmware
-ZD1211FW_VERSION:=1.4
-define Download/zd1211rw
-  FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
-  URL:=@SF/zd1211/
-  MD5SUM:=19f28781d76569af8551c9d11294c870
+define KernelPackage/b43/description
+Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
 endef
-$(eval $(call Download,zd1211rw))
 
-define KernelPackage/zd1211rw
+define KernelPackage/b43legacy
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Zydas ZD1211 support
-  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko
-  AUTOLOAD:=$(call AutoProbe,zd1211rw)
+  TITLE:=Broadcom 43xx-legacy wireless support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
+  KCONFIG:= \
+  	CONFIG_HW_RANDOM=y
+  DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko
+  AUTOLOAD:=$(call AutoProbe,b43legacy)
+  MENU:=1
 endef
 
-define KernelPackage/adm8211
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=ADMTek 8211 support
-  DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/adm8211.ko
-  AUTOLOAD:=$(call AutoProbe,adm8211)
-endef
+define KernelPackage/b43legacy/config
+  if PACKAGE_kmod-b43legacy
 
-define KernelPackage/ath/config
-  if PACKAGE_kmod-ath
-	config ATH_USER_REGD
-		bool "Force Atheros drivers to respect the user's regdomain settings"
+	config B43LEGACY_FW_SQUASH
+		bool "Remove unnecessary firmware files"
+		default y
 		help
-		  Atheros' idea of regulatory handling is that the EEPROM of the card defines
-		  the regulatory limits and the user is only allowed to restrict the settings
-		  even further, even if the country allows frequencies or power levels that
-		  are forbidden by the EEPROM settings.
+		  This options allows you to remove unnecessary b43legacy firmware files
+		  from the final rootfs image. This can reduce the rootfs size by
+		  up to 50k.
 
-		  Select this option if you want the driver to respect the user's decision about
-		  regulatory settings.
+		  If unsure, say Y.
 
-	config PACKAGE_ATH_DEBUG
-		bool "Atheros wireless debugging"
+	config B43LEGACY_FW_SQUASH_COREREVS
+		string "Core revisions to include"
+		depends on B43LEGACY_FW_SQUASH
+		default "1,2,3,4"
 		help
-		  Say Y, if you want to debug atheros wireless drivers.
-		  Only ath9k & ath10k make use of this.
+		  This is a comma seperated list of core revision numbers.
 
-	config PACKAGE_ATH_DFS
-		bool "Enable DFS support"
-		default y
-		help
-		  Dynamic frequency selection (DFS) is required for most of the 5 GHz band
-		  channels in Europe, US, and Japan.
+		  Example (keep files for rev4 only):
+		    4
 
-		  Select this option if you want to use such channels.
+		  Example (keep files for rev2 and rev4):
+		    2,4
 
   endif
 endef
 
-define KernelPackage/ath
+define KernelPackage/b43legacy/description
+Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
+endef
+
+
+define KernelPackage/brcmutil
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros common driver part
-  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 +kmod-mac80211
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
+  TITLE:=Broadcom IEEE802.11n common driver parts
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
+  DEPENDS+=@PCI_SUPPORT||USB_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko
+  AUTOLOAD:=$(call AutoProbe,brcmutil)
   MENU:=1
 endef
 
-define KernelPackage/ath/description
- This module contains some common parts needed by Atheros Wireless drivers.
+define KernelPackage/brcmutil/description
+ This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac.
 endef
 
-define KernelPackage/ath5k
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 5xxx wireless cards support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k
-  DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
-  AUTOLOAD:=$(call AutoProbe,ath5k)
-endef
+define KernelPackage/brcmutil/config
+  if PACKAGE_kmod-brcmutil
 
-define KernelPackage/ath5k/description
- This module adds support for wireless adapters based on
- Atheros 5xxx chipset.
+	config PACKAGE_BRCM80211_DEBUG
+		bool "Broadcom wireless driver debugging"
+		help
+		  Say Y, if you want to debug brcmsmac and brcmfmac wireless driver.
+
+  endif
 endef
 
-define KernelPackage/ath9k-common
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
-  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath + at DRIVER_11N_SUPPORT + at KERNEL_RELAY
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
+PKG_BRCMSMAC_FW_NAME:=broadcom-wl
+PKG_BRCMSMAC_FW_VERSION:=5.100.138
+PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o
+PKG_BRCMSMAC_FW_SOURCE:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION).tar.bz2
+PKG_BRCMSMAC_FW_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
+PKG_BRCMSMAC_FW_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
+
+define Download/brcmsmac
+  FILE:=$(PKG_BRCMSMAC_FW_SOURCE)
+  URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL)
+  MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM)
 endef
+$(eval $(call Download,brcmsmac))
 
-define KernelPackage/ath9k
+define KernelPackage/brcmsmac
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 802.11n PCI wireless cards support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
-  DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
-  AUTOLOAD:=$(call AutoProbe,ath9k)
+  TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT +!TARGET_brcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko
+  AUTOLOAD:=$(call AutoProbe,brcmsmac)
+  MENU:=1
 endef
 
-define KernelPackage/ath9k/description
-This module adds support for wireless adapters based on
-Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
+define KernelPackage/brcmsmac/description
+ Kernel module for Broadcom IEEE802.11n PCIe Wireless cards
 endef
 
-define KernelPackage/ath9k/config
+define KernelPackage/brcmsmac/config
+  if PACKAGE_kmod-brcmsmac
 
-	config ATH9K_SUPPORT_PCOEM
-		bool "Support chips used in PC OEM cards"
-		depends on PACKAGE_kmod-ath9k
-	
-endef
+	config BRCMSMAC_USE_FW_FROM_WL
+		bool "Use firmware extracted from broadcom proprietary driver"
+		default y
+		help
+		  Instead of using the official brcmsmac firmware a firmware
+		  version 666.2 extracted from the proprietary Broadcom driver
+		  is used. This is needed to get core rev 17 used in bcm4716
+		  to work.
 
-define KernelPackage/ath9k-htc
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 802.11n USB device support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
-  DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
-  AUTOLOAD:=$(call AutoProbe,ath9k_htc)
-endef
+		  If unsure, say Y.
 
-define KernelPackage/ath9k-htc/description
-This module adds support for wireless adapters based on
-Atheros USB AR9271 and AR7010 family of chipsets.
+  endif
 endef
 
-define KernelPackage/ath10k
+
+define KernelPackage/brcmfmac
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 802.11ac wireless cards support
-  URL:=https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
-  DEPENDS+= @PCI_SUPPORT +kmod-ath + at DRIVER_11N_SUPPORT
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
-  AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci)
+  TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
+  DEPENDS+= @USB_SUPPORT +kmod-cfg80211 + at DRIVER_11N_SUPPORT +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_USB:kmod-usb-core
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko
+  AUTOLOAD:=$(call AutoProbe,brcmfmac)
 endef
 
-define KernelPackage/ath10k/description
-This module adds support for wireless adapters based on
-Atheros IEEE 802.11ac family of chipsets. For now only
-PCI is supported.
+define KernelPackage/brcmfmac/description
+ Kernel module for Broadcom IEEE802.11n USB Wireless cards
 endef
 
-define KernelPackage/ath10k/config
-  if PACKAGE_kmod-ath10k
+define KernelPackage/brcmfmac/config
+  if PACKAGE_kmod-brcmfmac
 
-	config ATH10K_API2_FW
-		bool "Firmware optimized for AP operation (v10.1 / API v2)"
+	config BRCMFMAC_SDIO
+		bool "Enable SDIO bus interface support"
 		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.
+		  Enable support for cards attached to an SDIO bus.
+		  Select this option only if you are sure that your
+		  board has a Broadcom wireless chip atacched to
+		  that bus.
+
+	config BRCMFMAC_USB
+		bool "Enable USB bus interface support"
+		depends on USB_SUPPORT
+		default y
+		help
+		  Supported USB connected chipsets:
+		  BCM43235, BCM43236, BCM43238 (all in revision 3 only)
+		  BCM43143, BCM43242, BCM43566, BCM43569
+
+	config BRCMFMAC_PCIE
+		bool "Enable PCIE bus interface support"
+		depends on PCI_SUPPORT
+		default y
+		help
+		  Supported PCIe connected chipsets:
+		  BCM4354, BCM4356, BCM43567, BCM43570, BCM43602
 
   endif
 endef
 
+
 define KernelPackage/carl9170
   $(call KernelPackage/mac80211/Default)
   TITLE:=Driver for Atheros AR9170 USB sticks
@@ -641,82 +793,57 @@ define KernelPackage/carl9170
   AUTOLOAD:=$(call AutoProbe,carl9170)
 endef
 
-define KernelPackage/lib80211
+
+define KernelPackage/hermes
   $(call KernelPackage/mac80211/Default)
-  TITLE:=802.11 Networking stack
-  DEPENDS:=+kmod-cfg80211
-  FILES:= \
-	$(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
-	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
-	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
-	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
-  AUTOLOAD:=$(call AutoProbe, \
-	lib80211 \
-	lib80211_crypt_wep \
-	lib80211_crypt_ccmp \
-	lib80211_crypt_tkip \
-  )
+  TITLE:=Hermes 802.11b chipset support
+  DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 + at DRIVER_WEXT_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko
+  AUTOLOAD:=$(call AutoProbe,orinoco)
 endef
 
-define KernelPackage/lib80211/description
- Kernel modules for 802.11 Networking stack
- Includes:
- - lib80211
- - lib80211_crypt_wep
- - lib80211_crypt_tkip
- - lib80211_crytp_ccmp
+define KernelPackage/hermes/description
+ Kernel support for Hermes 802.11b chipsets
 endef
 
-define KernelPackage/libertas-usb
+define KernelPackage/hermes-pci
   $(call KernelPackage/mac80211/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 + at DRIVER_WEXT_SUPPORT
-  TITLE:=Marvell 88W8015 Wireless Driver
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko
-  AUTOLOAD:=$(call AutoProbe,libertas usb8xxx)
+  TITLE:=Intersil Prism 2.5 PCI support
+  DEPENDS:=@PCI_SUPPORT +kmod-hermes
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko
+  AUTOLOAD:=$(call AutoProbe,orinoco_pci)
 endef
 
-define KernelPackage/libertas-sdio
-  $(call KernelPackage/mac80211/Default)
-  DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc + at DRIVER_WEXT_SUPPORT @!TARGET_uml
-  TITLE:=Marvell 88W8686 Wireless Driver
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko
-  AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio)
+define KernelPackage/hermes-pci/description
+ Kernel modules for Intersil Prism 2.5 PCI support
 endef
 
-define KernelPackage/mac80211-hwsim
+define KernelPackage/hermes-pcmcia
   $(call KernelPackage/mac80211/Default)
-  TITLE:=mac80211 HW simulation device
-  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
-  AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
+  TITLE:=Hermes based PCMCIA adaptors
+  DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes @BROKEN
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko
+  AUTOLOAD:=$(call AutoProbe,orinoco_cs)
 endef
 
-PKG_MT7601U_FW_NAME:=DPO_MT7601U_LinuxSTA
-PKG_MT7601U_FW_VERSION:=3.0.0.4_20130913
-PKG_MT7601U_FW_MD5SUM:=5f440dccc8bc952745a191994fc34699
-PKG_MT7601U_FW_SOURCE:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION).tar.bz2
-PKG_MT7601U_FW_SOURCE_URL:=http://www.mediatek.com/AmazonS3/Downloads/linux/
-define Download/mt7601u-firmware
-  FILE:=$(PKG_MT7601U_FW_SOURCE)
-  URL:=$(PKG_MT7601U_FW_SOURCE_URL)
-  MD5SUM:=$(PKG_MT7601U_FW_MD5SUM)
-  SUBDIR:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)
+define KernelPackage/hermes-pcmcia/description
+ Kernel modules for Hermes based PCMCIA adaptors
 endef
-$(eval $(call Download,mt7601u-firmware))
 
-define KernelPackage/mt7601u
+define KernelPackage/hermes-plx
   $(call KernelPackage/mac80211/Default)
-  TITLE:=MT7601U-based USB dongles Wireless Driver
-  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
-  AUTOLOAD:=$(call AutoProbe,mt7601)
+  TITLE:=PLX9052 based PCI adaptor
+  DEPENDS:=@PCI_SUPPORT +kmod-hermes
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko
+  AUTOLOAD:=$(call AutoProbe,orinoco_plx)
+endef
+
+define KernelPackage/hermes-plx/description
+ Kernel modules for Hermes in PLX9052 based PCI adaptors
 endef
 
-define KernelPackage/net-libipw
+
+define KernelPackage/libipw
   $(call KernelPackage/mac80211/Default)
   TITLE:=libipw for ipw2100 and ipw2200
   DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211 + at DRIVER_WEXT_SUPPORT @!BIG_ENDIAN
@@ -724,29 +851,29 @@ define KernelPackage/net-libipw
   AUTOLOAD:=$(call AutoProbe,libipw)
 endef
 
-define KernelPackage/net-libipw/description
+define KernelPackage/libipw/description
  Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200.
 endef
 
 IPW2100_NAME:=ipw2100-fw
 IPW2100_VERSION:=1.3
 
-define Download/net-ipw2100
+define Download/ipw2100
   URL:=http://bughost.org/firmware/
   FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
   MD5SUM=46aa75bcda1a00efa841f9707bbbd113
 endef
-$(eval $(call Download,net-ipw2100))
+$(eval $(call Download,ipw2100))
 
-define KernelPackage/net-ipw2100
+define KernelPackage/ipw2100
   $(call KernelPackage/mac80211/Default)
   TITLE:=Intel IPW2100 driver
-  DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
+  DEPENDS:=@PCI_SUPPORT +kmod-libipw
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.ko
   AUTOLOAD:=$(call AutoProbe,ipw2100)
 endef
 
-define KernelPackage/net-ipw2100/description
+define KernelPackage/ipw2100/description
  Kernel support for Intel IPW2100
  Includes:
  - ipw2100
@@ -755,76 +882,28 @@ endef
 IPW2200_NAME:=ipw2200-fw
 IPW2200_VERSION:=3.1
 
-define Download/net-ipw2200
+define Download/ipw2200
   URL:=http://bughost.org/firmware/
   FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
   MD5SUM=eaba788643c7cc7483dd67ace70f6e99
 endef
-$(eval $(call Download,net-ipw2200))
+$(eval $(call Download,ipw2200))
 
-define KernelPackage/net-ipw2200
+define KernelPackage/ipw2200
   $(call KernelPackage/mac80211/Default)
   TITLE:=Intel IPW2200 driver
-  DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
+  DEPENDS:=@PCI_SUPPORT +kmod-libipw
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.ko
   AUTOLOAD:=$(call AutoProbe,ipw2200)
 endef
 
-define KernelPackage/net-ipw2200/description
+define KernelPackage/ipw2200/description
  Kernel support for Intel IPW2200
  Includes:
  - ipw2200
 endef
 
 
-define KernelPackage/net-hermes
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Hermes 802.11b chipset support
-  DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 + at DRIVER_WEXT_SUPPORT
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko
-  AUTOLOAD:=$(call AutoProbe,orinoco)
-endef
-
-define KernelPackage/net-hermes/description
- Kernel support for Hermes 802.11b chipsets
-endef
-
-define KernelPackage/net-hermes-pci
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Intersil Prism 2.5 PCI support
-  DEPENDS:=@PCI_SUPPORT +kmod-net-hermes
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko
-  AUTOLOAD:=$(call AutoProbe,orinoco_pci)
-endef
-
-define KernelPackage/net-hermes-pci/description
- Kernel modules for Intersil Prism 2.5 PCI support
-endef
-
-define KernelPackage/net-hermes-plx
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=PLX9052 based PCI adaptor
-  DEPENDS:=@PCI_SUPPORT +kmod-net-hermes
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko
-  AUTOLOAD:=$(call AutoProbe,orinoco_plx)
-endef
-
-define KernelPackage/net-hermes-plx/description
- Kernel modules for Hermes in PLX9052 based PCI adaptors
-endef
-
-define KernelPackage/net-hermes-pcmcia
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Hermes based PCMCIA adaptors
-  DEPENDS:=@PCMCIA_SUPPORT +kmod-net-hermes @BROKEN
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko
-  AUTOLOAD:=$(call AutoProbe,orinoco_cs)
-endef
-
-define KernelPackage/net-hermes-pcmcia/description
- Kernel modules for Hermes based PCMCIA adaptors
-endef
-
 define KernelPackage/iwlagn
   $(call KernelPackage/mac80211/Default)
   DEPENDS:= +kmod-mac80211 @PCI_SUPPORT + at DRIVER_11N_SUPPORT
@@ -1048,32 +1127,111 @@ define KernelPackage/iwl-legacy
   AUTOLOAD:=$(call AutoProbe,iwlegacy)
 endef
 
-define KernelPackage/iwl-legacy/description
- iwl-legacy kernel module for legacy Intel wireless support
-endef
+define KernelPackage/iwl-legacy/description
+ iwl-legacy kernel module for legacy Intel wireless support
+endef
+
+define KernelPackage/iwl3945
+  $(call KernelPackage/mac80211/Default)
+  DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy
+  TITLE:=Intel iwl3945 Wireless support
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl3945.ko
+  AUTOLOAD:=$(call AutoProbe,iwl3945)
+endef
+
+define KernelPackage/iwl3945/description
+ iwl3945 kernel module for Intel 3945 support
+endef
+
+define KernelPackage/iwl4965
+  $(call KernelPackage/mac80211/Default)
+  DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy + at DRIVER_11N_SUPPORT
+  TITLE:=Intel iwl4965 Wireless support
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl4965.ko
+  AUTOLOAD:=$(call AutoProbe,iwl4965)
+endef
+
+define KernelPackage/iwl4965/description
+ iwl4965 kernel module for Intel 4965 support
+endef
+
+
+define KernelPackage/lib80211
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=802.11 Networking stack
+  DEPENDS:=+kmod-cfg80211
+  FILES:= \
+	$(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
+	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
+	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
+	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
+  AUTOLOAD:=$(call AutoProbe, \
+	lib80211 \
+	lib80211_crypt_wep \
+	lib80211_crypt_ccmp \
+	lib80211_crypt_tkip \
+  )
+endef
+
+define KernelPackage/lib80211/description
+ Kernel modules for 802.11 Networking stack
+ Includes:
+ - lib80211
+ - lib80211_crypt_wep
+ - lib80211_crypt_tkip
+ - lib80211_crytp_ccmp
+endef
+
+
+define KernelPackage/libertas-usb
+  $(call KernelPackage/mac80211/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 + at DRIVER_WEXT_SUPPORT
+  TITLE:=Marvell 88W8015 Wireless Driver
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko
+  AUTOLOAD:=$(call AutoProbe,libertas usb8xxx)
+endef
+
+define KernelPackage/libertas-sdio
+  $(call KernelPackage/mac80211/Default)
+  DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc + at DRIVER_WEXT_SUPPORT @!TARGET_uml
+  TITLE:=Marvell 88W8686 Wireless Driver
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko
+  AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio)
+endef
+
 
-define KernelPackage/iwl3945
+define KernelPackage/mac80211-hwsim
   $(call KernelPackage/mac80211/Default)
-  DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy
-  TITLE:=Intel iwl3945 Wireless support
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl3945.ko
-  AUTOLOAD:=$(call AutoProbe,iwl3945)
+  TITLE:=mac80211 HW simulation device
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
+  AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
 endef
 
-define KernelPackage/iwl3945/description
- iwl3945 kernel module for Intel 3945 support
-endef
 
-define KernelPackage/iwl4965
-  $(call KernelPackage/mac80211/Default)
-  DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy + at DRIVER_11N_SUPPORT
-  TITLE:=Intel iwl4965 Wireless support
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl4965.ko
-  AUTOLOAD:=$(call AutoProbe,iwl4965)
+PKG_MT7601U_FW_NAME:=DPO_MT7601U_LinuxSTA
+PKG_MT7601U_FW_VERSION:=3.0.0.4_20130913
+PKG_MT7601U_FW_MD5SUM:=5f440dccc8bc952745a191994fc34699
+PKG_MT7601U_FW_SOURCE:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION).tar.bz2
+PKG_MT7601U_FW_SOURCE_URL:=http://www.mediatek.com/AmazonS3/Downloads/linux/
+define Download/mt7601u-firmware
+  FILE:=$(PKG_MT7601U_FW_SOURCE)
+  URL:=$(PKG_MT7601U_FW_SOURCE_URL)
+  MD5SUM:=$(PKG_MT7601U_FW_MD5SUM)
+  SUBDIR:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)
 endef
+$(eval $(call Download,mt7601u-firmware))
 
-define KernelPackage/iwl4965/description
- iwl4965 kernel module for Intel 4965 support
+define KernelPackage/mt7601u
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=MT7601U-based USB dongles Wireless Driver
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
+  AUTOLOAD:=$(call AutoProbe,mt7601)
 endef
 
 
@@ -1102,532 +1260,403 @@ define KernelPackage/mwifiex-pcie
   AUTOLOAD:=$(call AutoProbe,mwifiex_pcie)
 endef
 
-define KernelPackage/mwifiex-pcie/description
- Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards
-endef
-
-
-define KernelPackage/wlcore
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=TI common driver part
-  DEPENDS+= @TARGET_omap +kmod-mac80211 + at DRIVER_11N_SUPPORT
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
-  AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio)
-endef
-
-define KernelPackage/wlcore/description
- This module contains some common parts needed by TI Wireless drivers.
-endef
-
-define KernelPackage/wl12xx
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Driver for TI WL12xx
-  URL:=http://wireless.kernel.org/en/users/Drivers/wl12xx
-  DEPENDS+= +kmod-wlcore
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko
-  AUTOLOAD:=$(call AutoProbe,wl12xx)
-endef
-
-define KernelPackage/wl12xx/description
- Kernel modules for TI WL12xx
-endef
-
-define KernelPackage/wl18xx
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Driver for TI WL18xx
-  URL:=http://wireless.kernel.org/en/users/Drivers/wl18xx
-  DEPENDS+= +kmod-wlcore
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko
-  AUTOLOAD:=$(call AutoProbe,wl18xx)
-endef
-
-define KernelPackage/wl18xx/description
- Kernel modules for TI WL18xx
-endef
-
-
-#Broadcom firmware
-ifneq ($(CONFIG_B43_FW_6_30),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=6.30.163.46
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
-  PKG_B43_FWV4_MD5SUM:=6fe97e9368d25342a1ab943d3cf3496d
-else
-ifneq ($(CONFIG_B43_FW_5_10),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=5.10.56.27.3
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-  PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac
-else
-ifneq ($(CONFIG_B43_FW_4_178),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=4.178.10.4
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-  PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb
-else
-ifneq ($(CONFIG_B43_FW_5_100_138),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=5.100.138
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
-  PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
-else
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=4.150.10.5
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-  PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60
-endif
-endif
-endif
-endif
-ifneq ($(CONFIG_B43_OPENFIRMWARE),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=5.2
-  PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION)
-  PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz
-  PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/
-  PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa
-endif
-
-
-PKG_B43_FWV3_NAME:=wl_apsta
-PKG_B43_FWV3_VERSION:=3.130.20.0
-PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
-PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
-PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
-
-define Download/b43
-  FILE:=$(PKG_B43_FWV4_SOURCE)
-  URL:=$(PKG_B43_FWV4_SOURCE_URL)
-  MD5SUM:=$(PKG_B43_FWV4_MD5SUM)
-endef
-$(eval $(call Download,b43))
-
-define Download/b43legacy
-  FILE:=$(PKG_B43_FWV3_SOURCE)
-  URL:=$(PKG_B43_FWV3_SOURCE_URL)
-  MD5SUM:=$(PKG_B43_FWV3_MD5SUM)
-endef
-$(eval $(call Download,b43legacy))
-
-
-define KernelPackage/b43
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom 43xx wireless support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
-  KCONFIG:= \
-  	CONFIG_HW_RANDOM=y
-  # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb
-  DEPENDS += \
-	@PCI_SUPPORT +kmod-mac80211 \
-	$(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \
-	$(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko
-  AUTOLOAD:=$(call AutoProbe,b43)
-  MENU:=1
-endef
-
-define KernelPackage/b43/config
-
-config PACKAGE_B43_USE_SSB
-	select PACKAGE_kmod-ssb
-	tristate
-	depends on !TARGET_brcm47xx && !TARGET_brcm63xx
-	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
-	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB
-
-config PACKAGE_B43_USE_BCMA
-	select PACKAGE_kmod-bcma
-	tristate
-	depends on !TARGET_brcm47xx && !TARGET_bcm53xx
-	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
-	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA
-
-  if PACKAGE_kmod-b43
-
-	choice
-		prompt "b43 firmware version"
-		default B43_FW_5_100_138
-		help
-		  This option allows you to select the version of the b43 firmware.
-
-	config B43_FW_4_150
-		bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)"
-		help
-		  Old stable firmware for BCM43xx devices.
-
-		  If unsure, select this.
-
-	config B43_FW_4_178
-		bool "Firmware 478.104 from driver 4.178.10.4"
-		help
-		  Older firmware for BCM43xx devices.
-
-		  If unsure, select the "stable" firmware.
-
-	config B43_FW_5_10
-		bool "Firmware 508.1084 from driver 5.10.56.27"
-		help
-		  Older firmware for BCM43xx devices.
-
-		  If unsure, select the "stable" firmware.
-
-	config B43_FW_5_100_138
-		bool "Firmware 666.2 from driver 5.100.138 (stable)"
-		help
-		  The currently default firmware for BCM43xx devices.
-
-		  This firmware currently gets most of the testing and is needed for some N-PHY devices.
-
-		  If unsure, select the this firmware.
-
-	config B43_FW_6_30
-		bool "Firmware 784.2 from driver 6.30.163.46 (experimental)"
-		help
-		  Newer experimental firmware for BCM43xx devices.
-
-		  This firmware is mostly untested.
-
-		  If unsure, select the "stable" firmware.
-
-	config B43_OPENFIRMWARE
-		bool "Open FirmWare for WiFi networks"
-		help
-		  Opensource firmware for BCM43xx devices.
-
-		  Do _not_ select this, unless you know what you are doing.
-		  The Opensource firmware is not suitable for embedded devices, yet.
-		  It does not support QoS, which is bad for AccessPoints.
-		  It does not support hardware crypto acceleration, which is a showstopper
-		  for embedded devices with low CPU resources.
-
-		  If unsure, select the "stable" firmware.
-
-	endchoice
+define KernelPackage/mwifiex-pcie/description
+ Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards
+endef
 
-	config B43_FW_SQUASH
-		bool "Remove unnecessary firmware files"
-		depends on !B43_OPENFIRMWARE
-		default y
-		help
-		  This options allows you to remove unnecessary b43 firmware files
-		  from the final rootfs image. This can reduce the rootfs size by
-		  up to 200k.
 
-		  If unsure, say Y.
+# Prism54 drivers
+P54PCIFW:=2.13.12.0.arm
+P54USBFW:=2.13.24.0.lm87.arm
+P54SPIFW:=2.13.0.0.a.13.14.arm
 
-	config B43_FW_SQUASH_COREREVS
-		string "Core revisions to include"
-		depends on B43_FW_SQUASH
-		default "5,6,7,8,9,10,11,13,15" if TARGET_brcm47xx_legacy
-		default "16,28,29,30" if TARGET_brcm47xx_mips74k
-		default "5,6,7,8,9,10,11,13,15,16,28,29,30"
-		help
-		  This is a comma seperated list of core revision numbers.
+define Download/p54usb
+  FILE:=$(P54USBFW)
+  URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb
+  MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6
+endef
+$(eval $(call Download,p54usb))
 
-		  Example (keep files for rev5 only):
-		    5
+define Download/p54pci
+  FILE:=$(P54PCIFW)
+  URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac
+  MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4
+endef
+$(eval $(call Download,p54pci))
 
-		  Example (keep files for rev5 and rev11):
-		    5,11
+define Download/p54spi
+  FILE:=$(P54SPIFW)
+  URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560
+  MD5SUM:=42661f8ecbadd88012807493f596081d
+endef
+$(eval $(call Download,p54spi))
 
-	config B43_FW_SQUASH_PHYTYPES
-		string "PHY types to include"
-		depends on B43_FW_SQUASH
-		default "G,N,LP" if TARGET_brcm47xx_legacy
-		default "N,HT" if TARGET_brcm47xx_mips74k
-		default "G,N,LP,HT"
-		help
-		  This is a comma seperated list of PHY types:
-		    A  => A-PHY
-		    AG => Dual A-PHY G-PHY
-		    G  => G-PHY
-		    LP => LP-PHY
-		    N  => N-PHY
-		    HT  => HT-PHY
-		    LCN  => LCN-PHY
-		    LCN40  => LCN40-PHY
-		    AC  => AC-PHY
+define KernelPackage/p54/Default
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Prism54 Drivers
+endef
 
-		  Example (keep files for G-PHY only):
-		    G
+define KernelPackage/p54/description
+  Kernel module for Prism54 chipsets (mac80211)
+endef
 
-		  Example (keep files for G-PHY and N-PHY):
-		    G,N
+define KernelPackage/p54-common
+  $(call KernelPackage/p54/Default)
+  DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt
+  TITLE+= (COMMON)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko
+endef
 
-	choice
-		prompt "Supported buses"
-		default PACKAGE_B43_BUSES_BCMA_AND_SSB
-		help
-		  This allows choosing buses that b43 should support.
+define KernelPackage/p54-pci
+  $(call KernelPackage/p54/Default)
+  TITLE+= (PCI)
+  DEPENDS+= @PCI_SUPPORT +kmod-p54-common
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko
+  AUTOLOAD:=$(call AutoProbe,p54pci)
+endef
 
-	config PACKAGE_B43_BUSES_BCMA_AND_SSB
-		depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
-		bool "BCMA and SSB"
+define KernelPackage/p54-usb
+  $(call KernelPackage/p54/Default)
+  TITLE+= (USB)
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko
+  AUTOLOAD:=$(call AutoProbe,p54usb)
+endef
 
-	config PACKAGE_B43_BUSES_BCMA
-		depends on !TARGET_brcm47xx_legacy
-		bool "BCMA only"
+define KernelPackage/p54-spi
+  $(call KernelPackage/p54/Default)
+  TITLE+= (SPI)
+  DEPENDS+= @TARGET_omap24xx +kmod-p54-common
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko
+  AUTOLOAD:=$(call AutoProbe,p54spi)
+endef
 
-	config PACKAGE_B43_BUSES_SSB
-		depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
-		bool "SSB only"
 
-	endchoice
+define KernelPackage/rt2x00/Default
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Ralink Drivers for RT2x00 cards
+endef
 
-	config PACKAGE_B43_DEBUG
-		bool "Enable debug output and debugfs for b43"
-		default n
-		help
-		  Enable additional debug output and runtime sanity checks for b43
-		  and enables the debugfs interface.
+define KernelPackage/rt2x00-lib
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t
+  TITLE+= (LIB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko
+  MENU:=1
+endef
 
-		  If unsure, say N.
+define KernelPackage/rt2x00-lib/config
+  if PACKAGE_kmod-rt2x00-lib
 
-	config PACKAGE_B43_PIO
-		bool "Enable support for PIO transfer mode"
-		default n
+	config PACKAGE_RT2X00_LIB_DEBUGFS
+		bool "Enable rt2x00 debugfs support"
+		depends on PACKAGE_MAC80211_DEBUGFS
 		help
-		  Enable support for using PIO instead of DMA. Unless you have DMA
-		  transfer problems you don't need this.
-
-		  If unsure, say N.
+		  Enable creation of debugfs files for the rt2x00 drivers.
+		  These debugfs files support both reading and writing of the
+		  most important register types of the rt2x00 hardware.
 
-	config PACKAGE_B43_PHY_G
-		bool "Enable support for G-PHYs"
-		default n if TARGET_brcm47xx_mips74k
-		default y
+	config PACKAGE_RT2X00_DEBUG
+		bool "Enable rt2x00 debug output"
 		help
-		  Enable support for G-PHY. This includes support for the following devices:
-		  PCI: BCM4306, BCM4311, BCM4318
-		  SoC: BCM5352E, BCM4712
+		  Enable debugging output for all rt2x00 modules
 
-		  If unsure, say Y.
+  endif
+endef
 
-	config PACKAGE_B43_PHY_N
-		bool "Enable support for N-PHYs"
-		default y
-		help
-		  Enable support for N-PHY. This includes support for the following devices:
-		  PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225
-		  SoC: BCM4716, BCM4717, BCM4718
+define KernelPackage/rt2x00-mmio
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6
+  HIDDEN:=1
+  TITLE+= (MMIO)
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00mmio.ko
+endef
 
-		  Currently only 11g speed is available.
+define KernelPackage/rt2x00-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib
+  HIDDEN:=1
+  TITLE+= (PCI)
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt2x00pci)
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rt2x00-usb
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
+  HIDDEN:=1
+  TITLE+= (USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko
+  AUTOLOAD:=$(call AutoProbe,rt2x00usb)
+endef
 
-	config PACKAGE_B43_PHY_LP
-		bool "Enable support for LP-PHYs"
-		default n if TARGET_brcm47xx_mips74k
-		default y
-		help
-		  Enable support for LP-PHY. This includes support for the following devices:
-		  PCI: BCM4312
-		  SoC: BCM5354
+define KernelPackage/rt2800-lib
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt + at DRIVER_11N_SUPPORT
+  HIDDEN:=1
+  TITLE+= (rt2800 LIB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rt2400-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
+  TITLE+= (RT2400 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt2400pci)
+endef
 
-	config PACKAGE_B43_PHY_HT
-		bool "Enable support for HT-PHYs"
-		default n if TARGET_brcm47xx_legacy
-		default y
-		help
-		  Enable support for HT-PHY. This includes support for the following devices:
-		  PCI: BCM4331
+define KernelPackage/rt2500-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
+  TITLE+= (RT2500 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt2500pci)
+endef
 
-		  Currently only 11g speed is available.
+define KernelPackage/rt2500-usb
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
+  TITLE+= (RT2500 USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko
+  AUTOLOAD:=$(call AutoProbe,rt2500usb)
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rt61-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
+  TITLE+= (RT2x61 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt61pci)
+endef
+
+define KernelPackage/rt73-usb
+  $(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
+  TITLE+= (RT73 USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko
+  AUTOLOAD:=$(call AutoProbe,rt73usb)
+endef
 
-	config PACKAGE_B43_PHY_LCN
-		bool "Enable support for LCN-PHYs"
-		depends on BROKEN
-		default n
-		help
-		  Currently broken.
+define KernelPackage/rt2800-mmio
+$(call KernelPackage/rt2x00/Default)
+  TITLE += (RT28xx/RT3xxx MMIO)
+  DEPENDS += +kmod-rt2800-lib +kmod-rt2x00-mmio
+  HIDDEN:=1
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800mmio.ko
+endef
 
-		  If unsure, say N.
+define KernelPackage/rt2800-soc
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS += @(TARGET_ramips_rt288x||TARGET_ramips_rt305x||TARGET_ramips_rt3883||TARGET_ramips_mt7620) +kmod-rt2800-mmio +kmod-rt2800-lib
+  TITLE += (RT28xx/RT3xxx SoC)
+  FILES := \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800soc.ko
+  AUTOLOAD:=$(call AutoProbe,rt2800soc)
+endef
 
-  endif
+define KernelPackage/rt2800-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-rt2800-mmio
+  TITLE+= (RT2860 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt2800pci)
 endef
 
-define KernelPackage/b43/description
-Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
+define KernelPackage/rt2800-usb
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt
+  TITLE+= (RT2870 USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko
+  AUTOLOAD:=$(call AutoProbe,rt2800usb)
 endef
 
-define KernelPackage/b43legacy
+define KernelPackage/rtl818x/Default
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom 43xx-legacy wireless support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
-  KCONFIG:= \
-  	CONFIG_HW_RANDOM=y
-  DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko
-  AUTOLOAD:=$(call AutoProbe,b43legacy)
-  MENU:=1
+  TITLE:=Realtek Drivers for RTL818x devices
+  URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187
+  DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211
 endef
 
-define KernelPackage/b43legacy/config
-  if PACKAGE_kmod-b43legacy
-
-	config B43LEGACY_FW_SQUASH
-		bool "Remove unnecessary firmware files"
-		default y
-		help
-		  This options allows you to remove unnecessary b43legacy firmware files
-		  from the final rootfs image. This can reduce the rootfs size by
-		  up to 50k.
+define KernelPackage/rtl8180
+  $(call KernelPackage/rtl818x/Default)
+  DEPENDS+= @PCI_SUPPORT
+  TITLE+= (RTL8180 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl818x_pci.ko
+  AUTOLOAD:=$(call AutoProbe,rtl818x_pci)
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rtl8187
+$(call KernelPackage/rtl818x/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core
+  TITLE+= (RTL8187 USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8187)
+endef
 
-	config B43LEGACY_FW_SQUASH_COREREVS
-		string "Core revisions to include"
-		depends on B43LEGACY_FW_SQUASH
-		default "1,2,3,4"
+define KernelPackage/rtlwifi/config
+	config PACKAGE_RTLWIFI_DEBUG
+		bool "Realtek wireless debugging"
+		depends on PACKAGE_kmod-rtlwifi
 		help
-		  This is a comma seperated list of core revision numbers.
-
-		  Example (keep files for rev4 only):
-		    4
+		  Say Y, if you want to debug realtek wireless drivers.
 
-		  Example (keep files for rev2 and rev4):
-		    2,4
+endef
 
-  endif
+define KernelPackage/rtlwifi
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek common driver part
+  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 + at DRIVER_11N_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtlwifi.ko
+  HIDDEN:=1
 endef
 
-define KernelPackage/b43legacy/description
-Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
+define KernelPackage/rtlwifi-pci
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek common driver part (PCI support)
+  DEPENDS+= @PCI_SUPPORT +kmod-rtlwifi
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_pci.ko
+  AUTOLOAD:=$(call AutoProbe,rtl_pci)
+  HIDDEN:=1
 endef
 
+define KernelPackage/rtlwifi-usb
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek common driver part (USB support)
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-rtlwifi
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_usb.ko
+  AUTOLOAD:=$(call AutoProbe,rtl_usb)
+  HIDDEN:=1
+endef
 
-define KernelPackage/brcmutil
+define KernelPackage/rtl8192c-common
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom IEEE802.11n common driver parts
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
-  DEPENDS+=@PCI_SUPPORT||USB_SUPPORT
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko
-  AUTOLOAD:=$(call AutoProbe,brcmutil)
-  MENU:=1
+  TITLE:=Realtek RTL8192CE/RTL8192CU common support module
+  DEPENDS+= +kmod-rtlwifi
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
+  HIDDEN:=1
 endef
 
-define KernelPackage/brcmutil/description
- This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac.
+define KernelPackage/rtl8192ce
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8192CE/RTL8188CE support
+  DEPENDS+= +kmod-rtlwifi-pci +kmod-rtl8192c-common
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192ce.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8192ce)
 endef
 
-define KernelPackage/brcmutil/config
-  if PACKAGE_kmod-brcmutil
+define KernelPackage/rtl8192ce/install
+	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfw.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU_B.bin $(1)/lib/firmware/rtlwifi
+endef
 
-	config PACKAGE_BRCM80211_DEBUG
-		bool "Broadcom wireless driver debugging"
-		help
-		  Say Y, if you want to debug brcmsmac and brcmfmac wireless driver.
+define KernelPackage/rtl8192se
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8192SE/RTL8191SE support
+  DEPENDS+= +kmod-rtlwifi-pci
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192se/rtl8192se.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8192se)
+endef
 
-  endif
+define KernelPackage/rtl8192se/install
+	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192sefw.bin $(1)/lib/firmware/rtlwifi
 endef
 
-PKG_BRCMSMAC_FW_NAME:=broadcom-wl
-PKG_BRCMSMAC_FW_VERSION:=5.100.138
-PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o
-PKG_BRCMSMAC_FW_SOURCE:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION).tar.bz2
-PKG_BRCMSMAC_FW_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
-PKG_BRCMSMAC_FW_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
+define KernelPackage/rtl8192de
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8192DE/RTL8188DE support
+  DEPENDS+= +kmod-rtlwifi-pci
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192de/rtl8192de.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8192de)
+endef
 
-define Download/brcmsmac
-  FILE:=$(PKG_BRCMSMAC_FW_SOURCE)
-  URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL)
-  MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM)
+define KernelPackage/rtl8192de/install
+	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192defw.bin $(1)/lib/firmware/rtlwifi
 endef
-$(eval $(call Download,brcmsmac))
 
-define KernelPackage/brcmsmac
+define KernelPackage/rtl8192cu
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
-  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT +!TARGET_brcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko
-  AUTOLOAD:=$(call AutoProbe,brcmsmac)
-  MENU:=1
+  TITLE:=Realtek RTL8192CU/RTL8188CU support
+  DEPENDS+= +kmod-rtlwifi-usb +kmod-rtl8192c-common
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8192cu)
 endef
 
-define KernelPackage/brcmsmac/description
- Kernel module for Broadcom IEEE802.11n PCIe Wireless cards
+define KernelPackage/rtl8192cu/install
+	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_A.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_B.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_TMSC.bin $(1)/lib/firmware/rtlwifi
 endef
 
-define KernelPackage/brcmsmac/config
-  if PACKAGE_kmod-brcmsmac
-
-	config BRCMSMAC_USE_FW_FROM_WL
-		bool "Use firmware extracted from broadcom proprietary driver"
-		default y
-		help
-		  Instead of using the official brcmsmac firmware a firmware
-		  version 666.2 extracted from the proprietary Broadcom driver
-		  is used. This is needed to get core rev 17 used in bcm4716
-		  to work.
 
-		  If unsure, say Y.
+define KernelPackage/wlcore
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=TI common driver part
+  DEPENDS+= @TARGET_omap +kmod-mac80211 + at DRIVER_11N_SUPPORT
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
+  AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio)
+endef
 
-  endif
+define KernelPackage/wlcore/description
+ This module contains some common parts needed by TI Wireless drivers.
 endef
 
 
-define KernelPackage/brcmfmac
+define KernelPackage/wl12xx
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
-  DEPENDS+= @USB_SUPPORT +kmod-cfg80211 + at DRIVER_11N_SUPPORT +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_USB:kmod-usb-core
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko
-  AUTOLOAD:=$(call AutoProbe,brcmfmac)
+  TITLE:=Driver for TI WL12xx
+  URL:=http://wireless.kernel.org/en/users/Drivers/wl12xx
+  DEPENDS+= +kmod-wlcore
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko
+  AUTOLOAD:=$(call AutoProbe,wl12xx)
 endef
 
-define KernelPackage/brcmfmac/description
- Kernel module for Broadcom IEEE802.11n USB Wireless cards
+define KernelPackage/wl12xx/description
+ Kernel modules for TI WL12xx
 endef
 
-define KernelPackage/brcmfmac/config
-  if PACKAGE_kmod-brcmfmac
 
-	config BRCMFMAC_SDIO
-		bool "Enable SDIO bus interface support"
-		default n
-		help
-		  Enable support for cards attached to an SDIO bus.
-		  Select this option only if you are sure that your
-		  board has a Broadcom wireless chip atacched to
-		  that bus.
+define KernelPackage/wl18xx
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Driver for TI WL18xx
+  URL:=http://wireless.kernel.org/en/users/Drivers/wl18xx
+  DEPENDS+= +kmod-wlcore
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko
+  AUTOLOAD:=$(call AutoProbe,wl18xx)
+endef
 
-	config BRCMFMAC_USB
-		bool "Enable USB bus interface support"
-		depends on USB_SUPPORT
-		default y
-		help
-		  Supported USB connected chipsets:
-		  BCM43235, BCM43236, BCM43238 (all in revision 3 only)
-		  BCM43143, BCM43242, BCM43566, BCM43569
+define KernelPackage/wl18xx/description
+ Kernel modules for TI WL18xx
+endef
 
-	config BRCMFMAC_PCIE
-		bool "Enable PCIE bus interface support"
-		depends on PCI_SUPPORT
-		default y
-		help
-		  Supported PCIe connected chipsets:
-		  BCM4354, BCM4356, BCM43567, BCM43570, BCM43602
 
-  endif
+ZD1211FW_NAME:=zd1211-firmware
+ZD1211FW_VERSION:=1.4
+define Download/zd1211rw
+  FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
+  URL:=@SF/zd1211/
+  MD5SUM:=19f28781d76569af8551c9d11294c870
+endef
+$(eval $(call Download,zd1211rw))
+
+define KernelPackage/zd1211rw
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Zydas ZD1211 support
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko
+  AUTOLOAD:=$(call AutoProbe,zd1211rw)
 endef
 
+
 config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
 
 config-y:= \
@@ -1649,15 +1678,17 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
   config-y += \
 	CFG80211_DEBUGFS \
 	MAC80211_DEBUGFS \
+	ATH5K_DEBUG \
 	ATH9K_DEBUGFS \
 	ATH9K_HTC_DEBUGFS \
 	ATH10K_DEBUGFS \
-	CARL9170_DEBUGFS \
-	ATH5K_DEBUG
+	CARL9170_DEBUGFS
 endif
 
 config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP
 
+config-$(call config_package,adm8211) += ADM8211
+
 config-$(call config_package,ath) += ATH_CARDS ATH_COMMON
 config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG
 config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
@@ -1679,8 +1710,6 @@ else
   config-y += ATH5K_PCI
 endif
 
-config-$(call config_package,carl9170) += CARL9170
-
 config-$(call config_package,b43) += B43
 config-$(CONFIG_PACKAGE_B43_BUSES_BCMA_AND_SSB) += B43_BUSES_BCMA_AND_SSB
 config-$(CONFIG_PACKAGE_B43_BUSES_BCMA) += B43_BUSES_BCMA
@@ -1703,10 +1732,40 @@ config-$(CONFIG_BRCMFMAC_USB) += BRCMFMAC_USB
 config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE
 config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG
 
+config-$(call config_package,carl9170) += CARL9170
+
+config-$(call config_package,hermes) += HERMES
+config-$(call config_package,hermes-pci) += PCI_HERMES
+config-$(call config_package,hermes-plx) += PLX_HERMES
+config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES
+config-y += HERMES_PRISM
+
+config-$(call config_package,libipw) += LIBIPW
+config-$(call config_package,ipw2100) += IPW2100
+config-$(call config_package,ipw2200) += IPW2200
+
+config-$(call config_package,iwl-legacy) += IWLEGACY
+config-$(call config_package,iwl3945) += IWL3945
+config-$(call config_package,iwl4965) += IWL4965
+config-$(call config_package,iwlagn) += IWLWIFI IWLDVM IWLMVM
+config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG
+config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
+
+config-$(call config_package,libertas-sdio) += LIBERTAS LIBERTAS_SDIO
+config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB
+
 config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
 config-$(call config_package,mt7601u) += MT7601U
 config-y += WL_MEDIATEK
 
+config-$(call config_package,mwl8k) += MWL8K
+config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE
+
+config-$(call config_package,p54-common) += P54_COMMON
+config-$(call config_package,p54-pci) += P54_PCI
+config-$(call config_package,p54-usb) += P54_USB
+config-$(call config_package,p54-spi) += P54_SPI
+
 config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB
 config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI
 config-$(call config_package,rt2x00-mmio) += RT2X00_LIB_MMIO
@@ -1729,40 +1788,8 @@ config-y += RT2800PCI_RT33XX RT2800PCI_RT35XX RT2800PCI_RT53XX RT2800PCI_RT3290
 config-$(call config_package,rt2800-usb) += RT2800USB
 config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX RT2800USB_RT55XX RT2800USB_UNKNOWN
 
-config-$(call config_package,iwl-legacy) += IWLEGACY
-config-$(call config_package,iwl3945) += IWL3945
-config-$(call config_package,iwl4965) += IWL4965
-config-$(call config_package,iwlagn) += IWLWIFI IWLDVM IWLMVM
-config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG
-config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
-
-config-$(call config_package,net-libipw) += LIBIPW
-config-$(call config_package,net-ipw2100) += IPW2100
-config-$(call config_package,net-ipw2200) += IPW2200
-
-config-$(call config_package,p54-common) += P54_COMMON
-config-$(call config_package,p54-pci) += P54_PCI
-config-$(call config_package,p54-usb) += P54_USB
-config-$(call config_package,p54-spi) += P54_SPI
-
-config-$(call config_package,net-hermes) += HERMES
-config-$(call config_package,net-hermes-pci) += PCI_HERMES
-config-$(call config_package,net-hermes-plx) += PLX_HERMES
-config-$(call config_package,net-hermes-pcmcia) += PCMCIA_HERMES
-config-y += HERMES_PRISM
-
-config-$(call config_package,adm8211) += ADM8211
-config-$(call config_package,libertas-sdio) += LIBERTAS LIBERTAS_SDIO
-config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB
-config-$(call config_package,mwl8k) += MWL8K
-config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE
 config-$(call config_package,rtl8180) += RTL8180
 config-$(call config_package,rtl8187) += RTL8187
-config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
-config-$(call config_package,wl12xx) += WL12XX
-config-$(call config_package,wl18xx) += WL18XX
-config-y += WL_TI WILINK_PLATFORM_DATA
-config-$(call config_package,zd1211rw) += ZD1211RW
 
 config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI
 config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI
@@ -1774,8 +1801,17 @@ config-$(call config_package,rtl8192de) += RTL8192DE
 config-$(call config_package,rtl8192cu) += RTL8192CU
 config-$(CONFIG_PACKAGE_RTLWIFI_DEBUG) += RTLWIFI_DEBUG
 
+config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
+config-$(call config_package,wl12xx) += WL12XX
+config-$(call config_package,wl18xx) += WL18XX
+config-y += WL_TI WILINK_PLATFORM_DATA
+
+config-$(call config_package,zd1211rw) += ZD1211RW
+
+
 config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS B43_LEDS B43LEGACY_LEDS
 
+
 MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
 	CROSS_COMPILE="$(KERNEL_CROSS)" \
 	ARCH="$(LINUX_KARCH)" \
@@ -1860,161 +1896,107 @@ define Build/InstallDev
 	rm -f $(1)/usr/include/mac80211-backport/linux/module.h
 endef
 
-define KernelPackage/libertas-usb/install
-	$(INSTALL_DIR) $(1)/lib/firmware/libertas
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8388_v9.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8682.bin \
-		$(1)/lib/firmware/libertas/
-endef
-
-define KernelPackage/libertas-sdio/install
-	$(INSTALL_DIR) $(1)/lib/firmware/libertas
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385_helper.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9_helper.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688_helper.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688.bin \
-		$(1)/lib/firmware/libertas
-endef
-
-define KernelPackage/cfg80211/install
-	$(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
-	$(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
-	$(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
-endef
-
-define KernelPackage/p54-pci/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci
-endef
-
-define KernelPackage/p54-usb/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb
-endef
-
-define KernelPackage/p54-spi/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm
-endef
-
-define KernelPackage/rt61-pci/install
+define KernelPackage/ath9k-htc/install
 	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561s.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2661.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/htc_9271.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/htc_7010.fw \
 		$(1)/lib/firmware/
 endef
 
-define KernelPackage/rt73-usb/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt73.bin $(1)/lib/firmware/
-endef
-
-define KernelPackage/rt2800-pci/install
-	$(INSTALL_DIR) $(1)/lib/firmware
+define KernelPackage/ath10k/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2860.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt3290.bin \
-		$(1)/lib/firmware
-endef
-
-define KernelPackage/rt2800-usb/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2870.bin $(1)/lib/firmware/
-endef
-
-define KernelPackage/wl12xx/install
-	$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
+		$(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_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-mr.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-plt.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-sr.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl1271-nvs.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-mr.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-plt.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-sr.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-nvs.bin \
-		$(1)/lib/firmware/ti-connectivity
-endef
-
-define KernelPackage/wl18xx/install
-	$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
+		$(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_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-conf.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-3.bin \
-		$(1)/lib/firmware/ti-connectivity
+		$(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/zd1211rw/install
-	$(INSTALL_DIR) $(1)/lib/firmware/zd1211
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
+define KernelPackage/b43/install
+	rm -rf $(1)/lib/firmware/
+ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
+	tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
+else
+	tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
+endif
+	$(INSTALL_DIR) $(1)/lib/firmware/
+ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
+	$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
+	$(INSTALL_DIR) $(1)/lib/firmware/b43-open/
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
+else
+	b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
+endif
+ifneq ($(CONFIG_B43_FW_SQUASH),)
+	b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
+endif
 endef
 
-define KernelPackage/carl9170/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/carl9170-1.fw $(1)/lib/firmware
+define KernelPackage/b43legacy/install
+	$(INSTALL_DIR) $(1)/lib/firmware/
+	b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(DL_DIR)/$(PKG_B43_FWV3_SOURCE)
+ifneq ($(CONFIG_B43LEGACY_FW_SQUASH),)
+	b43-fwsquash.py "G" "$(CONFIG_B43LEGACY_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43legacy"
+endif
 endef
 
-define KernelPackage/ath9k-htc/install
-	$(INSTALL_DIR) $(1)/lib/firmware
+define KernelPackage/brcmsmac/install
+	$(INSTALL_DIR) $(1)/lib/firmware/brcm
+ifeq ($(CONFIG_BRCMSMAC_USE_FW_FROM_WL),y)
+	tar xjf "$(DL_DIR)/$(PKG_BRCMSMAC_FW_SOURCE)" -C "$(PKG_BUILD_DIR)"
+	b43-fwcutter --brcmsmac -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_BRCMSMAC_FW_OBJECT)
+else
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/htc_9271.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/htc_7010.fw \
-		$(1)/lib/firmware/
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx-0.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx_hdr-0.fw \
+		$(1)/lib/firmware/brcm/
+endif
 endef
 
-define KernelPackage/ath10k/install
-	$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
+define KernelPackage/brcmfmac/install
+	$(INSTALL_DIR) $(1)/lib/firmware/brcm
+ifneq ($(CONFIG_BRCMFMAC_USB),)
 	$(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)
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43236b.bin \
+		$(1)/lib/firmware/brcm/
 	$(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
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43143.bin \
+		$(1)/lib/firmware/brcm/
+endif
+ifneq ($(CONFIG_BRCMFMAC_PCIE),)
 	$(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
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43602-pcie.ap.bin \
+		$(1)/lib/firmware/brcm/brcmfmac43602-pcie.bin
 endif
 endef
 
-define KernelPackage/mt7601u/install
+define KernelPackage/carl9170/install
 	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)/mcu/bin/MT7601.bin \
-		$(1)/lib/firmware/mt7601u.bin
-endef
-
-define KernelPackage/mwl8k/install
-	$(INSTALL_DIR) $(1)/lib/firmware/mwl8k
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366_ap-3.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8366.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8687.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8687.fw \
-		$(1)/lib/firmware/mwl8k/
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/carl9170-1.fw $(1)/lib/firmware
 endef
 
-define KernelPackage/mwifiex-pcie/install
-	$(INSTALL_DIR) $(1)/lib/firmware/mrvl
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mrvl/pcie8897_uapsta.bin \
-		$(1)/lib/firmware/mrvl/
+define KernelPackage/cfg80211/install
+	$(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
+	$(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
+	$(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
 endef
 
-define KernelPackage/net-ipw2100/install
+define KernelPackage/ipw2100/install
 	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware
 endef
 
-define KernelPackage/net-ipw2200/install
+define KernelPackage/ipw2200/install
 	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware
 endef
@@ -2091,128 +2073,184 @@ define KernelPackage/iwl4965/install
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-4965-2.ucode $(1)/lib/firmware
 endef
 
-define KernelPackage/b43/install
-	rm -rf $(1)/lib/firmware/
-ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
-	tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
-else
-	tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
-endif
-	$(INSTALL_DIR) $(1)/lib/firmware/
-ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
-	$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
-	$(INSTALL_DIR) $(1)/lib/firmware/b43-open/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
-else
-	b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
-endif
-ifneq ($(CONFIG_B43_FW_SQUASH),)
-	b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
-endif
+define KernelPackage/libertas-usb/install
+	$(INSTALL_DIR) $(1)/lib/firmware/libertas
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8388_v9.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8682.bin \
+		$(1)/lib/firmware/libertas/
 endef
 
-define KernelPackage/b43legacy/install
-	$(INSTALL_DIR) $(1)/lib/firmware/
-	b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(DL_DIR)/$(PKG_B43_FWV3_SOURCE)
-ifneq ($(CONFIG_B43LEGACY_FW_SQUASH),)
-	b43-fwsquash.py "G" "$(CONFIG_B43LEGACY_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43legacy"
-endif
+define KernelPackage/libertas-sdio/install
+	$(INSTALL_DIR) $(1)/lib/firmware/libertas
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385_helper.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9_helper.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688_helper.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688.bin \
+		$(1)/lib/firmware/libertas
 endef
 
-define KernelPackage/brcmsmac/install
-	$(INSTALL_DIR) $(1)/lib/firmware/brcm
-ifeq ($(CONFIG_BRCMSMAC_USE_FW_FROM_WL),y)
-	tar xjf "$(DL_DIR)/$(PKG_BRCMSMAC_FW_SOURCE)" -C "$(PKG_BUILD_DIR)"
-	b43-fwcutter --brcmsmac -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_BRCMSMAC_FW_OBJECT)
-else
+define KernelPackage/mt7601u/install
+	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx-0.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx_hdr-0.fw \
-		$(1)/lib/firmware/brcm/
-endif
+		$(PKG_BUILD_DIR)/$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)/mcu/bin/MT7601.bin \
+		$(1)/lib/firmware/mt7601u.bin
 endef
 
-define KernelPackage/brcmfmac/install
-	$(INSTALL_DIR) $(1)/lib/firmware/brcm
-ifneq ($(CONFIG_BRCMFMAC_USB),)
+define KernelPackage/mwl8k/install
+	$(INSTALL_DIR) $(1)/lib/firmware/mwl8k
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43236b.bin \
-		$(1)/lib/firmware/brcm/
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366_ap-3.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8366.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8687.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8687.fw \
+		$(1)/lib/firmware/mwl8k/
+endef
+
+define KernelPackage/mwifiex-pcie/install
+	$(INSTALL_DIR) $(1)/lib/firmware/mrvl
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43143.bin \
-		$(1)/lib/firmware/brcm/
-endif
-ifneq ($(CONFIG_BRCMFMAC_PCIE),)
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mrvl/pcie8897_uapsta.bin \
+		$(1)/lib/firmware/mrvl/
+endef
+
+
+define KernelPackage/p54-pci/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci
+endef
+
+define KernelPackage/p54-spi/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm
+endef
+
+define KernelPackage/p54-usb/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb
+endef
+
+define KernelPackage/rt2800-pci/install
+	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43602-pcie.ap.bin \
-		$(1)/lib/firmware/brcm/brcmfmac43602-pcie.bin
-endif
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2860.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt3290.bin \
+		$(1)/lib/firmware
+endef
+
+define KernelPackage/rt2800-usb/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2870.bin $(1)/lib/firmware/
+endef
+
+define KernelPackage/rt61-pci/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561s.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2661.bin \
+		$(1)/lib/firmware/
+endef
+
+define KernelPackage/rt73-usb/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt73.bin $(1)/lib/firmware/
+endef
+
+define KernelPackage/wl12xx/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-mr.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-plt.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-sr.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl1271-nvs.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-mr.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-plt.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-sr.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-nvs.bin \
+		$(1)/lib/firmware/ti-connectivity
+endef
+
+define KernelPackage/wl18xx/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-conf.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-3.bin \
+		$(1)/lib/firmware/ti-connectivity
 endef
 
+define KernelPackage/zd1211rw/install
+	$(INSTALL_DIR) $(1)/lib/firmware/zd1211
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
+endef
+
+
 $(eval $(call KernelPackage,adm8211))
+$(eval $(call KernelPackage,ath))
+$(eval $(call KernelPackage,ath10k))
 $(eval $(call KernelPackage,ath5k))
+$(eval $(call KernelPackage,ath9k))
+$(eval $(call KernelPackage,ath9k-common))
+$(eval $(call KernelPackage,ath9k-htc))
+$(eval $(call KernelPackage,b43))
+$(eval $(call KernelPackage,b43legacy))
+$(eval $(call KernelPackage,brcmfmac))
+$(eval $(call KernelPackage,brcmsmac))
+$(eval $(call KernelPackage,brcmutil))
+$(eval $(call KernelPackage,carl9170))
+$(eval $(call KernelPackage,cfg80211))
+$(eval $(call KernelPackage,iwl3945))
+$(eval $(call KernelPackage,iwl4965))
+$(eval $(call KernelPackage,iwlagn))
+$(eval $(call KernelPackage,iwl-legacy))
 $(eval $(call KernelPackage,lib80211))
-$(eval $(call KernelPackage,libertas-usb))
 $(eval $(call KernelPackage,libertas-sdio))
-$(eval $(call KernelPackage,cfg80211))
+$(eval $(call KernelPackage,libertas-usb))
 $(eval $(call KernelPackage,mac80211))
+$(eval $(call KernelPackage,mac80211-hwsim))
+$(eval $(call KernelPackage,mt7601u))
+$(eval $(call KernelPackage,mwifiex-pcie))
+$(eval $(call KernelPackage,mwl8k))
+$(eval $(call KernelPackage,hermes))
+$(eval $(call KernelPackage,hermes-pci))
+$(eval $(call KernelPackage,hermes-pcmcia))
+$(eval $(call KernelPackage,hermes-plx))
+$(eval $(call KernelPackage,ipw2100))
+$(eval $(call KernelPackage,ipw2200))
+$(eval $(call KernelPackage,libipw))
 $(eval $(call KernelPackage,p54-common))
 $(eval $(call KernelPackage,p54-pci))
-$(eval $(call KernelPackage,p54-usb))
 $(eval $(call KernelPackage,p54-spi))
-$(eval $(call KernelPackage,rt2x00-lib))
-$(eval $(call KernelPackage,rt2x00-mmio))
-$(eval $(call KernelPackage,rt2x00-pci))
-$(eval $(call KernelPackage,rt2x00-usb))
-$(eval $(call KernelPackage,rt2800-lib))
+$(eval $(call KernelPackage,p54-usb))
 $(eval $(call KernelPackage,rt2400-pci))
 $(eval $(call KernelPackage,rt2500-pci))
 $(eval $(call KernelPackage,rt2500-usb))
-$(eval $(call KernelPackage,rt61-pci))
-$(eval $(call KernelPackage,rt73-usb))
+$(eval $(call KernelPackage,rt2800-lib))
 $(eval $(call KernelPackage,rt2800-mmio))
-$(eval $(call KernelPackage,rt2800-soc))
 $(eval $(call KernelPackage,rt2800-pci))
+$(eval $(call KernelPackage,rt2800-soc))
 $(eval $(call KernelPackage,rt2800-usb))
+$(eval $(call KernelPackage,rt2x00-lib))
+$(eval $(call KernelPackage,rt2x00-mmio))
+$(eval $(call KernelPackage,rt2x00-pci))
+$(eval $(call KernelPackage,rt2x00-usb))
+$(eval $(call KernelPackage,rt61-pci))
+$(eval $(call KernelPackage,rt73-usb))
 $(eval $(call KernelPackage,rtl8180))
 $(eval $(call KernelPackage,rtl8187))
-$(eval $(call KernelPackage,rtlwifi))
-$(eval $(call KernelPackage,rtlwifi-pci))
-$(eval $(call KernelPackage,rtlwifi-usb))
 $(eval $(call KernelPackage,rtl8192c-common))
 $(eval $(call KernelPackage,rtl8192ce))
-$(eval $(call KernelPackage,rtl8192se))
-$(eval $(call KernelPackage,rtl8192de))
 $(eval $(call KernelPackage,rtl8192cu))
-$(eval $(call KernelPackage,zd1211rw))
-$(eval $(call KernelPackage,mac80211-hwsim))
-$(eval $(call KernelPackage,mt7601u))
-$(eval $(call KernelPackage,ath9k-common))
-$(eval $(call KernelPackage,ath9k))
-$(eval $(call KernelPackage,ath9k-htc))
-$(eval $(call KernelPackage,ath10k))
-$(eval $(call KernelPackage,ath))
-$(eval $(call KernelPackage,carl9170))
-$(eval $(call KernelPackage,b43))
-$(eval $(call KernelPackage,b43legacy))
-$(eval $(call KernelPackage,brcmutil))
-$(eval $(call KernelPackage,brcmsmac))
-$(eval $(call KernelPackage,brcmfmac))
-$(eval $(call KernelPackage,net-libipw))
-$(eval $(call KernelPackage,net-ipw2100))
-$(eval $(call KernelPackage,net-ipw2200))
-$(eval $(call KernelPackage,iwlagn))
-$(eval $(call KernelPackage,iwl-legacy))
-$(eval $(call KernelPackage,iwl4965))
-$(eval $(call KernelPackage,iwl3945))
-$(eval $(call KernelPackage,mwl8k))
-$(eval $(call KernelPackage,mwifiex-pcie))
-$(eval $(call KernelPackage,net-hermes))
-$(eval $(call KernelPackage,net-hermes-pci))
-$(eval $(call KernelPackage,net-hermes-plx))
-$(eval $(call KernelPackage,net-hermes-pcmcia))
-$(eval $(call KernelPackage,wlcore))
+$(eval $(call KernelPackage,rtl8192de))
+$(eval $(call KernelPackage,rtl8192se))
+$(eval $(call KernelPackage,rtlwifi))
+$(eval $(call KernelPackage,rtlwifi-pci))
+$(eval $(call KernelPackage,rtlwifi-usb))
 $(eval $(call KernelPackage,wl12xx))
 $(eval $(call KernelPackage,wl18xx))
+$(eval $(call KernelPackage,wlcore))
+$(eval $(call KernelPackage,zd1211rw))
-- 
2.5.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Sun Aug 23 07:35:22 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Sun, 23 Aug 2015 13:35:22 +0200
Subject: [OpenWrt-Devel] [PATCH 6/7] mac80211: cosmetic changes
In-Reply-To: <55D9A836.4080800@web.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
 <1440327391-25355-2-git-send-email-dirkneukirchen@web.de>
 <55D9A836.4080800@web.de>
Message-ID: <CAOiHx==+K=_QoTMGinxYkytia_QREwOiQ7YKKpU6hTeL6_HmHg@mail.gmail.com>

Hi,

On Sun, Aug 23, 2015 at 1:02 PM, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
>
> - remove net prefix from some modules
> - try to sort alphabetically

> Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>

please split this into two (first remove the net prefix, then reorder
them), this should make it a bit less unreadable.


regards
Jonas
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 23 08:55:02 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 23 Aug 2015 14:55:02 +0200
Subject: [OpenWrt-Devel] [PATCH] kernel: arm64: psci: move psci firmware
	calls out of line
Message-ID: <1440334502-27357-1-git-send-email-dirkneukirchen@web.de>

- fixes build error on arm64 with FTRACE enabled
- upstream ticket says gcc5 but both linaro gcc variants
OpenWrt is using seem to be affected

backport upstream change f5e0a12ca2d939e47995f73428d9bf1ad372b289
for Kernel 3.18

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
found this in my local tree, diffconfig to replicate:

CONFIG_TARGET_arm64=y
CONFIG_TARGET_arm64_Default=y
CONFIG_TARGET_BOARD="arm64"
CONFIG_DEVEL=y
CONFIG_BUILD_LOG=y
CONFIG_KERNEL_DYNAMIC_FTRACE=y
CONFIG_KERNEL_ENABLE_DEFAULT_TRACERS=y
CONFIG_KERNEL_FTRACE=y
CONFIG_KERNEL_FTRACE_SYSCALLS=y
CONFIG_KERNEL_FUNCTION_GRAPH_TRACER=y
CONFIG_KERNEL_FUNCTION_PROFILER=y
CONFIG_KERNEL_FUNCTION_TRACER=y


 ...psci_move_psci_firmware_calls_out_of_line.patch | 124 +++++++++++++++++++++
 1 file changed, 124 insertions(+)
 create mode 100644 target/linux/generic/patches-3.18/090-from_4.0_arm64_psci_move_psci_firmware_calls_out_of_line.patch

diff --git a/target/linux/generic/patches-3.18/090-from_4.0_arm64_psci_move_psci_firmware_calls_out_of_line.patch b/target/linux/generic/patches-3.18/090-from_4.0_arm64_psci_move_psci_firmware_calls_out_of_line.patch
new file mode 100644
index 0000000..1db9d5f
--- /dev/null
+++ b/target/linux/generic/patches-3.18/090-from_4.0_arm64_psci_move_psci_firmware_calls_out_of_line.patch
@@ -0,0 +1,124 @@
+From f5e0a12ca2d939e47995f73428d9bf1ad372b289 Mon Sep 17 00:00:00 2001
+From: Will Deacon <will.deacon at arm.com>
+Date: Wed, 25 Feb 2015 12:10:35 +0000
+Subject: arm64: psci: move psci firmware calls out of line
+
+An arm64 allmodconfig fails to build with GCC 5 due to __asmeq
+assertions in the PSCI firmware calling code firing due to mcount
+preambles breaking our assumptions about register allocation of function
+arguments:
+
+  /tmp/ccDqJsJ6.s: Assembler messages:
+  /tmp/ccDqJsJ6.s:60: Error: .err encountered
+  /tmp/ccDqJsJ6.s:61: Error: .err encountered
+  /tmp/ccDqJsJ6.s:62: Error: .err encountered
+  /tmp/ccDqJsJ6.s:99: Error: .err encountered
+  /tmp/ccDqJsJ6.s:100: Error: .err encountered
+  /tmp/ccDqJsJ6.s:101: Error: .err encountered
+
+This patch fixes the issue by moving the PSCI calls out-of-line into
+their own assembly files, which are safe from the compiler's meddling
+fingers.
+
+Reported-by: Andy Whitcroft <apw at canonical.com>
+Signed-off-by: Will Deacon <will.deacon at arm.com>
+Signed-off-by: Catalin Marinas <catalin.marinas at arm.com>
+
+--- /dev/null
++++ b/arch/arm64/kernel/psci-call.S
+@@ -0,0 +1,28 @@
++/*
++ * 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.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * Copyright (C) 2015 ARM Limited
++ *
++ * Author: Will Deacon <will.deacon at arm.com>
++ */
++
++#include <linux/linkage.h>
++
++/* int __invoke_psci_fn_hvc(u64 function_id, u64 arg0, u64 arg1, u64 arg2) */
++ENTRY(__invoke_psci_fn_hvc)
++	hvc	#0
++	ret
++ENDPROC(__invoke_psci_fn_hvc)
++
++/* int __invoke_psci_fn_smc(u64 function_id, u64 arg0, u64 arg1, u64 arg2) */
++ENTRY(__invoke_psci_fn_smc)
++	smc	#0
++	ret
++ENDPROC(__invoke_psci_fn_smc)
+--- a/arch/arm64/kernel/psci.c
++++ b/arch/arm64/kernel/psci.c
+@@ -57,6 +57,9 @@ static struct psci_operations psci_ops;
+ static int (*invoke_psci_fn)(u64, u64, u64, u64);
+ typedef int (*psci_initcall_t)(const struct device_node *);
+ 
++asmlinkage int __invoke_psci_fn_hvc(u64, u64, u64, u64);
++asmlinkage int __invoke_psci_fn_smc(u64, u64, u64, u64);
++
+ enum psci_function {
+ 	PSCI_FN_CPU_SUSPEND,
+ 	PSCI_FN_CPU_ON,
+@@ -109,40 +112,6 @@ static void psci_power_state_unpack(u32
+ 			PSCI_0_2_POWER_STATE_AFFL_SHIFT;
+ }
+ 
+-/*
+- * The following two functions are invoked via the invoke_psci_fn pointer
+- * and will not be inlined, allowing us to piggyback on the AAPCS.
+- */
+-static noinline int __invoke_psci_fn_hvc(u64 function_id, u64 arg0, u64 arg1,
+-					 u64 arg2)
+-{
+-	asm volatile(
+-			__asmeq("%0", "x0")
+-			__asmeq("%1", "x1")
+-			__asmeq("%2", "x2")
+-			__asmeq("%3", "x3")
+-			"hvc	#0\n"
+-		: "+r" (function_id)
+-		: "r" (arg0), "r" (arg1), "r" (arg2));
+-
+-	return function_id;
+-}
+-
+-static noinline int __invoke_psci_fn_smc(u64 function_id, u64 arg0, u64 arg1,
+-					 u64 arg2)
+-{
+-	asm volatile(
+-			__asmeq("%0", "x0")
+-			__asmeq("%1", "x1")
+-			__asmeq("%2", "x2")
+-			__asmeq("%3", "x3")
+-			"smc	#0\n"
+-		: "+r" (function_id)
+-		: "r" (arg0), "r" (arg1), "r" (arg2));
+-
+-	return function_id;
+-}
+-
+ static int psci_get_version(void)
+ {
+ 	int err;
+--- a/arch/arm64/kernel/Makefile
++++ b/arch/arm64/kernel/Makefile
+@@ -14,8 +14,9 @@ CFLAGS_REMOVE_return_address.o = -pg
+ arm64-obj-y		:= cputable.o debug-monitors.o entry.o irq.o fpsimd.o	\
+ 			   entry-fpsimd.o process.o ptrace.o setup.o signal.o	\
+ 			   sys.o stacktrace.o time.o traps.o io.o vdso.o	\
+-			   hyp-stub.o psci.o cpu_ops.o insn.o return_address.o	\
+-			   cpuinfo.o cpu_errata.o alternative.o
++			   hyp-stub.o psci.o psci-call.o cpu_ops.o insn.o	\
++			   return_address.o cpuinfo.o cpu_errata.o		\
++			   alternative.o
+ 
+ arm64-obj-$(CONFIG_COMPAT)		+= sys32.o kuser32.o signal32.o 	\
+ 					   sys_compat.o
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Sun Aug 23 09:52:22 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Sun, 23 Aug 2015 15:52:22 +0200
Subject: [OpenWrt-Devel] [PATCH 1/3] mvebu: also copy nor initramfs kernels
	to bin
Message-ID: <1440337944-3803-1-git-send-email-jogo@openwrt.org>

r45421 added copying initramfs kernels for NAND profiles, but missed
both NOR profiles.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 target/linux/mvebu/image/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 7f270dd..255f1a4 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -63,6 +63,7 @@ define UBINORProfile
 
   define Image/Build/Profile/$(1)/Initramfs
 	$(call Image/Build/DTB,$(2),-initramfs)
+	cp $(KDIR)/uImage-initramfs-$(2) $(BIN_DIR)/$(IMG_PREFIX)-$(2)-initramfs
   endef
 
   define Image/Build/Profile/$(1)/squashfs
@@ -85,6 +86,7 @@ define NORProfile
 
   define Image/Build/Profile/$(1)/Initramfs
 	$(call Image/Build/DTB,$(2),-initramfs)
+	cp $(KDIR)/uImage-initramfs-$(2) $(BIN_DIR)/$(IMG_PREFIX)-$(2)-initramfs
   endef
 
   define Image/Build/Profile/$(1)/squashfs
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Sun Aug 23 09:52:23 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Sun, 23 Aug 2015 15:52:23 +0200
Subject: [OpenWrt-Devel] [PATCH 2/3] kernel: package up sdhci-pxav3
In-Reply-To: <1440337944-3803-1-git-send-email-jogo@openwrt.org>
References: <1440337944-3803-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440337944-3803-2-git-send-email-jogo@openwrt.org>

Package the sdhci controller driver found on armada 38x boards and add
backported fixes to allow them to be selected / not break the boot.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 package/kernel/linux/modules/other.mk              | 12 ++++++++
 ...Fix-hardware-dependencies-for-sdhci-pxav3.patch | 33 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 target/linux/mvebu/patches-4.0/060-mmc-Fix-hardware-dependencies-for-sdhci-pxav3.patch

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index 4a65a03..0da9a33 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -362,6 +362,18 @@ endef
 $(eval $(call KernelPackage,sdhci))
 
 
+define KernelPackage/sdhci-pxav3
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=Marvell MMP2 SD Host Controller support (PXAV3)
+  DEPENDS:=+kmod-sdhci @TARGET_mvebu
+  KCONFIG:=CONFIG_MMC_SDHCI_PXAV3
+  FILES:=$(LINUX_DIR)/drivers/mmc/host/sdhci-pxav3.ko
+  AUTOLOAD:=$(call AutoProbe,sdhci-pxav3,1)
+endef
+
+$(eval $(call KernelPackage,sdhci-pxav3))
+
+
 define KernelPackage/oprofile
   SUBMENU:=$(OTHER_MENU)
   TITLE:=OProfile profiling support
diff --git a/target/linux/mvebu/patches-4.0/060-mmc-Fix-hardware-dependencies-for-sdhci-pxav3.patch b/target/linux/mvebu/patches-4.0/060-mmc-Fix-hardware-dependencies-for-sdhci-pxav3.patch
new file mode 100644
index 0000000..5cc08b5
--- /dev/null
+++ b/target/linux/mvebu/patches-4.0/060-mmc-Fix-hardware-dependencies-for-sdhci-pxav3.patch
@@ -0,0 +1,33 @@
+From daa3054f5772b14dd073a2b95fd0353faec0fcc5 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare at suse.de>
+Date: Mon, 23 Feb 2015 11:30:40 +0100
+Subject: [PATCH] mmc: Fix hardware dependencies for sdhci-pxav3
+
+It was brought to my attention that the sdhci-pxav3 driver is needed
+on a few more ARM machines than I initially thought. Add the missing
+architectures to the dependency list.
+
+Credits to Peter Robinson for noticing my mistake and reporting.
+
+Reported-by: Peter Robinson <pbrobinson at gmail.com>
+Signed-off-by: Jean Delvare <jdelvare at suse.de>
+Cc: Chris Ball <chris at printf.net>
+Cc: Ulf Hansson <ulf.hansson at linaro.org>
+Cc: Eric Miao <eric.y.miao at gmail.com>
+Cc: Haojian Zhuang <haojian.zhuang at gmail.com>
+Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
+---
+ drivers/mmc/host/Kconfig |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/Kconfig
++++ b/drivers/mmc/host/Kconfig
+@@ -230,7 +230,7 @@ config MMC_SDHCI_PXAV3
+ 	tristate "Marvell MMP2 SD Host Controller support (PXAV3)"
+ 	depends on CLKDEV_LOOKUP
+ 	depends on MMC_SDHCI_PLTFM
+-	depends on ARCH_MMP || COMPILE_TEST
++	depends on ARCH_BERLIN || ARCH_MMP || ARCH_MVEBU || COMPILE_TEST
+ 	default CPU_MMP2
+ 	help
+ 	  This selects the Marvell(R) PXAV3 SD Host Controller.
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Sun Aug 23 09:52:24 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Sun, 23 Aug 2015 15:52:24 +0200
Subject: [OpenWrt-Devel] [PATCH 3/3] mvebu: Add Armada 388 General Purpose
	Development Board support
In-Reply-To: <1440337944-3803-1-git-send-email-jogo@openwrt.org>
References: <1440337944-3803-1-git-send-email-jogo@openwrt.org>
Message-ID: <1440337944-3803-3-git-send-email-jogo@openwrt.org>

The A388-GP is a board produced by Marvell that holds

- 1 PCIe slot
- 2 mini PCIe slot (one of them is multiplexed with the PCIe slot,
  muxing is selected through the GPIO expander)
- 1 16MB SPI-NOR
- 2 Gigabit Ethernet ports
- 4 SATA ports (2 of them are multiplexed with the mini PCIe slots,
  muxing is selected through the GPIO expander)
- 1 SDIO slot
- 1 USB3 port
- 2 USB2 port
- 2 GPIO/interrupts expander on I2C

Cherry pick the approriate patches from 4.0 that add the dts file and
its dependencies, add partitions to the spi flash and add a profile.

As a side effect the 385-rd dts file gets renamed to 388-rd for 3.18
as well; matching what it was named in 4.0 already.

Signed-off-by: Jonas Gorski <jogo at openwrt.org>
---
 .../mvebu/base-files/etc/uci-defaults/02_network   |   3 +
 target/linux/mvebu/base-files/lib/mvebu.sh         |   3 +
 target/linux/mvebu/image/Makefile                  |   3 +-
 ...emove-clock-frequency-from-Armada-38x-SDH.patch |  32 ++
 ...nable-no-1-8-v-flag-for-Armada-385-DB-SDH.patch |  35 ++
 ...ARM-mvebu-a38x-Add-more-pinctrl-functions.patch |  84 +++
 ...dd-Device-Tree-description-of-the-Armada-.patch | 632 +++++++++++++++++++++
 ...dd-Armada-388-General-Purpose-Development.patch | 329 +++++++++++
 .../patches-3.18/099-build_linksys_a385_dts.patch  |  10 +-
 .../207-armada-385-rd-mtd-partitions.patch         |   6 +-
 .../209-armada-385-gp-mtd-partitions.patch         |  19 +
 .../patches-3.18/300-add_missing_labels.patch      |   2 +-
 .../mvebu/patches-3.18/600-armada_38x_rtc.patch    |   2 +-
 .../209-armada-385-gp-mtd-partitions.patch         |  19 +
 target/linux/mvebu/profiles/marvell.mk             |  24 +-
 15 files changed, 1188 insertions(+), 15 deletions(-)
 create mode 100644 target/linux/mvebu/patches-3.18/071-ARM-mvebu-remove-clock-frequency-from-Armada-38x-SDH.patch
 create mode 100644 target/linux/mvebu/patches-3.18/072-ARM-mvebu-enable-no-1-8-v-flag-for-Armada-385-DB-SDH.patch
 create mode 100644 target/linux/mvebu/patches-3.18/073-ARM-mvebu-a38x-Add-more-pinctrl-functions.patch
 create mode 100644 target/linux/mvebu/patches-3.18/074-ARM-mvebu-Add-Device-Tree-description-of-the-Armada-.patch
 create mode 100644 target/linux/mvebu/patches-3.18/075-ARM-mvebu-Add-Armada-388-General-Purpose-Development.patch
 create mode 100644 target/linux/mvebu/patches-3.18/209-armada-385-gp-mtd-partitions.patch
 create mode 100644 target/linux/mvebu/patches-4.0/209-armada-385-gp-mtd-partitions.patch

diff --git a/target/linux/mvebu/base-files/etc/uci-defaults/02_network b/target/linux/mvebu/base-files/etc/uci-defaults/02_network
index d1ead03..002457b 100644
--- a/target/linux/mvebu/base-files/etc/uci-defaults/02_network
+++ b/target/linux/mvebu/base-files/etc/uci-defaults/02_network
@@ -30,6 +30,9 @@ armada-xp-linksys-mamba)
 armada-385-db-ap)
 	ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
 	;;
+armada-388-gp)
+	ucidef_set_interface_lan "eth0 eth1"
+	;;
 armada-xp-gp)
 	ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
 	;;
diff --git a/target/linux/mvebu/base-files/lib/mvebu.sh b/target/linux/mvebu/base-files/lib/mvebu.sh
index 3edfa6b..0a99209 100755
--- a/target/linux/mvebu/base-files/lib/mvebu.sh
+++ b/target/linux/mvebu/base-files/lib/mvebu.sh
@@ -43,6 +43,9 @@ mvebu_board_detect() {
 	*"Marvell Armada 385 Access Point Development Board")
 		name="armada-385-db-ap"
 		;;
+	*"Marvell Armada 385 GP")
+		name="armada-388-gp"
+		;;
 	*"Marvell Armada XP Development Board DB-MV784MP-GP")
 		name="armada-xp-gp"
 		;;
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 255f1a4..b9a66a3 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -140,7 +140,8 @@ $(eval $(call NANDProfile,Cobra,armada-385-linksys-cobra,128KiB,2048,512,2048))
 $(eval $(call UBINORProfile,OpenBlocks-AX-3-4,armada-xp-openblocks-ax3-4,128KiB))
 
 # Boards with small NOR, where UBI doesn't make sense
-$(eval $(call NORProfile,385-RD,armada-385-rd,256KiB))
+$(eval $(call NORProfile,388-GP,armada-388-gp,256KiB))
+$(eval $(call NORProfile,388-RD,armada-388-rd,256KiB))
 
 ###
 ### Linksys
diff --git a/target/linux/mvebu/patches-3.18/071-ARM-mvebu-remove-clock-frequency-from-Armada-38x-SDH.patch b/target/linux/mvebu/patches-3.18/071-ARM-mvebu-remove-clock-frequency-from-Armada-38x-SDH.patch
new file mode 100644
index 0000000..7adb2ad
--- /dev/null
+++ b/target/linux/mvebu/patches-3.18/071-ARM-mvebu-remove-clock-frequency-from-Armada-38x-SDH.patch
@@ -0,0 +1,32 @@
+From ebf50c9651ff28341b76e78c531592d7d3489bc6 Mon Sep 17 00:00:00 2001
+From: Marcin Wojtas <mw at semihalf.com>
+Date: Fri, 14 Nov 2014 16:57:30 +0100
+Subject: [PATCH] ARM: mvebu: remove clock-frequency from Armada 38x SDHCI
+ Device Tree node
+
+For proper operation of Armada 38x SDHCI controller proper 'clocks' property
+is sufficient. Therefore it is not useful to keep an additional
+'clock-frequency' property in SDHCI controller node of board-level Device Tree
+file for Armada 385 DB.
+
+This commit gets rid of useless 'clock-frequency' property.
+
+Signed-off-by: Marcin Wojtas <mw at semihalf.com>
+Reviewed-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Acked-by: Andrew Lunn <andrew at lunn.ch>
+Link: https://lkml.kernel.org/r/1415980652-7429-4-git-send-email-mw at semihalf.com
+Signed-off-by: Jason Cooper <jason at lakedaemon.net>
+---
+ arch/arm/boot/dts/armada-385-db.dts |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/arch/arm/boot/dts/armada-385-db.dts
++++ b/arch/arm/boot/dts/armada-385-db.dts
+@@ -116,7 +116,6 @@
+ 			};
+ 
+ 			sdhci at d8000 {
+-				clock-frequency = <200000000>;
+ 				broken-cd;
+ 				wp-inverted;
+ 				bus-width = <8>;
diff --git a/target/linux/mvebu/patches-3.18/072-ARM-mvebu-enable-no-1-8-v-flag-for-Armada-385-DB-SDH.patch b/target/linux/mvebu/patches-3.18/072-ARM-mvebu-enable-no-1-8-v-flag-for-Armada-385-DB-SDH.patch
new file mode 100644
index 0000000..313dd43
--- /dev/null
+++ b/target/linux/mvebu/patches-3.18/072-ARM-mvebu-enable-no-1-8-v-flag-for-Armada-385-DB-SDH.patch
@@ -0,0 +1,35 @@
+From 5e949f0c79917f3fd8512a3b66b0c861e03ec5a6 Mon Sep 17 00:00:00 2001
+From: Marcin Wojtas <mw at semihalf.com>
+Date: Fri, 14 Nov 2014 16:57:29 +0100
+Subject: [PATCH] ARM: mvebu: enable no-1-8-v flag for Armada 385 DB SDHCI
+ interface
+
+The Marvell Armada 38x SoC's SDHCI interface is capable of using 1.8v voltage,
+needed for driving "UHS-I" SD cards at their full speed. It is not, however,
+possible on the DB board. Due to physical connectivity connector supply is tied
+to 3v and any attempt of changing voltage in order to operate in the fastest UHS
+modes fails.
+
+This patch enables equivalent SDHCI quirk in order to adjust controller
+operation to system capabilities.
+
+Signed-off-by: Marcin Wojtas <mw at semihalf.com>
+Reviewed-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Acked-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
+Acked-by: Andrew Lunn <andrew at lunn.ch>
+Link: https://lkml.kernel.org/r/1415980652-7429-3-git-send-email-mw at semihalf.com
+Signed-off-by: Jason Cooper <jason at lakedaemon.net>
+---
+ arch/arm/boot/dts/armada-385-db.dts |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/boot/dts/armada-385-db.dts
++++ b/arch/arm/boot/dts/armada-385-db.dts
+@@ -120,6 +120,7 @@
+ 				wp-inverted;
+ 				bus-width = <8>;
+ 				status = "okay";
++				no-1-8-v;
+ 			};
+ 
+ 			usb3 at f0000 {
diff --git a/target/linux/mvebu/patches-3.18/073-ARM-mvebu-a38x-Add-more-pinctrl-functions.patch b/target/linux/mvebu/patches-3.18/073-ARM-mvebu-a38x-Add-more-pinctrl-functions.patch
new file mode 100644
index 0000000..9812e81
--- /dev/null
+++ b/target/linux/mvebu/patches-3.18/073-ARM-mvebu-a38x-Add-more-pinctrl-functions.patch
@@ -0,0 +1,84 @@
+From 34598503049688741edc45e800627d945293e5f2 Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Date: Thu, 8 Jan 2015 18:38:10 +0100
+Subject: [PATCH] ARM: mvebu: a38x: Add more pinctrl functions
+
+With the Armada 385 GP board more pinctrl functions depending of the
+SoC are needed. Add them to the DTSI to avoid duplication.
+
+Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew at lunn.ch>
+---
+ arch/arm/boot/dts/armada-38x.dtsi |   47 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 47 insertions(+)
+
+--- a/arch/arm/boot/dts/armada-38x.dtsi
++++ b/arch/arm/boot/dts/armada-38x.dtsi
+@@ -205,6 +205,14 @@
+ 					marvell,function = "ge0";
+ 				};
+ 
++				ge1_rgmii_pins: ge-rgmii-pins-1 {
++					marvell,pins = "mpp21", "mpp27", "mpp28",
++						       "mpp29", "mpp30", "mpp31",
++						       "mpp32", "mpp37", "mpp38",
++						       "mpp39", "mpp40", "mpp41";
++					marvell,function = "ge1";
++				};
++
+ 				i2c0_pins: i2c-pins-0 {
+ 					marvell,pins = "mpp2", "mpp3";
+ 					marvell,function = "i2c0";
+@@ -220,6 +228,17 @@
+ 					marvell,function = "ref";
+ 				};
+ 
++				ref_clk1_pins: ref-clk-pins-1 {
++					marvell,pins = "mpp46";
++					marvell,function = "ref";
++				};
++
++				spi0_pins: spi-pins-0 {
++					marvell,pins = "mpp22", "mpp23", "mpp24",
++						       "mpp25";
++					marvell,function = "spi0";
++				};
++
+ 				spi1_pins: spi-pins-1 {
+ 					marvell,pins = "mpp56", "mpp57", "mpp58",
+ 						       "mpp59";
+@@ -235,6 +254,34 @@
+ 					marvell,pins = "mpp19", "mpp20";
+ 					marvell,function = "ua1";
+ 				};
++
++				sdhci_pins: sdhci-pins {
++					marvell,pins = "mpp48", "mpp49", "mpp50",
++						       "mpp52", "mpp53", "mpp54",
++						       "mpp55", "mpp57", "mpp58",
++						       "mpp59";
++					marvell,function = "sd0";
++				};
++
++				sata0_pins: sata-pins-0 {
++					marvell,pins = "mpp20";
++					marvell,function = "sata0";
++				};
++
++				sata1_pins: sata-pins-1 {
++					marvell,pins = "mpp19";
++					marvell,function = "sata1";
++				};
++
++				sata2_pins: sata-pins-2 {
++					marvell,pins = "mpp47";
++					marvell,function = "sata2";
++				};
++
++				sata3_pins: sata-pins-3 {
++					marvell,pins = "mpp44";
++					marvell,function = "sata3";
++				};
+ 			};
+ 
+ 			gpio0: gpio at 18100 {
diff --git a/target/linux/mvebu/patches-3.18/074-ARM-mvebu-Add-Device-Tree-description-of-the-Armada-.patch b/target/linux/mvebu/patches-3.18/074-ARM-mvebu-Add-Device-Tree-description-of-the-Armada-.patch
new file mode 100644
index 0000000..828e1e5
--- /dev/null
+++ b/target/linux/mvebu/patches-3.18/074-ARM-mvebu-Add-Device-Tree-description-of-the-Armada-.patch
@@ -0,0 +1,632 @@
+From 881a50e47f231fb0185396125234f3188e14c2f3 Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Date: Thu, 8 Jan 2015 18:38:13 +0100
+Subject: [PATCH] ARM: mvebu: Add Device Tree description of the Armada 388
+ SoC
+
+This SoC belongs to the Armada 38x family. The main difference with
+the Armada 385 is that the 388 can handle two more SATA
+ports. Currently the consequence is the use of a different compatible
+string for the pinctrl node, in order to be able to use the pins
+associated to this 2 new SATA ports. The second SATA controller has
+also been moved from the armada38x.dtsi as it it specific to the
+Armada388 version.
+
+In the same time the Armada385 DB and Armada 385 RD board have been
+renamed in the 388 one and now include the armada-388.dtsi file. AS
+both of them have 4 SATA ports the SoC used on them were wrongly
+described.
+
+Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew at lunn.ch>
+---
+ arch/arm/boot/dts/Makefile          |    4 +-
+ arch/arm/boot/dts/armada-385-db.dts |  151 ----------------------------------
+ arch/arm/boot/dts/armada-385-rd.dts |   97 ----------------------
+ arch/arm/boot/dts/armada-388-db.dts |  152 +++++++++++++++++++++++++++++++++++
+ arch/arm/boot/dts/armada-388-rd.dts |   98 ++++++++++++++++++++++
+ arch/arm/boot/dts/armada-388.dtsi   |   70 ++++++++++++++++
+ 6 files changed, 322 insertions(+), 250 deletions(-)
+ delete mode 100644 arch/arm/boot/dts/armada-385-db.dts
+ delete mode 100644 arch/arm/boot/dts/armada-385-rd.dts
+ create mode 100644 arch/arm/boot/dts/armada-388-db.dts
+ create mode 100644 arch/arm/boot/dts/armada-388-rd.dts
+ create mode 100644 arch/arm/boot/dts/armada-388.dtsi
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -499,9 +499,9 @@ dtb-$(CONFIG_MACH_ARMADA_370) += \
+ dtb-$(CONFIG_MACH_ARMADA_375) += \
+ 	armada-375-db.dtb
+ dtb-$(CONFIG_MACH_ARMADA_38X) += \
+-	armada-385-db.dtb \
+ 	armada-385-db-ap.dtb \
+-	armada-385-rd.dtb
++	armada-388-db.dtb \
++	armada-388-rd.dtb
+ dtb-$(CONFIG_MACH_ARMADA_XP) += \
+ 	armada-xp-axpwifiap.dtb \
+ 	armada-xp-db.dtb \
+--- a/arch/arm/boot/dts/armada-385-db.dts
++++ /dev/null
+@@ -1,151 +0,0 @@
+-/*
+- * Device Tree file for Marvell Armada 385 evaluation board
+- * (DB-88F6820)
+- *
+- *  Copyright (C) 2014 Marvell
+- *
+- * Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
+- *
+- * This file is licensed under the terms of the GNU General Public
+- * License version 2.  This program is licensed "as is" without any
+- * warranty of any kind, whether express or implied.
+- */
+-
+-/dts-v1/;
+-#include "armada-385.dtsi"
+-
+-/ {
+-	model = "Marvell Armada 385 Development Board";
+-	compatible = "marvell,a385-db", "marvell,armada385", "marvell,armada380";
+-
+-	chosen {
+-		bootargs = "console=ttyS0,115200 earlyprintk";
+-	};
+-
+-	memory {
+-		device_type = "memory";
+-		reg = <0x00000000 0x10000000>; /* 256 MB */
+-	};
+-
+-	soc {
+-		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+-			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+-
+-		internal-regs {
+-			spi at 10600 {
+-				status = "okay";
+-
+-				spi-flash at 0 {
+-					#address-cells = <1>;
+-					#size-cells = <1>;
+-					compatible = "w25q32";
+-					reg = <0>; /* Chip select 0 */
+-					spi-max-frequency = <108000000>;
+-				};
+-			};
+-
+-			i2c at 11000 {
+-				status = "okay";
+-				clock-frequency = <100000>;
+-			};
+-
+-			i2c at 11100 {
+-				status = "okay";
+-				clock-frequency = <100000>;
+-			};
+-
+-			serial at 12000 {
+-				status = "okay";
+-			};
+-
+-			ethernet at 30000 {
+-				status = "okay";
+-				phy = <&phy1>;
+-				phy-mode = "rgmii-id";
+-			};
+-
+-			usb at 50000 {
+-				status = "ok";
+-			};
+-
+-			ethernet at 70000 {
+-				status = "okay";
+-				phy = <&phy0>;
+-				phy-mode = "rgmii-id";
+-			};
+-
+-			mdio at 72004 {
+-				phy0: ethernet-phy at 0 {
+-					reg = <0>;
+-				};
+-
+-				phy1: ethernet-phy at 1 {
+-					reg = <1>;
+-				};
+-			};
+-
+-			sata at a8000 {
+-				status = "okay";
+-			};
+-
+-			sata at e0000 {
+-				status = "okay";
+-			};
+-
+-			flash at d0000 {
+-				status = "okay";
+-				num-cs = <1>;
+-				marvell,nand-keep-config;
+-				marvell,nand-enable-arbiter;
+-				nand-on-flash-bbt;
+-				nand-ecc-strength = <4>;
+-				nand-ecc-step-size = <512>;
+-
+-				partition at 0 {
+-					label = "U-Boot";
+-					reg = <0 0x800000>;
+-				};
+-				partition at 800000 {
+-					label = "Linux";
+-					reg = <0x800000 0x800000>;
+-				};
+-				partition at 1000000 {
+-					label = "Filesystem";
+-					reg = <0x1000000 0x3f000000>;
+-				};
+-			};
+-
+-			sdhci at d8000 {
+-				broken-cd;
+-				wp-inverted;
+-				bus-width = <8>;
+-				status = "okay";
+-				no-1-8-v;
+-			};
+-
+-			usb3 at f0000 {
+-				status = "okay";
+-			};
+-
+-			usb3 at f8000 {
+-				status = "okay";
+-			};
+-		};
+-
+-		pcie-controller {
+-			status = "okay";
+-			/*
+-			 * The two PCIe units are accessible through
+-			 * standard PCIe slots on the board.
+-			 */
+-			pcie at 1,0 {
+-				/* Port 0, Lane 0 */
+-				status = "okay";
+-			};
+-			pcie at 2,0 {
+-				/* Port 1, Lane 0 */
+-				status = "okay";
+-			};
+-		};
+-	};
+-};
+--- a/arch/arm/boot/dts/armada-385-rd.dts
++++ /dev/null
+@@ -1,97 +0,0 @@
+-/*
+- * Device Tree file for Marvell Armada 385 Reference Design board
+- * (RD-88F6820-AP)
+- *
+- *  Copyright (C) 2014 Marvell
+- *
+- * Gregory CLEMENT <gregory.clement at free-electrons.com>
+- * Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
+- *
+- * This file is licensed under the terms of the GNU General Public
+- * License version 2.  This program is licensed "as is" without any
+- * warranty of any kind, whether express or implied.
+- */
+-
+-/dts-v1/;
+-#include "armada-385.dtsi"
+-
+-/ {
+-	model = "Marvell Armada 385 Reference Design";
+-	compatible = "marvell,a385-rd", "marvell,armada385", "marvell,armada380";
+-
+-	chosen {
+-		bootargs = "console=ttyS0,115200 earlyprintk";
+-	};
+-
+-	memory {
+-		device_type = "memory";
+-		reg = <0x00000000 0x10000000>; /* 256 MB */
+-	};
+-
+-	soc {
+-		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+-			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+-
+-		internal-regs {
+-			spi at 10600 {
+-				status = "okay";
+-
+-				spi-flash at 0 {
+-					#address-cells = <1>;
+-					#size-cells = <1>;
+-					compatible = "st,m25p128";
+-					reg = <0>; /* Chip select 0 */
+-					spi-max-frequency = <108000000>;
+-				};
+-			};
+-
+-			i2c at 11000 {
+-				status = "okay";
+-				clock-frequency = <100000>;
+-			};
+-
+-			serial at 12000 {
+-				status = "okay";
+-			};
+-
+-			ethernet at 30000 {
+-				status = "okay";
+-				phy = <&phy0>;
+-				phy-mode = "rgmii-id";
+-			};
+-
+-			ethernet at 70000 {
+-				status = "okay";
+-				phy = <&phy1>;
+-				phy-mode = "rgmii-id";
+-			};
+-
+-
+-			mdio at 72004 {
+-				phy0: ethernet-phy at 0 {
+-					reg = <0>;
+-				};
+-
+-				phy1: ethernet-phy at 1 {
+-					reg = <1>;
+-				};
+-			};
+-
+-			usb3 at f0000 {
+-				status = "okay";
+-			};
+-		};
+-
+-		pcie-controller {
+-			status = "okay";
+-			/*
+-			 * One PCIe units is accessible through
+-			 * standard PCIe slot on the board.
+-			 */
+-			pcie at 1,0 {
+-				/* Port 0, Lane 0 */
+-				status = "okay";
+-			};
+-		};
+-	};
+-};
+--- /dev/null
++++ b/arch/arm/boot/dts/armada-388-db.dts
+@@ -0,0 +1,152 @@
++/*
++ * Device Tree file for Marvell Armada 388 evaluation board
++ * (DB-88F6820)
++ *
++ *  Copyright (C) 2014 Marvell
++ *
++ * Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
++ *
++ * This file is licensed under the terms of the GNU General Public
++ * License version 2.  This program is licensed "as is" without any
++ * warranty of any kind, whether express or implied.
++ */
++
++/dts-v1/;
++#include "armada-388.dtsi"
++
++/ {
++	model = "Marvell Armada 385 Development Board";
++	compatible = "marvell,a385-db", "marvell,armada388",
++		"marvell,armada385", "marvell,armada380";
++
++	chosen {
++		bootargs = "console=ttyS0,115200 earlyprintk";
++	};
++
++	memory {
++		device_type = "memory";
++		reg = <0x00000000 0x10000000>; /* 256 MB */
++	};
++
++	soc {
++		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
++			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
++
++		internal-regs {
++			spi at 10600 {
++				status = "okay";
++
++				spi-flash at 0 {
++					#address-cells = <1>;
++					#size-cells = <1>;
++					compatible = "w25q32";
++					reg = <0>; /* Chip select 0 */
++					spi-max-frequency = <108000000>;
++				};
++			};
++
++			i2c at 11000 {
++				status = "okay";
++				clock-frequency = <100000>;
++			};
++
++			i2c at 11100 {
++				status = "okay";
++				clock-frequency = <100000>;
++			};
++
++			serial at 12000 {
++				status = "okay";
++			};
++
++			ethernet at 30000 {
++				status = "okay";
++				phy = <&phy1>;
++				phy-mode = "rgmii-id";
++			};
++
++			usb at 50000 {
++				status = "ok";
++			};
++
++			ethernet at 70000 {
++				status = "okay";
++				phy = <&phy0>;
++				phy-mode = "rgmii-id";
++			};
++
++			mdio at 72004 {
++				phy0: ethernet-phy at 0 {
++					reg = <0>;
++				};
++
++				phy1: ethernet-phy at 1 {
++					reg = <1>;
++				};
++			};
++
++			sata at a8000 {
++				status = "okay";
++			};
++
++			sata at e0000 {
++				status = "okay";
++			};
++
++			flash at d0000 {
++				status = "okay";
++				num-cs = <1>;
++				marvell,nand-keep-config;
++				marvell,nand-enable-arbiter;
++				nand-on-flash-bbt;
++				nand-ecc-strength = <4>;
++				nand-ecc-step-size = <512>;
++
++				partition at 0 {
++					label = "U-Boot";
++					reg = <0 0x800000>;
++				};
++				partition at 800000 {
++					label = "Linux";
++					reg = <0x800000 0x800000>;
++				};
++				partition at 1000000 {
++					label = "Filesystem";
++					reg = <0x1000000 0x3f000000>;
++				};
++			};
++
++			sdhci at d8000 {
++				broken-cd;
++				wp-inverted;
++				bus-width = <8>;
++				status = "okay";
++				no-1-8-v;
++			};
++
++			usb3 at f0000 {
++				status = "okay";
++			};
++
++			usb3 at f8000 {
++				status = "okay";
++			};
++		};
++
++		pcie-controller {
++			status = "okay";
++			/*
++			 * The two PCIe units are accessible through
++			 * standard PCIe slots on the board.
++			 */
++			pcie at 1,0 {
++				/* Port 0, Lane 0 */
++				status = "okay";
++			};
++			pcie at 2,0 {
++				/* Port 1, Lane 0 */
++				status = "okay";
++			};
++		};
++	};
++};
+--- /dev/null
++++ b/arch/arm/boot/dts/armada-388-rd.dts
+@@ -0,0 +1,98 @@
++/*
++ * Device Tree file for Marvell Armada 388 Reference Design board
++ * (RD-88F6820-AP)
++ *
++ *  Copyright (C) 2014 Marvell
++ *
++ * Gregory CLEMENT <gregory.clement at free-electrons.com>
++ * Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
++ *
++ * This file is licensed under the terms of the GNU General Public
++ * License version 2.  This program is licensed "as is" without any
++ * warranty of any kind, whether express or implied.
++ */
++
++/dts-v1/;
++#include "armada-388.dtsi"
++
++/ {
++	model = "Marvell Armada 385 Reference Design";
++	compatible = "marvell,a385-rd", "marvell,armada388",
++		"marvell,armada385","marvell,armada380";
++
++	chosen {
++		bootargs = "console=ttyS0,115200 earlyprintk";
++	};
++
++	memory {
++		device_type = "memory";
++		reg = <0x00000000 0x10000000>; /* 256 MB */
++	};
++
++	soc {
++		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
++			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
++
++		internal-regs {
++			spi at 10600 {
++				status = "okay";
++
++				spi-flash at 0 {
++					#address-cells = <1>;
++					#size-cells = <1>;
++					compatible = "st,m25p128";
++					reg = <0>; /* Chip select 0 */
++					spi-max-frequency = <108000000>;
++				};
++			};
++
++			i2c at 11000 {
++				status = "okay";
++				clock-frequency = <100000>;
++			};
++
++			serial at 12000 {
++				status = "okay";
++			};
++
++			ethernet at 30000 {
++				status = "okay";
++				phy = <&phy0>;
++				phy-mode = "rgmii-id";
++			};
++
++			ethernet at 70000 {
++				status = "okay";
++				phy = <&phy1>;
++				phy-mode = "rgmii-id";
++			};
++
++
++			mdio at 72004 {
++				phy0: ethernet-phy at 0 {
++					reg = <0>;
++				};
++
++				phy1: ethernet-phy at 1 {
++					reg = <1>;
++				};
++			};
++
++			usb3 at f0000 {
++				status = "okay";
++			};
++		};
++
++		pcie-controller {
++			status = "okay";
++			/*
++			 * One PCIe units is accessible through
++			 * standard PCIe slot on the board.
++			 */
++			pcie at 1,0 {
++				/* Port 0, Lane 0 */
++				status = "okay";
++			};
++		};
++	};
++};
+--- /dev/null
++++ b/arch/arm/boot/dts/armada-388.dtsi
+@@ -0,0 +1,70 @@
++/*
++ * Device Tree Include file for Marvell Armada 388 SoC.
++ *
++ * Copyright (C) 2015 Marvell
++ *
++ * Gregory CLEMENT <gregory.clement at free-electrons.com>
++ *
++ * This file is dual-licensed: you can use it either under the terms
++ * of the GPL or the X11 license, at your option. Note that this dual
++ * licensing only applies to this file, and not this project as a
++ * whole.
++ *
++ *  a) This file is licensed under the terms of the GNU General Public
++ *     License version 2.  This program is licensed "as is" without
++ *     any warranty of any kind, whether express or implied.
++ *
++ * Or, alternatively,
++ *
++ *  b) Permission is hereby granted, free of charge, to any person
++ *     obtaining a copy of this software and associated documentation
++ *     files (the "Software"), to deal in the Software without
++ *     restriction, including without limitation the rights to use,
++ *     copy, modify, merge, publish, distribute, sublicense, and/or
++ *     sell copies of the Software, and to permit persons to whom the
++ *     Software is furnished to do so, subject to the following
++ *     conditions:
++ *
++ *     The above copyright notice and this permission notice shall be
++ *     included in all copies or substantial portions of the Software.
++ *
++ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
++ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ *     OTHER DEALINGS IN THE SOFTWARE.
++ *
++ *
++ * The main difference with the Armada 385 is that the 388 can handle two more
++ * SATA ports. So we can reuse the dtsi of the Armada 385, override the pinctrl
++ * property and the name of the SoC, and add the second SATA host which control
++ * the 2 other ports.
++ */
++
++#include "armada-385.dtsi"
++
++/ {
++	model = "Marvell Armada 388 family SoC";
++	compatible = "marvell,armada388", "marvell,armada385",
++		"marvell,armada380";
++
++	soc {
++		internal-regs {
++			pinctrl at 18000 {
++				compatible = "marvell,mv88f6828-pinctrl";
++			};
++
++			sata at e0000 {
++				compatible = "marvell,armada-380-ahci";
++				reg = <0xe0000 0x2000>;
++				interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
++				clocks = <&gateclk 30>;
++				status = "disabled";
++			};
++
++		};
++	};
++};
diff --git a/target/linux/mvebu/patches-3.18/075-ARM-mvebu-Add-Armada-388-General-Purpose-Development.patch b/target/linux/mvebu/patches-3.18/075-ARM-mvebu-Add-Armada-388-General-Purpose-Development.patch
new file mode 100644
index 0000000..1807e5f
--- /dev/null
+++ b/target/linux/mvebu/patches-3.18/075-ARM-mvebu-Add-Armada-388-General-Purpose-Development.patch
@@ -0,0 +1,329 @@
+From 928413bd859c0936f03f6a3504c4721e83a3d1d7 Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Date: Thu, 8 Jan 2015 19:11:33 +0100
+Subject: [PATCH] ARM: mvebu: Add Armada 388 General Purpose Development Board
+ support
+
+The A388-GP is a board produced by Marvell that holds
+
+- 1 PCIe slot
+- 2 mini PCIe slot (one of them is multiplexed with the PCIe slot,
+  muxing is selected through the GPIO expander)
+- 1 16MB SPI-NOR
+- 2 Gigabit Ethernet ports
+- 4 SATA ports (2 of them are multiplexed with the mini PCIe slots,
+  muxing is selected through the GPIO expander)
+- 1 SDIO slot
+- 1 USB3 port
+- 2 USB2 port
+- 2 GPIO/interrupts expander on I2C
+
+Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew at lunn.ch>
+---
+ arch/arm/boot/dts/Makefile          |    1 +
+ arch/arm/boot/dts/armada-388-gp.dts |  288 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 289 insertions(+)
+ create mode 100644 arch/arm/boot/dts/armada-388-gp.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -501,6 +501,7 @@ dtb-$(CONFIG_MACH_ARMADA_375) += \
+ dtb-$(CONFIG_MACH_ARMADA_38X) += \
+ 	armada-385-db-ap.dtb \
+ 	armada-388-db.dtb \
++	armada-388-gp.dtb \
+ 	armada-388-rd.dtb
+ dtb-$(CONFIG_MACH_ARMADA_XP) += \
+ 	armada-xp-axpwifiap.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/armada-388-gp.dts
+@@ -0,0 +1,288 @@
++/*
++ * Device Tree file for Marvell Armada 385 development board
++ * (RD-88F6820-GP)
++ *
++ * Copyright (C) 2014 Marvell
++ *
++ * Gregory CLEMENT <gregory.clement at free-electrons.com>
++ *
++ * This file is dual-licensed: you can use it either under the terms
++ * of the GPL or the X11 license, at your option. Note that this dual
++ * licensing only applies to this file, and not this project as a
++ * whole.
++ *
++ *  a) This file is licensed under the terms of the GNU General Public
++ *     License version 2.  This program is licensed "as is" without
++ *     any warranty of any kind, whether express or implied.
++ *
++ * Or, alternatively,
++ *
++ *  b) Permission is hereby granted, free of charge, to any person
++ *     obtaining a copy of this software and associated documentation
++ *     files (the "Software"), to deal in the Software without
++ *     restriction, including without limitation the rights to use,
++ *     copy, modify, merge, publish, distribute, sublicense, and/or
++ *     sell copies of the Software, and to permit persons to whom the
++ *     Software is furnished to do so, subject to the following
++ *     conditions:
++ *
++ *     The above copyright notice and this permission notice shall be
++ *     included in all copies or substantial portions of the Software.
++ *
++ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
++ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ *     OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++/dts-v1/;
++#include "armada-388.dtsi"
++#include <dt-bindings/gpio/gpio.h>
++
++/ {
++	model = "Marvell Armada 385 GP";
++	compatible = "marvell,a385-gp", "marvell,armada388", "marvell,armada380";
++
++	chosen {
++		bootargs = "console=ttyS0,115200";
++		stdout-path = &uart0;
++	};
++
++	memory {
++		device_type = "memory";
++		reg = <0x00000000 0x80000000>; /* 2 GB */
++	};
++
++	soc {
++		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
++			  MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
++
++		internal-regs {
++			spi at 10600 {
++				pinctrl-names = "default";
++				pinctrl-0 = <&spi0_pins>;
++				status = "okay";
++
++				spi-flash at 0 {
++					#address-cells = <1>;
++					#size-cells = <1>;
++					compatible = "st,m25p128";
++					reg = <0>; /* Chip select 0 */
++					spi-max-frequency = <50000000>;
++					m25p,fast-read;
++				};
++			};
++
++			i2c at 11000 {
++				pinctrl-names = "default";
++				pinctrl-0 = <&i2c0_pins>;
++				status = "okay";
++				clock-frequency = <100000>;
++				/*
++				 * The EEPROM located at adresse 54 is needed
++				 * for the boot - DO NOT ERASE IT -
++				 */
++
++				expander0: pca9555 at 20 {
++					compatible = "nxp,pca9555";
++					pinctrl-names = "default";
++					pinctrl-0 = <&pca0_pins>;
++					interrupt-parent = <&gpio0>;
++					interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
++					gpio-controller;
++					#gpio-cells = <2>;
++					interrupt-controller;
++					#interrupt-cells = <2>;
++					reg = <0x20>;
++				};
++
++				expander1: pca9555 at 21 {
++					compatible = "nxp,pca9555";
++					pinctrl-names = "default";
++					interrupt-parent = <&gpio0>;
++					interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
++					gpio-controller;
++					#gpio-cells = <2>;
++					interrupt-controller;
++					#interrupt-cells = <2>;
++					reg = <0x21>;
++				};
++
++			};
++
++			serial at 12000 {
++				/*
++				 * Exported on the micro USB connector CON16
++				 * through an FTDI
++				 */
++
++				pinctrl-names = "default";
++				pinctrl-0 = <&uart0_pins>;
++				status = "okay";
++			};
++
++			/* GE1 CON15 */
++			ethernet at 30000 {
++				pinctrl-names = "default";
++				pinctrl-0 = <&ge1_rgmii_pins>;
++				status = "okay";
++				phy = <&phy1>;
++				phy-mode = "rgmii-id";
++			};
++
++			/* CON4 */
++			usb at 50000 {
++				vcc-supply = <&reg_usb2_0_vbus>;
++				status = "okay";
++			};
++
++			/* GE0 CON1 */
++			ethernet at 70000 {
++				pinctrl-names = "default";
++				/*
++				 * The Reference Clock 0 is used to provide a
++				 * clock to the PHY
++				 */
++				pinctrl-0 = <&ge0_rgmii_pins>, <&ref_clk0_pins>;
++				status = "okay";
++				phy = <&phy0>;
++				phy-mode = "rgmii-id";
++			};
++
++
++			mdio at 72004 {
++				pinctrl-names = "default";
++				pinctrl-0 = <&mdio_pins>;
++
++				phy0: ethernet-phy at 1 {
++					reg = <1>;
++				};
++
++				phy1: ethernet-phy at 0 {
++					reg = <0>;
++				};
++			};
++
++			sata at a8000 {
++				pinctrl-names = "default";
++				pinctrl-0 = <&sata0_pins>, <&sata1_pins>;
++				status = "okay";
++				#address-cells = <1>;
++				#size-cells = <0>;
++			};
++
++			sata at e0000 {
++				pinctrl-names = "default";
++				pinctrl-0 = <&sata2_pins>, <&sata3_pins>;
++				status = "okay";
++				#address-cells = <1>;
++				#size-cells = <0>;
++			};
++
++			sdhci at d8000 {
++				pinctrl-names = "default";
++				pinctrl-0 = <&sdhci_pins>;
++				cd-gpios = <&expander0 5 GPIO_ACTIVE_LOW>;
++				no-1-8-v;
++				wp-inverted;
++				bus-width = <8>;
++				status = "okay";
++			};
++
++			/* CON5 */
++			usb3 at f0000 {
++				vcc-supply = <&reg_usb2_1_vbus>;
++				status = "okay";
++			};
++
++			/* CON7 */
++			usb3 at f8000 {
++				vcc-supply = <&reg_usb3_vbus>;
++				status = "okay";
++			};
++		};
++
++		pcie-controller {
++			status = "okay";
++			/*
++			 * One PCIe units is accessible through
++			 * standard PCIe slot on the board.
++			 */
++			pcie at 1,0 {
++				/* Port 0, Lane 0 */
++				status = "okay";
++			};
++
++			/*
++			 * The two other PCIe units are accessible
++			 * through mini PCIe slot on the board.
++			 */
++			pcie at 2,0 {
++				/* Port 1, Lane 0 */
++				status = "okay";
++			};
++			pcie at 3,0 {
++				/* Port 2, Lane 0 */
++				status = "okay";
++			};
++		};
++
++		gpio-fan {
++			compatible = "gpio-fan";
++			gpios = <&expander1 3 GPIO_ACTIVE_HIGH>;
++			gpio-fan,speed-map = <	 0 0
++					      3000 1>;
++		};
++	};
++
++	reg_usb3_vbus: usb3-vbus {
++		compatible = "regulator-fixed";
++		regulator-name = "usb3-vbus";
++		regulator-min-microvolt = <5000000>;
++		regulator-max-microvolt = <5000000>;
++		enable-active-high;
++		regulator-always-on;
++		gpio = <&expander1 15 GPIO_ACTIVE_HIGH>;
++	};
++
++	reg_usb2_0_vbus: v5-vbus0 {
++		compatible = "regulator-fixed";
++		regulator-name = "v5.0-vbus0";
++		regulator-min-microvolt = <5000000>;
++		regulator-max-microvolt = <5000000>;
++		enable-active-high;
++		regulator-always-on;
++		gpio = <&expander1 14 GPIO_ACTIVE_HIGH>;
++	};
++
++	reg_usb2_1_vbus: v5-vbus1 {
++		compatible = "regulator-fixed";
++		regulator-name = "v5.0-vbus1";
++		regulator-min-microvolt = <5000000>;
++		regulator-max-microvolt = <5000000>;
++		enable-active-high;
++		regulator-always-on;
++		gpio = <&expander0 4 GPIO_ACTIVE_HIGH>;
++	};
++
++	reg_usb2_1_vbus: v5-vbus1 {
++		compatible = "regulator-fixed";
++		regulator-name = "v5.0-vbus1";
++		regulator-min-microvolt = <5000000>;
++		regulator-max-microvolt = <5000000>;
++		enable-active-high;
++		regulator-always-on;
++		gpio = <&expander0 4 GPIO_ACTIVE_HIGH>;
++	};
++};
++
++&pinctrl {
++	pca0_pins: pca0_pins {
++		marvell,pins = "mpp18";
++		marvell,function = "gpio";
++	};
++};
diff --git a/target/linux/mvebu/patches-3.18/099-build_linksys_a385_dts.patch b/target/linux/mvebu/patches-3.18/099-build_linksys_a385_dts.patch
index b55bba1..7360298 100644
--- a/target/linux/mvebu/patches-3.18/099-build_linksys_a385_dts.patch
+++ b/target/linux/mvebu/patches-3.18/099-build_linksys_a385_dts.patch
@@ -1,11 +1,11 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -501,6 +501,8 @@ dtb-$(CONFIG_MACH_ARMADA_375) += \
+@@ -500,6 +500,8 @@ dtb-$(CONFIG_MACH_ARMADA_375) += \
+ 	armada-375-db.dtb
  dtb-$(CONFIG_MACH_ARMADA_38X) += \
- 	armada-385-db.dtb \
  	armada-385-db-ap.dtb \
 +	armada-385-linksys-caiman.dtb \
 +	armada-385-linksys-cobra.dtb \
- 	armada-385-rd.dtb
- dtb-$(CONFIG_MACH_ARMADA_XP) += \
- 	armada-xp-axpwifiap.dtb \
+ 	armada-388-db.dtb \
+ 	armada-388-gp.dtb \
+ 	armada-388-rd.dtb
diff --git a/target/linux/mvebu/patches-3.18/207-armada-385-rd-mtd-partitions.patch b/target/linux/mvebu/patches-3.18/207-armada-385-rd-mtd-partitions.patch
index 80cec30..f0386a6 100644
--- a/target/linux/mvebu/patches-3.18/207-armada-385-rd-mtd-partitions.patch
+++ b/target/linux/mvebu/patches-3.18/207-armada-385-rd-mtd-partitions.patch
@@ -1,6 +1,6 @@
---- a/arch/arm/boot/dts/armada-385-rd.dts
-+++ b/arch/arm/boot/dts/armada-385-rd.dts
-@@ -42,6 +42,16 @@
+--- a/arch/arm/boot/dts/armada-388-rd.dts
++++ b/arch/arm/boot/dts/armada-388-rd.dts
+@@ -43,6 +43,16 @@
  					compatible = "st,m25p128";
  					reg = <0>; /* Chip select 0 */
  					spi-max-frequency = <108000000>;
diff --git a/target/linux/mvebu/patches-3.18/209-armada-385-gp-mtd-partitions.patch b/target/linux/mvebu/patches-3.18/209-armada-385-gp-mtd-partitions.patch
new file mode 100644
index 0000000..c662274
--- /dev/null
+++ b/target/linux/mvebu/patches-3.18/209-armada-385-gp-mtd-partitions.patch
@@ -0,0 +1,19 @@
+--- a/arch/arm/boot/dts/armada-388-gp.dts
++++ b/arch/arm/boot/dts/armada-388-gp.dts
+@@ -74,6 +74,16 @@
+ 					reg = <0>; /* Chip select 0 */
+ 					spi-max-frequency = <50000000>;
+ 					m25p,fast-read;
++
++					partition at 0 {
++						label = "uboot";
++						reg = <0 0x400000>;
++					};
++
++					partition at 1 {
++						label = "firmware";
++						reg = <0x400000 0xc00000>;
++					};
+ 				};
+ 			};
+ 
diff --git a/target/linux/mvebu/patches-3.18/300-add_missing_labels.patch b/target/linux/mvebu/patches-3.18/300-add_missing_labels.patch
index b674b56..2ee65e6 100644
--- a/target/linux/mvebu/patches-3.18/300-add_missing_labels.patch
+++ b/target/linux/mvebu/patches-3.18/300-add_missing_labels.patch
@@ -18,7 +18,7 @@
  				compatible = "marvell,mv88f6820-pinctrl";
  				reg = <0x18000 0x20>;
  
-@@ -412,7 +412,7 @@
+@@ -459,7 +459,7 @@
  				status = "disabled";
  			};
  
diff --git a/target/linux/mvebu/patches-3.18/600-armada_38x_rtc.patch b/target/linux/mvebu/patches-3.18/600-armada_38x_rtc.patch
index 399421d..42f2568 100644
--- a/target/linux/mvebu/patches-3.18/600-armada_38x_rtc.patch
+++ b/target/linux/mvebu/patches-3.18/600-armada_38x_rtc.patch
@@ -387,7 +387,7 @@
  M:	Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
 --- a/arch/arm/boot/dts/armada-38x.dtsi
 +++ b/arch/arm/boot/dts/armada-38x.dtsi
-@@ -420,6 +420,13 @@
+@@ -467,6 +467,13 @@
  				clocks = <&gateclk 4>;
  			};
  
diff --git a/target/linux/mvebu/patches-4.0/209-armada-385-gp-mtd-partitions.patch b/target/linux/mvebu/patches-4.0/209-armada-385-gp-mtd-partitions.patch
new file mode 100644
index 0000000..c662274
--- /dev/null
+++ b/target/linux/mvebu/patches-4.0/209-armada-385-gp-mtd-partitions.patch
@@ -0,0 +1,19 @@
+--- a/arch/arm/boot/dts/armada-388-gp.dts
++++ b/arch/arm/boot/dts/armada-388-gp.dts
+@@ -74,6 +74,16 @@
+ 					reg = <0>; /* Chip select 0 */
+ 					spi-max-frequency = <50000000>;
+ 					m25p,fast-read;
++
++					partition at 0 {
++						label = "uboot";
++						reg = <0 0x400000>;
++					};
++
++					partition at 1 {
++						label = "firmware";
++						reg = <0x400000 0xc00000>;
++					};
+ 				};
+ 			};
+ 
diff --git a/target/linux/mvebu/profiles/marvell.mk b/target/linux/mvebu/profiles/marvell.mk
index e8ca9bd..68885df 100644
--- a/target/linux/mvebu/profiles/marvell.mk
+++ b/target/linux/mvebu/profiles/marvell.mk
@@ -35,19 +35,35 @@ endef
 
 $(eval $(call Profile,370-RD))
 
-define Profile/385-RD
-  NAME:=Marvell Armada 385 RD (RD-88F6820-AP)
+define Profile/388-GP
+  NAME:=Marvell Armada 388 GP (DB-88F6820-GP)
+  PACKAGES:= \
+	kmod-mmc kmod-sdhci kmod-sdhci-pxav3 \
+	kmod-ata-core kmod-ata-marvell-sata \
+	kmod-usb2 kmod-usb3 kmod-usb-storage \
+	kmod-i2c-core kmod-i2c-mv64xxx kmod-gpio-pca953x \
+	kmod-rtc-armada38x kmod-thermal-armada
+endef
+
+define Profile/388-GP/Description
+ Package set compatible with the Armada 385 general purpose development board (DB-88F6820-GP).
+endef
+
+$(eval $(call Profile,388-GP))
+
+define Profile/388-RD
+  NAME:=Marvell Armada 388 RD (RD-88F6820-AP)
   PACKAGES:= \
 	kmod-mmc kmod-mvsdio kmod-usb3 kmod-usb-storage \
 	kmod-i2c-core kmod-i2c-mv64xxx \
 	kmod-thermal-armada
 endef
 
-define Profile/385-RD/Description
+define Profile/388-RD/Description
  Package set compatible with the Armada 385 reference design board (RD-88F6820-AP).
 endef
 
-$(eval $(call Profile,385-RD))
+$(eval $(call Profile,388-RD))
 
 define Profile/385-DB-AP
   NAME:=Marvell Armada 385 DB AP (DB-88F6820-AP)
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Sun Aug 23 11:19:25 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Sun, 23 Aug 2015 17:19:25 +0200
Subject: [OpenWrt-Devel] [PATCHv3] Fixes regarding bridge
	multicast-to-unicast feature
Message-ID: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>

Hi,

Here are a few patches to fix the issues the multicast-to-unicast
feature of the bridge has: IGMP/MLD report suppression could lead
to multicast packet loss. Also see ticket #17625 [0].

As previously discussed on this mailing list, AP-isolation together
with bridge-hairpinning is a way to make the multicast-to-unicast
feature usable even if listeners potentially suppressing reports
are present: That way the bridge will get all reports and will have
full control on where to forward them. For instance *not* to other
STAs (unless there is a multicast router).

Furthermore [PATCH netifd 2/3] introduces a netifd option to disable
the multicast-to-unicast feature.

[PATCH netifd 3/3] is not related to this issue but introduces a
handy option (which I would like to make use of for IGMP/MLD domain
segmentation).


The OpenWRT specific patches should be applied after the netifd
patches arrived in OpenWRT.

Cheers, Linus

[0]: https://dev.openwrt.org/ticket/17625

~~~

Changelog v3:
* Removed [PATCH openwrt 1/3]:
  Now included in [PATCH netifd 1/3] through netifd-wireless.sh

Changelog v2:
* Separated introduction of multicast_to_unicast configuration option
  in separate patch
* passing multicast_to_unicast to netifd scripts via json from netifd
  instead of external uci command calls
* Moved multicast_to_unicast uci option to be a bridge instead of
  bridge member option
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Sun Aug 23 11:19:26 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Sun, 23 Aug 2015 17:19:26 +0200
Subject: [OpenWrt-Devel] [PATCHv3 netifd 1/3] bridge: Fix
 multicast_to_unicast feature by hairpin+isolate
In-Reply-To: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
References: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1440343170-13040-2-git-send-email-linus.luessing@c0d3.blue>

All IGMP and MLD versions suffer from a specific limitation (from a
snooping switch perspective): Report suppression.

Once a listener hears an IGMPv2/3 or MLDv1 report for the same group
itself participates in then it might (if this listener is an IGMPv3 or
MLDv2 listener) or will (if this is an IGMPv1/2 or MLDv1 listener)
refrain from sending its own report.

Therefore we might currently miss such surpressing listeners as they
won't receive the multicast packet with the mangled, unicasted
destination.

Fixing this by first isolating the STAs and giving the bridge more
control over traffic forwarding. E.g. refraining to forward listener
reports to other STAs.

For broadcast and unicast traffic to an STA on the same AP, the hairpin
feature of the bridge will reflect such traffic back to the AP
interface. However, if the AP interface is actually configured to
isolate STAs, then hairpin is kept disabled.

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 device.h                   |    1 +
 scripts/netifd-wireless.sh |   15 +++++++++++++++
 system-linux.c             |   26 ++++++++++++++++++++------
 wireless.c                 |   12 +++++++++++-
 wireless.h                 |    1 +
 5 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/device.h b/device.h
index ce135ba..373445c 100644
--- a/device.h
+++ b/device.h
@@ -173,6 +173,7 @@ struct device {
 	bool iface_config;
 	bool default_config;
 	bool wireless;
+	bool wireless_isolate;
 
 	struct interface *config_iface;
 
diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh
index c5d8a96..f981f1b 100644
--- a/scripts/netifd-wireless.sh
+++ b/scripts/netifd-wireless.sh
@@ -248,12 +248,26 @@ wireless_vif_parse_encryption() {
 	esac
 }
 
+_wireless_set_brsnoop_isolation() {
+	local multicast_to_unicast="$1"
+	local isolate
+
+	json_get_var isolate isolate
+
+	[ $isolate -gt 0 -o -z "$network_bridge" ] && return
+
+	[ -z "$multicast_to_unicast" ] && multicast_to_unicast=1
+	[ $multicast_to_unicast -gt 0 ] && json_add_boolean isolate 1
+}
+
 for_each_interface() {
 	local _w_types="$1"; shift
 	local _w_ifaces _w_iface
 	local _w_type
 	local _w_found
 
+	local multicast_to_unicast
+
 	json_get_keys _w_ifaces interfaces
 	json_select interfaces
 	for _w_iface in $_w_ifaces; do
@@ -261,6 +275,7 @@ for_each_interface() {
 		if [ -n "$_w_types" ]; then
 			json_get_var network_bridge bridge
 			json_select config
+			_wireless_set_brsnoop_isolation "$multicast_to_unicast"
 			json_get_var _w_type mode
 			json_select ..
 			_w_types=" $_w_types "
diff --git a/system-linux.c b/system-linux.c
index 9ba13fd..9c4bea6 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -315,6 +315,16 @@ static void system_set_dadtransmits(struct device *dev, const char *val)
 	system_set_dev_sysctl("/proc/sys/net/ipv6/conf/%s/dad_transmits", dev->ifname, val);
 }
 
+static void system_bridge_set_multicast_to_unicast(struct device *dev, const char *val)
+{
+	system_set_dev_sysctl("/sys/class/net/%s/brport/multicast_to_unicast", dev->ifname, val);
+}
+
+static void system_bridge_set_hairpin_mode(struct device *dev, const char *val)
+{
+	system_set_dev_sysctl("/sys/class/net/%s/brport/hairpin_mode", dev->ifname, val);
+}
+
 static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz)
 {
 	int fd = -1, ret = -1;
@@ -556,12 +566,16 @@ static char *system_get_bridge(const char *name, char *buf, int buflen)
 	return path + 1;
 }
 
-static void system_bridge_set_wireless(const char *bridge, const char *dev)
+static void
+system_bridge_set_wireless(struct device *dev)
 {
-	snprintf(dev_buf, sizeof(dev_buf),
-		 "/sys/devices/virtual/net/%s/brif/%s/multicast_to_unicast",
-		 bridge, dev);
-	system_set_sysctl(dev_buf, "1");
+	bool hairpin = true;
+
+	if (dev->wireless_isolate)
+		hairpin = false;
+
+	system_bridge_set_multicast_to_unicast(dev, "1");
+	system_bridge_set_hairpin_mode(dev, hairpin ? "1" : "0");
 }
 
 int system_bridge_addif(struct device *bridge, struct device *dev)
@@ -574,7 +588,7 @@ int system_bridge_addif(struct device *bridge, struct device *dev)
 		ret = system_bridge_if(bridge->ifname, dev, SIOCBRADDIF, NULL);
 
 	if (dev->wireless)
-		system_bridge_set_wireless(bridge->ifname, dev->ifname);
+		system_bridge_set_wireless(dev);
 
 	return ret;
 }
diff --git a/wireless.c b/wireless.c
index fbd6191..337f563 100644
--- a/wireless.c
+++ b/wireless.c
@@ -35,12 +35,14 @@ static const struct uci_blob_param_list wdev_param = {
 enum {
 	VIF_ATTR_DISABLED,
 	VIF_ATTR_NETWORK,
+	VIF_ATTR_ISOLATE,
 	__VIF_ATTR_MAX,
 };
 
 static const struct blobmsg_policy vif_policy[__VIF_ATTR_MAX] = {
 	[VIF_ATTR_DISABLED] = { .name = "disabled", .type = BLOBMSG_TYPE_BOOL },
 	[VIF_ATTR_NETWORK] = { .name = "network", .type = BLOBMSG_TYPE_ARRAY },
+	[VIF_ATTR_ISOLATE] = { .name = "isolate", .type = BLOBMSG_TYPE_BOOL },
 };
 
 static const struct uci_blob_param_list vif_param = {
@@ -204,8 +206,10 @@ static void wireless_interface_handle_link(struct wireless_interface *vif, bool
 
 	if (up) {
 		struct device *dev = device_get(vif->ifname, 2);
-		if (dev)
+		if (dev) {
+			dev->wireless_isolate = vif->isolate;
 			dev->wireless = true;
+		}
 	}
 
 	blobmsg_for_each_attr(cur, vif->network, rem) {
@@ -700,6 +704,12 @@ void wireless_interface_create(struct wireless_device *wdev, struct blob_attr *d
 	vif->wdev = wdev;
 	vif->config = data;
 	vif->section = section;
+	vif->isolate = false;
+
+	cur = tb[VIF_ATTR_ISOLATE];
+	if (cur && blobmsg_get_bool(cur))
+		vif->isolate = blobmsg_get_bool(cur);
+
 	vlist_add(&wdev->interfaces, &vif->node, vif->name);
 }
 
diff --git a/wireless.h b/wireless.h
index c5dbb88..476c63e 100644
--- a/wireless.h
+++ b/wireless.h
@@ -77,6 +77,7 @@ struct wireless_interface {
 
 	const char *ifname;
 	struct blob_attr *network;
+	bool isolate;
 };
 
 struct wireless_process {
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Sun Aug 23 11:19:27 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Sun, 23 Aug 2015 17:19:27 +0200
Subject: [OpenWrt-Devel] [PATCHv3 netifd 2/3] bridge: Allow setting
	multicast_to_unicast option
In-Reply-To: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
References: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1440343170-13040-3-git-send-email-linus.luessing@c0d3.blue>

With this patch the multicast_to_unicast feature can be disabled for all
wireless interfaces via an according option on the uci bridge interface.

This patch also exports the setting information to wireless handler
scripts. The hostapd script will need that information to determine
whether to enable or disable ap-isolation, for instance.

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 device.c                   |    9 +++++++++
 device.h                   |    3 +++
 scripts/netifd-wireless.sh |    1 +
 system-linux.c             |   13 +++++++++----
 wireless.c                 |    4 ++++
 5 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/device.c b/device.c
index b5bee11..b44ccb8 100644
--- a/device.c
+++ b/device.c
@@ -48,6 +48,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = {
 	[DEV_ATTR_RPS] = { .name = "rps", .type = BLOBMSG_TYPE_BOOL },
 	[DEV_ATTR_XPS] = { .name = "xps", .type = BLOBMSG_TYPE_BOOL },
 	[DEV_ATTR_DADTRANSMITS] = { .name = "dadtransmits", .type = BLOBMSG_TYPE_INT32 },
+	[DEV_ATTR_MULTICAST_TO_UNICAST] = { .name = "multicast_to_unicast", .type = BLOBMSG_TYPE_BOOL },
 };
 
 const struct uci_blob_param_list device_attr_list = {
@@ -174,6 +175,7 @@ device_merge_settings(struct device *dev, struct device_settings *n)
 		s->neigh6reachabletime : os->neigh6reachabletime;
 	n->dadtransmits = s->flags & DEV_OPT_DADTRANSMITS ?
 		s->dadtransmits : os->dadtransmits;
+	n->multicast_to_unicast = s->multicast_to_unicast;
 	n->flags = s->flags | os->flags;
 }
 
@@ -274,6 +276,11 @@ device_init_settings(struct device *dev, struct blob_attr **tb)
 		s->flags |= DEV_OPT_DADTRANSMITS;
 	}
 
+	if ((cur = tb[DEV_ATTR_MULTICAST_TO_UNICAST])) {
+		s->multicast_to_unicast = blobmsg_get_bool(cur);
+		s->flags |= DEV_OPT_MULTICAST_TO_UNICAST;
+	}
+
 	device_set_disabled(dev, disabled);
 }
 
@@ -884,6 +891,8 @@ device_dump_status(struct blob_buf *b, struct device *dev)
 		}
 		if (st.flags & DEV_OPT_DADTRANSMITS)
 			blobmsg_add_u32(b, "dadtransmits", st.dadtransmits);
+		if (st.flags & DEV_OPT_MULTICAST_TO_UNICAST)
+			blobmsg_add_u8(b, "multicast_to_unicast", st.multicast_to_unicast);
 	}
 
 	s = blobmsg_open_table(b, "statistics");
diff --git a/device.h b/device.h
index 373445c..4344d8a 100644
--- a/device.h
+++ b/device.h
@@ -42,6 +42,7 @@ enum {
 	DEV_ATTR_RPS,
 	DEV_ATTR_XPS,
 	DEV_ATTR_DADTRANSMITS,
+	DEV_ATTR_MULTICAST_TO_UNICAST,
 	__DEV_ATTR_MAX,
 };
 
@@ -84,6 +85,7 @@ enum {
 	DEV_OPT_XPS			= (1 << 11),
 	DEV_OPT_MTU6			= (1 << 12),
 	DEV_OPT_DADTRANSMITS		= (1 << 13),
+	DEV_OPT_MULTICAST_TO_UNICAST	= (1 << 14),
 };
 
 /* events broadcasted to all users of a device */
@@ -141,6 +143,7 @@ struct device_settings {
 	bool rps;
 	bool xps;
 	unsigned int dadtransmits;
+	bool multicast_to_unicast;
 };
 
 /*
diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh
index f981f1b..83a8223 100644
--- a/scripts/netifd-wireless.sh
+++ b/scripts/netifd-wireless.sh
@@ -274,6 +274,7 @@ for_each_interface() {
 		json_select "$_w_iface"
 		if [ -n "$_w_types" ]; then
 			json_get_var network_bridge bridge
+			json_get_var multicast_to_unicast multicast_to_unicast
 			json_select config
 			_wireless_set_brsnoop_isolation "$multicast_to_unicast"
 			json_get_var _w_type mode
diff --git a/system-linux.c b/system-linux.c
index 9c4bea6..944245c 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -567,14 +567,19 @@ static char *system_get_bridge(const char *name, char *buf, int buflen)
 }
 
 static void
-system_bridge_set_wireless(struct device *dev)
+system_bridge_set_wireless(struct device *bridge, struct device *dev)
 {
+	bool mcast_to_ucast = true;
 	bool hairpin = true;
 
-	if (dev->wireless_isolate)
+	if (bridge->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST &&
+	    !bridge->settings.multicast_to_unicast)
+		mcast_to_ucast = false;
+
+	if (!mcast_to_ucast || dev->wireless_isolate)
 		hairpin = false;
 
-	system_bridge_set_multicast_to_unicast(dev, "1");
+	system_bridge_set_multicast_to_unicast(dev, mcast_to_ucast ? "1" : "0");
 	system_bridge_set_hairpin_mode(dev, hairpin ? "1" : "0");
 }
 
@@ -588,7 +593,7 @@ int system_bridge_addif(struct device *bridge, struct device *dev)
 		ret = system_bridge_if(bridge->ifname, dev, SIOCBRADDIF, NULL);
 
 	if (dev->wireless)
-		system_bridge_set_wireless(dev);
+		system_bridge_set_wireless(bridge, dev);
 
 	return ret;
 }
diff --git a/wireless.c b/wireless.c
index 337f563..d0d2942 100644
--- a/wireless.c
+++ b/wireless.c
@@ -92,6 +92,10 @@ vif_config_add_bridge(struct blob_buf *buf, struct blob_attr *networks, bool pre
 		dev->hotplug_ops->prepare(dev);
 
 	blobmsg_add_string(buf, "bridge", dev->ifname);
+
+	if (dev->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST)
+		blobmsg_add_u8(buf, "multicast_to_unicast",
+			       dev->settings.multicast_to_unicast);
 }
 
 static void
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Sun Aug 23 11:19:28 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Sun, 23 Aug 2015 17:19:28 +0200
Subject: [OpenWrt-Devel] [PATCHv3 netifd 3/3] bridge: Allow setting
	multicast_router option
In-Reply-To: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
References: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1440343170-13040-4-git-send-email-linus.luessing@c0d3.blue>

The multicast_router option of a bridge allows to control the forwarding
behaviour of multicast packets independant of the listener state:

* 0: Only forward if specific listener is present
* 1 (default): Forward if specific listener or a multicast router
  was detected (currently only learned via query messages, no MRD
  support yet)
* 2: Always forward any multicast traffic on this port

Since MRD is not mandated you might end up with silent multicast routers
(e.g. if your link has more than one multicast router; only one can
become the selected, "noisy" querier). Here you might need a manual
configuration option like the "multicast_router" option.

Other scenarios where this can be useful are for instance:
* Segmentation of IGMP/MLD domains together with ebtables
* Dedicated bridge port for monitoring/debugging purposes

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 device.c       |   12 ++++++++++++
 device.h       |    3 +++
 system-linux.c |   18 ++++++++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/device.c b/device.c
index b44ccb8..d6e288c 100644
--- a/device.c
+++ b/device.c
@@ -49,6 +49,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = {
 	[DEV_ATTR_XPS] = { .name = "xps", .type = BLOBMSG_TYPE_BOOL },
 	[DEV_ATTR_DADTRANSMITS] = { .name = "dadtransmits", .type = BLOBMSG_TYPE_INT32 },
 	[DEV_ATTR_MULTICAST_TO_UNICAST] = { .name = "multicast_to_unicast", .type = BLOBMSG_TYPE_BOOL },
+	[DEV_ATTR_MULTICAST_ROUTER] = { .name = "multicast_router", .type = BLOBMSG_TYPE_INT32 },
 };
 
 const struct uci_blob_param_list device_attr_list = {
@@ -176,6 +177,7 @@ device_merge_settings(struct device *dev, struct device_settings *n)
 	n->dadtransmits = s->flags & DEV_OPT_DADTRANSMITS ?
 		s->dadtransmits : os->dadtransmits;
 	n->multicast_to_unicast = s->multicast_to_unicast;
+	n->multicast_router = s->multicast_router;
 	n->flags = s->flags | os->flags;
 }
 
@@ -281,6 +283,14 @@ device_init_settings(struct device *dev, struct blob_attr **tb)
 		s->flags |= DEV_OPT_MULTICAST_TO_UNICAST;
 	}
 
+	if ((cur = tb[DEV_ATTR_MULTICAST_ROUTER])) {
+		s->multicast_router = blobmsg_get_u32(cur);
+		if (s->multicast_router >= 0 && s->multicast_router <= 2)
+			s->flags |= DEV_OPT_MULTICAST_ROUTER;
+		else
+			DPRINTF("Invalid value: %d - (Use 0: never, 1: learn, 2: always)\n", blobmsg_get_u32(cur));
+	}
+
 	device_set_disabled(dev, disabled);
 }
 
@@ -893,6 +903,8 @@ device_dump_status(struct blob_buf *b, struct device *dev)
 			blobmsg_add_u32(b, "dadtransmits", st.dadtransmits);
 		if (st.flags & DEV_OPT_MULTICAST_TO_UNICAST)
 			blobmsg_add_u8(b, "multicast_to_unicast", st.multicast_to_unicast);
+		if (st.flags & DEV_OPT_MULTICAST_ROUTER)
+			blobmsg_add_u32(b, "multicast_router", st.multicast_router);
 	}
 
 	s = blobmsg_open_table(b, "statistics");
diff --git a/device.h b/device.h
index 4344d8a..86a1628 100644
--- a/device.h
+++ b/device.h
@@ -43,6 +43,7 @@ enum {
 	DEV_ATTR_XPS,
 	DEV_ATTR_DADTRANSMITS,
 	DEV_ATTR_MULTICAST_TO_UNICAST,
+	DEV_ATTR_MULTICAST_ROUTER,
 	__DEV_ATTR_MAX,
 };
 
@@ -86,6 +87,7 @@ enum {
 	DEV_OPT_MTU6			= (1 << 12),
 	DEV_OPT_DADTRANSMITS		= (1 << 13),
 	DEV_OPT_MULTICAST_TO_UNICAST	= (1 << 14),
+	DEV_OPT_MULTICAST_ROUTER	= (1 << 15),
 };
 
 /* events broadcasted to all users of a device */
@@ -144,6 +146,7 @@ struct device_settings {
 	bool xps;
 	unsigned int dadtransmits;
 	bool multicast_to_unicast;
+	unsigned int multicast_router;
 };
 
 /*
diff --git a/system-linux.c b/system-linux.c
index 944245c..01500a5 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -325,6 +325,13 @@ static void system_bridge_set_hairpin_mode(struct device *dev, const char *val)
 	system_set_dev_sysctl("/sys/class/net/%s/brport/hairpin_mode", dev->ifname, val);
 }
 
+static void system_bridge_set_multicast_router(struct device *dev, const char *val, bool bridge)
+{
+	system_set_dev_sysctl(bridge ? "/sys/class/net/%s/bridge/multicast_router" :
+				       "/sys/class/net/%s/brport/multicast_router",
+			      dev->ifname, val);
+}
+
 static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz)
 {
 	int fd = -1, ret = -1;
@@ -585,6 +592,7 @@ system_bridge_set_wireless(struct device *bridge, struct device *dev)
 
 int system_bridge_addif(struct device *bridge, struct device *dev)
 {
+	char buf[64];
 	char *oldbr;
 	int ret = 0;
 
@@ -595,6 +603,11 @@ int system_bridge_addif(struct device *bridge, struct device *dev)
 	if (dev->wireless)
 		system_bridge_set_wireless(bridge, dev);
 
+	if (dev->settings.flags & DEV_OPT_MULTICAST_ROUTER) {
+		snprintf(buf, sizeof(buf), "%i", dev->settings.multicast_router);
+		system_bridge_set_multicast_router(dev, buf, false);
+	}
+
 	return ret;
 }
 
@@ -845,6 +858,11 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg)
 	system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/hash_max",
 		bridge->ifname, buf);
 
+	if (bridge->settings.flags & DEV_OPT_MULTICAST_ROUTER) {
+		snprintf(buf, sizeof(buf), "%i", bridge->settings.multicast_router);
+		system_bridge_set_multicast_router(bridge, buf, true);
+	}
+
 	args[0] = BRCTL_SET_BRIDGE_PRIORITY;
 	args[1] = cfg->priority;
 	system_bridge_if(bridge->ifname, NULL, SIOCDEVPRIVATE, &args);
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Sun Aug 23 11:19:29 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Sun, 23 Aug 2015 17:19:29 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 1/2] Revert "kernel: disable
 multicast-to-unicast translation for ipv6 neighbor solicitation (#17625)"
In-Reply-To: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
References: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>

This reverts commit a080e8e1943156168913d0353a2e99d1151102aa.

It did not fix the problem but just hid some symptom. The real issue was
that IGMP/MLD report suppression was not considered for the
multicast-to-unicast feature. A recent netifd which isolates IGMP/MLD
reports between STAs by utilizing AP-isolation and bridge-hairpinning
should have fixed this.

It is perfectly fine to apply multicast-to-unicast to IPv6 Neighbor
Solicitations, too (once that feature is configured correctly).

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 .../645-bridge_multicast_to_unicast.patch          |   37 +++++++++-----------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
index 00ad14f..e8be1fd 100644
--- a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
+++ b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
@@ -87,19 +87,16 @@
  {
  	struct br_ip br_group;
  
-@@ -736,7 +758,10 @@ static int br_ip6_multicast_add_group(st
+@@ -736,7 +758,7 @@ static int br_ip6_multicast_add_group(st
  	br_group.proto = htons(ETH_P_IPV6);
  	br_group.vid = vid;
  
 -	return br_multicast_add_group(br, port, &br_group);
-+	if (ipv6_addr_is_solict_mult(group))
-+		src = NULL;
-+
 +	return br_multicast_add_group(br, port, &br_group, src);
  }
  #endif
  
-@@ -965,6 +990,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -965,6 +987,7 @@ static int br_ip4_multicast_igmp3_report
  					 struct sk_buff *skb,
  					 u16 vid)
  {
@@ -107,7 +104,7 @@
  	struct igmpv3_report *ih;
  	struct igmpv3_grec *grec;
  	int i;
-@@ -1008,7 +1034,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -1008,7 +1031,7 @@ static int br_ip4_multicast_igmp3_report
  			continue;
  		}
  
@@ -116,7 +113,7 @@
  		if (err)
  			break;
  	}
-@@ -1022,6 +1048,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1022,6 +1045,7 @@ static int br_ip6_multicast_mld2_report(
  					struct sk_buff *skb,
  					u16 vid)
  {
@@ -124,7 +121,7 @@
  	struct icmp6hdr *icmp6h;
  	struct mld2_grec *grec;
  	int i;
-@@ -1070,7 +1097,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1070,7 +1094,7 @@ static int br_ip6_multicast_mld2_report(
  		}
  
  		err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
@@ -133,7 +130,7 @@
  		if (err)
  			break;
  	}
-@@ -1406,7 +1433,8 @@ br_multicast_leave_group(struct net_brid
+@@ -1407,7 +1431,8 @@ br_multicast_leave_group(struct net_brid
  			 struct net_bridge_port *port,
  			 struct br_ip *group,
  			 struct bridge_mcast_other_query *other_query,
@@ -143,7 +140,7 @@
  {
  	struct net_bridge_mdb_htable *mdb;
  	struct net_bridge_mdb_entry *mp;
-@@ -1456,7 +1484,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1457,7 +1482,7 @@ br_multicast_leave_group(struct net_brid
  		for (pp = &mp->ports;
  		     (p = mlock_dereference(*pp, br)) != NULL;
  		     pp = &p->next) {
@@ -152,7 +149,7 @@
  				continue;
  
  			rcu_assign_pointer(*pp, p->next);
-@@ -1490,7 +1518,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1491,7 +1516,7 @@ br_multicast_leave_group(struct net_brid
  	for (p = mlock_dereference(mp->ports, br);
  	     p != NULL;
  	     p = mlock_dereference(p->next, br)) {
@@ -161,7 +158,7 @@
  			continue;
  
  		if (!hlist_unhashed(&p->mglist) &&
-@@ -1508,8 +1536,8 @@ out:
+@@ -1509,8 +1534,8 @@ out:
  
  static void br_ip4_multicast_leave_group(struct net_bridge *br,
  					 struct net_bridge_port *port,
@@ -172,7 +169,7 @@
  {
  	struct br_ip br_group;
  	struct bridge_mcast_own_query *own_query;
-@@ -1524,14 +1552,14 @@ static void br_ip4_multicast_leave_group
+@@ -1525,14 +1550,14 @@ static void br_ip4_multicast_leave_group
  	br_group.vid = vid;
  
  	br_multicast_leave_group(br, port, &br_group, &br->ip4_other_query,
@@ -189,7 +186,7 @@
  {
  	struct br_ip br_group;
  	struct bridge_mcast_own_query *own_query;
-@@ -1546,7 +1574,7 @@ static void br_ip6_multicast_leave_group
+@@ -1547,7 +1572,7 @@ static void br_ip6_multicast_leave_group
  	br_group.vid = vid;
  
  	br_multicast_leave_group(br, port, &br_group, &br->ip6_other_query,
@@ -198,7 +195,7 @@
  }
  #endif
  
-@@ -1555,6 +1583,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1556,6 +1581,7 @@ static int br_multicast_ipv4_rcv(struct
  				 struct sk_buff *skb,
  				 u16 vid)
  {
@@ -206,7 +203,7 @@
  	struct sk_buff *skb2 = skb;
  	const struct iphdr *iph;
  	struct igmphdr *ih;
-@@ -1628,7 +1657,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1629,7 +1655,7 @@ static int br_multicast_ipv4_rcv(struct
  	case IGMP_HOST_MEMBERSHIP_REPORT:
  	case IGMPV2_HOST_MEMBERSHIP_REPORT:
  		BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
@@ -215,7 +212,7 @@
  		break;
  	case IGMPV3_HOST_MEMBERSHIP_REPORT:
  		err = br_ip4_multicast_igmp3_report(br, port, skb2, vid);
-@@ -1637,7 +1666,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1638,7 +1664,7 @@ static int br_multicast_ipv4_rcv(struct
  		err = br_ip4_multicast_query(br, port, skb2, vid);
  		break;
  	case IGMP_HOST_LEAVE_MESSAGE:
@@ -224,7 +221,7 @@
  		break;
  	}
  
-@@ -1655,6 +1684,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1656,6 +1682,7 @@ static int br_multicast_ipv6_rcv(struct
  				 struct sk_buff *skb,
  				 u16 vid)
  {
@@ -232,7 +229,7 @@
  	struct sk_buff *skb2;
  	const struct ipv6hdr *ip6h;
  	u8 icmp6_type;
-@@ -1764,7 +1794,8 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1765,7 +1792,8 @@ static int br_multicast_ipv6_rcv(struct
  		}
  		mld = (struct mld_msg *)skb_transport_header(skb2);
  		BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
@@ -242,7 +239,7 @@
  		break;
  	    }
  	case ICMPV6_MLD2_REPORT:
-@@ -1781,7 +1812,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1782,7 +1810,7 @@ static int br_multicast_ipv6_rcv(struct
  			goto out;
  		}
  		mld = (struct mld_msg *)skb_transport_header(skb2);
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Sun Aug 23 11:19:30 2015
From: linus.luessing at c0d3.blue (=?UTF-8?q?Linus=20L=C3=BCssing?=)
Date: Sun, 23 Aug 2015 17:19:30 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 2/2] kernel: bridge,
 multicast-to-unicast: assign src after pskb_may_pull()
In-Reply-To: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
References: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <1440343170-13040-6-git-send-email-linus.luessing@c0d3.blue>

A call to pskb_may_pull() might reallocate skb->data. Therefore we
should only assign the src-pointer after any potential reallocations.

Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
---
 .../645-bridge_multicast_to_unicast.patch          |   45 +++++++++++---------
 1 file changed, 26 insertions(+), 19 deletions(-)

diff --git a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
index e8be1fd..83f2475 100644
--- a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
+++ b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
@@ -100,37 +100,40 @@
  					 struct sk_buff *skb,
  					 u16 vid)
  {
-+	const unsigned char *src = eth_hdr(skb)->h_source;
++	unsigned char *src;
  	struct igmpv3_report *ih;
  	struct igmpv3_grec *grec;
  	int i;
-@@ -1008,7 +1031,7 @@ static int br_ip4_multicast_igmp3_report
+@@ -1008,7 +1031,8 @@ static int br_ip4_multicast_igmp3_report
  			continue;
  		}
  
 -		err = br_ip4_multicast_add_group(br, port, group, vid);
++		src = eth_hdr(skb)->h_source;
 +		err = br_ip4_multicast_add_group(br, port, group, vid, src);
  		if (err)
  			break;
  	}
-@@ -1022,6 +1045,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1022,6 +1046,7 @@ static int br_ip6_multicast_mld2_report(
  					struct sk_buff *skb,
  					u16 vid)
  {
-+	const unsigned char *src = eth_hdr(skb)->h_source;
++	unsigned char *src;
  	struct icmp6hdr *icmp6h;
  	struct mld2_grec *grec;
  	int i;
-@@ -1070,7 +1094,7 @@ static int br_ip6_multicast_mld2_report(
+@@ -1069,8 +1094,9 @@ static int br_ip6_multicast_mld2_report(
+ 			continue;
  		}
  
++		src = eth_hdr(skb)->h_source;
  		err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
 -						 vid);
 +						 vid, src);
  		if (err)
  			break;
  	}
-@@ -1407,7 +1431,8 @@ br_multicast_leave_group(struct net_brid
+@@ -1407,7 +1433,8 @@ br_multicast_leave_group(struct net_brid
  			 struct net_bridge_port *port,
  			 struct br_ip *group,
  			 struct bridge_mcast_other_query *other_query,
@@ -140,7 +143,7 @@
  {
  	struct net_bridge_mdb_htable *mdb;
  	struct net_bridge_mdb_entry *mp;
-@@ -1457,7 +1482,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1457,7 +1484,7 @@ br_multicast_leave_group(struct net_brid
  		for (pp = &mp->ports;
  		     (p = mlock_dereference(*pp, br)) != NULL;
  		     pp = &p->next) {
@@ -149,7 +152,7 @@
  				continue;
  
  			rcu_assign_pointer(*pp, p->next);
-@@ -1491,7 +1516,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1491,7 +1518,7 @@ br_multicast_leave_group(struct net_brid
  	for (p = mlock_dereference(mp->ports, br);
  	     p != NULL;
  	     p = mlock_dereference(p->next, br)) {
@@ -158,7 +161,7 @@
  			continue;
  
  		if (!hlist_unhashed(&p->mglist) &&
-@@ -1509,8 +1534,8 @@ out:
+@@ -1509,8 +1536,8 @@ out:
  
  static void br_ip4_multicast_leave_group(struct net_bridge *br,
  					 struct net_bridge_port *port,
@@ -169,7 +172,7 @@
  {
  	struct br_ip br_group;
  	struct bridge_mcast_own_query *own_query;
-@@ -1525,14 +1550,14 @@ static void br_ip4_multicast_leave_group
+@@ -1525,14 +1552,14 @@ static void br_ip4_multicast_leave_group
  	br_group.vid = vid;
  
  	br_multicast_leave_group(br, port, &br_group, &br->ip4_other_query,
@@ -186,7 +189,7 @@
  {
  	struct br_ip br_group;
  	struct bridge_mcast_own_query *own_query;
-@@ -1547,7 +1572,7 @@ static void br_ip6_multicast_leave_group
+@@ -1547,7 +1574,7 @@ static void br_ip6_multicast_leave_group
  	br_group.vid = vid;
  
  	br_multicast_leave_group(br, port, &br_group, &br->ip6_other_query,
@@ -195,55 +198,59 @@
  }
  #endif
  
-@@ -1556,6 +1581,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1556,6 +1583,7 @@ static int br_multicast_ipv4_rcv(struct
  				 struct sk_buff *skb,
  				 u16 vid)
  {
-+	const unsigned char *src = eth_hdr(skb)->h_source;
++	unsigned char *src;
  	struct sk_buff *skb2 = skb;
  	const struct iphdr *iph;
  	struct igmphdr *ih;
-@@ -1629,7 +1655,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1629,7 +1657,8 @@ static int br_multicast_ipv4_rcv(struct
  	case IGMP_HOST_MEMBERSHIP_REPORT:
  	case IGMPV2_HOST_MEMBERSHIP_REPORT:
  		BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
 -		err = br_ip4_multicast_add_group(br, port, ih->group, vid);
++		src = eth_hdr(skb)->h_source;
 +		err = br_ip4_multicast_add_group(br, port, ih->group, vid, src);
  		break;
  	case IGMPV3_HOST_MEMBERSHIP_REPORT:
  		err = br_ip4_multicast_igmp3_report(br, port, skb2, vid);
-@@ -1638,7 +1664,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1638,7 +1667,8 @@ static int br_multicast_ipv4_rcv(struct
  		err = br_ip4_multicast_query(br, port, skb2, vid);
  		break;
  	case IGMP_HOST_LEAVE_MESSAGE:
 -		br_ip4_multicast_leave_group(br, port, ih->group, vid);
++		src = eth_hdr(skb)->h_source;
 +		br_ip4_multicast_leave_group(br, port, ih->group, vid, src);
  		break;
  	}
  
-@@ -1656,6 +1682,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1656,6 +1686,7 @@ static int br_multicast_ipv6_rcv(struct
  				 struct sk_buff *skb,
  				 u16 vid)
  {
-+	const unsigned char *src = eth_hdr(skb)->h_source;
++	unsigned char *src;
  	struct sk_buff *skb2;
  	const struct ipv6hdr *ip6h;
  	u8 icmp6_type;
-@@ -1765,7 +1792,8 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1765,7 +1796,9 @@ static int br_multicast_ipv6_rcv(struct
  		}
  		mld = (struct mld_msg *)skb_transport_header(skb2);
  		BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
 -		err = br_ip6_multicast_add_group(br, port, &mld->mld_mca, vid);
++		src = eth_hdr(skb)->h_source;
 +		err = br_ip6_multicast_add_group(br, port, &mld->mld_mca, vid,
 +						 src);
  		break;
  	    }
  	case ICMPV6_MLD2_REPORT:
-@@ -1782,7 +1810,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1782,7 +1815,8 @@ static int br_multicast_ipv6_rcv(struct
  			goto out;
  		}
  		mld = (struct mld_msg *)skb_transport_header(skb2);
 -		br_ip6_multicast_leave_group(br, port, &mld->mld_mca, vid);
++		src = eth_hdr(skb)->h_source;
 +		br_ip6_multicast_leave_group(br, port, &mld->mld_mca, vid, src);
  	    }
  	}
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From tesarmar at gmail.com  Sun Aug 23 11:21:15 2015
From: tesarmar at gmail.com (Martin Tesar)
Date: Sun, 23 Aug 2015 17:21:15 +0200
Subject: [OpenWrt-Devel] [PATCH] brcm63xx: add Comtrend VR-3026e support
Message-ID: <1440343275-31989-1-git-send-email-tesarmar@gmail.com>

Signed-off-by: Martin Tesar <tesarmar at gmail.com>
---
 target/linux/brcm63xx/base-files/etc/diag.sh       |  3 +
 .../base-files/etc/uci-defaults/02_network         |  3 +-
 .../base-files/etc/uci-defaults/09_fix_crc         |  1 +
 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
 .../lib/preinit/05_init_interfaces_brcm63xx        |  1 +
 target/linux/brcm63xx/dts/vr-3026e.dts             | 84 ++++++++++++++++++++++
 target/linux/brcm63xx/image/Makefile               |  2 +
 .../brcm63xx/patches-4.1/805-board_VR-3026e.patch  | 81 +++++++++++++++++++++
 target/linux/brcm63xx/profiles/comtrend.mk         |  9 +++
 9 files changed, 186 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/brcm63xx/dts/vr-3026e.dts
 create mode 100644 target/linux/brcm63xx/patches-4.1/805-board_VR-3026e.patch

diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
index 7916ac2..792df01 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -39,6 +39,9 @@ set_state() {
 	vr-3025u)
 		status_led="VR-3025u:green:power"
 		;;
+        vr-3026e)
+                status_led="VR-3026e:green:power"
+                ;;
 	wap-5813n)
 		status_led="WAP-5813n:green:power"
 		;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 2ff9e45..70df711 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -95,7 +95,8 @@ fast2704v2 |\
 hg655b |\
 p870hw-51a_v2 |\
 vr-3025un |\
-vr-3025u)
+vr-3025u |\
+vr-3026e)
 	ucidef_set_interface_lan "eth0.1"
 	ucidef_add_switch "eth0" "1" "1"
 	ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t"
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index 4a167dc..901050d 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -30,6 +30,7 @@ case "$(brcm63xx_board_name)" in
 	v2500v_bb |\
 	vr-3025u |\
 	vr-3025un |\
+        vr-3026e |\
 	wap-5813n)
 		do_fixcrc
 		;;
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 92fa5f2..5c0a968 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -102,6 +102,9 @@ brcm63xx_dt_detect() {
 	"Comtrend VR-3025un")
 		board_name="vr-3025un"
 		;;
+        "Comtrend VR-3026e")
+                board_name="vr-3026e"
+                ;;
 	"Comtrend WAP-5813n")
 		board_name="wap-5813n"
 		;;
diff --git a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
index d6ec537..fef671b 100644
--- a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
+++ b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
@@ -32,6 +32,7 @@ set_preinit_iface() {
 	v2110 |\
 	vr-3025un |\
 	vr-3025u |\
+        vr-3026e |\
 	wap-5813n)
 		ifname=eth0
 		;;
diff --git a/target/linux/brcm63xx/dts/vr-3026e.dts b/target/linux/brcm63xx/dts/vr-3026e.dts
new file mode 100644
index 0000000..7a00ed4
--- /dev/null
+++ b/target/linux/brcm63xx/dts/vr-3026e.dts
@@ -0,0 +1,84 @@
+/dts-v1/;
+
+#include "bcm6368.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Comtrend VR-3026e";
+	compatible = "comtrend,vr-3026e", "brcm,bcm6368";
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		debounce-interval = <60>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 2 1>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		dsl_green {
+			label = "VR-3026e:green:dsl";
+			gpios = <&gpio0 2 1>;
+		};
+		inet_green {
+			label = "VR-3026e:green:inet";
+			gpios = <&gpio0 5 0>;
+		};
+		lan1_green {
+			label = "VR-3026e:green:lan1";
+			gpios = <&gpio0 6 1>;
+		};
+		lan2_green {
+			label = "VR-3026e:green:lan2";
+			gpios = <&gpio0 7 1>;
+		};
+		lan3_green {
+			label = "VR-3026e:green:lan3";
+			gpios = <&gpio0 8 1>;
+		};
+		power_green {
+			label = "VR-3026e:green:power";
+			gpios = <&gpio0 22 0>;
+			default-state = "on";
+		};
+		power_red {
+			label = "VR-3026e:red:power";
+			gpios = <&gpio0 24 0>;
+		};
+		inet_red {
+			label = "VR-3026e:red:inet";
+			gpios = <&gpio0 31 0>;
+		};
+	};
+};
+
+&pflash {
+	status = "ok";
+
+	linux,part-probe = "bcm63xxpart";
+
+	cfe at 0 {
+		label = "CFE";
+		reg = <0x000000 0x010000>;
+		read-only;
+	};
+
+	linux at 10000 {
+		label = "linux";
+		reg = <0x010000 0x7e0000>;
+	};
+
+	nvram at 7f0000 {
+		label = "nvram";
+		reg = <0x7f0000 0x010000>;
+	};
+};
diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
index 90b9fa6..9d3ec9f 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -535,6 +535,8 @@ $(eval $(call bcm63xxCfe,CT6373,CT-6373,ct-6373,CT6373-1,6358))
 $(eval $(call bcm63xxCfe,VR3025u,VR-3025u,vr-3025u,96368M-1541N,6368,--pad 16 --image-offset 0x20000 --block-size 0x20000))
 # Comtrend VR-3025un
 $(eval $(call bcm63xxCfe,VR3025un,VR-3025un,vr-3025un,96368M-1341N,6368,--pad 4))
+# Comtrend VR-3026e
+$(eval $(call bcm63xxCfe,VR3026e,VR-3026e,vr-3026e,96368MT-1341N1,6368,--pad 4))
 # Comtrend WAP-5813n
 $(eval $(call bcm63xxCfe,WAP5813n,WAP-5813n,wap-5813n,96369R-1231N,6368,--pad 4))
 # D-Link DSL-2640B, rev B2
diff --git a/target/linux/brcm63xx/patches-4.1/805-board_VR-3026e.patch b/target/linux/brcm63xx/patches-4.1/805-board_VR-3026e.patch
new file mode 100644
index 0000000..f8577a7
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.1/805-board_VR-3026e.patch
@@ -0,0 +1,81 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2168,6 +2168,60 @@ static struct board_info __initdata boar
+	},
+ };
+
++static struct sprom_fixup __initdata vr3026e_fixups[] = {
++        { .offset = 97, .value = 0xfeb3 },
++        { .offset = 98, .value = 0x1618 },
++        { .offset = 99, .value = 0xfab0 },
++        { .offset = 113, .value = 0xfed1 },
++        { .offset = 114, .value = 0x1609 },
++        { .offset = 115, .value = 0xfad9 },
++};
++
++static struct board_info __initdata board_VR3026e = {
++        .name                                   = "96368MT-1341N1",
++        .expected_cpu_id                = 0x6368,
++
++        .has_uart0                              = 1,
++        .has_pci                                = 1,
++        .use_fallback_sprom                     = 1,
++        .has_ohci0                              = 1,
++        .has_ehci0                              = 1,
++
++        .has_enetsw                             = 1,
++        .enetsw = {
++                .used_ports = {
++                        [0] = {
++                                .used           = 1,
++                                .phy_id         = 1,
++                                .name           = "port1",
++                        },
++                        [1] = {
++                                .used           = 1,
++                                .phy_id         = 2,
++                                .name           = "port2",
++                        },
++                        [2] = {
++                                .used           = 1,
++                                .phy_id         = 3,
++                                .name           = "port3",
++                        },
++                        [3] = {
++                                .used           = 1,
++                                .phy_id         = 4,
++                                .name           = "port4",
++                        },
++                },
++        },
++
++        .fallback_sprom = {
++                .type                           = SPROM_BCM43222,
++                .pci_bus                        = 0,
++                .pci_dev                        = 1,
++                .board_fixups                   = vr3026e_fixups,
++                .num_board_fixups               = ARRAY_SIZE(vr3026e_fixups),
++        },
++};
++
+ Xstatic struct b53_platform_data WAP5813n_b53_pdata = {
+	.alias = "eth0",
+ };
+@@ -2471,7 +2525,8 @@ static const struct board_info __initcon
+	&board_HG655b,
+	&board_P870HW51A_V2,
+	&board_VR3025u,
+-	&board_VR3025un,
++        &board_VR3025un,
++	&board_VR3026e,
+	&board_WAP5813n,
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
+@@ -2572,6 +2627,7 @@ static struct of_device_id const bcm963x
+	{ .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, },
+	{ .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, },
+	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
++        { .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, },
+	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
+	{ .compatible = "huawei,hg655b", .data = &board_HG655b, },
+	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
diff --git a/target/linux/brcm63xx/profiles/comtrend.mk b/target/linux/brcm63xx/profiles/comtrend.mk
index 8c1b862..99fec4a 100644
--- a/target/linux/brcm63xx/profiles/comtrend.mk
+++ b/target/linux/brcm63xx/profiles/comtrend.mk
@@ -73,6 +73,15 @@ define Profile/VR3025un/Description
 endef
 $(eval $(call Profile,VR3025un))
 
+define Profile/VR3026e
+  NAME:=Comtrend VR-3026e
+  PACKAGES:=kmod-b43 wpad-mini
+endef
+define Profile/VR3026e/Description
+  Package set optimized for VR-3026e.
+endef
+$(eval $(call Profile,VR3026e))
+
 define Profile/WAP5813n
   NAME:=Comtrend WAP-5813n
   PACKAGES:=kmod-b43 wpad-mini \
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Sun Aug 23 16:17:17 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Sun, 23 Aug 2015 22:17:17 +0200
Subject: [OpenWrt-Devel] [PATCH 4/7] mac80211: refresh Intel firmware
In-Reply-To: <1440327391-25355-5-git-send-email-dirkneukirchen@web.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
 <1440327391-25355-5-git-send-email-dirkneukirchen@web.de>
Message-ID: <55DA2A4D.8000009@hauke-m.de>



On 08/23/2015 12:56 PM, Dirk Neukirchen wrote:
> - sort firmware
> - add newer firmware for Intel chipsets
> - newer Intel MVM require firmware
> - ucode 13 requires Kernel 4.1+
> 
> only compile tested

Have you looked if this would close any open feature requests / issues
in OpenWrt trac?

> Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
> ---
>  package/kernel/mac80211/Makefile | 198 ++++++++++++++++++++++++++-------------
>  1 file changed, 133 insertions(+), 65 deletions(-)
> 
> +
> +	config IWL3160_FW
> +		bool "Intel 3160 Firmware"
> +		default y
> +		help
> +		  Download and install firmware for:
> +		    Intel Wireless WiFi 3160
> +
> +	config IWL3160_13_FW
> +		bool "Intel 3160 Firmware ucode 13 (4.1+)"
> +		default y
> +		depends on LINUX_4_1
> +		help
> +		  Download and install firmware for:
> +		    Intel Wireless WiFi 3160

Does this really depend on the kernel version and not on the iwl driver
version? OpenWrt uses the driver from a very recent wireless tree, so it
should be equivalent to something between 4.2 and 4.3 now.

I would suggest just using the most recent firmware files for the Intel
wifi devices.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From lynxis at fe80.eu  Sun Aug 23 21:57:10 2015
From: lynxis at fe80.eu (Alexander Couzens)
Date: Mon, 24 Aug 2015 03:57:10 +0200
Subject: [OpenWrt-Devel] [PATCH v3] busybox: lock: implement -n "Fail rather
	than wait"
In-Reply-To: <CAOiHx==jSOqV_ZK7P8Ow053K63ptVPmpKnaZH_OQwB=Prr2opQ@mail.gmail.com>
References: <CAOiHx==jSOqV_ZK7P8Ow053K63ptVPmpKnaZH_OQwB=Prr2opQ@mail.gmail.com>
Message-ID: <1440381430-5767-1-git-send-email-lynxis@fe80.eu>

lock -n is similiar to flock -n. If the lock was already taken,
fail with exit code = 1 and write error message to stderr.

example:
if ! lock -n /tmp/foo ; then
	echo lock exits.
else
	echo lock was free. But is locked now.
fi
> lock was free. But is locked now.
> lock exists.

Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
v1: implement feature
v2: rename variable failinsteadwait into try_lock
    extend description of -n
    run make package/utils/busybox/refresh
v3: drop changelog from commit message
	remove ret variable

 package/utils/busybox/patches/220-add_lock_util.patch | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
index f42edcb..9cac9e6 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -1,6 +1,6 @@
 --- a/include/applets.src.h
 +++ b/include/applets.src.h
-@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, 
+@@ -211,6 +211,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN,
  IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
  IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
@@ -35,7 +35,7 @@
  lib-$(CONFIG_MICROCOM)    += microcom.o
 --- /dev/null
 +++ b/miscutils/lock.c
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,144 @@
 +/*
 + * Copyright (C) 2006 Felix Fietkau <nbd at openwrt.org>
 + *
@@ -56,6 +56,7 @@
 +static int unlock = 0;
 +static int shared = 0;
 +static int waitonly = 0;
++static int try_lock = 0;
 +static int fd;
 +static char *file;
 +
@@ -65,6 +66,7 @@
 +	                "	-s	Use shared locking\n"
 +	                "	-u	Unlock\n"
 +	                "	-w	Wait for the lock to become free, don't acquire lock\n"
++			"	-n	Don't wait for the lock to become free. Fail with exit code\n"
 +					"\n", name);
 +	exit(1);
 +}
@@ -95,6 +97,7 @@
 +static int do_lock(void)
 +{
 +	int pid;
++	int flags;
 +	char pidstr[8];
 +
 +	if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) {
@@ -104,7 +107,10 @@
 +		}
 +	}
 +
-+	if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) {
++	flags = shared ? LOCK_SH : LOCK_EX;
++	flags |= try_lock ? LOCK_NB : 0;
++
++	if (flock(fd, flags) < 0) {
 +		fprintf(stderr, "Can't lock %s\n", file);
 +		return 1;
 +	}
@@ -156,6 +162,9 @@
 +				case 'u':
 +					unlock = 1;
 +					break;
++				case 'n':
++					try_lock = 1;
++					break;
 +			}
 +		}
 +		c--;
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From varkabhadram at gmail.com  Sun Aug 23 23:30:25 2015
From: varkabhadram at gmail.com (Varka Bhadram)
Date: Mon, 24 Aug 2015 09:00:25 +0530
Subject: [OpenWrt-Devel] [PATCH] wpan-tools: bump to wpan-tools-0.5
Message-ID: <1440387025-28000-1-git-send-email-varkabhadram@gmail.com>

Signed-off-by: Varka Bhadram <varkabhadram at gmail.com>
---
 package/network/utils/wpan-tools/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/wpan-tools/Makefile b/package/network/utils/wpan-tools/Makefile
index 87a5fb1..6c2559d 100644
--- a/package/network/utils/wpan-tools/Makefile
+++ b/package/network/utils/wpan-tools/Makefile
@@ -8,11 +8,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wpan-tools
-PKG_VERSION:=0.4
+PKG_VERSION:=0.5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://wpan.cakelab.org/releases/
-PKG_MD5SUM:=37575523d1543e06b11295f03a891fa7
+PKG_MD5SUM:=6226df405a98c13ec41bf4d1f0777d6b
 
 include $(INCLUDE_DIR)/package.mk
 
-- 
1.7.9.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:09:43 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:09:43 -0400
Subject: [OpenWrt-Devel] [PATCH 1/9] ar71xx: PowerCloud CAP324 kernel support
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <1a9957421267a7d0152c53b7fe62dd5f1a3ad1f6.1441188484.git.openwrt@daniel.thecshore.com>

Kernel part of support for PowerCloud CAP324 Cloud AP.
The CAP324 Cloud AP was a device sold by PowerCloud Systems as hardware for
the CloudCommand service for 'cloud' based managment of large numbers
access points.

The CAP324 is a dual-band 802.11n wireless access point with 16MB flash
and 128MB RAM and single gigabit ethernet port.  It can be powered via PoE
or a wall wart.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 target/linux/ar71xx/mikrotik/config-default        |   1 +
 target/linux/ar71xx/nand/config-default            |   1 +
 ...-MIPS-ath79-add-powercloud-cap324-support.patch | 175 +++++++++++++++++++++
 4 files changed, 178 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-powercloud-cap324-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 21c4601..f921916 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -48,6 +48,7 @@ CONFIG_ATH79_MACH_ARCHER_C7=y
 CONFIG_ATH79_MACH_AW_NR580=y
 CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
 CONFIG_ATH79_MACH_BSB=y
+CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index de91e4b..c46529c 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -15,6 +15,7 @@
 # CONFIG_ATH79_MACH_ARCHER_C7 is not set
 # CONFIG_ATH79_MACH_AW_NR580 is not set
 # CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set
+# CONFIG_ATH79_MACH_CAP324 is not set
 # CONFIG_ATH79_MACH_CAP4200AG is not set
 # CONFIG_ATH79_MACH_CARAMBOLA2 is not set
 # CONFIG_ATH79_MACH_CPE510 is not set
diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index 50b6dbe..0407da0 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -13,6 +13,7 @@
 # CONFIG_ATH79_MACH_AP96 is not set
 # CONFIG_ATH79_MACH_ARCHER_C7 is not set
 # CONFIG_ATH79_MACH_AW_NR580 is not set
+# CONFIG_ATH79_MACH_CAP324 is not set
 # CONFIG_ATH79_MACH_CAP4200AG is not set
 # CONFIG_ATH79_MACH_CARAMBOLA2 is not set
 # CONFIG_ATH79_MACH_DB120 is not set
diff --git a/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-powercloud-cap324-support.patch b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-powercloud-cap324-support.patch
new file mode 100644
index 0000000..2653d24
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-powercloud-cap324-support.patch
@@ -0,0 +1,175 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -866,6 +866,16 @@ config ATH79_MACH_MZK_W300NH
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CAP324
++	bool "PowerCloud Systems CAP324 board support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_RW2458N
+ 	bool "Redwave RW2458N board support"
+ 	select SOC_AR724X
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -57,6 +57,7 @@ obj-$(CONFIG_ATH79_MACH_ARCHER_C7)	+= ma
+ obj-$(CONFIG_ATH79_MACH_AW_NR580)	+= mach-aw-nr580.o
+ obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)+= mach-bhu-bxu2000n2-a.o
+ obj-$(CONFIG_ATH79_MACH_BSB)		+= mach-bsb.o
++obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+--- /dev/null
++++ b/arch/mips/ath79/mach-cap324.c
+@@ -0,0 +1,133 @@
++/*
++ *  PowerCloud Systems CAP324 board support
++ *
++ *  Copyright (C) 2012 Gabor Juhos <juhosg at openwrt.org>
++ *  Copyright (C) 2012-2013 PowerCloud Systems
++ *  Copyright (C) 2015 Daniel Dickinson
++ *
++ *  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.
++ */
++
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CAP324_GPIO_LED_POWER_GREEN	12
++#define CAP324_GPIO_LED_POWER_AMBER	13
++#define CAP324_GPIO_LED_LAN_GREEN	14
++#define CAP324_GPIO_LED_LAN_AMBER	15
++#define CAP324_GPIO_LED_WLAN_GREEN	18
++#define CAP324_GPIO_LED_WLAN_AMBER	19
++
++#define CAP324_GPIO_BTN_RESET	17
++
++#define CAP324_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CAP324_KEYS_DEBOUNCE_INTERVAL (3 * CAP324_KEYS_POLL_INTERVAL)
++
++#define CAP324_MAC_OFFSET		0
++#define CAP324_WMAC_CALDATA_OFFSET	0x1000
++#define CAP324_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cap324_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:green:power",
++		.gpio		= CAP324_GPIO_LED_POWER_GREEN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CAP324_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:green:lan",
++		.gpio		= CAP324_GPIO_LED_LAN_GREEN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:amber:lan",
++		.gpio		= CAP324_GPIO_LED_LAN_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:green:wlan",
++		.gpio		= CAP324_GPIO_LED_WLAN_GREEN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:amber:wlan",
++		.gpio		= CAP324_GPIO_LED_WLAN_AMBER,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cap324_gpio_keys[] __initdata = {
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_RESTART,
++		.debounce_interval = CAP324_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CAP324_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cap324_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++	u8 mac[6];
++
++	ath79_gpio_output_select(CAP324_GPIO_LED_LAN_GREEN,
++				 AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CAP324_GPIO_LED_LAN_AMBER,
++				 AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cap324_leds_gpio),
++				 cap324_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CAP324_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cap324_gpio_keys),
++					cap324_gpio_keys);
++
++	ath79_init_mac(mac, art + CAP324_MAC_OFFSET, -1);
++	ath79_wmac_disable_2ghz();
++	ath79_register_wmac(art + CAP324_WMAC_CALDATA_OFFSET, mac);
++
++	ath79_init_mac(mac, art + CAP324_MAC_OFFSET, -2);
++	ap91_pci_init(art + CAP324_PCIE_CALDATA_OFFSET, mac);
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
++				   AR934X_ETH_CFG_SW_ONLY_MODE);
++
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr,
++		       art + CAP324_MAC_OFFSET, -2);
++
++	/* GMAC0 is connected to an external PHY */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CAP324, "CAP324", "PowerCloud CAP324",
++	     cap324_setup);
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -40,6 +40,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_AW_NR580,		/* AzureWave AW-NR580 */
+ 	ATH79_MACH_BHU_BXU2000N2_A1,	/* BHU BXU2000n-2 A1 */
+ 	ATH79_MACH_BSB,			/* Smart Electronics Black Swift board */
++	ATH79_MACH_CAP324,		/* PowerCloud Systems CAP324 */
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:09:52 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:09:52 -0400
Subject: [OpenWrt-Devel] [PATCH 2/9] ar71xx: PowerCloud CAP324 image
	generation
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <9c79b6588c92e8f406623da2d6247b357b3e0298.1441188484.git.openwrt@daniel.thecshore.com>

Image generation (and mtd partition) part of support for
PowerCloud CAP324 Cloud AP. The CAP324 Cloud AP is a device sold by
PowerCloud Systems who's stock firmware (CloudCommand) provides
'cloud' based managment of large numbers of access points.

The CAP324 is a dual-band 802.11n wireless access point with 16MB flash
and 128MB RAM and single gigabit ethernet port.  It can be powered via
PoE or a wall wart.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 44 +++++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 +++
 2 files changed, 48 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index 1399ef4..b56d131 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -27,3 +27,47 @@ define Profile/DLRTDEV01/Description
 endef
 
 $(eval $(call Profile,DLRTDEV01))
+
+define Profile/CAP324
+	NAME:=PowerCloud CAP324 Cloud AP
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324/Description
+	Package set optimized for the PowerCloud Systems CAP324 Cloud AP
+
+	The CAP324 Cloud AP is a device sold by PowerCloud Systems 
+	who's stock firmware (CloudCommand) provides 'cloud' based
+	managment of large numbers of access points.    
+
+	The CAP324 is a dual-band 802.11n wireless access point with 16MB
+	flash and 128MB RAM and single gigabit ethernet port.  It can be 
+	powered via PoE or a wall wart.
+endef
+
+$(eval $(call Profile,CAP324))
+
+define Profile/CAP324NOCLOUD
+	NAME:=PowerCloud CAP324 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CAP324NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CAP324 Without Cloud
+
+	The CAP324 Cloud AP is a device sold by PowerCloud Systems 
+	who's stock firmware (CloudCommand) provides 'cloud' based
+	managment of large numbers of access points.    
+
+	The CAP324 is a dual-band 802.11n wireless access point with 16MB
+	flash and 128MB RAM and single gigabit ethernet port.  It can be 
+	powered via PoE or a wall wart.
+
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CAP324NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 8f609de..15bb6a3 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1198,6 +1198,8 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13760k(rootfs),640k(certs),64k(nvram),64k(art),15296k at 0x50000(firmware)
+cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
@@ -2075,6 +2077,8 @@ $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(
 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:10:14 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:10:14 -0400
Subject: [OpenWrt-Devel] [PATCH 3/9] ar71xx: PowerCloud CAP324 OpenWrt
	configuration
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <a409e6c0fda7b225216aceb63b9567c23fa6fe3b.1441188484.git.openwrt@daniel.thecshore.com>

Openwrt configuration part of support for PowerCloud CAP324
Cloud AP.  The CAP324 Cloud AP is a device sold by PowerCloud Systems
who's stock firmware (CloudCommand) provides 'cloud' based managment
of large numbers access points.

The CAP324 is a dual-band 802.11n wireless access point with 16MB flash
and 128MB RAM and single gigabit ethernet port.  It can be powered via PoE
or a wall wart.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 6 ++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 1 +
 6 files changed, 15 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 8fb559e..e6f73b1 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -15,6 +15,7 @@ board=$(ar71xx_board_name)
 
 case "$board" in
 all0258n | \
+cap324 | \
 cap4200ag | \
 carambola2 | \
 eap300v2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 36de775..cd17bd3 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -53,6 +53,9 @@ get_status_led() {
 	bxu2000n-2-a1)
 		status_led="bhu:green:status"
 		;;
+	cap324)
+		status_led="pcs:green:power"
+		;;
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
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 e7f7a4c..52c2635 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -84,6 +84,12 @@ bxu2000n-2-a1)
 	ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
 	;;
 
+cap324)
+	ucidef_set_led_netdev "lan" "LAN" "pcs:green:lan" "eth0"
+	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+	ucidef_set_led_wlan "wlan_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+	;;
+
 cap4200ag)
 	ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
 	ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber: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 686fce9..0704088 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -333,6 +333,7 @@ dlan-pro-1200-ac)
 all0305 |\
 aw-nr580 |\
 bullet-m |\
+cap324 |\
 cap4200ag |\
 eap300v2 |\
 eap7660d |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index e1f345e..859840c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -389,6 +389,9 @@ ar71xx_board_detect() {
 	*AW-NR580)
 		name="aw-nr580"
 		;;
+	*CAP324)
+		name="cap324"
+		;;
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index c1962e4..dbc4e39 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -167,6 +167,7 @@ platform_check_image() {
 	case "$board" in
 	all0315n | \
 	all0258n | \
+	cap324 | \
 	cap4200ag)
 		platform_check_image_allnet "$1" && return 0
 		return 1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:11:28 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:11:28 -0400
Subject: [OpenWrt-Devel] [PATCH 4/9] ar71xx: PowerCloud CR3000 kernel support
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <c9e7a647160e635501669f9a6d421a98a596456b.1441188484.git.openwrt@daniel.thecshore.com>

Kernel part of support package for PowerCloud CR3000.  The CR3000 is
a 802.11n 2.4 GHz wireless router with 8MB flash, 64MB RAM,
a four port gigabit ethernet switch, and a fast ethernet wan port which
was sold by PowerCloud Systems as hardware for the Skydog
cloud-managed router service.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 target/linux/ar71xx/mikrotik/config-default        |   1 +
 target/linux/ar71xx/nand/config-default            |   1 +
 ...-MIPS-ath79-add-powercloud-cr3000-support.patch | 201 +++++++++++++++++++++
 4 files changed, 204 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-powercloud-cr3000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index f921916..ed1957e 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_CAP324=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CR3000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index c46529c..d541c0f 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -19,6 +19,7 @@
 # CONFIG_ATH79_MACH_CAP4200AG is not set
 # CONFIG_ATH79_MACH_CARAMBOLA2 is not set
 # CONFIG_ATH79_MACH_CPE510 is not set
+# CONFIG_ATH79_MACH_CR3000 is not set
 # CONFIG_ATH79_MACH_DB120 is not set
 # CONFIG_ATH79_MACH_DGL_5500_A1 is not set
 # CONFIG_ATH79_MACH_DHP_1565_A1 is not set
diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index 0407da0..e875c76 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -16,6 +16,7 @@
 # CONFIG_ATH79_MACH_CAP324 is not set
 # CONFIG_ATH79_MACH_CAP4200AG is not set
 # CONFIG_ATH79_MACH_CARAMBOLA2 is not set
+# CONFIG_ATH79_MACH_CR3000 is not set
 # CONFIG_ATH79_MACH_DB120 is not set
 # CONFIG_ATH79_MACH_DIR_505_A1 is not set
 # CONFIG_ATH79_MACH_DIR_600_A1 is not set
diff --git a/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-powercloud-cr3000-support.patch b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-powercloud-cr3000-support.patch
new file mode 100644
index 0000000..96ff873
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-powercloud-cr3000-support.patch
@@ -0,0 +1,201 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -876,6 +876,16 @@ config ATH79_MACH_CAP324
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR3000
++	bool "PowerCloud Systems CR3000 board support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_RW2458N
+ 	bool "Redwave RW2458N board support"
+ 	select SOC_AR724X
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_ATH79_MACH_BSB)		+= mach-bs
+ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach-cap324.o
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
++obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+--- /dev/null
++++ b/arch/mips/ath79/mach-cr3000.c
+@@ -0,0 +1,159 @@
++/*
++ * PowerCloud Systems CR3000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR3000_GPIO_LED_WLAN_2G		13
++#define CR3000_GPIO_LED_POWER_AMBER	15
++#define CR3000_GPIO_LED_WAN             18
++#define CR3000_GPIO_LED_LAN1            19
++#define CR3000_GPIO_LED_LAN2            20
++#define CR3000_GPIO_LED_LAN3            21
++#define CR3000_GPIO_LED_LAN4            22
++
++#define CR3000_GPIO_BTN_WPS		16
++#define CR3000_GPIO_BTN_RESET		17
++
++#define CR3000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR3000_KEYS_DEBOUNCE_INTERVAL	(3 * CR3000_KEYS_POLL_INTERVAL)
++
++#define CR3000_MAC0_OFFSET		0
++#define CR3000_MAC1_OFFSET		6
++#define CR3000_WMAC_CALDATA_OFFSET	0x1000
++#define CR3000_WMAC_MAC_OFFSET	        0x1002
++#define CR3000_PCIE_CALDATA_OFFSET	0x5000
++
++static struct gpio_led cr3000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR3000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR3000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wan",
++		.gpio		= CR3000_GPIO_LED_WAN,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:lan1",
++		.gpio		= CR3000_GPIO_LED_LAN1,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:lan2",
++		.gpio		= CR3000_GPIO_LED_LAN2,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:lan3",
++		.gpio		= CR3000_GPIO_LED_LAN3,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:lan4",
++		.gpio		= CR3000_GPIO_LED_LAN4,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr3000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR3000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR3000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static void __init cr3000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr3000_leds_gpio),
++				 cr3000_leds_gpio);
++
++	ath79_register_gpio_keys_polled(-1, CR3000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr3000_gpio_keys),
++					cr3000_gpio_keys);
++
++	/* WLAN 2GHz onboard */
++	ath79_register_wmac(art + CR3000_WMAC_CALDATA_OFFSET, art + CR3000_WMAC_MAC_OFFSET);
++	
++	ath79_register_mdio(1, 0x0);
++	ath79_register_mdio(0, 0x0);
++
++	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);
++
++	/* Lan 4-port switch attached to GMAC1 internal switch */
++	ath79_init_mac(ath79_eth1_data.mac_addr, art + CR3000_MAC0_OFFSET, 0);
++
++	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++	ath79_register_eth(1);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR3000_MAC1_OFFSET, 0);
++
++	/* WAN Fast Ethernet interface attached to GMAC0 */
++	ath79_switch_data.phy4_mii_en = 1;
++	ath79_switch_data.phy_poll_mask = BIT(0);
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR3000, "CR3000", "PowerCloud CR3000",
++	     cr3000_setup);
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -44,6 +44,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
++	ATH79_MACH_CR3000,              /* PowerCloud CR3000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:13:15 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:13:15 -0400
Subject: [OpenWrt-Devel] [PATCH 5/9] ar71xx: PowerCloud CR3000 image
	generation
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <3c593e34b7799dacf40c62cd1d3eeec2a248739d.1441188484.git.openwrt@daniel.thecshore.com>

Image generation (and mtd partition)  part of support for the PowerCloud
Systems CR3000.  The CR3000 is a 802.11n 2.4 GHz wireless router with
8MB flash, 64MB RAM, a four port gigabit ethernet switch, and a fast
ethernet wan port that was sold by PowerCloud Systems as hardware for
the Skydog cloud-managed router service.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 37 +++++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 41 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index b56d131..ec712aa 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -71,3 +71,40 @@ endef
 
 $(eval $(call Profile,CAP324NOCLOUD))
 
+define Profile/CR3000
+	NAME:=PowerCloud CR3000 Cloud Router
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000/Description
+	Package set optimized for the PowerCloud Systems CR3000 Cloud Router
+
+	The CR3000 is a 802.11n 2.4 GHz wireless router with
+	8MB flash, 64MB RAM, a four port gigabit ethernet switch,
+       and a faster ethernet wan port that was sold by PowerCloud
+       Systems as hardware for the Skydog cloud-managed router service.
+endef
+
+$(eval $(call Profile,CR3000))
+
+define Profile/CR3000NOCLOUD
+	NAME:=PowerCloud CR3000 Without Cloud
+	PACKAGES:=uboot-envtools
+endef
+
+define Profile/CR3000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR3000 Without Cloud
+
+	The CR3000 is a 802.11n 2.4 GHz wireless router with
+	8MB flash, 64MB RAM, a four port gigabit ethernet switch,
+       and a faster ethernet wan port that was sold by PowerCloud
+       Systems as hardware for the Skydog cloud-managed router service.
+
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR3000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 15bb6a3..5e1b432 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1202,6 +1202,8 @@ cap324_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),13
 cap324nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,1536k(kernel),14464k(rootfs),64k(art),16000k at 0x50000(firmware)
 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k at 0xa0000(firmware)
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
+cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2080,6 +2082,8 @@ $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call SingleProfile,AthLzma,64k,CAP324,cap324,CAP324,ttyS0,115200,$$(cap324_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0,115200,$$(cap324nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:13:24 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:13:24 -0400
Subject: [OpenWrt-Devel] [PATCH 6/9] ar71xx: PowerCloud CR3000 OpenWrt
	configuration
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <7d7e586f439451409b2ec8d74a3b213d4cb52afb.1441188484.git.openwrt@daniel.thecshore.com>

OpenWRt configuration part of support for the PowerCloud
Systems CR3000.  The CR3000 is a 802.11n 2.4 GHz wireless router with
8MB flash, 64MB RAM, a four port gigabit ethernet switch, and a fast
ethernet wan port that was sold by PowerCloud Systems as
hardware for the Skydog cloud-managed router service.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 9 +++++++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++++++
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index e6f73b1..20a83b0 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -18,6 +18,7 @@ all0258n | \
 cap324 | \
 cap4200ag | \
 carambola2 | \
+cr3000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index cd17bd3..3330eea 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
+	cr3000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 52c2635..640fd2b 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -112,6 +112,15 @@ cpe510)
 	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
 	;;
 
+cr3000)
+	ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
+	ucidef_set_led_switch "lan2" "LAN2" "pcs:blue:lan2" "switch0" "0x08"
+	ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10"
+	ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02"
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 0704088..7b081db 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -271,6 +271,12 @@ wzr-hp-g300nh)
 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
 	;;
 
+cr3000)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+	ucidef_add_switch "switch0" "1" "1"
+	ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+	;;
+
 dgl-5500-a1 |\
 dir-825-c1)
 	local mac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 859840c..281d73c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -399,6 +399,9 @@ ar71xx_board_detect() {
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;
+	*CR3000)
+		name="cr3000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index dbc4e39..feb091f 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -168,7 +168,8 @@ platform_check_image() {
 	all0315n | \
 	all0258n | \
 	cap324 | \
-	cap4200ag)
+	cap4200ag | \
+	cr3000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:15:16 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:15:16 -0400
Subject: [OpenWrt-Devel] [PATCH 7/9] ar71xx: PowerCloud CR5000 kernel support
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <58c64f673233a2039f633005e8080f5e56372d27.1441188484.git.openwrt@daniel.thecshore.com>

Kernel part of support for the PowerCloud Systems CR5000.  The
CR5000 is a dual-band 802.11n wireless router with 8MB flash,
64 MB RAM, (unused in stock firmware) USB 2.0 port, and five
port gigabit ethernet switch.  The CR5000 was sold as hardware for
the Skydog cloud-managed router service.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 target/linux/ar71xx/mikrotik/config-default        |   1 +
 target/linux/ar71xx/nand/config-default            |   1 +
 ...-MIPS-ath79-add-powercloud-cr5000-support.patch | 219 +++++++++++++++++++++
 4 files changed, 222 insertions(+)
 create mode 100644 target/linux/ar71xx/patches-4.1/817-MIPS-ath79-add-powercloud-cr5000-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index ed1957e..7260954 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -53,6 +53,7 @@ CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
 CONFIG_ATH79_MACH_DHP_1565_A1=y
diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index d541c0f..88ac6cf 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -20,6 +20,7 @@
 # CONFIG_ATH79_MACH_CARAMBOLA2 is not set
 # CONFIG_ATH79_MACH_CPE510 is not set
 # CONFIG_ATH79_MACH_CR3000 is not set
+# CONFIG_ATH79_MACH_CR5000 is not set
 # CONFIG_ATH79_MACH_DB120 is not set
 # CONFIG_ATH79_MACH_DGL_5500_A1 is not set
 # CONFIG_ATH79_MACH_DHP_1565_A1 is not set
diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
index e875c76..314dbeb 100644
--- a/target/linux/ar71xx/nand/config-default
+++ b/target/linux/ar71xx/nand/config-default
@@ -17,6 +17,7 @@
 # CONFIG_ATH79_MACH_CAP4200AG is not set
 # CONFIG_ATH79_MACH_CARAMBOLA2 is not set
 # CONFIG_ATH79_MACH_CR3000 is not set
+# CONFIG_ATH79_MACH_CR5000 is not set
 # CONFIG_ATH79_MACH_DB120 is not set
 # CONFIG_ATH79_MACH_DIR_505_A1 is not set
 # CONFIG_ATH79_MACH_DIR_600_A1 is not set
diff --git a/target/linux/ar71xx/patches-4.1/817-MIPS-ath79-add-powercloud-cr5000-support.patch b/target/linux/ar71xx/patches-4.1/817-MIPS-ath79-add-powercloud-cr5000-support.patch
new file mode 100644
index 0000000..5edd4b3
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/817-MIPS-ath79-add-powercloud-cr5000-support.patch
@@ -0,0 +1,219 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -886,6 +886,17 @@ config ATH79_MACH_CR3000
+ 	select ATH79_DEV_M25P80
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_CR5000
++	bool "PowerCloud Systems CR5000 support"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_RW2458N
+ 	bool "Redwave RW2458N board support"
+ 	select SOC_AR724X
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -61,6 +61,7 @@ obj-$(CONFIG_ATH79_MACH_CAP324)		+= mach
+ obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
+ obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
+ obj-$(CONFIG_ATH79_MACH_CR3000)		+= mach-cr3000.o
++obj-$(CONFIG_ATH79_MACH_CR5000)		+= mach-cr5000.o
+ obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
+ obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)	+= mach-dlan-pro-1200-ac.o
+--- /dev/null
++++ b/arch/mips/ath79/mach-cr5000.c
+@@ -0,0 +1,176 @@
++/*
++ * PowerCloud CR5000 support
++ *
++ * Copyright (c) 2011 Qualcomm Atheros
++ * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
++ * Copyright (c) 2012-2013 PowerCloud Systems
++ * Copyright (c) 2015 Daniel Dickinson <openwrt at daniel.thecshore.com>
++ *
++ * 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 WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ */
++
++#include <linux/gpio.h>
++#include <linux/pci.h>
++#include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/ath9k_platform.h>
++#include <linux/ar8216_platform.h>
++
++#include <asm/mach-ath79/ar71xx_regs.h>
++#include <asm/mach-ath79/ath79.h>
++
++#include "common.h"
++#include "dev-ap9x-pci.h"
++#include "dev-eth.h"
++#include "dev-gpio-buttons.h"
++#include "dev-leds-gpio.h"
++#include "dev-m25p80.h"
++#include "dev-spi.h"
++#include "dev-usb.h"
++#include "dev-wmac.h"
++#include "machtypes.h"
++
++#define CR5000_GPIO_LED_WLAN_2G		14
++#define CR5000_GPIO_LED_WPS		12
++#define CR5000_GPIO_LED_POWER_AMBER      4
++/* GPIO2 has to have JTAG disabled as it is also to
++ * power led
++ */
++#define CR5000_GPIO_LED_POWER_ENABLE     2
++#define CR5000_GPIO_BTN_WPS		16
++#define CR5000_GPIO_BTN_RESET		17
++
++#define CR5000_KEYS_POLL_INTERVAL	20	/* msecs */
++#define CR5000_KEYS_DEBOUNCE_INTERVAL	(3 * CR5000_KEYS_POLL_INTERVAL)
++
++#define CR5000_MAC0_OFFSET		0
++#define CR5000_WMAC_CALDATA_OFFSET	0x1000
++#define CR5000_WMAC_MAC_OFFSET	        0x1002
++#define CR5000_PCIE_CALDATA_OFFSET	0x5000
++#define CR5000_PCIE_MAC_OFFSET	        0x5002
++
++static struct gpio_led cr5000_leds_gpio[] __initdata = {
++	{
++		.name		= "pcs:amber:power",
++		.gpio		= CR5000_GPIO_LED_POWER_AMBER,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:white:wps",
++		.gpio		= CR5000_GPIO_LED_WPS,
++		.active_low	= 1,
++	},
++	{
++		.name		= "pcs:blue:wlan",
++		.gpio		= CR5000_GPIO_LED_WLAN_2G,
++		.active_low	= 1,
++	},
++};
++
++static struct gpio_keys_button cr5000_gpio_keys[] __initdata = {
++	{
++		.desc		= "WPS button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_WPS,
++		.active_low	= 1,
++	},
++	{
++		.desc		= "Reset button",
++		.type		= EV_KEY,
++		.code		= KEY_WPS_BUTTON,
++		.debounce_interval = CR5000_KEYS_DEBOUNCE_INTERVAL,
++		.gpio		= CR5000_GPIO_BTN_RESET,
++		.active_low	= 1,
++	},
++};
++
++static struct ar8327_pad_cfg cr5000_ar8327_pad0_cfg = {
++	.mode = AR8327_PAD_MAC_RGMII,
++	.txclk_delay_en = true,
++	.rxclk_delay_en = true,
++	.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
++	.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
++};
++
++static struct ar8327_led_cfg cr5000_ar8327_led_cfg = {
++	.led_ctrl0 = 0x00000000,
++	.led_ctrl1 = 0xc737c737,
++	.led_ctrl2 = 0x00000000,
++	.led_ctrl3 = 0x00c30c00,
++	.open_drain = true,
++};
++
++static struct ar8327_platform_data cr5000_ar8327_data = {
++	.pad0_cfg = &cr5000_ar8327_pad0_cfg,
++	.port0_cfg = {
++		.force_link = 1,
++		.speed = AR8327_PORT_SPEED_1000,
++		.duplex = 1,
++		.txpause = 1,
++		.rxpause = 1,
++	},
++	.led_cfg = &cr5000_ar8327_led_cfg,
++};
++
++static struct mdio_board_info cr5000_mdio0_info[] = {
++	{
++		.bus_id = "ag71xx-mdio.0",
++		.phy_addr = 0,
++		.platform_data = &cr5000_ar8327_data,
++	},
++};
++
++static void __init cr5000_setup(void)
++{
++	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
++
++	ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE);
++	gpio_request_one(CR5000_GPIO_LED_POWER_ENABLE,
++	GPIOF_OUT_INIT_LOW, "Power LED enable");
++	ath79_gpio_output_select(CR5000_GPIO_LED_POWER_AMBER, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WLAN_2G, AR934X_GPIO_OUT_GPIO);
++	ath79_gpio_output_select(CR5000_GPIO_LED_WPS, AR934X_GPIO_OUT_GPIO);
++
++	ath79_register_m25p80(NULL);
++
++	ath79_register_leds_gpio(-1, ARRAY_SIZE(cr5000_leds_gpio),
++				 cr5000_leds_gpio);
++	ath79_register_gpio_keys_polled(-1, CR5000_KEYS_POLL_INTERVAL,
++					ARRAY_SIZE(cr5000_gpio_keys),
++					cr5000_gpio_keys);
++	ath79_register_usb();
++	ath79_register_wmac(art + CR5000_WMAC_CALDATA_OFFSET, art + CR5000_WMAC_MAC_OFFSET);
++	ap94_pci_init(NULL, NULL, NULL, art + CR5000_PCIE_MAC_OFFSET);
++
++        ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
++
++	ath79_register_mdio(0, 0x0);
++
++	ath79_init_mac(ath79_eth0_data.mac_addr, art + CR5000_MAC0_OFFSET, 0);
++
++	mdiobus_register_board_info(cr5000_mdio0_info,
++				    ARRAY_SIZE(cr5000_mdio0_info));
++
++	/* GMAC0 is connected to an AR8327 switch */
++	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++	ath79_eth0_data.phy_mask = BIT(0);
++	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++	ath79_eth0_pll_data.pll_1000 = 0x06000000;
++	ath79_register_eth(0);
++}
++
++MIPS_MACHINE(ATH79_MACH_CR5000, "CR5000", "PowerCloud CR5000",
++	     cr5000_setup);
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -45,6 +45,7 @@ enum ath79_mach_type {
+ 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
+ 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
+ 	ATH79_MACH_CR3000,              /* PowerCloud CR3000 */
++	ATH79_MACH_CR5000,              /* PowerCloud CR5000 */
+ 	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
+ 	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
+ 	ATH79_MACH_DGL_5500_A1,		/* D-link DGL-5500 rev. A1 */
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:15:23 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:15:23 -0400
Subject: [OpenWrt-Devel] [PATCH 8/9] ar71xx: PowerCloud CR5000 image
	generation
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <175a763bb77915af6c2fe10b2f7013e726bd3e7a.1441188484.git.openwrt@daniel.thecshore.com>

Image generation (and mtd parititioning) part of support for the
PowerCloud Systems CR5000.  The CR5000 is a dual-band 802.11n
wireless router with 8MB flash, 64MB RAM, (unused on stock firmware)
USB 2.0 port and five port gigabit ethernet switch.  The CR5000
was sold as hardware for the Skydog cloud-managed router service.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/pcs.mk | 37 +++++++++++++++++++++++++++++
 target/linux/ar71xx/image/Makefile          |  4 ++++
 2 files changed, 41 insertions(+)

diff --git a/target/linux/ar71xx/generic/profiles/pcs.mk b/target/linux/ar71xx/generic/profiles/pcs.mk
index ec712aa..e912d9d 100644
--- a/target/linux/ar71xx/generic/profiles/pcs.mk
+++ b/target/linux/ar71xx/generic/profiles/pcs.mk
@@ -108,3 +108,40 @@ endef
 
 $(eval $(call Profile,CR3000NOCLOUD))
 
+define Profile/CR5000
+	NAME:=PowerCloud CR5000 Cloud Router
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000/Description
+	Package set optimized for the PowerCloud Systems CR5000 Cloud Router
+
+	The CR5000 is a dual-band 802.11n wireless router with 8MB flash,
+	64MB RAM, (unused on stock firmware) USB 2.0 port and five port
+	gigabit ethernet switch.  The CR5000 was sold as hardware for
+	the Skydog cloud-managed router service.
+endef
+
+$(eval $(call Profile,CR5000))
+
+define Profile/CR5000NOCLOUD
+	NAME:=PowerCloud CR5000 Without Cloud
+	PACKAGES:=uboot-envtools kmod-usb-core kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+
+define Profile/CR5000NOCLOUD/Description
+	Package set optimized for the PowerCloud Systems CR5000 Without Cloud
+
+	The CR5000 is a dual-band 802.11n wireless router with 8MB flash,
+	64MB RAM, (unused on stock firmware) USB 2.0 port and five port
+	gigabit ethernet switch.  The CR5000 was sold as hardware for
+	the Skydog cloud-managed router service.
+
+	WARNING: Will remove certificates used by cloud firmware
+	After flashing this firmware you will not be able to
+	return the device to cloud operation.
+        The advantage is reclaiming flash used for the certificates.
+endef
+
+$(eval $(call Profile,CR5000NOCLOUD))
+
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 5e1b432..bb21daf 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1204,6 +1204,8 @@ cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k at 0x40000(firmware)
 cr3000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5696k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
 cr3000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
+cr5000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),5760k(rootfs),640k(certs),64k(nvram),64k(art)ro,7104k at 0x50000(firmware)
+cr5000nocloud_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k at 0x50000(firmware)
 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
 db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
 dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
@@ -2084,6 +2086,8 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP324NOCLOUD,cap324nocloud,CAP324,ttyS0
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000,cr3000,CR3000,ttyS0,115200,$$(cr3000_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CR3000NOCLOUD,cr3000nocloud,CR3000,ttyS0,115200,$$(cr3000nocloud_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000,cr5000,CR5000,ttyS0,115200,$$(cr5000_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CR5000NOCLOUD,cr5000nocloud,CR5000,ttyS0,115200,$$(cr5000nocloud_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Mon Aug 24 00:15:30 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Mon, 24 Aug 2015 00:15:30 -0400
Subject: [OpenWrt-Devel] [PATCH 9/9] ar71xx: PowerCloud CR5000 openwrt
	configuration
In-Reply-To: <cover.1441188483.git.openwrt@daniel.thecshore.com>
References: <cover.1441188483.git.openwrt@daniel.thecshore.com>
Message-ID: <d144610888376b74b7accf2fee341b0c1a0f405f.1441188484.git.openwrt@daniel.thecshore.com>

OpenWrt configuration part of support for the PowerCloud Systems
CR5000.  The CR5000 is a dual-band 802.11n wireless router with
8MB flash, 64MB RAM, (unused on stock firmware) USB 2.0 port and
five port gigabit ethernet switch.  The CR5000 was sold as
hardware for the Skydog cloud-managed router service.

    Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 package/boot/uboot-envtools/files/ar71xx                   | 1 +
 target/linux/ar71xx/base-files/etc/diag.sh                 | 3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds    | 5 +++++
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh               | 3 +++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh     | 3 ++-
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx
index 20a83b0..5331d18 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -19,6 +19,7 @@ cap324 | \
 cap4200ag | \
 carambola2 | \
 cr3000 | \
+cr5000 | \
 eap300v2 | \
 hornet-ub | \
 hornet-ub-x2 | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 3330eea..fad4c56 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -65,6 +65,9 @@ get_status_led() {
 	cr3000)
 		status_led="pcs:amber:power"
 		;;
+	cr5000)
+		status_led="pcs:amber:power"
+		;;
 	db120)
 		status_led="db120: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 640fd2b..7b61015 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -121,6 +121,11 @@ cr3000)
 	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
 	;;
 
+cr5000)
+	ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+	ucidef_set_led_usbdev "usb" "USB" "pcs:white:wps" "1-1"
+	;;
+
 db120)
 	ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
 	;;
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 7b081db..71e9ec5 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -31,6 +31,7 @@ wlr8100)
 	ucidef_add_switch_vlan "switch0" "2" "0t 1"
 	;;
 
+cr5000 |\
 esr1750 |\
 epg5000)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 281d73c..75cc642 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -402,6 +402,9 @@ ar71xx_board_detect() {
 	*CR3000)
 		name="cr3000"
 		;;
+	*CR5000)
+		name="cr5000"
+		;;
 	*"DB120 reference board")
 		name="db120"
 		;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index feb091f..9be1745 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -169,7 +169,8 @@ platform_check_image() {
 	all0258n | \
 	cap324 | \
 	cap4200ag | \
-	cr3000)
+	cr3000 |\
+	cr5000)
 		platform_check_image_allnet "$1" && return 0
 		return 1
 		;;
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Mon Aug 24 05:53:30 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Mon, 24 Aug 2015 11:53:30 +0200
Subject: [OpenWrt-Devel] [PATCH] brcm63xx: add Comtrend VR-3026e support
In-Reply-To: <1440343275-31989-1-git-send-email-tesarmar@gmail.com>
References: <1440343275-31989-1-git-send-email-tesarmar@gmail.com>
Message-ID: <CAOiHx=nznuSwzb+3fhfAb260=X9H1PvJnR-gWDfOOhNfvHekjQ@mail.gmail.com>

Hi,

On Sun, Aug 23, 2015 at 5:21 PM, Martin Tesar <tesarmar at gmail.com> wrote:

A few words about the device would be nice. Please try to avoid an
empty commit message.

> Signed-off-by: Martin Tesar <tesarmar at gmail.com>

Codewise it looks good, but you used spaces for indentation; please
replace them with tabs as used everywhere else.

> ---
>  target/linux/brcm63xx/base-files/etc/diag.sh       |  3 +
>  .../base-files/etc/uci-defaults/02_network         |  3 +-
>  .../base-files/etc/uci-defaults/09_fix_crc         |  1 +
>  target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
>  .../lib/preinit/05_init_interfaces_brcm63xx        |  1 +
>  target/linux/brcm63xx/dts/vr-3026e.dts             | 84 ++++++++++++++++++++++
>  target/linux/brcm63xx/image/Makefile               |  2 +
>  .../brcm63xx/patches-4.1/805-board_VR-3026e.patch  | 81 +++++++++++++++++++++

Also currently there is still 3.18 support, so please also add the patch there.

>  target/linux/brcm63xx/profiles/comtrend.mk         |  9 +++
>  9 files changed, 186 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/brcm63xx/dts/vr-3026e.dts
>  create mode 100644 target/linux/brcm63xx/patches-4.1/805-board_VR-3026e.patch


Regards
Jonas
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bapclenet at gmail.com  Mon Aug 24 10:24:06 2015
From: bapclenet at gmail.com (Baptiste Clenet)
Date: Mon, 24 Aug 2015 16:24:06 +0200
Subject: [OpenWrt-Devel] [PATCH] wpan-tools: bump to wpan-tools-0.5
In-Reply-To: <1440387025-28000-1-git-send-email-varkabhadram@gmail.com>
References: <1440387025-28000-1-git-send-email-varkabhadram@gmail.com>
Message-ID: <CAPpUg6OfCt_wkEtX4sXrxf6WNmMcfF-GOwHpoRNiO6-b8XV1Xg@mail.gmail.com>

2015-08-24 5:30 GMT+02:00 Varka Bhadram <varkabhadram at gmail.com>:
> Signed-off-by: Varka Bhadram <varkabhadram at gmail.com>
> ---
>  package/network/utils/wpan-tools/Makefile |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/package/network/utils/wpan-tools/Makefile b/package/network/utils/wpan-tools/Makefile
> index 87a5fb1..6c2559d 100644
> --- a/package/network/utils/wpan-tools/Makefile
> +++ b/package/network/utils/wpan-tools/Makefile
> @@ -8,11 +8,11 @@
>  include $(TOPDIR)/rules.mk
>
>  PKG_NAME:=wpan-tools
> -PKG_VERSION:=0.4
> +PKG_VERSION:=0.5
>
>  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
>  PKG_SOURCE_URL:=http://wpan.cakelab.org/releases/
> -PKG_MD5SUM:=37575523d1543e06b11295f03a891fa7
> +PKG_MD5SUM:=6226df405a98c13ec41bf4d1f0777d6b
>
>  include $(INCLUDE_DIR)/package.mk
>
> --
> 1.7.9.5
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Which version of the kernel is required to use wpan tools 0.5 at least?

-- 
Baptiste
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 24 11:25:36 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 24 Aug 2015 17:25:36 +0200
Subject: [OpenWrt-Devel] [PATCH 4/8 v2] mac80211: refresh Intel firmware
Message-ID: <1440429936-31741-1-git-send-email-dirkneukirchen@web.de>

- sort firmware
- add newer firmware for Intel chipsets
- newer Intel MVM require firmware

only compile tested

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
v2: 
- remove old / always use newer firmware
- remove Kernel version dependencies

The Kernel version only seem to indicate the changed driver
code. I couldn't find hard version checks just that
after some code fixes there are firmware API bumps.

thx Hauke for hinting at that

 package/kernel/mac80211/Makefile | 169 +++++++++++++++++++++++----------------
 1 file changed, 98 insertions(+), 71 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index a3ecb5b..75622cc 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -838,116 +838,139 @@ define KernelPackage/iwlagn
 endef
 
 define KernelPackage/iwlagn/description
- iwlagn kernel module for Intel 5000/5150/1000/6000/6050/6005/6030/100 support
+ iwlagn kernel module for
+ Intel Wireless WiFi Link 6250AGN Adapter
+ Intel 6000 Series Wi-Fi Adapters (6200AGN and 6300AGN)
+ Intel WiFi Link 1000BGN
+ Intel Wireless WiFi 5150AGN
+ Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN
+ Intel 6005 Series Wi-Fi Adapters
+ Intel 6030 Series Wi-Fi Adapters
+ Intel Wireless WiFi Link 6150BGN 2 Adapter
+ Intel 100 Series Wi-Fi Adapters (100BGN and 130BGN)
+ Intel 2000 Series Wi-Fi Adapters
+ Intel 7260 Wi-Fi Adapter
+ Intel 3160 Wi-Fi Adapter
+ Intel 7265 Wi-Fi Adapter
+ Intel 8260 Wi-Fi Adapter
+ Intel 3165 Wi-Fi Adapter
 endef
 
 define KernelPackage/iwlagn/config
   if PACKAGE_kmod-iwlagn
 
-	config IWL5000_FW
-		bool "Intel 5000 Firmware"
+	config IWL100_FW
+		bool "Intel 100 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN
+		    Intel Centrino Wireless-N 100
 
-	config IWL5150_FW
-		bool "Intel 5150 Firmware"
+	config IWL1000_FW
+		bool "Intel 1000 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Wireless WiFi 5150AGN
+		    Intel Centrino Wireless-N 1000
 
-	config IWL1000_FW
-		bool "Intel 1000 Firmware"
+	config IWL105_FW
+		bool "Intel 105 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 1000
+		    Intel Centrino Wireless-N 105
 
-	config IWL6000_FW
-		bool "Intel 6000 Firmware"
+	config IWL135_FW
+		bool "Intel 135 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Ultimate-N 6300 and Advanced-N 6200
+		    Intel Centrino Wireless-N 135
 
-	config IWL6050_FW
-		bool "Intel 6050 Firmware"
+	config IWL2000_FW
+		bool "Intel 2000 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150
+		    Intel Centrino Wireless-N 2200
 
-	config IWL6005_FW
-		bool "Intel 6005 Firmware"
+	config IWL2030_FW
+		bool "Intel 2030 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Advanced-N 6205
+		    Intel Centrino Wireless-N 2230
 
-	config IWL6030_FW
-		bool "Intel 6030 Firmware"
+	config IWL3160_FW
+		bool "Intel 3160 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235
+		    Intel Wireless WiFi 3160
 
-	config IWL7260_FW
-		bool "Intel 7260 Firmware"
+	config IWL5000_FW
+		bool "Intel 5000 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260
+		    Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN
 
-	config IWL7265_FW
-		bool "Intel 7265 Firmware"
+	config IWL5150_FW
+		bool "Intel 5150 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Wireless 7265
+		    Intel Wireless WiFi 5150AGN
 
-	config IWL100_FW
-		bool "Intel 100 Firmware"
+	config IWL6000_FW
+		bool "Intel 6000 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 100
+		    Intel Centrino Ultimate-N 6300 and Advanced-N 6200
 
-	config IWL2000_FW
-		bool "Intel 2000 Firmware"
+	config IWL6005_FW
+		bool "Intel 6005 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 2200
+		    Intel Centrino Advanced-N 6205
 
-	config IWL2030_FW
-		bool "Intel 2030 Firmware"
+	config IWL6030_FW
+		bool "Intel 6030 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 2230
+		    Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235
 
-	config IWL105_FW
-		bool "Intel 105 Firmware"
+	config IWL6050_FW
+		bool "Intel 6050 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 105
+		    Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150
 
-	config IWL135_FW
-		bool "Intel 135 Firmware"
+	config IWL7260_FW
+		bool "Intel 7260 Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Centrino Wireless-N 135
+		    Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260
 
-	config IWL3160_FW
-		bool "Intel 3160 Firmware"
+	config IWL7265_FW
+		bool "Intel 7265 Firmware"
+		default y
+		help
+		  Download and install firmware for:
+		    Intel Wireless 7265, 7265D, 3165
+
+	config IWL8000_FW
+		bool "Intel 8000 Series Firmware"
 		default y
 		help
 		  Download and install firmware for:
-		    Intel Wireless 3160
+		    Intel Wireless Series 8260, 4165
+
   endif
 endef
 
@@ -1930,50 +1953,54 @@ endef
 
 define KernelPackage/iwlagn/install
 	$(INSTALL_DIR) $(1)/lib/firmware
+ifneq ($(CONFIG_IWL100_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL1000_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL105_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-105-6.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL135_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-135-6.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL2000_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2000-6.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL2030_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2030-6.ucode $(1)/lib/firmware
+endif
+ifneq ($(CONFIG_IWL3160_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3160-13.ucode $(1)/lib/firmware
+endif
 ifneq ($(CONFIG_IWL5000_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5000-5.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL5150_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5150-2.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL1000_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware
-endif
 ifneq ($(CONFIG_IWL6000_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000-4.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL6050_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware
-endif
 ifneq ($(CONFIG_IWL6005_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2a-6.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL6030_FW),)
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2b-6.ucode $(1)/lib/firmware
 endif
+ifneq ($(CONFIG_IWL6050_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware
+endif
 ifneq ($(CONFIG_IWL7260_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-9.ucode $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-13.ucode $(1)/lib/firmware
 endif
 ifneq ($(CONFIG_IWL7265_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265-9.ucode $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265-13.ucode $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7265D-13.ucode $(1)/lib/firmware
 endif
-ifneq ($(CONFIG_IWL100_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
-endif
-ifneq ($(CONFIG_IWL2000_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2000-6.ucode $(1)/lib/firmware
-endif
-ifneq ($(CONFIG_IWL2030_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2030-6.ucode $(1)/lib/firmware
-endif
-ifneq ($(CONFIG_IWL105_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-105-6.ucode $(1)/lib/firmware
-endif
-ifneq ($(CONFIG_IWL135_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-135-6.ucode $(1)/lib/firmware
-endif
-ifneq ($(CONFIG_IWL3160_FW),)
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3160-9.ucode $(1)/lib/firmware
+ifneq ($(CONFIG_IWL8000_FW),)
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-8000C-13.ucode $(1)/lib/firmware
 endif
 endef
 
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 24 11:25:45 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 24 Aug 2015 17:25:45 +0200
Subject: [OpenWrt-Devel] [PATCH 1/2 v2] mac80211: cleanup remove net prefixes
Message-ID: <1440429945-31795-1-git-send-email-dirkneukirchen@web.de>

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
v2 : split 6/7 into two commits

 package/kernel/mac80211/Makefile | 82 ++++++++++++++++++++--------------------
 1 file changed, 41 insertions(+), 41 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index be179f2..b7471b9 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -27,8 +27,8 @@ PKG_DRIVERS = \
 	rt2x00-lib rt2x00-pci rt2x00-usb rt2800-lib rt2400-pci rt2500-pci \
 	rt2500-usb rt61-pci rt73-usb rt2800-mmio rt2800-pci rt2800-usb rt2800-soc \
 	rtl8180 rtl8187 zd1211rw mac80211-hwsim carl9170 b43 b43legacy \
-	ath9k-common ath9k ath9k-htc ath10k ath net-libipw net-ipw2100 net-ipw2200 \
-	mwl8k mwifiex-pcie net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \
+	ath9k-common ath9k ath9k-htc ath10k ath libipw ipw2100 ipw2200 \
+	mwl8k mwifiex-pcie hermes hermes-pci hermes-plx hermes-pcmcia \
 	iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \
 	rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \
 	rtl8192de rtl8192cu mt7601u
@@ -716,7 +716,7 @@ define KernelPackage/mt7601u
   AUTOLOAD:=$(call AutoProbe,mt7601)
 endef
 
-define KernelPackage/net-libipw
+define KernelPackage/libipw
   $(call KernelPackage/mac80211/Default)
   TITLE:=libipw for ipw2100 and ipw2200
   DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211 + at DRIVER_WEXT_SUPPORT @!BIG_ENDIAN
@@ -724,29 +724,29 @@ define KernelPackage/net-libipw
   AUTOLOAD:=$(call AutoProbe,libipw)
 endef
 
-define KernelPackage/net-libipw/description
+define KernelPackage/libipw/description
  Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200.
 endef
 
 IPW2100_NAME:=ipw2100-fw
 IPW2100_VERSION:=1.3
 
-define Download/net-ipw2100
+define Download/ipw2100
   URL:=http://bughost.org/firmware/
   FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
   MD5SUM=46aa75bcda1a00efa841f9707bbbd113
 endef
-$(eval $(call Download,net-ipw2100))
+$(eval $(call Download,ipw2100))
 
-define KernelPackage/net-ipw2100
+define KernelPackage/ipw2100
   $(call KernelPackage/mac80211/Default)
   TITLE:=Intel IPW2100 driver
-  DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
+  DEPENDS:=@PCI_SUPPORT +kmod-libipw
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.ko
   AUTOLOAD:=$(call AutoProbe,ipw2100)
 endef
 
-define KernelPackage/net-ipw2100/description
+define KernelPackage/ipw2100/description
  Kernel support for Intel IPW2100
  Includes:
  - ipw2100
@@ -755,29 +755,29 @@ endef
 IPW2200_NAME:=ipw2200-fw
 IPW2200_VERSION:=3.1
 
-define Download/net-ipw2200
+define Download/ipw2200
   URL:=http://bughost.org/firmware/
   FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
   MD5SUM=eaba788643c7cc7483dd67ace70f6e99
 endef
-$(eval $(call Download,net-ipw2200))
+$(eval $(call Download,ipw2200))
 
-define KernelPackage/net-ipw2200
+define KernelPackage/ipw2200
   $(call KernelPackage/mac80211/Default)
   TITLE:=Intel IPW2200 driver
-  DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
+  DEPENDS:=@PCI_SUPPORT +kmod-libipw
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.ko
   AUTOLOAD:=$(call AutoProbe,ipw2200)
 endef
 
-define KernelPackage/net-ipw2200/description
+define KernelPackage/ipw2200/description
  Kernel support for Intel IPW2200
  Includes:
  - ipw2200
 endef
 
 
-define KernelPackage/net-hermes
+define KernelPackage/hermes
   $(call KernelPackage/mac80211/Default)
   TITLE:=Hermes 802.11b chipset support
   DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 + at DRIVER_WEXT_SUPPORT
@@ -785,43 +785,43 @@ define KernelPackage/net-hermes
   AUTOLOAD:=$(call AutoProbe,orinoco)
 endef
 
-define KernelPackage/net-hermes/description
+define KernelPackage/hermes/description
  Kernel support for Hermes 802.11b chipsets
 endef
 
-define KernelPackage/net-hermes-pci
+define KernelPackage/hermes-pci
   $(call KernelPackage/mac80211/Default)
   TITLE:=Intersil Prism 2.5 PCI support
-  DEPENDS:=@PCI_SUPPORT +kmod-net-hermes
+  DEPENDS:=@PCI_SUPPORT +kmod-hermes
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko
   AUTOLOAD:=$(call AutoProbe,orinoco_pci)
 endef
 
-define KernelPackage/net-hermes-pci/description
+define KernelPackage/hermes-pci/description
  Kernel modules for Intersil Prism 2.5 PCI support
 endef
 
-define KernelPackage/net-hermes-plx
+define KernelPackage/hermes-plx
   $(call KernelPackage/mac80211/Default)
   TITLE:=PLX9052 based PCI adaptor
-  DEPENDS:=@PCI_SUPPORT +kmod-net-hermes
+  DEPENDS:=@PCI_SUPPORT +kmod-hermes
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko
   AUTOLOAD:=$(call AutoProbe,orinoco_plx)
 endef
 
-define KernelPackage/net-hermes-plx/description
+define KernelPackage/hermes-plx/description
  Kernel modules for Hermes in PLX9052 based PCI adaptors
 endef
 
-define KernelPackage/net-hermes-pcmcia
+define KernelPackage/hermes-pcmcia
   $(call KernelPackage/mac80211/Default)
   TITLE:=Hermes based PCMCIA adaptors
-  DEPENDS:=@PCMCIA_SUPPORT +kmod-net-hermes @BROKEN
+  DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes @BROKEN
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko
   AUTOLOAD:=$(call AutoProbe,orinoco_cs)
 endef
 
-define KernelPackage/net-hermes-pcmcia/description
+define KernelPackage/hermes-pcmcia/description
  Kernel modules for Hermes based PCMCIA adaptors
 endef
 
@@ -1704,19 +1704,19 @@ config-$(call config_package,iwlagn) += IWLWIFI IWLDVM IWLMVM
 config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG
 config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
 
-config-$(call config_package,net-libipw) += LIBIPW
-config-$(call config_package,net-ipw2100) += IPW2100
-config-$(call config_package,net-ipw2200) += IPW2200
+config-$(call config_package,libipw) += LIBIPW
+config-$(call config_package,ipw2100) += IPW2100
+config-$(call config_package,ipw2200) += IPW2200
 
 config-$(call config_package,p54-common) += P54_COMMON
 config-$(call config_package,p54-pci) += P54_PCI
 config-$(call config_package,p54-usb) += P54_USB
 config-$(call config_package,p54-spi) += P54_SPI
 
-config-$(call config_package,net-hermes) += HERMES
-config-$(call config_package,net-hermes-pci) += PCI_HERMES
-config-$(call config_package,net-hermes-plx) += PLX_HERMES
-config-$(call config_package,net-hermes-pcmcia) += PCMCIA_HERMES
+config-$(call config_package,hermes) += HERMES
+config-$(call config_package,hermes-pci) += PCI_HERMES
+config-$(call config_package,hermes-plx) += PLX_HERMES
+config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES
 config-y += HERMES_PRISM
 
 config-$(call config_package,adm8211) += ADM8211
@@ -1977,12 +1977,12 @@ define KernelPackage/mwifiex-pcie/install
 		$(1)/lib/firmware/mrvl/
 endef
 
-define KernelPackage/net-ipw2100/install
+define KernelPackage/ipw2100/install
 	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware
 endef
 
-define KernelPackage/net-ipw2200/install
+define KernelPackage/ipw2200/install
 	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware
 endef
@@ -2159,19 +2159,19 @@ $(eval $(call KernelPackage,b43legacy))
 $(eval $(call KernelPackage,brcmutil))
 $(eval $(call KernelPackage,brcmsmac))
 $(eval $(call KernelPackage,brcmfmac))
-$(eval $(call KernelPackage,net-libipw))
-$(eval $(call KernelPackage,net-ipw2100))
-$(eval $(call KernelPackage,net-ipw2200))
+$(eval $(call KernelPackage,libipw))
+$(eval $(call KernelPackage,ipw2100))
+$(eval $(call KernelPackage,ipw2200))
 $(eval $(call KernelPackage,iwlagn))
 $(eval $(call KernelPackage,iwl-legacy))
 $(eval $(call KernelPackage,iwl4965))
 $(eval $(call KernelPackage,iwl3945))
 $(eval $(call KernelPackage,mwl8k))
 $(eval $(call KernelPackage,mwifiex-pcie))
-$(eval $(call KernelPackage,net-hermes))
-$(eval $(call KernelPackage,net-hermes-pci))
-$(eval $(call KernelPackage,net-hermes-plx))
-$(eval $(call KernelPackage,net-hermes-pcmcia))
+$(eval $(call KernelPackage,hermes))
+$(eval $(call KernelPackage,hermes-pci))
+$(eval $(call KernelPackage,hermes-plx))
+$(eval $(call KernelPackage,hermes-pcmcia))
 $(eval $(call KernelPackage,wlcore))
 $(eval $(call KernelPackage,wl12xx))
 $(eval $(call KernelPackage,wl18xx))
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 24 11:27:02 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 24 Aug 2015 17:27:02 +0200
Subject: [OpenWrt-Devel] [PATCH 2/2 v2] mac80211: cosmetic changes
Message-ID: <55DB37C6.7010807@web.de>


try to sort alphabetically

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
v2: split 6/7 changes into 2 commits

 package/kernel/mac80211/Makefile | 2434 +++++++++++++++++++-------------------
 1 file changed, 1236 insertions(+), 1198 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index b7471b9..e8ce4d0 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -23,15 +23,28 @@ PKG_BUILD_PARALLEL:=1
 PKG_MAINTAINER:=Felix Fietkau <nbd at openwrt.org>
 
 PKG_DRIVERS = \
-	adm8211 ath5k libertas-usb libertas-sdio p54-common p54-pci p54-usb p54-spi \
-	rt2x00-lib rt2x00-pci rt2x00-usb rt2800-lib rt2400-pci rt2500-pci \
-	rt2500-usb rt61-pci rt73-usb rt2800-mmio rt2800-pci rt2800-usb rt2800-soc \
-	rtl8180 rtl8187 zd1211rw mac80211-hwsim carl9170 b43 b43legacy \
-	ath9k-common ath9k ath9k-htc ath10k ath libipw ipw2100 ipw2200 \
-	mwl8k mwifiex-pcie hermes hermes-pci hermes-plx hermes-pcmcia \
-	iwl-legacy iwl3945 iwl4965 iwlagn wlcore wl12xx wl18xx lib80211 \
+	adm8211 \
+	ath ath5k ath9k ath9k-common ath9k-htc ath10k \
+	b43 b43legacy \
+	carl9170 \
+	hermes hermes-pci hermes-pcmcia hermes-plx \
+	iwl-legacy iwl3945 iwl4965 iwlagn \
+	libipw ipw2100 ipw2200 \
+	libertas-usb libertas-sdio \
+	lib80211 \
+	mac80211-hwsim \
+	mt7601u \
+	mwl8k mwifiex-pcie \
+	p54-common p54-pci p54-usb p54-spi \
+	rt2x00-lib rt2x00-pci rt2x00-usb \
+	rt2400-pci rt2500-pci rt2500-usb \
+	rt2800-lib rt2800-mmio rt2800-pci rt2800-usb rt2800-soc \
+	rt61-pci rt73-usb \
+	rtl8180 rtl8187 \
 	rtlwifi rtlwifi-pci rtlwifi-usb rtl8192c-common rtl8192ce rtl8192se \
-	rtl8192de rtl8192cu mt7601u
+	rtl8192de rtl8192cu \
+	wlcore wl12xx wl18xx \
+	zd1211rw
 
 PKG_CONFIG_DEPENDS:= \
 	CONFIG_PACKAGE_kmod-mac80211 \
@@ -126,513 +139,652 @@ define Download/linux-firmware
 endef
 $(eval $(call Download,linux-firmware))
 
-PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware
-PKG_ATH10K_LINUX_FIRMWARE_VERSION:=b46f3e01a6c1f9150fb4612ef53611d714565842
-PKG_ATH10K_LINUX_FIRMWARE_SOURCE:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION).tar.bz2
-PKG_ATH10K_LINUX_FIRMWARE_PROTO:=git
-PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git
-PKG_ATH10K_LINUX_FIRMWARE_SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION)
-#PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM:=?
 
-define Download/ath10k-firmware
-  FILE:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE)
-  URL:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL)
-  PROTO:=$(PKG_ATH10K_LINUX_FIRMWARE_PROTO)
-  VERSION:=$(PKG_ATH10K_LINUX_FIRMWARE_VERSION)
-  SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)
-  #MIRROR_MD5SUM:=$(PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM)
+define KernelPackage/adm8211
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=ADMTek 8211 support
+  DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/adm8211.ko
+  AUTOLOAD:=$(call AutoProbe,adm8211)
 endef
-$(eval $(call Download,ath10k-firmware))
 
-# Prism54 drivers
-P54PCIFW:=2.13.12.0.arm
-P54USBFW:=2.13.24.0.lm87.arm
-P54SPIFW:=2.13.0.0.a.13.14.arm
 
-define Download/p54usb
-  FILE:=$(P54USBFW)
-  URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb
-  MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6
-endef
-$(eval $(call Download,p54usb))
+define KernelPackage/ath/config
+  if PACKAGE_kmod-ath
+	config ATH_USER_REGD
+		bool "Force Atheros drivers to respect the user's regdomain settings"
+		help
+		  Atheros' idea of regulatory handling is that the EEPROM of the card defines
+		  the regulatory limits and the user is only allowed to restrict the settings
+		  even further, even if the country allows frequencies or power levels that
+		  are forbidden by the EEPROM settings.
 
-define Download/p54pci
-  FILE:=$(P54PCIFW)
-  URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac
-  MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4
-endef
-$(eval $(call Download,p54pci))
+		  Select this option if you want the driver to respect the user's decision about
+		  regulatory settings.
 
-define Download/p54spi
-  FILE:=$(P54SPIFW)
-  URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560
-  MD5SUM:=42661f8ecbadd88012807493f596081d
-endef
-$(eval $(call Download,p54spi))
+	config PACKAGE_ATH_DEBUG
+		bool "Atheros wireless debugging"
+		help
+		  Say Y, if you want to debug atheros wireless drivers.
+		  Only ath9k & ath10k make use of this.
 
-define KernelPackage/p54/Default
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Prism54 Drivers
-endef
+	config PACKAGE_ATH_DFS
+		bool "Enable DFS support"
+		default y
+		help
+		  Dynamic frequency selection (DFS) is required for most of the 5 GHz band
+		  channels in Europe, US, and Japan.
 
-define KernelPackage/p54/description
-  Kernel module for Prism54 chipsets (mac80211)
+		  Select this option if you want to use such channels.
+
+  endif
 endef
 
-define KernelPackage/p54-common
-  $(call KernelPackage/p54/Default)
-  DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt
-  TITLE+= (COMMON)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko
+define KernelPackage/ath
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros common driver part
+  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 +kmod-mac80211
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
+  MENU:=1
 endef
 
-define KernelPackage/p54-pci
-  $(call KernelPackage/p54/Default)
-  TITLE+= (PCI)
-  DEPENDS+= @PCI_SUPPORT +kmod-p54-common
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko
-  AUTOLOAD:=$(call AutoProbe,p54pci)
+define KernelPackage/ath/description
+ This module contains some common parts needed by Atheros Wireless drivers.
 endef
 
-define KernelPackage/p54-usb
-  $(call KernelPackage/p54/Default)
-  TITLE+= (USB)
-  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko
-  AUTOLOAD:=$(call AutoProbe,p54usb)
+define KernelPackage/ath5k
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 5xxx wireless cards support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k
+  DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
+  AUTOLOAD:=$(call AutoProbe,ath5k)
 endef
 
-define KernelPackage/p54-spi
-  $(call KernelPackage/p54/Default)
-  TITLE+= (SPI)
-  DEPENDS+= @TARGET_omap24xx +kmod-p54-common
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko
-  AUTOLOAD:=$(call AutoProbe,p54spi)
+define KernelPackage/ath5k/description
+ This module adds support for wireless adapters based on
+ Atheros 5xxx chipset.
 endef
 
-define KernelPackage/rt2x00/Default
+define KernelPackage/ath9k
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Ralink Drivers for RT2x00 cards
+  TITLE:=Atheros 802.11n PCI wireless cards support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
+  DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
+  AUTOLOAD:=$(call AutoProbe,ath9k)
 endef
 
-define KernelPackage/rt2x00-lib
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t
-  TITLE+= (LIB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko
-  MENU:=1
+define KernelPackage/ath9k/description
+This module adds support for wireless adapters based on
+Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
 endef
 
-define KernelPackage/rt2x00-lib/config
-  if PACKAGE_kmod-rt2x00-lib
-
-	config PACKAGE_RT2X00_LIB_DEBUGFS
-		bool "Enable rt2x00 debugfs support"
-		depends on PACKAGE_MAC80211_DEBUGFS
-		help
-		  Enable creation of debugfs files for the rt2x00 drivers.
-		  These debugfs files support both reading and writing of the
-		  most important register types of the rt2x00 hardware.
+define KernelPackage/ath9k/config
 
-	config PACKAGE_RT2X00_DEBUG
-		bool "Enable rt2x00 debug output"
-		help
-		  Enable debugging output for all rt2x00 modules
+	config ATH9K_SUPPORT_PCOEM
+		bool "Support chips used in PC OEM cards"
+		depends on PACKAGE_kmod-ath9k
 
-  endif
 endef
 
-define KernelPackage/rt2x00-mmio
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6
-  HIDDEN:=1
-  TITLE+= (MMIO)
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00mmio.ko
+define KernelPackage/ath9k-common
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
+  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath + at DRIVER_11N_SUPPORT + at KERNEL_RELAY
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
 endef
 
-define KernelPackage/rt2x00-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib
-  HIDDEN:=1
-  TITLE+= (PCI)
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt2x00pci)
+define KernelPackage/ath9k-htc
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 802.11n USB device support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
+  DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
+  AUTOLOAD:=$(call AutoProbe,ath9k_htc)
 endef
 
-define KernelPackage/rt2x00-usb
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
-  HIDDEN:=1
-  TITLE+= (USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko
-  AUTOLOAD:=$(call AutoProbe,rt2x00usb)
+define KernelPackage/ath9k-htc/description
+This module adds support for wireless adapters based on
+Atheros USB AR9271 and AR7010 family of chipsets.
 endef
 
-define KernelPackage/rt2800-lib
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt + at DRIVER_11N_SUPPORT
-  HIDDEN:=1
-  TITLE+= (rt2800 LIB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko
-endef
 
-define KernelPackage/rt2400-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
-  TITLE+= (RT2400 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt2400pci)
-endef
+PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware
+PKG_ATH10K_LINUX_FIRMWARE_VERSION:=b46f3e01a6c1f9150fb4612ef53611d714565842
+PKG_ATH10K_LINUX_FIRMWARE_SOURCE:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION).tar.bz2
+PKG_ATH10K_LINUX_FIRMWARE_PROTO:=git
+PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git
+PKG_ATH10K_LINUX_FIRMWARE_SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION)
+#PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM:=?
 
-define KernelPackage/rt2500-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
-  TITLE+= (RT2500 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt2500pci)
+define Download/ath10k-firmware
+  FILE:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE)
+  URL:=$(PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL)
+  PROTO:=$(PKG_ATH10K_LINUX_FIRMWARE_PROTO)
+  VERSION:=$(PKG_ATH10K_LINUX_FIRMWARE_VERSION)
+  SUBDIR:=$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)
+  #MIRROR_MD5SUM:=$(PKG_ATH10K_LINUX_FIRMWARE_MIRROR_MD5SUM)
 endef
+$(eval $(call Download,ath10k-firmware))
 
-define KernelPackage/rt2500-usb
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
-  TITLE+= (RT2500 USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko
-  AUTOLOAD:=$(call AutoProbe,rt2500usb)
+define KernelPackage/ath10k
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 802.11ac wireless cards support
+  URL:=https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
+  DEPENDS+= @PCI_SUPPORT +kmod-ath + at DRIVER_11N_SUPPORT
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
+  AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci)
 endef
 
-define KernelPackage/rt61-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
-  TITLE+= (RT2x61 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt61pci)
+define KernelPackage/ath10k/description
+This module adds support for wireless adapters based on
+Atheros IEEE 802.11ac family of chipsets. For now only
+PCI is supported.
 endef
 
-define KernelPackage/rt73-usb
-  $(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
-  TITLE+= (RT73 USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko
-  AUTOLOAD:=$(call AutoProbe,rt73usb)
-endef
+define KernelPackage/ath10k/config
+  if PACKAGE_kmod-ath10k
 
-define KernelPackage/rt2800-mmio
-$(call KernelPackage/rt2x00/Default)
-  TITLE += (RT28xx/RT3xxx MMIO)
-  DEPENDS += +kmod-rt2800-lib +kmod-rt2x00-mmio
-  HIDDEN:=1
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800mmio.ko
-endef
+	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.
 
-define KernelPackage/rt2800-soc
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS += @(TARGET_ramips_rt288x||TARGET_ramips_rt305x||TARGET_ramips_rt3883||TARGET_ramips_mt7620) +kmod-rt2800-mmio +kmod-rt2800-lib
-  TITLE += (RT28xx/RT3xxx SoC)
-  FILES := \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800soc.ko
-  AUTOLOAD:=$(call AutoProbe,rt2800soc)
+  endif
 endef
 
-define KernelPackage/rt2800-pci
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-rt2800-mmio
-  TITLE+= (RT2860 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko
-  AUTOLOAD:=$(call AutoProbe,rt2800pci)
+
+#Broadcom firmware
+ifneq ($(CONFIG_B43_FW_6_30),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=6.30.163.46
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
+  PKG_B43_FWV4_MD5SUM:=6fe97e9368d25342a1ab943d3cf3496d
+else
+ifneq ($(CONFIG_B43_FW_5_10),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=5.10.56.27.3
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
+  PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac
+else
+ifneq ($(CONFIG_B43_FW_4_178),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=4.178.10.4
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
+  PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb
+else
+ifneq ($(CONFIG_B43_FW_5_100_138),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=5.100.138
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
+  PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
+else
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=4.150.10.5
+  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o
+  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
+  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
+  PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60
+endif
+endif
+endif
+endif
+ifneq ($(CONFIG_B43_OPENFIRMWARE),)
+  PKG_B43_FWV4_NAME:=broadcom-wl
+  PKG_B43_FWV4_VERSION:=5.2
+  PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION)
+  PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz
+  PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/
+  PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa
+endif
+
+
+PKG_B43_FWV3_NAME:=wl_apsta
+PKG_B43_FWV3_VERSION:=3.130.20.0
+PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
+PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
+PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
+
+define Download/b43
+  FILE:=$(PKG_B43_FWV4_SOURCE)
+  URL:=$(PKG_B43_FWV4_SOURCE_URL)
+  MD5SUM:=$(PKG_B43_FWV4_MD5SUM)
 endef
+$(eval $(call Download,b43))
 
-define KernelPackage/rt2800-usb
-$(call KernelPackage/rt2x00/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt
-  TITLE+= (RT2870 USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko
-  AUTOLOAD:=$(call AutoProbe,rt2800usb)
+define Download/b43legacy
+  FILE:=$(PKG_B43_FWV3_SOURCE)
+  URL:=$(PKG_B43_FWV3_SOURCE_URL)
+  MD5SUM:=$(PKG_B43_FWV3_MD5SUM)
 endef
+$(eval $(call Download,b43legacy))
 
-define KernelPackage/rtl818x/Default
+
+define KernelPackage/b43
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek Drivers for RTL818x devices
-  URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187
-  DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211
+  TITLE:=Broadcom 43xx wireless support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
+  KCONFIG:= \
+  	CONFIG_HW_RANDOM=y
+  # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb
+  DEPENDS += \
+	@PCI_SUPPORT +kmod-mac80211 \
+	$(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \
+	$(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko
+  AUTOLOAD:=$(call AutoProbe,b43)
+  MENU:=1
 endef
 
-define KernelPackage/rtl8180
-  $(call KernelPackage/rtl818x/Default)
-  DEPENDS+= @PCI_SUPPORT
-  TITLE+= (RTL8180 PCI)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl818x_pci.ko
-  AUTOLOAD:=$(call AutoProbe,rtl818x_pci)
-endef
+define KernelPackage/b43/config
 
-define KernelPackage/rtl8187
-$(call KernelPackage/rtl818x/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-usb-core
-  TITLE+= (RTL8187 USB)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8187)
-endef
+config PACKAGE_B43_USE_SSB
+	select PACKAGE_kmod-ssb
+	tristate
+	depends on !TARGET_brcm47xx && !TARGET_brcm63xx
+	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
+	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB
 
-define KernelPackage/rtlwifi/config
-	config PACKAGE_RTLWIFI_DEBUG
-		bool "Realtek wireless debugging"
-		depends on PACKAGE_kmod-rtlwifi
+config PACKAGE_B43_USE_BCMA
+	select PACKAGE_kmod-bcma
+	tristate
+	depends on !TARGET_brcm47xx && !TARGET_bcm53xx
+	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
+	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA
+
+  if PACKAGE_kmod-b43
+
+	choice
+		prompt "b43 firmware version"
+		default B43_FW_5_100_138
 		help
-		  Say Y, if you want to debug realtek wireless drivers.
+		  This option allows you to select the version of the b43 firmware.
 
-endef
+	config B43_FW_4_150
+		bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)"
+		help
+		  Old stable firmware for BCM43xx devices.
 
-define KernelPackage/rtlwifi
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek common driver part
-  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 + at DRIVER_11N_SUPPORT
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtlwifi.ko
-  HIDDEN:=1
-endef
+		  If unsure, select this.
 
-define KernelPackage/rtlwifi-pci
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek common driver part (PCI support)
-  DEPENDS+= @PCI_SUPPORT +kmod-rtlwifi
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_pci.ko
-  AUTOLOAD:=$(call AutoProbe,rtl_pci)
-  HIDDEN:=1
-endef
+	config B43_FW_4_178
+		bool "Firmware 478.104 from driver 4.178.10.4"
+		help
+		  Older firmware for BCM43xx devices.
 
-define KernelPackage/rtlwifi-usb
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek common driver part (USB support)
-  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-rtlwifi
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_usb.ko
-  AUTOLOAD:=$(call AutoProbe,rtl_usb)
-  HIDDEN:=1
-endef
+		  If unsure, select the "stable" firmware.
 
-define KernelPackage/rtl8192c-common
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192CE/RTL8192CU common support module
-  DEPENDS+= +kmod-rtlwifi
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
-  HIDDEN:=1
-endef
+	config B43_FW_5_10
+		bool "Firmware 508.1084 from driver 5.10.56.27"
+		help
+		  Older firmware for BCM43xx devices.
+
+		  If unsure, select the "stable" firmware.
+
+	config B43_FW_5_100_138
+		bool "Firmware 666.2 from driver 5.100.138 (stable)"
+		help
+		  The currently default firmware for BCM43xx devices.
+
+		  This firmware currently gets most of the testing and is needed for some N-PHY devices.
+
+		  If unsure, select the this firmware.
+
+	config B43_FW_6_30
+		bool "Firmware 784.2 from driver 6.30.163.46 (experimental)"
+		help
+		  Newer experimental firmware for BCM43xx devices.
+
+		  This firmware is mostly untested.
+
+		  If unsure, select the "stable" firmware.
+
+	config B43_OPENFIRMWARE
+		bool "Open FirmWare for WiFi networks"
+		help
+		  Opensource firmware for BCM43xx devices.
+
+		  Do _not_ select this, unless you know what you are doing.
+		  The Opensource firmware is not suitable for embedded devices, yet.
+		  It does not support QoS, which is bad for AccessPoints.
+		  It does not support hardware crypto acceleration, which is a showstopper
+		  for embedded devices with low CPU resources.
+
+		  If unsure, select the "stable" firmware.
+
+	endchoice
+
+	config B43_FW_SQUASH
+		bool "Remove unnecessary firmware files"
+		depends on !B43_OPENFIRMWARE
+		default y
+		help
+		  This options allows you to remove unnecessary b43 firmware files
+		  from the final rootfs image. This can reduce the rootfs size by
+		  up to 200k.
+
+		  If unsure, say Y.
+
+	config B43_FW_SQUASH_COREREVS
+		string "Core revisions to include"
+		depends on B43_FW_SQUASH
+		default "5,6,7,8,9,10,11,13,15" if TARGET_brcm47xx_legacy
+		default "16,28,29,30" if TARGET_brcm47xx_mips74k
+		default "5,6,7,8,9,10,11,13,15,16,28,29,30"
+		help
+		  This is a comma seperated list of core revision numbers.
+
+		  Example (keep files for rev5 only):
+		    5
+
+		  Example (keep files for rev5 and rev11):
+		    5,11
+
+	config B43_FW_SQUASH_PHYTYPES
+		string "PHY types to include"
+		depends on B43_FW_SQUASH
+		default "G,N,LP" if TARGET_brcm47xx_legacy
+		default "N,HT" if TARGET_brcm47xx_mips74k
+		default "G,N,LP,HT"
+		help
+		  This is a comma seperated list of PHY types:
+		    A  => A-PHY
+		    AG => Dual A-PHY G-PHY
+		    G  => G-PHY
+		    LP => LP-PHY
+		    N  => N-PHY
+		    HT  => HT-PHY
+		    LCN  => LCN-PHY
+		    LCN40  => LCN40-PHY
+		    AC  => AC-PHY
+
+		  Example (keep files for G-PHY only):
+		    G
+
+		  Example (keep files for G-PHY and N-PHY):
+		    G,N
+
+	choice
+		prompt "Supported buses"
+		default PACKAGE_B43_BUSES_BCMA_AND_SSB
+		help
+		  This allows choosing buses that b43 should support.
+
+	config PACKAGE_B43_BUSES_BCMA_AND_SSB
+		depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
+		bool "BCMA and SSB"
+
+	config PACKAGE_B43_BUSES_BCMA
+		depends on !TARGET_brcm47xx_legacy
+		bool "BCMA only"
+
+	config PACKAGE_B43_BUSES_SSB
+		depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
+		bool "SSB only"
+
+	endchoice
+
+	config PACKAGE_B43_DEBUG
+		bool "Enable debug output and debugfs for b43"
+		default n
+		help
+		  Enable additional debug output and runtime sanity checks for b43
+		  and enables the debugfs interface.
+
+		  If unsure, say N.
+
+	config PACKAGE_B43_PIO
+		bool "Enable support for PIO transfer mode"
+		default n
+		help
+		  Enable support for using PIO instead of DMA. Unless you have DMA
+		  transfer problems you don't need this.
+
+		  If unsure, say N.
+
+	config PACKAGE_B43_PHY_G
+		bool "Enable support for G-PHYs"
+		default n if TARGET_brcm47xx_mips74k
+		default y
+		help
+		  Enable support for G-PHY. This includes support for the following devices:
+		  PCI: BCM4306, BCM4311, BCM4318
+		  SoC: BCM5352E, BCM4712
+
+		  If unsure, say Y.
+
+	config PACKAGE_B43_PHY_N
+		bool "Enable support for N-PHYs"
+		default y
+		help
+		  Enable support for N-PHY. This includes support for the following devices:
+		  PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225
+		  SoC: BCM4716, BCM4717, BCM4718
 
-define KernelPackage/rtl8192ce
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192CE/RTL8188CE support
-  DEPENDS+= +kmod-rtlwifi-pci +kmod-rtl8192c-common
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192ce.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8192ce)
-endef
+		  Currently only 11g speed is available.
 
-define KernelPackage/rtl8192ce/install
-	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfw.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU_B.bin $(1)/lib/firmware/rtlwifi
-endef
+		  If unsure, say Y.
 
-define KernelPackage/rtl8192se
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192SE/RTL8191SE support
-  DEPENDS+= +kmod-rtlwifi-pci
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192se/rtl8192se.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8192se)
-endef
+	config PACKAGE_B43_PHY_LP
+		bool "Enable support for LP-PHYs"
+		default n if TARGET_brcm47xx_mips74k
+		default y
+		help
+		  Enable support for LP-PHY. This includes support for the following devices:
+		  PCI: BCM4312
+		  SoC: BCM5354
 
-define KernelPackage/rtl8192se/install
-	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192sefw.bin $(1)/lib/firmware/rtlwifi
-endef
+		  If unsure, say Y.
 
-define KernelPackage/rtl8192de
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192DE/RTL8188DE support
-  DEPENDS+= +kmod-rtlwifi-pci
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192de/rtl8192de.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8192de)
-endef
+	config PACKAGE_B43_PHY_HT
+		bool "Enable support for HT-PHYs"
+		default n if TARGET_brcm47xx_legacy
+		default y
+		help
+		  Enable support for HT-PHY. This includes support for the following devices:
+		  PCI: BCM4331
 
-define KernelPackage/rtl8192de/install
-	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192defw.bin $(1)/lib/firmware/rtlwifi
-endef
+		  Currently only 11g speed is available.
 
-define KernelPackage/rtl8192cu
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Realtek RTL8192CU/RTL8188CU support
-  DEPENDS+= +kmod-rtlwifi-usb +kmod-rtl8192c-common
-  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
-  AUTOLOAD:=$(call AutoProbe,rtl8192cu)
-endef
+		  If unsure, say Y.
 
-define KernelPackage/rtl8192cu/install
-	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_A.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_B.bin $(1)/lib/firmware/rtlwifi
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_TMSC.bin $(1)/lib/firmware/rtlwifi
-endef
+	config PACKAGE_B43_PHY_LCN
+		bool "Enable support for LCN-PHYs"
+		depends on BROKEN
+		default n
+		help
+		  Currently broken.
 
-ZD1211FW_NAME:=zd1211-firmware
-ZD1211FW_VERSION:=1.4
-define Download/zd1211rw
-  FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
-  URL:=@SF/zd1211/
-  MD5SUM:=19f28781d76569af8551c9d11294c870
+		  If unsure, say N.
+
+  endif
 endef
-$(eval $(call Download,zd1211rw))
 
-define KernelPackage/zd1211rw
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Zydas ZD1211 support
-  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko
-  AUTOLOAD:=$(call AutoProbe,zd1211rw)
+define KernelPackage/b43/description
+Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
 endef
 
-define KernelPackage/adm8211
+define KernelPackage/b43legacy
   $(call KernelPackage/mac80211/Default)
-  TITLE:=ADMTek 8211 support
-  DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/adm8211.ko
-  AUTOLOAD:=$(call AutoProbe,adm8211)
+  TITLE:=Broadcom 43xx-legacy wireless support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
+  KCONFIG:= \
+  	CONFIG_HW_RANDOM=y
+  DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko
+  AUTOLOAD:=$(call AutoProbe,b43legacy)
+  MENU:=1
 endef
 
-define KernelPackage/ath/config
-  if PACKAGE_kmod-ath
-	config ATH_USER_REGD
-		bool "Force Atheros drivers to respect the user's regdomain settings"
+define KernelPackage/b43legacy/config
+  if PACKAGE_kmod-b43legacy
+
+	config B43LEGACY_FW_SQUASH
+		bool "Remove unnecessary firmware files"
+		default y
 		help
-		  Atheros' idea of regulatory handling is that the EEPROM of the card defines
-		  the regulatory limits and the user is only allowed to restrict the settings
-		  even further, even if the country allows frequencies or power levels that
-		  are forbidden by the EEPROM settings.
+		  This options allows you to remove unnecessary b43legacy firmware files
+		  from the final rootfs image. This can reduce the rootfs size by
+		  up to 50k.
 
-		  Select this option if you want the driver to respect the user's decision about
-		  regulatory settings.
+		  If unsure, say Y.
 
-	config PACKAGE_ATH_DEBUG
-		bool "Atheros wireless debugging"
+	config B43LEGACY_FW_SQUASH_COREREVS
+		string "Core revisions to include"
+		depends on B43LEGACY_FW_SQUASH
+		default "1,2,3,4"
 		help
-		  Say Y, if you want to debug atheros wireless drivers.
-		  Only ath9k & ath10k make use of this.
+		  This is a comma seperated list of core revision numbers.
 
-	config PACKAGE_ATH_DFS
-		bool "Enable DFS support"
-		default y
-		help
-		  Dynamic frequency selection (DFS) is required for most of the 5 GHz band
-		  channels in Europe, US, and Japan.
+		  Example (keep files for rev4 only):
+		    4
 
-		  Select this option if you want to use such channels.
+		  Example (keep files for rev2 and rev4):
+		    2,4
 
   endif
 endef
 
-define KernelPackage/ath
+define KernelPackage/b43legacy/description
+Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
+endef
+
+
+define KernelPackage/brcmutil
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros common driver part
-  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath25 +kmod-mac80211
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
+  TITLE:=Broadcom IEEE802.11n common driver parts
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
+  DEPENDS+=@PCI_SUPPORT||USB_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko
+  AUTOLOAD:=$(call AutoProbe,brcmutil)
   MENU:=1
 endef
 
-define KernelPackage/ath/description
- This module contains some common parts needed by Atheros Wireless drivers.
+define KernelPackage/brcmutil/description
+ This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac.
 endef
 
-define KernelPackage/ath5k
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 5xxx wireless cards support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k
-  DEPENDS+= @PCI_SUPPORT||@TARGET_ath25 +kmod-ath
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
-  AUTOLOAD:=$(call AutoProbe,ath5k)
-endef
+define KernelPackage/brcmutil/config
+  if PACKAGE_kmod-brcmutil
 
-define KernelPackage/ath5k/description
- This module adds support for wireless adapters based on
- Atheros 5xxx chipset.
+	config PACKAGE_BRCM80211_DEBUG
+		bool "Broadcom wireless driver debugging"
+		help
+		  Say Y, if you want to debug brcmsmac and brcmfmac wireless driver.
+
+  endif
 endef
 
-define KernelPackage/ath9k-common
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
-  DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath + at DRIVER_11N_SUPPORT + at KERNEL_RELAY
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
+PKG_BRCMSMAC_FW_NAME:=broadcom-wl
+PKG_BRCMSMAC_FW_VERSION:=5.100.138
+PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o
+PKG_BRCMSMAC_FW_SOURCE:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION).tar.bz2
+PKG_BRCMSMAC_FW_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
+PKG_BRCMSMAC_FW_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
+
+define Download/brcmsmac
+  FILE:=$(PKG_BRCMSMAC_FW_SOURCE)
+  URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL)
+  MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM)
 endef
+$(eval $(call Download,brcmsmac))
 
-define KernelPackage/ath9k
+define KernelPackage/brcmsmac
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 802.11n PCI wireless cards support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
-  DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
-  AUTOLOAD:=$(call AutoProbe,ath9k)
+  TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT +!TARGET_brcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko
+  AUTOLOAD:=$(call AutoProbe,brcmsmac)
+  MENU:=1
 endef
 
-define KernelPackage/ath9k/description
-This module adds support for wireless adapters based on
-Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
+define KernelPackage/brcmsmac/description
+ Kernel module for Broadcom IEEE802.11n PCIe Wireless cards
 endef
 
-define KernelPackage/ath9k/config
+define KernelPackage/brcmsmac/config
+  if PACKAGE_kmod-brcmsmac
 
-	config ATH9K_SUPPORT_PCOEM
-		bool "Support chips used in PC OEM cards"
-		depends on PACKAGE_kmod-ath9k
-	
-endef
+	config BRCMSMAC_USE_FW_FROM_WL
+		bool "Use firmware extracted from broadcom proprietary driver"
+		default y
+		help
+		  Instead of using the official brcmsmac firmware a firmware
+		  version 666.2 extracted from the proprietary Broadcom driver
+		  is used. This is needed to get core rev 17 used in bcm4716
+		  to work.
 
-define KernelPackage/ath9k-htc
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 802.11n USB device support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
-  DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
-  AUTOLOAD:=$(call AutoProbe,ath9k_htc)
-endef
+		  If unsure, say Y.
 
-define KernelPackage/ath9k-htc/description
-This module adds support for wireless adapters based on
-Atheros USB AR9271 and AR7010 family of chipsets.
+  endif
 endef
 
-define KernelPackage/ath10k
+
+define KernelPackage/brcmfmac
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Atheros 802.11ac wireless cards support
-  URL:=https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
-  DEPENDS+= @PCI_SUPPORT +kmod-ath + at DRIVER_11N_SUPPORT
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
-  AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci)
+  TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
+  DEPENDS+= @USB_SUPPORT +kmod-cfg80211 + at DRIVER_11N_SUPPORT +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_USB:kmod-usb-core
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko
+  AUTOLOAD:=$(call AutoProbe,brcmfmac)
 endef
 
-define KernelPackage/ath10k/description
-This module adds support for wireless adapters based on
-Atheros IEEE 802.11ac family of chipsets. For now only
-PCI is supported.
+define KernelPackage/brcmfmac/description
+ Kernel module for Broadcom IEEE802.11n USB Wireless cards
 endef
 
-define KernelPackage/ath10k/config
-  if PACKAGE_kmod-ath10k
+define KernelPackage/brcmfmac/config
+  if PACKAGE_kmod-brcmfmac
 
-	config ATH10K_API2_FW
-		bool "Firmware optimized for AP operation (v10.1 / API v2)"
+	config BRCMFMAC_SDIO
+		bool "Enable SDIO bus interface support"
 		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.
+		  Enable support for cards attached to an SDIO bus.
+		  Select this option only if you are sure that your
+		  board has a Broadcom wireless chip atacched to
+		  that bus.
+
+	config BRCMFMAC_USB
+		bool "Enable USB bus interface support"
+		depends on USB_SUPPORT
+		default y
+		help
+		  Supported USB connected chipsets:
+		  BCM43235, BCM43236, BCM43238 (all in revision 3 only)
+		  BCM43143, BCM43242, BCM43566, BCM43569
+
+	config BRCMFMAC_PCIE
+		bool "Enable PCIE bus interface support"
+		depends on PCI_SUPPORT
+		default y
+		help
+		  Supported PCIe connected chipsets:
+		  BCM4354, BCM4356, BCM43567, BCM43570, BCM43602
 
   endif
 endef
 
+
 define KernelPackage/carl9170
   $(call KernelPackage/mac80211/Default)
   TITLE:=Driver for Atheros AR9170 USB sticks
@@ -641,81 +793,56 @@ define KernelPackage/carl9170
   AUTOLOAD:=$(call AutoProbe,carl9170)
 endef
 
-define KernelPackage/lib80211
+
+define KernelPackage/hermes
   $(call KernelPackage/mac80211/Default)
-  TITLE:=802.11 Networking stack
-  DEPENDS:=+kmod-cfg80211
-  FILES:= \
-	$(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
-	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
-	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
-	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
-  AUTOLOAD:=$(call AutoProbe, \
-	lib80211 \
-	lib80211_crypt_wep \
-	lib80211_crypt_ccmp \
-	lib80211_crypt_tkip \
-  )
+  TITLE:=Hermes 802.11b chipset support
+  DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 + at DRIVER_WEXT_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko
+  AUTOLOAD:=$(call AutoProbe,orinoco)
 endef
 
-define KernelPackage/lib80211/description
- Kernel modules for 802.11 Networking stack
- Includes:
- - lib80211
- - lib80211_crypt_wep
- - lib80211_crypt_tkip
- - lib80211_crytp_ccmp
+define KernelPackage/hermes/description
+ Kernel support for Hermes 802.11b chipsets
 endef
 
-define KernelPackage/libertas-usb
+define KernelPackage/hermes-pci
   $(call KernelPackage/mac80211/Default)
-  DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 + at DRIVER_WEXT_SUPPORT
-  TITLE:=Marvell 88W8015 Wireless Driver
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko
-  AUTOLOAD:=$(call AutoProbe,libertas usb8xxx)
+  TITLE:=Intersil Prism 2.5 PCI support
+  DEPENDS:=@PCI_SUPPORT +kmod-hermes
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko
+  AUTOLOAD:=$(call AutoProbe,orinoco_pci)
 endef
 
-define KernelPackage/libertas-sdio
-  $(call KernelPackage/mac80211/Default)
-  DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc + at DRIVER_WEXT_SUPPORT @!TARGET_uml
-  TITLE:=Marvell 88W8686 Wireless Driver
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko
-  AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio)
+define KernelPackage/hermes-pci/description
+ Kernel modules for Intersil Prism 2.5 PCI support
 endef
 
-define KernelPackage/mac80211-hwsim
+define KernelPackage/hermes-pcmcia
   $(call KernelPackage/mac80211/Default)
-  TITLE:=mac80211 HW simulation device
-  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
-  AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
+  TITLE:=Hermes based PCMCIA adaptors
+  DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes @BROKEN
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko
+  AUTOLOAD:=$(call AutoProbe,orinoco_cs)
 endef
 
-PKG_MT7601U_FW_NAME:=DPO_MT7601U_LinuxSTA
-PKG_MT7601U_FW_VERSION:=3.0.0.4_20130913
-PKG_MT7601U_FW_MD5SUM:=5f440dccc8bc952745a191994fc34699
-PKG_MT7601U_FW_SOURCE:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION).tar.bz2
-PKG_MT7601U_FW_SOURCE_URL:=http://www.mediatek.com/AmazonS3/Downloads/linux/
-define Download/mt7601u-firmware
-  FILE:=$(PKG_MT7601U_FW_SOURCE)
-  URL:=$(PKG_MT7601U_FW_SOURCE_URL)
-  MD5SUM:=$(PKG_MT7601U_FW_MD5SUM)
-  SUBDIR:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)
+define KernelPackage/hermes-pcmcia/description
+ Kernel modules for Hermes based PCMCIA adaptors
 endef
-$(eval $(call Download,mt7601u-firmware))
 
-define KernelPackage/mt7601u
+define KernelPackage/hermes-plx
   $(call KernelPackage/mac80211/Default)
-  TITLE:=MT7601U-based USB dongles Wireless Driver
-  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
-  AUTOLOAD:=$(call AutoProbe,mt7601)
+  TITLE:=PLX9052 based PCI adaptor
+  DEPENDS:=@PCI_SUPPORT +kmod-hermes
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko
+  AUTOLOAD:=$(call AutoProbe,orinoco_plx)
+endef
+
+define KernelPackage/hermes-plx/description
+ Kernel modules for Hermes in PLX9052 based PCI adaptors
 endef
 
+
 define KernelPackage/libipw
   $(call KernelPackage/mac80211/Default)
   TITLE:=libipw for ipw2100 and ipw2200
@@ -777,54 +904,6 @@ define KernelPackage/ipw2200/description
 endef
 
 
-define KernelPackage/hermes
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Hermes 802.11b chipset support
-  DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 + at DRIVER_WEXT_SUPPORT
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko
-  AUTOLOAD:=$(call AutoProbe,orinoco)
-endef
-
-define KernelPackage/hermes/description
- Kernel support for Hermes 802.11b chipsets
-endef
-
-define KernelPackage/hermes-pci
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Intersil Prism 2.5 PCI support
-  DEPENDS:=@PCI_SUPPORT +kmod-hermes
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko
-  AUTOLOAD:=$(call AutoProbe,orinoco_pci)
-endef
-
-define KernelPackage/hermes-pci/description
- Kernel modules for Intersil Prism 2.5 PCI support
-endef
-
-define KernelPackage/hermes-plx
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=PLX9052 based PCI adaptor
-  DEPENDS:=@PCI_SUPPORT +kmod-hermes
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko
-  AUTOLOAD:=$(call AutoProbe,orinoco_plx)
-endef
-
-define KernelPackage/hermes-plx/description
- Kernel modules for Hermes in PLX9052 based PCI adaptors
-endef
-
-define KernelPackage/hermes-pcmcia
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Hermes based PCMCIA adaptors
-  DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes @BROKEN
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko
-  AUTOLOAD:=$(call AutoProbe,orinoco_cs)
-endef
-
-define KernelPackage/hermes-pcmcia/description
- Kernel modules for Hermes based PCMCIA adaptors
-endef
-
 define KernelPackage/iwlagn
   $(call KernelPackage/mac80211/Default)
   DEPENDS:= +kmod-mac80211 @PCI_SUPPORT + at DRIVER_11N_SUPPORT
@@ -1028,20 +1107,99 @@ define KernelPackage/iwl3945
   AUTOLOAD:=$(call AutoProbe,iwl3945)
 endef
 
-define KernelPackage/iwl3945/description
- iwl3945 kernel module for Intel 3945 support
-endef
+define KernelPackage/iwl3945/description
+ iwl3945 kernel module for Intel 3945 support
+endef
+
+define KernelPackage/iwl4965
+  $(call KernelPackage/mac80211/Default)
+  DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy + at DRIVER_11N_SUPPORT
+  TITLE:=Intel iwl4965 Wireless support
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl4965.ko
+  AUTOLOAD:=$(call AutoProbe,iwl4965)
+endef
+
+define KernelPackage/iwl4965/description
+ iwl4965 kernel module for Intel 4965 support
+endef
+
+
+define KernelPackage/lib80211
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=802.11 Networking stack
+  DEPENDS:=+kmod-cfg80211
+  FILES:= \
+	$(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
+	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
+	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
+	$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
+  AUTOLOAD:=$(call AutoProbe, \
+	lib80211 \
+	lib80211_crypt_wep \
+	lib80211_crypt_ccmp \
+	lib80211_crypt_tkip \
+  )
+endef
+
+define KernelPackage/lib80211/description
+ Kernel modules for 802.11 Networking stack
+ Includes:
+ - lib80211
+ - lib80211_crypt_wep
+ - lib80211_crypt_tkip
+ - lib80211_crytp_ccmp
+endef
+
+
+define KernelPackage/libertas-usb
+  $(call KernelPackage/mac80211/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 + at DRIVER_WEXT_SUPPORT
+  TITLE:=Marvell 88W8015 Wireless Driver
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko
+  AUTOLOAD:=$(call AutoProbe,libertas usb8xxx)
+endef
+
+define KernelPackage/libertas-sdio
+  $(call KernelPackage/mac80211/Default)
+  DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc + at DRIVER_WEXT_SUPPORT @!TARGET_uml
+  TITLE:=Marvell 88W8686 Wireless Driver
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko
+  AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio)
+endef
+
+
+define KernelPackage/mac80211-hwsim
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=mac80211 HW simulation device
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
+  AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
+endef
+
 
-define KernelPackage/iwl4965
-  $(call KernelPackage/mac80211/Default)
-  DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy + at DRIVER_11N_SUPPORT
-  TITLE:=Intel iwl4965 Wireless support
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl4965.ko
-  AUTOLOAD:=$(call AutoProbe,iwl4965)
+PKG_MT7601U_FW_NAME:=DPO_MT7601U_LinuxSTA
+PKG_MT7601U_FW_VERSION:=3.0.0.4_20130913
+PKG_MT7601U_FW_MD5SUM:=5f440dccc8bc952745a191994fc34699
+PKG_MT7601U_FW_SOURCE:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION).tar.bz2
+PKG_MT7601U_FW_SOURCE_URL:=http://www.mediatek.com/AmazonS3/Downloads/linux/
+define Download/mt7601u-firmware
+  FILE:=$(PKG_MT7601U_FW_SOURCE)
+  URL:=$(PKG_MT7601U_FW_SOURCE_URL)
+  MD5SUM:=$(PKG_MT7601U_FW_MD5SUM)
+  SUBDIR:=$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)
 endef
+$(eval $(call Download,mt7601u-firmware))
 
-define KernelPackage/iwl4965/description
- iwl4965 kernel module for Intel 4965 support
+define KernelPackage/mt7601u
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=MT7601U-based USB dongles Wireless Driver
+  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
+  AUTOLOAD:=$(call AutoProbe,mt7601)
 endef
 
 
@@ -1075,527 +1233,398 @@ define KernelPackage/mwifiex-pcie/description
 endef
 
 
-define KernelPackage/wlcore
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=TI common driver part
-  DEPENDS+= @TARGET_omap +kmod-mac80211 + at DRIVER_11N_SUPPORT
-  FILES:= \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
-	$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
-  AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio)
-endef
-
-define KernelPackage/wlcore/description
- This module contains some common parts needed by TI Wireless drivers.
-endef
-
-define KernelPackage/wl12xx
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Driver for TI WL12xx
-  URL:=http://wireless.kernel.org/en/users/Drivers/wl12xx
-  DEPENDS+= +kmod-wlcore
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko
-  AUTOLOAD:=$(call AutoProbe,wl12xx)
-endef
-
-define KernelPackage/wl12xx/description
- Kernel modules for TI WL12xx
-endef
-
-define KernelPackage/wl18xx
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Driver for TI WL18xx
-  URL:=http://wireless.kernel.org/en/users/Drivers/wl18xx
-  DEPENDS+= +kmod-wlcore
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko
-  AUTOLOAD:=$(call AutoProbe,wl18xx)
-endef
-
-define KernelPackage/wl18xx/description
- Kernel modules for TI WL18xx
-endef
-
-
-#Broadcom firmware
-ifneq ($(CONFIG_B43_FW_6_30),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=6.30.163.46
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
-  PKG_B43_FWV4_MD5SUM:=6fe97e9368d25342a1ab943d3cf3496d
-else
-ifneq ($(CONFIG_B43_FW_5_10),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=5.10.56.27.3
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-  PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac
-else
-ifneq ($(CONFIG_B43_FW_4_178),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=4.178.10.4
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-  PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb
-else
-ifneq ($(CONFIG_B43_FW_5_100_138),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=5.100.138
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
-  PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
-else
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=4.150.10.5
-  PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o
-  PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
-  PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-  PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60
-endif
-endif
-endif
-endif
-ifneq ($(CONFIG_B43_OPENFIRMWARE),)
-  PKG_B43_FWV4_NAME:=broadcom-wl
-  PKG_B43_FWV4_VERSION:=5.2
-  PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION)
-  PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz
-  PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/
-  PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa
-endif
-
-
-PKG_B43_FWV3_NAME:=wl_apsta
-PKG_B43_FWV3_VERSION:=3.130.20.0
-PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
-PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
-PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
-
-define Download/b43
-  FILE:=$(PKG_B43_FWV4_SOURCE)
-  URL:=$(PKG_B43_FWV4_SOURCE_URL)
-  MD5SUM:=$(PKG_B43_FWV4_MD5SUM)
-endef
-$(eval $(call Download,b43))
-
-define Download/b43legacy
-  FILE:=$(PKG_B43_FWV3_SOURCE)
-  URL:=$(PKG_B43_FWV3_SOURCE_URL)
-  MD5SUM:=$(PKG_B43_FWV3_MD5SUM)
-endef
-$(eval $(call Download,b43legacy))
-
-
-define KernelPackage/b43
-  $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom 43xx wireless support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
-  KCONFIG:= \
-  	CONFIG_HW_RANDOM=y
-  # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb
-  DEPENDS += \
-	@PCI_SUPPORT +kmod-mac80211 \
-	$(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \
-	$(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma)
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko
-  AUTOLOAD:=$(call AutoProbe,b43)
-  MENU:=1
-endef
-
-define KernelPackage/b43/config
-
-config PACKAGE_B43_USE_SSB
-	select PACKAGE_kmod-ssb
-	tristate
-	depends on !TARGET_brcm47xx && !TARGET_brcm63xx
-	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
-	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB
-
-config PACKAGE_B43_USE_BCMA
-	select PACKAGE_kmod-bcma
-	tristate
-	depends on !TARGET_brcm47xx && !TARGET_bcm53xx
-	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
-	default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA
-
-  if PACKAGE_kmod-b43
-
-	choice
-		prompt "b43 firmware version"
-		default B43_FW_5_100_138
-		help
-		  This option allows you to select the version of the b43 firmware.
-
-	config B43_FW_4_150
-		bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)"
-		help
-		  Old stable firmware for BCM43xx devices.
-
-		  If unsure, select this.
-
-	config B43_FW_4_178
-		bool "Firmware 478.104 from driver 4.178.10.4"
-		help
-		  Older firmware for BCM43xx devices.
-
-		  If unsure, select the "stable" firmware.
-
-	config B43_FW_5_10
-		bool "Firmware 508.1084 from driver 5.10.56.27"
-		help
-		  Older firmware for BCM43xx devices.
-
-		  If unsure, select the "stable" firmware.
-
-	config B43_FW_5_100_138
-		bool "Firmware 666.2 from driver 5.100.138 (stable)"
-		help
-		  The currently default firmware for BCM43xx devices.
-
-		  This firmware currently gets most of the testing and is needed for some N-PHY devices.
-
-		  If unsure, select the this firmware.
-
-	config B43_FW_6_30
-		bool "Firmware 784.2 from driver 6.30.163.46 (experimental)"
-		help
-		  Newer experimental firmware for BCM43xx devices.
-
-		  This firmware is mostly untested.
-
-		  If unsure, select the "stable" firmware.
-
-	config B43_OPENFIRMWARE
-		bool "Open FirmWare for WiFi networks"
-		help
-		  Opensource firmware for BCM43xx devices.
-
-		  Do _not_ select this, unless you know what you are doing.
-		  The Opensource firmware is not suitable for embedded devices, yet.
-		  It does not support QoS, which is bad for AccessPoints.
-		  It does not support hardware crypto acceleration, which is a showstopper
-		  for embedded devices with low CPU resources.
-
-		  If unsure, select the "stable" firmware.
-
-	endchoice
+# Prism54 drivers
+P54PCIFW:=2.13.12.0.arm
+P54USBFW:=2.13.24.0.lm87.arm
+P54SPIFW:=2.13.0.0.a.13.14.arm
 
-	config B43_FW_SQUASH
-		bool "Remove unnecessary firmware files"
-		depends on !B43_OPENFIRMWARE
-		default y
-		help
-		  This options allows you to remove unnecessary b43 firmware files
-		  from the final rootfs image. This can reduce the rootfs size by
-		  up to 200k.
+define Download/p54usb
+  FILE:=$(P54USBFW)
+  URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb
+  MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6
+endef
+$(eval $(call Download,p54usb))
 
-		  If unsure, say Y.
+define Download/p54pci
+  FILE:=$(P54PCIFW)
+  URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac
+  MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4
+endef
+$(eval $(call Download,p54pci))
 
-	config B43_FW_SQUASH_COREREVS
-		string "Core revisions to include"
-		depends on B43_FW_SQUASH
-		default "5,6,7,8,9,10,11,13,15" if TARGET_brcm47xx_legacy
-		default "16,28,29,30" if TARGET_brcm47xx_mips74k
-		default "5,6,7,8,9,10,11,13,15,16,28,29,30"
-		help
-		  This is a comma seperated list of core revision numbers.
+define Download/p54spi
+  FILE:=$(P54SPIFW)
+  URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560
+  MD5SUM:=42661f8ecbadd88012807493f596081d
+endef
+$(eval $(call Download,p54spi))
 
-		  Example (keep files for rev5 only):
-		    5
+define KernelPackage/p54/Default
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Prism54 Drivers
+endef
 
-		  Example (keep files for rev5 and rev11):
-		    5,11
+define KernelPackage/p54/description
+  Kernel module for Prism54 chipsets (mac80211)
+endef
 
-	config B43_FW_SQUASH_PHYTYPES
-		string "PHY types to include"
-		depends on B43_FW_SQUASH
-		default "G,N,LP" if TARGET_brcm47xx_legacy
-		default "N,HT" if TARGET_brcm47xx_mips74k
-		default "G,N,LP,HT"
-		help
-		  This is a comma seperated list of PHY types:
-		    A  => A-PHY
-		    AG => Dual A-PHY G-PHY
-		    G  => G-PHY
-		    LP => LP-PHY
-		    N  => N-PHY
-		    HT  => HT-PHY
-		    LCN  => LCN-PHY
-		    LCN40  => LCN40-PHY
-		    AC  => AC-PHY
+define KernelPackage/p54-common
+  $(call KernelPackage/p54/Default)
+  DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt
+  TITLE+= (COMMON)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko
+endef
 
-		  Example (keep files for G-PHY only):
-		    G
+define KernelPackage/p54-pci
+  $(call KernelPackage/p54/Default)
+  TITLE+= (PCI)
+  DEPENDS+= @PCI_SUPPORT +kmod-p54-common
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko
+  AUTOLOAD:=$(call AutoProbe,p54pci)
+endef
 
-		  Example (keep files for G-PHY and N-PHY):
-		    G,N
+define KernelPackage/p54-usb
+  $(call KernelPackage/p54/Default)
+  TITLE+= (USB)
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko
+  AUTOLOAD:=$(call AutoProbe,p54usb)
+endef
 
-	choice
-		prompt "Supported buses"
-		default PACKAGE_B43_BUSES_BCMA_AND_SSB
-		help
-		  This allows choosing buses that b43 should support.
+define KernelPackage/p54-spi
+  $(call KernelPackage/p54/Default)
+  TITLE+= (SPI)
+  DEPENDS+= @TARGET_omap24xx +kmod-p54-common
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko
+  AUTOLOAD:=$(call AutoProbe,p54spi)
+endef
 
-	config PACKAGE_B43_BUSES_BCMA_AND_SSB
-		depends on !TARGET_brcm47xx_legacy && !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
-		bool "BCMA and SSB"
 
-	config PACKAGE_B43_BUSES_BCMA
-		depends on !TARGET_brcm47xx_legacy
-		bool "BCMA only"
+define KernelPackage/rt2x00/Default
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Ralink Drivers for RT2x00 cards
+endef
 
-	config PACKAGE_B43_BUSES_SSB
-		depends on !TARGET_brcm47xx_mips74k && !TARGET_bcm53xx
-		bool "SSB only"
+define KernelPackage/rt2x00-lib
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t
+  TITLE+= (LIB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko
+  MENU:=1
+endef
 
-	endchoice
+define KernelPackage/rt2x00-lib/config
+  if PACKAGE_kmod-rt2x00-lib
 
-	config PACKAGE_B43_DEBUG
-		bool "Enable debug output and debugfs for b43"
-		default n
+	config PACKAGE_RT2X00_LIB_DEBUGFS
+		bool "Enable rt2x00 debugfs support"
+		depends on PACKAGE_MAC80211_DEBUGFS
 		help
-		  Enable additional debug output and runtime sanity checks for b43
-		  and enables the debugfs interface.
-
-		  If unsure, say N.
+		  Enable creation of debugfs files for the rt2x00 drivers.
+		  These debugfs files support both reading and writing of the
+		  most important register types of the rt2x00 hardware.
 
-	config PACKAGE_B43_PIO
-		bool "Enable support for PIO transfer mode"
-		default n
+	config PACKAGE_RT2X00_DEBUG
+		bool "Enable rt2x00 debug output"
 		help
-		  Enable support for using PIO instead of DMA. Unless you have DMA
-		  transfer problems you don't need this.
-
-		  If unsure, say N.
+		  Enable debugging output for all rt2x00 modules
 
-	config PACKAGE_B43_PHY_G
-		bool "Enable support for G-PHYs"
-		default n if TARGET_brcm47xx_mips74k
-		default y
-		help
-		  Enable support for G-PHY. This includes support for the following devices:
-		  PCI: BCM4306, BCM4311, BCM4318
-		  SoC: BCM5352E, BCM4712
+  endif
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rt2x00-mmio
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6
+  HIDDEN:=1
+  TITLE+= (MMIO)
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00mmio.ko
+endef
 
-	config PACKAGE_B43_PHY_N
-		bool "Enable support for N-PHYs"
-		default y
-		help
-		  Enable support for N-PHY. This includes support for the following devices:
-		  PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225
-		  SoC: BCM4716, BCM4717, BCM4718
+define KernelPackage/rt2x00-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib
+  HIDDEN:=1
+  TITLE+= (PCI)
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt2x00pci)
+endef
 
-		  Currently only 11g speed is available.
+define KernelPackage/rt2x00-usb
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
+  HIDDEN:=1
+  TITLE+= (USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko
+  AUTOLOAD:=$(call AutoProbe,rt2x00usb)
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rt2800-lib
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt + at DRIVER_11N_SUPPORT
+  HIDDEN:=1
+  TITLE+= (rt2800 LIB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko
+endef
 
-	config PACKAGE_B43_PHY_LP
-		bool "Enable support for LP-PHYs"
-		default n if TARGET_brcm47xx_mips74k
-		default y
-		help
-		  Enable support for LP-PHY. This includes support for the following devices:
-		  PCI: BCM4312
-		  SoC: BCM5354
+define KernelPackage/rt2400-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
+  TITLE+= (RT2400 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt2400pci)
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rt2500-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
+  TITLE+= (RT2500 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt2500pci)
+endef
 
-	config PACKAGE_B43_PHY_HT
-		bool "Enable support for HT-PHYs"
-		default n if TARGET_brcm47xx_legacy
-		default y
-		help
-		  Enable support for HT-PHY. This includes support for the following devices:
-		  PCI: BCM4331
+define KernelPackage/rt2500-usb
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
+  TITLE+= (RT2500 USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko
+  AUTOLOAD:=$(call AutoProbe,rt2500usb)
+endef
 
-		  Currently only 11g speed is available.
+define KernelPackage/rt61-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
+  TITLE+= (RT2x61 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt61pci)
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rt73-usb
+  $(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
+  TITLE+= (RT73 USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko
+  AUTOLOAD:=$(call AutoProbe,rt73usb)
+endef
 
-	config PACKAGE_B43_PHY_LCN
-		bool "Enable support for LCN-PHYs"
-		depends on BROKEN
-		default n
-		help
-		  Currently broken.
+define KernelPackage/rt2800-mmio
+$(call KernelPackage/rt2x00/Default)
+  TITLE += (RT28xx/RT3xxx MMIO)
+  DEPENDS += +kmod-rt2800-lib +kmod-rt2x00-mmio
+  HIDDEN:=1
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800mmio.ko
+endef
 
-		  If unsure, say N.
+define KernelPackage/rt2800-soc
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS += @(TARGET_ramips_rt288x||TARGET_ramips_rt305x||TARGET_ramips_rt3883||TARGET_ramips_mt7620) +kmod-rt2800-mmio +kmod-rt2800-lib
+  TITLE += (RT28xx/RT3xxx SoC)
+  FILES := \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800soc.ko
+  AUTOLOAD:=$(call AutoProbe,rt2800soc)
+endef
 
-  endif
+define KernelPackage/rt2800-pci
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-rt2800-mmio
+  TITLE+= (RT2860 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko
+  AUTOLOAD:=$(call AutoProbe,rt2800pci)
 endef
 
-define KernelPackage/b43/description
-Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
+define KernelPackage/rt2800-usb
+$(call KernelPackage/rt2x00/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt
+  TITLE+= (RT2870 USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko
+  AUTOLOAD:=$(call AutoProbe,rt2800usb)
 endef
 
-define KernelPackage/b43legacy
+define KernelPackage/rtl818x/Default
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom 43xx-legacy wireless support
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
-  KCONFIG:= \
-  	CONFIG_HW_RANDOM=y
-  DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko
-  AUTOLOAD:=$(call AutoProbe,b43legacy)
-  MENU:=1
+  TITLE:=Realtek Drivers for RTL818x devices
+  URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187
+  DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211
 endef
 
-define KernelPackage/b43legacy/config
-  if PACKAGE_kmod-b43legacy
-
-	config B43LEGACY_FW_SQUASH
-		bool "Remove unnecessary firmware files"
-		default y
-		help
-		  This options allows you to remove unnecessary b43legacy firmware files
-		  from the final rootfs image. This can reduce the rootfs size by
-		  up to 50k.
+define KernelPackage/rtl8180
+  $(call KernelPackage/rtl818x/Default)
+  DEPENDS+= @PCI_SUPPORT
+  TITLE+= (RTL8180 PCI)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl818x_pci.ko
+  AUTOLOAD:=$(call AutoProbe,rtl818x_pci)
+endef
 
-		  If unsure, say Y.
+define KernelPackage/rtl8187
+$(call KernelPackage/rtl818x/Default)
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core
+  TITLE+= (RTL8187 USB)
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8187)
+endef
 
-	config B43LEGACY_FW_SQUASH_COREREVS
-		string "Core revisions to include"
-		depends on B43LEGACY_FW_SQUASH
-		default "1,2,3,4"
+define KernelPackage/rtlwifi/config
+	config PACKAGE_RTLWIFI_DEBUG
+		bool "Realtek wireless debugging"
+		depends on PACKAGE_kmod-rtlwifi
 		help
-		  This is a comma seperated list of core revision numbers.
-
-		  Example (keep files for rev4 only):
-		    4
+		  Say Y, if you want to debug realtek wireless drivers.
 
-		  Example (keep files for rev2 and rev4):
-		    2,4
+endef
 
-  endif
+define KernelPackage/rtlwifi
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek common driver part
+  DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 + at DRIVER_11N_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtlwifi.ko
+  HIDDEN:=1
 endef
 
-define KernelPackage/b43legacy/description
-Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
+define KernelPackage/rtlwifi-pci
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek common driver part (PCI support)
+  DEPENDS+= @PCI_SUPPORT +kmod-rtlwifi
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_pci.ko
+  AUTOLOAD:=$(call AutoProbe,rtl_pci)
+  HIDDEN:=1
 endef
 
+define KernelPackage/rtlwifi-usb
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek common driver part (USB support)
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-rtlwifi
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl_usb.ko
+  AUTOLOAD:=$(call AutoProbe,rtl_usb)
+  HIDDEN:=1
+endef
 
-define KernelPackage/brcmutil
+define KernelPackage/rtl8192c-common
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom IEEE802.11n common driver parts
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
-  DEPENDS+=@PCI_SUPPORT||USB_SUPPORT
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko
-  AUTOLOAD:=$(call AutoProbe,brcmutil)
-  MENU:=1
+  TITLE:=Realtek RTL8192CE/RTL8192CU common support module
+  DEPENDS+= +kmod-rtlwifi
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
+  HIDDEN:=1
 endef
 
-define KernelPackage/brcmutil/description
- This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac.
+define KernelPackage/rtl8192ce
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8192CE/RTL8188CE support
+  DEPENDS+= +kmod-rtlwifi-pci +kmod-rtl8192c-common
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192ce.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8192ce)
 endef
 
-define KernelPackage/brcmutil/config
-  if PACKAGE_kmod-brcmutil
+define KernelPackage/rtl8192ce/install
+	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfw.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cfwU_B.bin $(1)/lib/firmware/rtlwifi
+endef
 
-	config PACKAGE_BRCM80211_DEBUG
-		bool "Broadcom wireless driver debugging"
-		help
-		  Say Y, if you want to debug brcmsmac and brcmfmac wireless driver.
+define KernelPackage/rtl8192se
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8192SE/RTL8191SE support
+  DEPENDS+= +kmod-rtlwifi-pci
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192se/rtl8192se.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8192se)
+endef
 
-  endif
+define KernelPackage/rtl8192se/install
+	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192sefw.bin $(1)/lib/firmware/rtlwifi
 endef
 
-PKG_BRCMSMAC_FW_NAME:=broadcom-wl
-PKG_BRCMSMAC_FW_VERSION:=5.100.138
-PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o
-PKG_BRCMSMAC_FW_SOURCE:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION).tar.bz2
-PKG_BRCMSMAC_FW_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
-PKG_BRCMSMAC_FW_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
+define KernelPackage/rtl8192de
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Realtek RTL8192DE/RTL8188DE support
+  DEPENDS+= +kmod-rtlwifi-pci
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192de/rtl8192de.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8192de)
+endef
 
-define Download/brcmsmac
-  FILE:=$(PKG_BRCMSMAC_FW_SOURCE)
-  URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL)
-  MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM)
+define KernelPackage/rtl8192de/install
+	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192defw.bin $(1)/lib/firmware/rtlwifi
 endef
-$(eval $(call Download,brcmsmac))
 
-define KernelPackage/brcmsmac
+define KernelPackage/rtl8192cu
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
-  DEPENDS+= +kmod-mac80211 + at DRIVER_11N_SUPPORT +!TARGET_brcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko
-  AUTOLOAD:=$(call AutoProbe,brcmsmac)
-  MENU:=1
+  TITLE:=Realtek RTL8192CU/RTL8188CU support
+  DEPENDS+= +kmod-rtlwifi-usb +kmod-rtl8192c-common
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8192cu)
 endef
 
-define KernelPackage/brcmsmac/description
- Kernel module for Broadcom IEEE802.11n PCIe Wireless cards
+define KernelPackage/rtl8192cu/install
+	$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_A.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_B.bin $(1)/lib/firmware/rtlwifi
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rtlwifi/rtl8192cufw_TMSC.bin $(1)/lib/firmware/rtlwifi
 endef
 
-define KernelPackage/brcmsmac/config
-  if PACKAGE_kmod-brcmsmac
-
-	config BRCMSMAC_USE_FW_FROM_WL
-		bool "Use firmware extracted from broadcom proprietary driver"
-		default y
-		help
-		  Instead of using the official brcmsmac firmware a firmware
-		  version 666.2 extracted from the proprietary Broadcom driver
-		  is used. This is needed to get core rev 17 used in bcm4716
-		  to work.
 
-		  If unsure, say Y.
+define KernelPackage/wlcore
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=TI common driver part
+  DEPENDS+= @TARGET_omap +kmod-mac80211 + at DRIVER_11N_SUPPORT
+  FILES:= \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
+	$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
+  AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio)
+endef
 
-  endif
+define KernelPackage/wlcore/description
+ This module contains some common parts needed by TI Wireless drivers.
 endef
 
 
-define KernelPackage/brcmfmac
+define KernelPackage/wl12xx
   $(call KernelPackage/mac80211/Default)
-  TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
-  URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
-  DEPENDS+= @USB_SUPPORT +kmod-cfg80211 + at DRIVER_11N_SUPPORT +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc +BRCMFMAC_USB:kmod-usb-core
-  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko
-  AUTOLOAD:=$(call AutoProbe,brcmfmac)
+  TITLE:=Driver for TI WL12xx
+  URL:=http://wireless.kernel.org/en/users/Drivers/wl12xx
+  DEPENDS+= +kmod-wlcore
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko
+  AUTOLOAD:=$(call AutoProbe,wl12xx)
 endef
 
-define KernelPackage/brcmfmac/description
- Kernel module for Broadcom IEEE802.11n USB Wireless cards
+define KernelPackage/wl12xx/description
+ Kernel modules for TI WL12xx
 endef
 
-define KernelPackage/brcmfmac/config
-  if PACKAGE_kmod-brcmfmac
 
-	config BRCMFMAC_SDIO
-		bool "Enable SDIO bus interface support"
-		default n
-		help
-		  Enable support for cards attached to an SDIO bus.
-		  Select this option only if you are sure that your
-		  board has a Broadcom wireless chip atacched to
-		  that bus.
+define KernelPackage/wl18xx
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Driver for TI WL18xx
+  URL:=http://wireless.kernel.org/en/users/Drivers/wl18xx
+  DEPENDS+= +kmod-wlcore
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko
+  AUTOLOAD:=$(call AutoProbe,wl18xx)
+endef
 
-	config BRCMFMAC_USB
-		bool "Enable USB bus interface support"
-		depends on USB_SUPPORT
-		default y
-		help
-		  Supported USB connected chipsets:
-		  BCM43235, BCM43236, BCM43238 (all in revision 3 only)
-		  BCM43143, BCM43242, BCM43566, BCM43569
+define KernelPackage/wl18xx/description
+ Kernel modules for TI WL18xx
+endef
 
-	config BRCMFMAC_PCIE
-		bool "Enable PCIE bus interface support"
-		depends on PCI_SUPPORT
-		default y
-		help
-		  Supported PCIe connected chipsets:
-		  BCM4354, BCM4356, BCM43567, BCM43570, BCM43602
 
-  endif
+ZD1211FW_NAME:=zd1211-firmware
+ZD1211FW_VERSION:=1.4
+define Download/zd1211rw
+  FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
+  URL:=@SF/zd1211/
+  MD5SUM:=19f28781d76569af8551c9d11294c870
+endef
+$(eval $(call Download,zd1211rw))
+
+define KernelPackage/zd1211rw
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Zydas ZD1211 support
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko
+  AUTOLOAD:=$(call AutoProbe,zd1211rw)
 endef
 
+
 config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
 
 config-y:= \
@@ -1617,15 +1646,17 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
   config-y += \
 	CFG80211_DEBUGFS \
 	MAC80211_DEBUGFS \
+	ATH5K_DEBUG \
 	ATH9K_DEBUGFS \
 	ATH9K_HTC_DEBUGFS \
 	ATH10K_DEBUGFS \
-	CARL9170_DEBUGFS \
-	ATH5K_DEBUG
+	CARL9170_DEBUGFS
 endif
 
 config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP
 
+config-$(call config_package,adm8211) += ADM8211
+
 config-$(call config_package,ath) += ATH_CARDS ATH_COMMON
 config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG
 config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
@@ -1647,8 +1678,6 @@ else
   config-y += ATH5K_PCI
 endif
 
-config-$(call config_package,carl9170) += CARL9170
-
 config-$(call config_package,b43) += B43
 config-$(CONFIG_PACKAGE_B43_BUSES_BCMA_AND_SSB) += B43_BUSES_BCMA_AND_SSB
 config-$(CONFIG_PACKAGE_B43_BUSES_BCMA) += B43_BUSES_BCMA
@@ -1671,10 +1700,40 @@ config-$(CONFIG_BRCMFMAC_USB) += BRCMFMAC_USB
 config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE
 config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG
 
+config-$(call config_package,carl9170) += CARL9170
+
+config-$(call config_package,hermes) += HERMES
+config-$(call config_package,hermes-pci) += PCI_HERMES
+config-$(call config_package,hermes-plx) += PLX_HERMES
+config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES
+config-y += HERMES_PRISM
+
+config-$(call config_package,libipw) += LIBIPW
+config-$(call config_package,ipw2100) += IPW2100
+config-$(call config_package,ipw2200) += IPW2200
+
+config-$(call config_package,iwl-legacy) += IWLEGACY
+config-$(call config_package,iwl3945) += IWL3945
+config-$(call config_package,iwl4965) += IWL4965
+config-$(call config_package,iwlagn) += IWLWIFI IWLDVM IWLMVM
+config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG
+config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
+
+config-$(call config_package,libertas-sdio) += LIBERTAS LIBERTAS_SDIO
+config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB
+
 config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
 config-$(call config_package,mt7601u) += MT7601U
 config-y += WL_MEDIATEK
 
+config-$(call config_package,mwl8k) += MWL8K
+config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE
+
+config-$(call config_package,p54-common) += P54_COMMON
+config-$(call config_package,p54-pci) += P54_PCI
+config-$(call config_package,p54-usb) += P54_USB
+config-$(call config_package,p54-spi) += P54_SPI
+
 config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB
 config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI
 config-$(call config_package,rt2x00-mmio) += RT2X00_LIB_MMIO
@@ -1697,40 +1756,8 @@ config-y += RT2800PCI_RT33XX RT2800PCI_RT35XX RT2800PCI_RT53XX RT2800PCI_RT3290
 config-$(call config_package,rt2800-usb) += RT2800USB
 config-y += RT2800USB_RT33XX RT2800USB_RT35XX RT2800USB_RT3573 RT2800USB_RT53XX RT2800USB_RT55XX RT2800USB_UNKNOWN
 
-config-$(call config_package,iwl-legacy) += IWLEGACY
-config-$(call config_package,iwl3945) += IWL3945
-config-$(call config_package,iwl4965) += IWL4965
-config-$(call config_package,iwlagn) += IWLWIFI IWLDVM IWLMVM
-config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG
-config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
-
-config-$(call config_package,libipw) += LIBIPW
-config-$(call config_package,ipw2100) += IPW2100
-config-$(call config_package,ipw2200) += IPW2200
-
-config-$(call config_package,p54-common) += P54_COMMON
-config-$(call config_package,p54-pci) += P54_PCI
-config-$(call config_package,p54-usb) += P54_USB
-config-$(call config_package,p54-spi) += P54_SPI
-
-config-$(call config_package,hermes) += HERMES
-config-$(call config_package,hermes-pci) += PCI_HERMES
-config-$(call config_package,hermes-plx) += PLX_HERMES
-config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES
-config-y += HERMES_PRISM
-
-config-$(call config_package,adm8211) += ADM8211
-config-$(call config_package,libertas-sdio) += LIBERTAS LIBERTAS_SDIO
-config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB
-config-$(call config_package,mwl8k) += MWL8K
-config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE
 config-$(call config_package,rtl8180) += RTL8180
 config-$(call config_package,rtl8187) += RTL8187
-config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
-config-$(call config_package,wl12xx) += WL12XX
-config-$(call config_package,wl18xx) += WL18XX
-config-y += WL_TI WILINK_PLATFORM_DATA
-config-$(call config_package,zd1211rw) += ZD1211RW
 
 config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI
 config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI
@@ -1742,8 +1769,17 @@ config-$(call config_package,rtl8192de) += RTL8192DE
 config-$(call config_package,rtl8192cu) += RTL8192CU
 config-$(CONFIG_PACKAGE_RTLWIFI_DEBUG) += RTLWIFI_DEBUG
 
+config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
+config-$(call config_package,wl12xx) += WL12XX
+config-$(call config_package,wl18xx) += WL18XX
+config-y += WL_TI WILINK_PLATFORM_DATA
+
+config-$(call config_package,zd1211rw) += ZD1211RW
+
+
 config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS B43_LEDS B43LEGACY_LEDS
 
+
 MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
 	CROSS_COMPILE="$(KERNEL_CROSS)" \
 	ARCH="$(LINUX_KARCH)" \
@@ -1828,106 +1864,6 @@ define Build/InstallDev
 	rm -f $(1)/usr/include/mac80211-backport/linux/module.h
 endef
 
-define KernelPackage/libertas-usb/install
-	$(INSTALL_DIR) $(1)/lib/firmware/libertas
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8388_v9.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8682.bin \
-		$(1)/lib/firmware/libertas/
-endef
-
-define KernelPackage/libertas-sdio/install
-	$(INSTALL_DIR) $(1)/lib/firmware/libertas
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385_helper.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9_helper.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688_helper.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688.bin \
-		$(1)/lib/firmware/libertas
-endef
-
-define KernelPackage/cfg80211/install
-	$(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
-	$(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
-	$(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
-endef
-
-define KernelPackage/p54-pci/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci
-endef
-
-define KernelPackage/p54-usb/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb
-endef
-
-define KernelPackage/p54-spi/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm
-endef
-
-define KernelPackage/rt61-pci/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561s.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2661.bin \
-		$(1)/lib/firmware/
-endef
-
-define KernelPackage/rt73-usb/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt73.bin $(1)/lib/firmware/
-endef
-
-define KernelPackage/rt2800-pci/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2860.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt3290.bin \
-		$(1)/lib/firmware
-endef
-
-define KernelPackage/rt2800-usb/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2870.bin $(1)/lib/firmware/
-endef
-
-define KernelPackage/wl12xx/install
-	$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-mr.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-plt.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-sr.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl1271-nvs.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-mr.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-plt.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-sr.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-nvs.bin \
-		$(1)/lib/firmware/ti-connectivity
-endef
-
-define KernelPackage/wl18xx/install
-	$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-conf.bin \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-3.bin \
-		$(1)/lib/firmware/ti-connectivity
-endef
-
-define KernelPackage/zd1211rw/install
-	$(INSTALL_DIR) $(1)/lib/firmware/zd1211
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
-endef
-
-define KernelPackage/carl9170/install
-	$(INSTALL_DIR) $(1)/lib/firmware
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/carl9170-1.fw $(1)/lib/firmware
-endef
-
 define KernelPackage/ath9k-htc/install
 	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) \
@@ -1952,29 +1888,75 @@ else
 endif
 endef
 
-define KernelPackage/mt7601u/install
-	$(INSTALL_DIR) $(1)/lib/firmware
+define KernelPackage/b43/install
+	rm -rf $(1)/lib/firmware/
+ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
+	tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
+else
+	tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
+endif
+	$(INSTALL_DIR) $(1)/lib/firmware/
+ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
+	$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
+	$(INSTALL_DIR) $(1)/lib/firmware/b43-open/
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
+else
+	b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
+endif
+ifneq ($(CONFIG_B43_FW_SQUASH),)
+	b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
+endif
+endef
+
+define KernelPackage/b43legacy/install
+	$(INSTALL_DIR) $(1)/lib/firmware/
+	b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(DL_DIR)/$(PKG_B43_FWV3_SOURCE)
+ifneq ($(CONFIG_B43LEGACY_FW_SQUASH),)
+	b43-fwsquash.py "G" "$(CONFIG_B43LEGACY_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43legacy"
+endif
+endef
+
+define KernelPackage/brcmsmac/install
+	$(INSTALL_DIR) $(1)/lib/firmware/brcm
+ifeq ($(CONFIG_BRCMSMAC_USE_FW_FROM_WL),y)
+	tar xjf "$(DL_DIR)/$(PKG_BRCMSMAC_FW_SOURCE)" -C "$(PKG_BUILD_DIR)"
+	b43-fwcutter --brcmsmac -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_BRCMSMAC_FW_OBJECT)
+else
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)/mcu/bin/MT7601.bin \
-		$(1)/lib/firmware/mt7601u.bin
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx-0.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx_hdr-0.fw \
+		$(1)/lib/firmware/brcm/
+endif
 endef
 
-define KernelPackage/mwl8k/install
-	$(INSTALL_DIR) $(1)/lib/firmware/mwl8k
+define KernelPackage/brcmfmac/install
+	$(INSTALL_DIR) $(1)/lib/firmware/brcm
+ifneq ($(CONFIG_BRCMFMAC_USB),)
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366_ap-3.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8366.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8687.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8687.fw \
-		$(1)/lib/firmware/mwl8k/
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43236b.bin \
+		$(1)/lib/firmware/brcm/
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43143.bin \
+		$(1)/lib/firmware/brcm/
+endif
+ifneq ($(CONFIG_BRCMFMAC_PCIE),)
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43602-pcie.ap.bin \
+		$(1)/lib/firmware/brcm/brcmfmac43602-pcie.bin
+endif
 endef
 
-define KernelPackage/mwifiex-pcie/install
-	$(INSTALL_DIR) $(1)/lib/firmware/mrvl
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mrvl/pcie8897_uapsta.bin \
-		$(1)/lib/firmware/mrvl/
+define KernelPackage/carl9170/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/carl9170-1.fw $(1)/lib/firmware
+endef
+
+define KernelPackage/cfg80211/install
+	$(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
+	$(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
+	$(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
 endef
 
 define KernelPackage/ipw2100/install
@@ -2050,128 +2032,184 @@ define KernelPackage/iwl4965/install
 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-4965-2.ucode $(1)/lib/firmware
 endef
 
-define KernelPackage/b43/install
-	rm -rf $(1)/lib/firmware/
-ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
-	tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
-else
-	tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
-endif
-	$(INSTALL_DIR) $(1)/lib/firmware/
-ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
-	$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
-	$(INSTALL_DIR) $(1)/lib/firmware/b43-open/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
-else
-	b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
-endif
-ifneq ($(CONFIG_B43_FW_SQUASH),)
-	b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
-endif
+define KernelPackage/libertas-usb/install
+	$(INSTALL_DIR) $(1)/lib/firmware/libertas
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8388_v9.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8682.bin \
+		$(1)/lib/firmware/libertas/
 endef
 
-define KernelPackage/b43legacy/install
-	$(INSTALL_DIR) $(1)/lib/firmware/
-	b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(DL_DIR)/$(PKG_B43_FWV3_SOURCE)
-ifneq ($(CONFIG_B43LEGACY_FW_SQUASH),)
-	b43-fwsquash.py "G" "$(CONFIG_B43LEGACY_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43legacy"
-endif
+define KernelPackage/libertas-sdio/install
+	$(INSTALL_DIR) $(1)/lib/firmware/libertas
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385_helper.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9_helper.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688_helper.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688.bin \
+		$(1)/lib/firmware/libertas
 endef
 
-define KernelPackage/brcmsmac/install
-	$(INSTALL_DIR) $(1)/lib/firmware/brcm
-ifeq ($(CONFIG_BRCMSMAC_USE_FW_FROM_WL),y)
-	tar xjf "$(DL_DIR)/$(PKG_BRCMSMAC_FW_SOURCE)" -C "$(PKG_BUILD_DIR)"
-	b43-fwcutter --brcmsmac -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_BRCMSMAC_FW_OBJECT)
-else
+define KernelPackage/mt7601u/install
+	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx-0.fw \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx_hdr-0.fw \
-		$(1)/lib/firmware/brcm/
-endif
+		$(PKG_BUILD_DIR)/$(PKG_MT7601U_FW_NAME)_$(PKG_MT7601U_FW_VERSION)/mcu/bin/MT7601.bin \
+		$(1)/lib/firmware/mt7601u.bin
 endef
 
-define KernelPackage/brcmfmac/install
-	$(INSTALL_DIR) $(1)/lib/firmware/brcm
-ifneq ($(CONFIG_BRCMFMAC_USB),)
+define KernelPackage/mwl8k/install
+	$(INSTALL_DIR) $(1)/lib/firmware/mwl8k
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43236b.bin \
-		$(1)/lib/firmware/brcm/
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366_ap-3.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8366.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8687.fw \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8687.fw \
+		$(1)/lib/firmware/mwl8k/
+endef
+
+define KernelPackage/mwifiex-pcie/install
+	$(INSTALL_DIR) $(1)/lib/firmware/mrvl
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43143.bin \
-		$(1)/lib/firmware/brcm/
-endif
-ifneq ($(CONFIG_BRCMFMAC_PCIE),)
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mrvl/pcie8897_uapsta.bin \
+		$(1)/lib/firmware/mrvl/
+endef
+
+
+define KernelPackage/p54-pci/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci
+endef
+
+define KernelPackage/p54-spi/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm
+endef
+
+define KernelPackage/p54-usb/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb
+endef
+
+define KernelPackage/rt2800-pci/install
+	$(INSTALL_DIR) $(1)/lib/firmware
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43602-pcie.ap.bin \
-		$(1)/lib/firmware/brcm/brcmfmac43602-pcie.bin
-endif
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2860.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt3290.bin \
+		$(1)/lib/firmware
+endef
+
+define KernelPackage/rt2800-usb/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2870.bin $(1)/lib/firmware/
+endef
+
+define KernelPackage/rt61-pci/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561s.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2661.bin \
+		$(1)/lib/firmware/
+endef
+
+define KernelPackage/rt73-usb/install
+	$(INSTALL_DIR) $(1)/lib/firmware
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt73.bin $(1)/lib/firmware/
+endef
+
+define KernelPackage/wl12xx/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-mr.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-plt.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-sr.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl1271-nvs.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-mr.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-plt.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-fw-5-sr.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl128x-nvs.bin \
+		$(1)/lib/firmware/ti-connectivity
+endef
+
+define KernelPackage/wl18xx/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
+	$(INSTALL_DATA) \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-conf.bin \
+		$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-3.bin \
+		$(1)/lib/firmware/ti-connectivity
+endef
+
+define KernelPackage/zd1211rw/install
+	$(INSTALL_DIR) $(1)/lib/firmware/zd1211
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
 endef
 
+
 $(eval $(call KernelPackage,adm8211))
+$(eval $(call KernelPackage,ath))
+$(eval $(call KernelPackage,ath10k))
 $(eval $(call KernelPackage,ath5k))
+$(eval $(call KernelPackage,ath9k))
+$(eval $(call KernelPackage,ath9k-common))
+$(eval $(call KernelPackage,ath9k-htc))
+$(eval $(call KernelPackage,b43))
+$(eval $(call KernelPackage,b43legacy))
+$(eval $(call KernelPackage,brcmfmac))
+$(eval $(call KernelPackage,brcmsmac))
+$(eval $(call KernelPackage,brcmutil))
+$(eval $(call KernelPackage,carl9170))
+$(eval $(call KernelPackage,cfg80211))
+$(eval $(call KernelPackage,iwl3945))
+$(eval $(call KernelPackage,iwl4965))
+$(eval $(call KernelPackage,iwlagn))
+$(eval $(call KernelPackage,iwl-legacy))
 $(eval $(call KernelPackage,lib80211))
-$(eval $(call KernelPackage,libertas-usb))
 $(eval $(call KernelPackage,libertas-sdio))
-$(eval $(call KernelPackage,cfg80211))
+$(eval $(call KernelPackage,libertas-usb))
 $(eval $(call KernelPackage,mac80211))
+$(eval $(call KernelPackage,mac80211-hwsim))
+$(eval $(call KernelPackage,mt7601u))
+$(eval $(call KernelPackage,mwifiex-pcie))
+$(eval $(call KernelPackage,mwl8k))
+$(eval $(call KernelPackage,hermes))
+$(eval $(call KernelPackage,hermes-pci))
+$(eval $(call KernelPackage,hermes-pcmcia))
+$(eval $(call KernelPackage,hermes-plx))
+$(eval $(call KernelPackage,ipw2100))
+$(eval $(call KernelPackage,ipw2200))
+$(eval $(call KernelPackage,libipw))
 $(eval $(call KernelPackage,p54-common))
 $(eval $(call KernelPackage,p54-pci))
-$(eval $(call KernelPackage,p54-usb))
 $(eval $(call KernelPackage,p54-spi))
-$(eval $(call KernelPackage,rt2x00-lib))
-$(eval $(call KernelPackage,rt2x00-mmio))
-$(eval $(call KernelPackage,rt2x00-pci))
-$(eval $(call KernelPackage,rt2x00-usb))
-$(eval $(call KernelPackage,rt2800-lib))
+$(eval $(call KernelPackage,p54-usb))
 $(eval $(call KernelPackage,rt2400-pci))
 $(eval $(call KernelPackage,rt2500-pci))
 $(eval $(call KernelPackage,rt2500-usb))
-$(eval $(call KernelPackage,rt61-pci))
-$(eval $(call KernelPackage,rt73-usb))
+$(eval $(call KernelPackage,rt2800-lib))
 $(eval $(call KernelPackage,rt2800-mmio))
-$(eval $(call KernelPackage,rt2800-soc))
 $(eval $(call KernelPackage,rt2800-pci))
+$(eval $(call KernelPackage,rt2800-soc))
 $(eval $(call KernelPackage,rt2800-usb))
+$(eval $(call KernelPackage,rt2x00-lib))
+$(eval $(call KernelPackage,rt2x00-mmio))
+$(eval $(call KernelPackage,rt2x00-pci))
+$(eval $(call KernelPackage,rt2x00-usb))
+$(eval $(call KernelPackage,rt61-pci))
+$(eval $(call KernelPackage,rt73-usb))
 $(eval $(call KernelPackage,rtl8180))
 $(eval $(call KernelPackage,rtl8187))
-$(eval $(call KernelPackage,rtlwifi))
-$(eval $(call KernelPackage,rtlwifi-pci))
-$(eval $(call KernelPackage,rtlwifi-usb))
 $(eval $(call KernelPackage,rtl8192c-common))
 $(eval $(call KernelPackage,rtl8192ce))
-$(eval $(call KernelPackage,rtl8192se))
-$(eval $(call KernelPackage,rtl8192de))
 $(eval $(call KernelPackage,rtl8192cu))
-$(eval $(call KernelPackage,zd1211rw))
-$(eval $(call KernelPackage,mac80211-hwsim))
-$(eval $(call KernelPackage,mt7601u))
-$(eval $(call KernelPackage,ath9k-common))
-$(eval $(call KernelPackage,ath9k))
-$(eval $(call KernelPackage,ath9k-htc))
-$(eval $(call KernelPackage,ath10k))
-$(eval $(call KernelPackage,ath))
-$(eval $(call KernelPackage,carl9170))
-$(eval $(call KernelPackage,b43))
-$(eval $(call KernelPackage,b43legacy))
-$(eval $(call KernelPackage,brcmutil))
-$(eval $(call KernelPackage,brcmsmac))
-$(eval $(call KernelPackage,brcmfmac))
-$(eval $(call KernelPackage,libipw))
-$(eval $(call KernelPackage,ipw2100))
-$(eval $(call KernelPackage,ipw2200))
-$(eval $(call KernelPackage,iwlagn))
-$(eval $(call KernelPackage,iwl-legacy))
-$(eval $(call KernelPackage,iwl4965))
-$(eval $(call KernelPackage,iwl3945))
-$(eval $(call KernelPackage,mwl8k))
-$(eval $(call KernelPackage,mwifiex-pcie))
-$(eval $(call KernelPackage,hermes))
-$(eval $(call KernelPackage,hermes-pci))
-$(eval $(call KernelPackage,hermes-plx))
-$(eval $(call KernelPackage,hermes-pcmcia))
-$(eval $(call KernelPackage,wlcore))
+$(eval $(call KernelPackage,rtl8192de))
+$(eval $(call KernelPackage,rtl8192se))
+$(eval $(call KernelPackage,rtlwifi))
+$(eval $(call KernelPackage,rtlwifi-pci))
+$(eval $(call KernelPackage,rtlwifi-usb))
 $(eval $(call KernelPackage,wl12xx))
 $(eval $(call KernelPackage,wl18xx))
+$(eval $(call KernelPackage,wlcore))
+$(eval $(call KernelPackage,zd1211rw))
-- 
2.5.0

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 24 12:12:57 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 24 Aug 2015 18:12:57 +0200
Subject: [OpenWrt-Devel] [PATCH 4/7] mac80211: refresh Intel firmware
In-Reply-To: <55DA2A4D.8000009@hauke-m.de>
References: <1440327391-25355-1-git-send-email-dirkneukirchen@web.de>
 <1440327391-25355-5-git-send-email-dirkneukirchen@web.de>
 <55DA2A4D.8000009@hauke-m.de>
Message-ID: <55DB4289.2070006@web.de>

On 23.08.2015 22:17, Hauke Mehrtens wrote:
> 
> 
> On 08/23/2015 12:56 PM, Dirk Neukirchen wrote:
>> - sort firmware
>> - add newer firmware for Intel chipsets
>> - newer Intel MVM require firmware
>> - ucode 13 requires Kernel 4.1+
>>
>> only compile tested
> 
> Have you looked if this would close any open feature requests / issues
> in OpenWrt trac?
> 

The first patch that adds IWLMVM should fix 
https://dev.openwrt.org/ticket/19459

Forum users try to use Intel cards - example:
https://forum.openwrt.org/viewtopic.php?id=54488
Also more IWLMVM symbol then firmware issues

>> Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
>> ---
>>  package/kernel/mac80211/Makefile | 198 ++++++++++++++++++++++++++-------------
>>  1 file changed, 133 insertions(+), 65 deletions(-)
>>
>> +
>> +	config IWL3160_FW
>> +		bool "Intel 3160 Firmware"
>> +		default y
>> +		help
>> +		  Download and install firmware for:
>> +		    Intel Wireless WiFi 3160
>> +
>> +	config IWL3160_13_FW
>> +		bool "Intel 3160 Firmware ucode 13 (4.1+)"
>> +		default y
>> +		depends on LINUX_4_1
>> +		help
>> +		  Download and install firmware for:
>> +		    Intel Wireless WiFi 3160
> 
> Does this really depend on the kernel version and not on the iwl driver
> version? OpenWrt uses the driver from a very recent wireless tree, so it
> should be equivalent to something between 4.2 and 4.3 now.
> 
> I would suggest just using the most recent firmware files for the Intel
> wifi devices.
> 
I submitted an updated version of the patch - the kernel "version" only
means that the driver has *some* (?) git commits and a bump in the ABI version

Intel has some changelog for their firmware but the linux-firmware commits dont contain these.
Sometimes other firmware repos contain these but those differ from main linux-firmware
( https://chromium.googlesource.com/chromiumos/third_party/linux-firmware/ has ucode-14 
and sometimes include changelogs )

> Hauke
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Mon Aug 24 16:23:09 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Mon, 24 Aug 2015 23:23:09 +0300
Subject: [OpenWrt-Devel] [PATCH] target/linux/generic: allow up to 4
	8250-compatible UARTS
Message-ID: <1440447789-29478-1-git-send-email-abrodkin@synopsys.com>

Default value of both SERIAL_8250_NR_UARTS & SERIAL_8250_RUNTIME_UARTS is 4,
see: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/Kconfig

And some boards rely on that default setting.
What's worse some boards use 3rd or even 4th UART as its primary
serial console.

For example Synopsys DesignWare SDP board, see "console=ttyS3,115200n8"
here: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/boot/dts/axs101.dts

So having expected default value allows usage of kernel configs that are
closer to their upstream versions.

Cc: Jonas Gorski <jogo at openwrt.org>
Cc: Zoltan HERPAI <wigyori at uid0.hu>
Cc: Hauke Mehrtens <hauke at hauke-m.de>
Cc: Dirk Neukirchen <dirkneukirchen at web.de>
Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
---
 target/linux/generic/config-4.1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/generic/config-4.1 b/target/linux/generic/config-4.1
index de4c62c..c7d5871 100644
--- a/target/linux/generic/config-4.1
+++ b/target/linux/generic/config-4.1
@@ -3567,10 +3567,10 @@ CONFIG_SERIAL_8250_DMA=y
 # CONFIG_SERIAL_8250_FOURPORT is not set
 # CONFIG_SERIAL_8250_HUB6 is not set
 # CONFIG_SERIAL_8250_MANY_PORTS is not set
-CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_PCI is not set
 # CONFIG_SERIAL_8250_RSA is not set
-CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_SYSRQ is not set
 # CONFIG_SERIAL_ALTERA_JTAGUART is not set
 # CONFIG_SERIAL_ALTERA_UART is not set
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hauke at hauke-m.de  Mon Aug 24 16:27:39 2015
From: hauke at hauke-m.de (Hauke Mehrtens)
Date: Mon, 24 Aug 2015 22:27:39 +0200
Subject: [OpenWrt-Devel] [PATCH] target/linux/generic: allow up to 4
	8250-compatible UARTS
In-Reply-To: <1440447789-29478-1-git-send-email-abrodkin@synopsys.com>
References: <1440447789-29478-1-git-send-email-abrodkin@synopsys.com>
Message-ID: <55DB7E3B.2090802@hauke-m.de>

On 08/24/2015 10:23 PM, Alexey Brodkin wrote:
> Default value of both SERIAL_8250_NR_UARTS & SERIAL_8250_RUNTIME_UARTS is 4,
> see: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/Kconfig
> 
> And some boards rely on that default setting.
> What's worse some boards use 3rd or even 4th UART as its primary
> serial console.
> 
> For example Synopsys DesignWare SDP board, see "console=ttyS3,115200n8"
> here: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/boot/dts/axs101.dts
> 
> So having expected default value allows usage of kernel configs that are
> closer to their upstream versions.
> 
> Cc: Jonas Gorski <jogo at openwrt.org>
> Cc: Zoltan HERPAI <wigyori at uid0.hu>
> Cc: Hauke Mehrtens <hauke at hauke-m.de>
> Cc: Dirk Neukirchen <dirkneukirchen at web.de>
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> ---

Nack.

Most targets are using 2 uarts. If your target needs more just overwrite
this in your target/linux/<target name>/config-4.1 file like it is done
in target/linux/sunxi/config-4.1 for example.

Hauke
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Mon Aug 24 16:37:05 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Mon, 24 Aug 2015 20:37:05 +0000
Subject: [OpenWrt-Devel] [PATCH] target/linux/generic: allow up to 4
 8250-compatible UARTS
In-Reply-To: <55DB7E3B.2090802@hauke-m.de>
References: <1440447789-29478-1-git-send-email-abrodkin@synopsys.com>
 <55DB7E3B.2090802@hauke-m.de>
Message-ID: <1440448625.2745.19.camel@synopsys.com>

Hi Hauke,

On Mon, 2015-08-24 at 22:27 +0200, Hauke Mehrtens wrote:
> On 08/24/2015 10:23 PM, Alexey Brodkin wrote:
> > Default value of both SERIAL_8250_NR_UARTS & SERIAL_8250_RUNTIME_UARTS is 4,
> > see: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/Kconfig
> > 
> > And some boards rely on that default setting.
> > What's worse some boards use 3rd or even 4th UART as its primary
> > serial console.
> > 
> > For example Synopsys DesignWare SDP board, see "console=ttyS3,115200n8"
> > here: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/boot/dts/axs101.dts
> > 
> > So having expected default value allows usage of kernel configs that are
> > closer to their upstream versions.
> > 
> > Cc: Jonas Gorski <jogo at openwrt.org>
> > Cc: Zoltan HERPAI <wigyori at uid0.hu>
> > Cc: Hauke Mehrtens <hauke at hauke-m.de>
> > Cc: Dirk Neukirchen <dirkneukirchen at web.de>
> > Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> > ---
> 
> Nack.
> 
> Most targets are using 2 uarts. If your target needs more just overwrite
> this in your target/linux/<target name>/config-4.1 file like it is done
> in target/linux/sunxi/config-4.1 for example.

Ok I'll add those in my board's config.

Still just for my understanding I'm wondering what benefit this limitation
allows to achieve?

-Alexey
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Tue Aug 25 02:50:10 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Tue, 25 Aug 2015 08:50:10 +0200
Subject: [OpenWrt-Devel] [PATCHv3 netifd 3/3] bridge: Allow setting
 multicast_router option
In-Reply-To: <1440343170-13040-4-git-send-email-linus.luessing@c0d3.blue>
References: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
 <1440343170-13040-4-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <55DC1022.3010000@openwrt.org>

On 2015-08-23 17:19, Linus L?ssing wrote:
> The multicast_router option of a bridge allows to control the forwarding
> behaviour of multicast packets independant of the listener state:
> 
> * 0: Only forward if specific listener is present
> * 1 (default): Forward if specific listener or a multicast router
>   was detected (currently only learned via query messages, no MRD
>   support yet)
> * 2: Always forward any multicast traffic on this port
> 
> Since MRD is not mandated you might end up with silent multicast routers
> (e.g. if your link has more than one multicast router; only one can
> become the selected, "noisy" querier). Here you might need a manual
> configuration option like the "multicast_router" option.
> 
> Other scenarios where this can be useful are for instance:
> * Segmentation of IGMP/MLD domains together with ebtables
> * Dedicated bridge port for monitoring/debugging purposes
> 
> Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
> ---
>  device.c       |   12 ++++++++++++
>  device.h       |    3 +++
>  system-linux.c |   18 ++++++++++++++++++
>  3 files changed, 33 insertions(+)
> 
> diff --git a/device.c b/device.c
> index b44ccb8..d6e288c 100644
> --- a/device.c
> +++ b/device.c
> @@ -281,6 +283,14 @@ device_init_settings(struct device *dev, struct blob_attr **tb)
>  		s->flags |= DEV_OPT_MULTICAST_TO_UNICAST;
>  	}
>  
> +	if ((cur = tb[DEV_ATTR_MULTICAST_ROUTER])) {
> +		s->multicast_router = blobmsg_get_u32(cur);
> +		if (s->multicast_router >= 0 && s->multicast_router <= 2)
Applied the netifd patches with a minor modification: Removed the >= 0
test because the field is unsigned (fixes a compiler warning).

Thanks,

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Tue Aug 25 03:26:14 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Tue, 25 Aug 2015 09:26:14 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 2/2] kernel: bridge,
 multicast-to-unicast: assign src after pskb_may_pull()
In-Reply-To: <1440343170-13040-6-git-send-email-linus.luessing@c0d3.blue>
References: <1440343170-13040-1-git-send-email-linus.luessing@c0d3.blue>
 <1440343170-13040-6-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <55DC1896.1090602@openwrt.org>

On 2015-08-23 17:19, Linus L?ssing wrote:
> A call to pskb_may_pull() might reallocate skb->data. Therefore we
> should only assign the src-pointer after any potential reallocations.
> 
> Signed-off-by: Linus L?ssing <linus.luessing at c0d3.blue>
Applied both patches with modifications:
- Ported to Linux 4.1
- Removed unnecessary de-constification of src

Thanks,

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From nbd at openwrt.org  Tue Aug 25 03:48:46 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Tue, 25 Aug 2015 09:48:46 +0200
Subject: [OpenWrt-Devel] [musl] SuperH conflict of
 arch/sh/__set_thread_area vs thread/__set_thread_area
In-Reply-To: <20150821142336.GA32742@brightrain.aerifal.cx>
References: <5769061.FLTLqujSyv@debian64>
 <20150820030402.GT32742@brightrain.aerifal.cx> <4450715.CJV8mqCvIO@debian64>
 <6159471.3UQWOnjUZP@debian64> <20150821142336.GA32742@brightrain.aerifal.cx>
Message-ID: <55DC1DDE.4020009@openwrt.org>

On 2015-08-21 16:23, Rich Felker wrote:
>> 2. patch patch-kernel.sh
>> 
>> ---
>> --- a/scripts/patch-kernel.sh
>> +++ b/scripts/patch-kernel.sh
>> @@ -37,7 +37,7 @@ for i in ${patchdir}/${patchpattern} ; do
>>      [ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue	
>>      echo ""
>>      echo "Applying ${i} using ${type}: " 
>> -    ${uncomp} ${i} | ${PATCH:-patch} -f -p1 -E -d ${targetdir} 
>> +    ${uncomp} ${i} | ${PATCH:-patch} -f -p1 -d ${targetdir}
>>      if [ $? != 0 ] ; then
>>          echo "Patch failed!  Please fix $i!"
>>  	exit 1
>> 
>> ---
>> 
>> Does anyone have any preferences? I'm opting for "patch patch-kernel"
>> (and I will send a proper patch next week to OpenWRT even if no one
>> cares now :-D ) 
> 
> This seems like a better approach to me, but I don't know if it would
> adversely affect the kernel or other components.
Applied this change in r46723 - I don't expect any side effects in the
kernel or other components, since this flag seems to be relevant for
non-standard patch formats only, and we usually keep our patches consistent.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Tue Aug 25 12:08:06 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Tue, 25 Aug 2015 18:08:06 +0200
Subject: [OpenWrt-Devel] [PATCH 1/2] realview: enable sd card support
Message-ID: <1440518886-12375-1-git-send-email-dirkneukirchen@web.de>

qemu can be run with -sd <imagename>

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 target/linux/realview/config-3.18 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/realview/config-3.18 b/target/linux/realview/config-3.18
index d619694..a8cbd38 100644
--- a/target/linux/realview/config-3.18
+++ b/target/linux/realview/config-3.18
@@ -78,6 +78,7 @@ CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 CONFIG_DEBUG_USER=y
 CONFIG_DMA_CACHE_RWFO=y
 CONFIG_DNOTIFY=y
+CONFIG_EXT4_FS=y
 CONFIG_FB=y
 CONFIG_FB_ARMCLCD=y
 CONFIG_FB_CFB_COPYAREA=y
@@ -184,6 +185,9 @@ CONFIG_MACH_REALVIEW_PBX=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_MDIO_BOARDINFO=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+CONFIG_MMC=y
+CONFIG_MMC_ARMMMCI=y
+CONFIG_MMC_BLOCK=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MULTI_IRQ_HANDLER=y
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Tue Aug 25 12:08:12 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Tue, 25 Aug 2015 18:08:12 +0200
Subject: [OpenWrt-Devel] [PATCH 2/2] realview: create sd card image for qemu
Message-ID: <1440518892-12436-1-git-send-email-dirkneukirchen@web.de>

enables a real rootfs with custom size

use qemu with:
qemu-system-arm -M realview-pbx-a9 \
-kernel openwrt-realview-vmlinux.elf \
-nographic -m 1024M \
-sd openwrt-realview-sdcard.img \
--append "console=ttyAMA0 root=/dev/mmcblk0p1"

modified script from brcm2708 target

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 target/linux/realview/image/Makefile               |  9 +++++++++
 .../realview/image/gen_realview_sdcard_img.sh      | 23 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100755 target/linux/realview/image/gen_realview_sdcard_img.sh

diff --git a/target/linux/realview/image/Makefile b/target/linux/realview/image/Makefile
index 28db6f3..ad7aa69 100644
--- a/target/linux/realview/image/Makefile
+++ b/target/linux/realview/image/Makefile
@@ -21,7 +21,16 @@ endef
 
 define Image/Build
 	$(call Image/Build/$(1))
+	$(call Build/sdcard-img)
 	dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
 endef
 
+define Build/sdcard-img
+	./gen_realview_sdcard_img.sh \
+	$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)sdcard.img \
+	$(KDIR)/root.ext4 \
+	$(CONFIG_TARGET_ROOTFS_PARTSIZE)
+endef
+
+
 $(eval $(call BuildImage))
diff --git a/target/linux/realview/image/gen_realview_sdcard_img.sh b/target/linux/realview/image/gen_realview_sdcard_img.sh
new file mode 100755
index 0000000..4619def
--- /dev/null
+++ b/target/linux/realview/image/gen_realview_sdcard_img.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+set -x
+[ $# -eq 3 ] || {
+    echo "SYNTAX: $0 <file> <rootfs image> <rootfs size>"
+    exit 1
+}
+
+OUTPUT="$1"
+ROOTFS="$2"
+ROOTFSSIZE="$3"
+
+head=4
+sect=63
+
+set `ptgen -o $OUTPUT -h $head -s $sect -l 4096 -t 83 -p ${ROOTFSSIZE}M`
+
+ROOTFSOFFSET="$(($1 / 512))"
+ROOTFSSIZE="$(($2 / 512))"
+
+dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc
+
+
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mbanderson at uwalumni.com  Tue Aug 25 18:43:13 2015
From: mbanderson at uwalumni.com (Michael Anderson)
Date: Tue, 25 Aug 2015 17:43:13 -0500
Subject: [OpenWrt-Devel] Just open-sourced our OpenWrt Router test framework
Message-ID: <CAGBQ0xRHO0Cs4kYqXVU3aQRiEYTZzz7sE6a+9ECkQ4y7vLNSPA@mail.gmail.com>

Hi,

The lawyers of company I work for, Qualcomm, finally agreed to let me post
our project to github:

    https://github.com/qca/boardfarm

Long story short, our team needed an automated way to flash/sysupgrade new
daily builds of openwrt-based software onto various devices, run tests, and
report results.  We needed to use it with continuous integration software
like Jenkins so that we could test new code changes to router software
before they are merged.

So, we started this project two years ago, it's grown quite a bit, and it's
been fantastic at catching kernel panics, memory leaks, networking
problems, and more.  We run it on dozens of different boards every day.
It's all written in Python, including the tests.  There's more details at
the above link.

I also included a document on how to setup a single router test station
<https://github.com/qca/boardfarm/blob/master/docs/BOARD_FARM.md>. That's
just an example using inexpensive computers, but any linux computers will
do.


Anyway, just wanted to let people know this exists in case there's some
interest.  We continue to work on this and improve this.  We actually have
server racks filled with many devices for running these tests.

Michael Anderson, Ph.D.
Snr Engineer
1-512-532-3029
AUS.B-340N
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150825/49b5d301/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From champetier.etienne at gmail.com  Tue Aug 25 19:00:38 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Tue, 25 Aug 2015 23:00:38 +0000
Subject: [OpenWrt-Devel] [PATCH procd v2 0/5] jail work
Message-ID: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>

This patch series rework a bit ujail,
and add capabilities support to it

Seccomp filter are very powerful but not totally generic,
each arch can have different set of syscalls,
each libc can use different syscall for the same function,
and seccomp isn't supported on all arch.

Capabilities are more high level, but still can restrict
jail to a sane minimum of privileges.

Patch 4 is a bit big and i can split it if needed, just tell me how

Waiting for your comments
Etienne
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Tue Aug 25 19:00:39 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Tue, 25 Aug 2015 23:00:39 +0000
Subject: [OpenWrt-Devel] [PATCH procd v2 1/5] add UTRACE_SUPPORT build option
In-Reply-To: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440543643-43546-2-git-send-email-champetier.etienne@gmail.com>

we can now build preload-seccomp, ujail, utrace separately

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6af17a3..805e2ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,7 +84,9 @@ TARGET_LINK_LIBRARIES(ujail ubox)
 INSTALL(TARGETS ujail
 	RUNTIME DESTINATION sbin
 )
+endif()
 
+IF(UTRACE_SUPPORT)
 ADD_EXECUTABLE(utrace trace/trace.c)
 TARGET_LINK_LIBRARIES(utrace ubox ${json} blobmsg_json)
 INSTALL(TARGETS utrace
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Tue Aug 25 19:00:40 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Tue, 25 Aug 2015 23:00:40 +0000
Subject: [OpenWrt-Devel] [PATCH procd v2 2/5] jail,
	seccomp: fix typo/improve log prefix
In-Reply-To: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440543643-43546-3-git-send-email-champetier.etienne@gmail.com>

(perload-jail -> preload-seccomp)

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/seccomp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/jail/seccomp.h b/jail/seccomp.h
index 6c585ad..c44a607 100644
--- a/jail/seccomp.h
+++ b/jail/seccomp.h
@@ -12,8 +12,8 @@
  */
 
 #define INFO(fmt, ...) do { \
-	syslog(0,"perload-jail: "fmt, ## __VA_ARGS__); \
-	fprintf(stderr,"perload-jail: "fmt, ## __VA_ARGS__); \
+	syslog(0,"preload-seccomp: "fmt, ## __VA_ARGS__); \
+	fprintf(stderr,"preload-seccomp: "fmt, ## __VA_ARGS__); \
 	} while (0)
 
 int install_syscall_filter(const char *argv, const char *file);
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Tue Aug 25 19:00:41 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Tue, 25 Aug 2015 23:00:41 +0000
Subject: [OpenWrt-Devel] [PATCH procd v2 3/5] jail,
	seccomp: remove useless root check
In-Reply-To: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440543643-43546-4-git-send-email-champetier.etienne@gmail.com>

prctl(PR_SET_NO_NEW_PRIVS, 1) is enough, we don't require CAP_SYS_ADMIN
see
https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt
https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/preload.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/jail/preload.c b/jail/preload.c
index 97ac44d..a1cc0b6 100644
--- a/jail/preload.c
+++ b/jail/preload.c
@@ -27,14 +27,8 @@ static main_t __main__;
 
 static int __preload_main__(int argc, char **argv, char **envp)
 {
-	uid_t uid = getuid();
 	char *env_file = getenv("SECCOMP_FILE");
 
-	if (uid) {
-		INFO("preload-seccomp: %s: not root, cannot install seccomp filter\n", *argv);
-		return -1;
-	}
-
 	if (install_syscall_filter(*argv, env_file))
 		return -1;
 
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Tue Aug 25 19:00:42 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Tue, 25 Aug 2015 23:00:42 +0000
Subject: [OpenWrt-Devel] [PATCH procd v2 4/5] ujail: reworks & cleanups
In-Reply-To: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440543643-43546-5-git-send-email-champetier.etienne@gmail.com>

-use EXIT_SUCCESS/EXIT_FAILURE (not -1)
-parse every option in main, put them in opts struct
-add CLONE_NEWIPC to the clone() call (it's already compiled in openwrt kernel)
-return the exit status of the jailed process, or the num of the signal that killed it
-add missing options to usage()
-add a warning in usage() about ujail security
-debug option can now take an int as parameter (~debug level),
  with -d2 you now activate "LD_DEBUG=all" for exemple
-do not depend on libpreload-seccomp.so if -S is not present
-there is now only one ujail process instead of two

jail creation is now as follow:
1) create jail root dir (mkdir)
2) create new namespace (clone)
(in the parent wait for the child with uloop)
3) build the jail root fs (mount bind all the libs/bins ...),
pivot_root and mount special fs (procfs, sysfs) (build_jail_fs())
4) build envp (LD_PRELOAD the seccomp helper or ...)
5) drop capabilities (next patch)
6) execve the jailed bin
7) remove jail root dir (once child is dead)

there is no need to umount anything because we are already in a namespace

Todo:
-allow signals from the parent to the child

Feature request:
-when we add a file or dir, detect if it's an exec and add it's dependencies

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/jail.c | 391 ++++++++++++++++++++++++------------------------------------
 1 file changed, 156 insertions(+), 235 deletions(-)

diff --git a/jail/jail.c b/jail/jail.c
index 2bba292..487d18f 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -43,7 +43,17 @@
 #include <libubox/uloop.h>
 
 #define STACK_SIZE	(1024 * 1024)
-#define OPT_ARGS	"P:S:n:r:w:psuldo"
+#define OPT_ARGS	"P:S:n:r:w:d:psulo"
+
+static struct {
+	char *path;
+	char *name;
+	char **jail_argv;
+	char *seccomp;
+	int procfs;
+	int ronly;
+	int sysfs;
+} opts;
 
 struct extra {
 	struct list_head list;
@@ -125,7 +135,7 @@ static int mount_bind(const char *root, const char *path, const char *name, int
 		return -1;
 	}
 
-	if (readonly && mount(old, new, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL)) {
+	if (readonly && mount(NULL, new, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL)) {
 		ERROR("failed to remount ro %s: %s\n", new, strerror(errno));
 		return -1;
 	}
@@ -135,80 +145,75 @@ static int mount_bind(const char *root, const char *path, const char *name, int
 	return 0;
 }
 
-static int build_jail(const char *path)
+static int build_jail_fs()
 {
 	struct library *l;
 	struct extra *m;
-	int ret = 0;
 
-	mkdir(path, 0755);
-
-	if (mount("tmpfs", path, "tmpfs", MS_NOATIME, "mode=0755")) {
+	if (mount("tmpfs", opts.path, "tmpfs", MS_NOATIME, "mode=0755")) {
 		ERROR("tmpfs mount failed %s\n", strerror(errno));
 		return -1;
 	}
 
-	avl_for_each_element(&libraries, l, avl)
-		if (mount_bind(path, l->path, l->name, 1, -1))
-			return -1;
-
-	list_for_each_entry(m, &extras, list)
-		if (mount_bind(path, m->path, m->name, m->readonly, 0))
-			return -1;
-
-	return ret;
-}
+	if (chdir(opts.path)) {
+		ERROR("failed to chdir() in the jail root\n");
+		return -1;
+	}
 
-static void _umount(const char *root, const char *path)
-{
-	char *buf = NULL;
+	avl_init(&libraries, avl_strcmp, false, NULL);
+	alloc_library_path("/lib64");
+	alloc_library_path("/lib");
+	alloc_library_path("/usr/lib");
+	load_ldso_conf("/etc/ld.so.conf");
 
-	if (asprintf(&buf, "%s%s", root, path) < 0) {
-		ERROR("failed to alloc umount buffer: %s\n", strerror(errno));
-	} else {
-		DEBUG("umount %s\n", buf);
-		umount(buf);
-		free(buf);
+	if (elf_load_deps(*opts.jail_argv)) {
+		ERROR("failed to load dependencies\n");
+		return -1;
 	}
-}
 
-static int stop_jail(const char *root)
-{
-	struct library *l;
-	struct extra *m;
+	if (opts.seccomp && elf_load_deps("libpreload-seccomp.so")) {
+		ERROR("failed to load libpreload-seccomp.so\n");
+		return -1;
+	}
 
-	avl_for_each_element(&libraries, l, avl) {
-		char path[256];
-		char *p = l->path;
+	avl_for_each_element(&libraries, l, avl)
+		if (mount_bind(opts.path, l->path, l->name, 1, -1))
+			return -1;
 
-		if (strstr(p, "local"))
-			p = "/lib";
+	list_for_each_entry(m, &extras, list)
+		if (mount_bind(opts.path, m->path, m->name, m->readonly, 0))
+			return -1;
 
-		snprintf(path, sizeof(path), "%s%s/%s", root, p, l->name);
-		DEBUG("umount %s\n", path);
-		umount(path);
+	char *mpoint;
+	if (asprintf(&mpoint, "%s/old", opts.path) < 0) {
+		ERROR("failed to alloc pivot path: %s\n", strerror(errno));
+		return -1;
 	}
-
-	list_for_each_entry(m, &extras, list) {
-		char path[256];
-
-		snprintf(path, sizeof(path), "%s%s/%s", root, m->path, m->name);
-		DEBUG("umount %s\n", path);
-		umount(path);
+	mkdir_p(mpoint, 0755);
+	if (pivot_root(opts.path, mpoint) == -1) {
+		ERROR("pivot_root failed:%s\n", strerror(errno));
+		free(mpoint);
+		return -1;
 	}
-
-	_umount(root, "/proc");
-	_umount(root, "/sys");
-
-	DEBUG("umount %s\n", root);
-	umount(root);
-	rmdir(root);
+	free(mpoint);
+	umount2("/old", MNT_DETACH);
+	rmdir("/old");
+	if (opts.procfs) {
+		mkdir("/proc", 0755);
+		mount("proc", "/proc", "proc", MS_NOATIME, 0);
+	}
+	if (opts.sysfs) {
+		mkdir("/sys", 0755);
+		mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
+	}
+	if (opts.ronly)
+		mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
 
 	return 0;
 }
 
 #define MAX_ENVP	8
-static char** build_envp(const char *seccomp, int debug)
+static char** build_envp(const char *seccomp)
 {
 	static char *envp[MAX_ENVP];
 	static char preload_var[64];
@@ -227,177 +232,77 @@ static char** build_envp(const char *seccomp, int debug)
 		snprintf(preload_var, sizeof(preload_var), "LD_PRELOAD=%s", preload_lib);
 		envp[count++] = preload_var;
 	}
-	if (debug)
+	if (debug > 1)
 		envp[count++] = debug_var;
 
 	return envp;
 }
 
-static int spawn(const char *path, char **argv, const char *seccomp)
-{
-	pid_t pid = fork();
-
-	if (pid < 0) {
-		ERROR("failed to spawn %s: %s\n", *argv, strerror(errno));
-		return -1;
-	} else if (!pid) {
-		char **envp = build_envp(seccomp, 0);
-
-		INFO("spawning %s\n", *argv);
-		execve(*argv, argv, envp);
-		ERROR("failed to spawn child %s: %s\n", *argv, strerror(errno));
-		exit(-1);
-	}
-
-	return pid;
-}
-
-static int usage(void)
+static void usage(void)
 {
-	fprintf(stderr, "jail <options> -D <binary> <params ...>\n");
+	fprintf(stderr, "ujail <options> -- <binary> <params ...>\n");
 	fprintf(stderr, "  -P <path>\tpath where the jail will be staged\n");
 	fprintf(stderr, "  -S <file>\tseccomp filter\n");
 	fprintf(stderr, "  -n <name>\tthe name of the jail\n");
 	fprintf(stderr, "  -r <file>\treadonly files that should be staged\n");
 	fprintf(stderr, "  -w <file>\twriteable files that should be staged\n");
-	fprintf(stderr, "  -p\t\tjail has /proc\t\n");
-	fprintf(stderr, "  -s\t\tjail has /sys\t\n");
-	fprintf(stderr, "  -l\t\tjail has /dev/log\t\n");
-	fprintf(stderr, "  -u\t\tjail has a ubus socket\t\n");
-
-	return -1;
+	fprintf(stderr, "  -d <num>\tshow debug log (increase num to increase verbosity)\n");
+	fprintf(stderr, "  -p\t\tjail has /proc\n");
+	fprintf(stderr, "  -s\t\tjail has /sys\n");
+	fprintf(stderr, "  -l\t\tjail has /dev/log\n");
+	fprintf(stderr, "  -u\t\tjail has a ubus socket\n");
+	fprintf(stderr, "  -o\t\tremont jail root (/) read only\n");
+	fprintf(stderr, "\nWarning: by default root inside the jail is the same\n\
+and he has the same powers as root outside the jail,\n\
+thus he can escape the jail and/or break stuff.\n\
+Please use an appropriate seccomp filter (-S) to restrict his powers\n");
 }
 
-static int child_running = 1;
-
-static void child_process_handler(struct uloop_process *c, int ret)
-{
-	INFO("child (%d) exited: %d\n", c->pid, ret);
-	uloop_end();
-	child_running = 0;
-}
-
-struct uloop_process child_process = {
-	.cb = child_process_handler,
-};
-
-static int spawn_child(void *arg)
+static int spawn_jail(void *arg)
 {
-	char *path = get_current_dir_name();
-	int procfs = 0, sysfs = 0;
-	char *seccomp = NULL;
-	char **argv = arg;
-	int argc = 0, ch;
-	char *mpoint;
-	int ronly = 0;
-
-	while (argv[argc])
-		argc++;
-
-	optind = 0;
-	while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
-		switch (ch) {
-		case 'd':
-			debug = 1;
-			break;
-		case 'S':
-			seccomp = optarg;
-			break;
-		case 'p':
-			procfs = 1;
-			break;
-		case 'o':
-			ronly = 1;
-			break;
-		case 's':
-			sysfs = 1;
-			break;
-		case 'n':
-			if (sethostname(optarg, strlen(optarg)))
-				ERROR("failed to sethostname: %s\n", strerror(errno));
-			break;
-		}
+	if (opts.name && sethostname(opts.name, strlen(opts.name))) {
+		ERROR("failed to sethostname: %s\n", strerror(errno));
 	}
 
-	if (asprintf(&mpoint, "%s/old", path) < 0) {
-		ERROR("failed to alloc pivot path: %s\n", strerror(errno));
-		return -1;
-	}
-	mkdir_p(mpoint, 0755);
-	if (pivot_root(path, mpoint) == -1) {
-		ERROR("pivot_root failed:%s\n", strerror(errno));
-		return -1;
-	}
-	free(mpoint);
-	umount2("/old", MNT_DETACH);
-	rmdir("/old");
-	if (procfs) {
-		mkdir("/proc", 0755);
-		mount("proc", "/proc", "proc", MS_NOATIME, 0);
+	if (build_jail_fs()) {
+		ERROR("failed to build jail fs");
+		exit(EXIT_FAILURE);
 	}
-	if (sysfs) {
-		mkdir("/sys", 0755);
-		mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
-	}
-	if (ronly)
-		mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
 
-	uloop_init();
+	char **envp = build_envp(opts.seccomp);
+	if (!envp)
+		exit(EXIT_FAILURE);
 
-	child_process.pid = spawn(path, &argv[optind], seccomp);
-	uloop_process_add(&child_process);
-	uloop_run();
-	uloop_done();
-	if (child_running) {
-		kill(child_process.pid, SIGTERM);
-		waitpid(child_process.pid, NULL, 0);
-	}
+	//TODO: drop capabilities() here
+	//prctl(PR_CAPBSET_DROP, ..., 0, 0, 0);
 
-	return 0;
+	INFO("exec-ing %s\n", *opts.jail_argv);
+	execve(*opts.jail_argv, opts.jail_argv, envp);
+	//we get there only if execve fails
+	ERROR("failed to execve %s: %s\n", *opts.jail_argv, strerror(errno));
+	exit(EXIT_FAILURE);
 }
 
-static int namespace_running = 1;
+static int jail_running = 1;
+static int jail_return_code = 0;
 
-static void namespace_process_handler(struct uloop_process *c, int ret)
+static void jail_process_handler(struct uloop_process *c, int ret)
 {
-	INFO("namespace (%d) exited: %d\n", c->pid, ret);
+	if (WIFEXITED(ret)) {
+		jail_return_code = WEXITSTATUS(ret);
+		INFO("jail (%d) exited with exit: %d\n", c->pid, jail_return_code);
+	} else {
+		jail_return_code = WTERMSIG(ret);
+		INFO("jail (%d) exited with signal: %d\n", c->pid, jail_return_code);
+	}
+	jail_running = 0;
 	uloop_end();
-	namespace_running = 0;
 }
 
-struct uloop_process namespace_process = {
-	.cb = namespace_process_handler,
+static struct uloop_process jail_process = {
+	.cb = jail_process_handler,
 };
 
-static void spawn_namespace(const char *path, int argc, char **argv)
-{
-	char *dir = get_current_dir_name();
-
-	uloop_init();
-	if (chdir(path)) {
-		ERROR("failed to chdir() into the jail\n");
-		return;
-	}
-	namespace_process.pid = clone(spawn_child,
-			child_stack + STACK_SIZE,
-			CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | SIGCHLD, argv);
-
-	if (namespace_process.pid != -1) {
-		if (chdir(dir))
-			ERROR("failed to chdir() out of the jail\n");
-		free(dir);
-		uloop_process_add(&namespace_process);
-		uloop_run();
-		uloop_done();
-		if (namespace_running) {
-			kill(namespace_process.pid, SIGTERM);
-			waitpid(namespace_process.pid, NULL, 0);
-		}
-	} else {
-		ERROR("failed to spawn namespace: %s\n", strerror(errno));
-	}
-}
-
 static void add_extra(char *name, int readonly)
 {
 	struct extra *f;
@@ -419,16 +324,14 @@ static void add_extra(char *name, int readonly)
 int main(int argc, char **argv)
 {
 	uid_t uid = getuid();
-	const char *name = NULL;
-	char *path = NULL;
-	struct stat s;
-	int ch, ret;
 	char log[] = "/dev/log";
 	char ubus[] = "/var/run/ubus.sock";
+	int ret = EXIT_SUCCESS;
+	int ch;
 
 	if (uid) {
 		ERROR("not root, aborting: %s\n", strerror(errno));
-		return -1;
+		return EXIT_FAILURE;
 	}
 
 	umask(022);
@@ -436,15 +339,27 @@ int main(int argc, char **argv)
 	while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
 		switch (ch) {
 		case 'd':
-			debug = 1;
+			debug = atoi(optarg);
+			break;
+		case 'p':
+			opts.procfs = 1;
+			break;
+		case 'o':
+			opts.ronly = 1;
+			break;
+		case 's':
+			opts.sysfs = 1;
+			break;
+		case 'S':
+			opts.seccomp = optarg;
+			add_extra(optarg, 1);
 			break;
 		case 'P':
-			path = optarg;
+			opts.path = optarg;
 			break;
 		case 'n':
-			name = optarg;
+			opts.name = optarg;
 			break;
-		case 'S':
 		case 'r':
 			add_extra(optarg, 1);
 			break;
@@ -460,46 +375,52 @@ int main(int argc, char **argv)
 		}
 	}
 
-	if (argc - optind < 1)
-		return usage();
+	//no <binary> param found
+	if (argc - optind < 1) {
+		usage();
+		return EXIT_FAILURE;
+	}
 
-	if (!path && asprintf(&path, "/tmp/%s", basename(argv[optind])) == -1) {
-		ERROR("failed to set root path\n: %s", strerror(errno));
-		return -1;
+	opts.jail_argv = &argv[optind];
+
+	if (!opts.path && asprintf(&opts.path, "/tmp/%s", basename(*opts.jail_argv)) == -1) {
+		ERROR("failed to asprintf root path: %s\n", strerror(errno));
+		return EXIT_FAILURE;
 	}
 
-	if (!stat(path, &s)) {
-		ERROR("%s already exists: %s\n", path, strerror(errno));
-		return -1;
+	if (mkdir(opts.path, 0755)) {
+		ERROR("unable to create root path: %s (%s)\n", opts.path, strerror(errno));
+		return EXIT_FAILURE;
 	}
 
-	if (name)
-		prctl(PR_SET_NAME, name, NULL, NULL, NULL);
+	if (opts.name)
+		prctl(PR_SET_NAME, opts.name, NULL, NULL, NULL);
 
-	avl_init(&libraries, avl_strcmp, false, NULL);
-	alloc_library_path("/lib64");
-	alloc_library_path("/lib");
-	alloc_library_path("/usr/lib");
-	load_ldso_conf("/etc/ld.so.conf");
+	uloop_init();
+	jail_process.pid = clone(spawn_jail,
+			child_stack + STACK_SIZE,
+			CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | SIGCHLD, argv);
 
-	if (elf_load_deps(argv[optind])) {
-		ERROR("failed to load dependencies\n");
-		return -1;
+	if (jail_process.pid != -1) {
+		uloop_process_add(&jail_process);
+		uloop_run();
+		uloop_done();
+		if (jail_running) {
+			kill(jail_process.pid, SIGTERM);
+			waitpid(jail_process.pid, NULL, 0);
+		}
+	} else {
+		ERROR("failed to spawn namespace: %s\n", strerror(errno));
+		ret = EXIT_FAILURE;
 	}
 
-	if (elf_load_deps("libpreload-seccomp.so")) {
-		ERROR("failed to load libpreload-seccomp.so\n");
-		return -1;
+	if (rmdir(opts.path)) {
+		ERROR("Unable to remove root path: %s (%s)\n", opts.path, strerror(errno));
+		ret = EXIT_FAILURE;
 	}
 
-	ret = build_jail(path);
-
-	if (!ret)
-		spawn_namespace(path, argc, argv);
-	else
-		ERROR("failed to build jail\n");
-
-	stop_jail(path);
+	if (ret)
+		return ret;
 
-	return ret;
+	return jail_return_code;
 }
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Tue Aug 25 19:00:43 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Tue, 25 Aug 2015 23:00:43 +0000
Subject: [OpenWrt-Devel] [PATCH procd v2 5/5] jail: add capabilities support
In-Reply-To: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440543643-43546-6-git-send-email-champetier.etienne@gmail.com>

If there is one or more capabilities in cap.keep,
drop all capabilities not in cap.keep.
Always drop all capabalities in cap.drop

exemple json syntax:
{
"cap.keep": [
        "cap_net_raw"
],
"cap.drop": []
}

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 CMakeLists.txt         |  18 +++++---
 jail/capabilities.c    | 116 +++++++++++++++++++++++++++++++++++++++++++++++++
 jail/capabilities.h    |  14 ++++++
 jail/jail.c            |  15 +++++--
 make_capabilities_h.sh |  10 +++++
 5 files changed, 164 insertions(+), 9 deletions(-)
 create mode 100644 jail/capabilities.c
 create mode 100644 jail/capabilities.h
 create mode 100755 make_capabilities_h.sh

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 805e2ed..cc1e4a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,7 +67,14 @@ ADD_CUSTOM_COMMAND(
 	COMMAND ./make_syscall_h.sh ${CMAKE_C_COMPILER} > ./syscall-names.h
 	DEPENDS ./make_syscall_h.sh
 )
-ADD_CUSTOM_TARGET(headers DEPENDS syscall-names.h)
+ADD_CUSTOM_TARGET(syscall-names-h DEPENDS syscall-names.h)
+
+ADD_CUSTOM_COMMAND(
+	OUTPUT capabilities-names.h
+	COMMAND ./make_capabilities_h.sh ${CMAKE_C_COMPILER} > ./capabilities-names.h
+	DEPENDS ./make_capabilities_h.sh
+)
+ADD_CUSTOM_TARGET(capabilities-names-h DEPENDS capabilities-names.h)
 
 IF(SECCOMP_SUPPORT)
 ADD_LIBRARY(preload-seccomp SHARED jail/preload.c jail/seccomp.c)
@@ -75,15 +82,16 @@ TARGET_LINK_LIBRARIES(preload-seccomp dl ubox blobmsg_json)
 INSTALL(TARGETS preload-seccomp
 	LIBRARY DESTINATION lib
 )
-ADD_DEPENDENCIES(preload-seccomp headers)
+ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
 endif()
 
 IF(JAIL_SUPPORT)
-ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c)
-TARGET_LINK_LIBRARIES(ujail ubox)
+ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
+TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
 INSTALL(TARGETS ujail
 	RUNTIME DESTINATION sbin
 )
+ADD_DEPENDENCIES(ujail capabilities-names-h)
 endif()
 
 IF(UTRACE_SUPPORT)
@@ -92,7 +100,7 @@ TARGET_LINK_LIBRARIES(utrace ubox ${json} blobmsg_json)
 INSTALL(TARGETS utrace
 	RUNTIME DESTINATION sbin
 )
-ADD_DEPENDENCIES(utrace headers)
+ADD_DEPENDENCIES(utrace syscall-names-h)
 
 ADD_LIBRARY(preload-trace SHARED trace/preload.c)
 TARGET_LINK_LIBRARIES(preload-trace dl)
diff --git a/jail/capabilities.c b/jail/capabilities.c
new file mode 100644
index 0000000..b5ea965
--- /dev/null
+++ b/jail/capabilities.c
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2015 Etienne CHAMPETIER <champetier.etienne at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#define _GNU_SOURCE 1
+#include <syslog.h>
+#include <sys/prctl.h>
+
+#include <libubox/blobmsg.h>
+#include <libubox/blobmsg_json.h>
+
+#include "log.h"
+#include "../capabilities-names.h"
+#include "capabilities.h"
+
+static int find_capabilities(const char *name)
+{
+	int i;
+
+	for (i = 0; i <= CAP_LAST_CAP; i++)
+		if (capabilities_names[i] && !strcmp(capabilities_names[i], name))
+			return i;
+
+	return -1;
+}
+
+int drop_capabilities(const char *file)
+{
+	enum {
+		CAP_KEEP,
+		CAP_DROP,
+		__CAP_MAX
+	};
+	static const struct blobmsg_policy policy[__CAP_MAX] = {
+		[CAP_KEEP] = { .name = "cap.keep", .type = BLOBMSG_TYPE_ARRAY },
+		[CAP_DROP] = { .name = "cap.drop", .type = BLOBMSG_TYPE_ARRAY },
+	};
+	struct blob_buf b = { 0 };
+	struct blob_attr *tb[__CAP_MAX];
+	struct blob_attr *cur;
+	int rem, cap;
+	char *name;
+	uint64_t capdrop = 0LLU;
+
+	DEBUG("dropping capabilities\n");
+
+	blob_buf_init(&b, 0);
+	if (!blobmsg_add_json_from_file(&b, file)) {
+		ERROR("failed to load %s\n", file);
+		return -1;
+	}
+
+	blobmsg_parse(policy, __CAP_MAX, tb, blob_data(b.head), blob_len(b.head));
+	if (!tb[CAP_KEEP] && !tb[CAP_DROP]) {
+		ERROR("failed to parse %s\n", file);
+		return -1;
+	}
+
+	blobmsg_for_each_attr(cur, tb[CAP_KEEP], rem) {
+		name = blobmsg_get_string(cur);
+		if (!name) {
+			ERROR("invalid capability name in cap.keep\n");
+			return -1;
+		}
+		cap = find_capabilities(name);
+		if (cap == -1) {
+			ERROR("unknown capability %s in cap.keep\n", name);
+			return -1;
+		}
+		capdrop |= (1LLU << cap);
+	}
+
+	if (capdrop == 0LLU) {
+		DEBUG("cap.keep empty -> only dropping capabilities from cap.drop (blacklist)\n");
+		capdrop = 0xffffffffffffffffLLU;
+	} else {
+		DEBUG("cap.keep has at least one capability -> dropping every capabilities not in cap.keep (whitelist)\n");
+	}
+
+	blobmsg_for_each_attr(cur, tb[CAP_DROP], rem) {
+		name = blobmsg_get_string(cur);
+		if (!name) {
+			ERROR("invalid capability name in cap.drop\n");
+			return -1;
+		}
+		cap = find_capabilities(name);
+		if (cap == -1) {
+			ERROR("unknown capability %s in cap.drop\n", name);
+			return -1;
+		}
+		capdrop &= ~(1LLU << cap);
+	}
+
+	for (cap = 0; cap <= CAP_LAST_CAP; cap++) {
+		if ( (capdrop & (1LLU << cap)) == 0) {
+			DEBUG("dropping capability %s (%d)\n", capabilities_names[cap], cap);
+			if (prctl(PR_CAPBSET_DROP, cap, 0, 0, 0)) {
+				ERROR("prctl(PR_CAPBSET_DROP, %d) failed: %s\n", cap, strerror(errno));
+				return errno;
+			}
+		} else {
+			DEBUG("keeping capability %s (%d)\n", capabilities_names[cap], cap);
+		}
+	}
+
+	return 0;
+}
diff --git a/jail/capabilities.h b/jail/capabilities.h
new file mode 100644
index 0000000..e6699e9
--- /dev/null
+++ b/jail/capabilities.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2015 Etienne CHAMPETIER <champetier.etienne at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+int drop_capabilities(const char *file);
diff --git a/jail/jail.c b/jail/jail.c
index 487d18f..cfaefdd 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -37,19 +37,21 @@
 #include <sched.h>
 
 #include "elf.h"
+#include "capabilities.h"
 
 #include <libubox/utils.h>
 #include <libubox/list.h>
 #include <libubox/uloop.h>
 
 #define STACK_SIZE	(1024 * 1024)
-#define OPT_ARGS	"P:S:n:r:w:d:psulo"
+#define OPT_ARGS	"P:S:C:n:r:w:d:psulo"
 
 static struct {
 	char *path;
 	char *name;
 	char **jail_argv;
 	char *seccomp;
+	char *capabilities;
 	int procfs;
 	int ronly;
 	int sysfs;
@@ -243,6 +245,7 @@ static void usage(void)
 	fprintf(stderr, "ujail <options> -- <binary> <params ...>\n");
 	fprintf(stderr, "  -P <path>\tpath where the jail will be staged\n");
 	fprintf(stderr, "  -S <file>\tseccomp filter\n");
+	fprintf(stderr, "  -C <file>\tcapabilities drop config\n");
 	fprintf(stderr, "  -n <name>\tthe name of the jail\n");
 	fprintf(stderr, "  -r <file>\treadonly files that should be staged\n");
 	fprintf(stderr, "  -w <file>\twriteable files that should be staged\n");
@@ -255,7 +258,7 @@ static void usage(void)
 	fprintf(stderr, "\nWarning: by default root inside the jail is the same\n\
 and he has the same powers as root outside the jail,\n\
 thus he can escape the jail and/or break stuff.\n\
-Please use an appropriate seccomp filter (-S) to restrict his powers\n");
+Please use an appropriate seccomp/capabilities filter (-S/-C) to restrict his powers\n");
 }
 
 static int spawn_jail(void *arg)
@@ -273,8 +276,8 @@ static int spawn_jail(void *arg)
 	if (!envp)
 		exit(EXIT_FAILURE);
 
-	//TODO: drop capabilities() here
-	//prctl(PR_CAPBSET_DROP, ..., 0, 0, 0);
+	if (opts.capabilities && drop_capabilities(opts.capabilities))
+		exit(EXIT_FAILURE);
 
 	INFO("exec-ing %s\n", *opts.jail_argv);
 	execve(*opts.jail_argv, opts.jail_argv, envp);
@@ -354,6 +357,10 @@ int main(int argc, char **argv)
 			opts.seccomp = optarg;
 			add_extra(optarg, 1);
 			break;
+		case 'C':
+			opts.capabilities = optarg;
+			add_extra(optarg, 1);
+			break;
 		case 'P':
 			opts.path = optarg;
 			break;
diff --git a/make_capabilities_h.sh b/make_capabilities_h.sh
new file mode 100755
index 0000000..635e740
--- /dev/null
+++ b/make_capabilities_h.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+CC=$1
+[ -n "$TARGET_CC_NOCACHE" ] && CC=$TARGET_CC_NOCACHE
+
+echo "#include <linux/capability.h>"
+echo "static const char *capabilities_names[] = {"
+echo "#include <linux/capability.h>" | ${CC} -E -dM - | grep '#define CAP' | grep -vE '(CAP_TO|CAP_LAST_CAP)' | \
+	awk '{print $3" "$2}' | sort -n | awk '{print "   ["$1"]\t= \""tolower($2)"\","}'
+echo "};"
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Tue Aug 25 19:11:48 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Tue, 25 Aug 2015 23:11:48 +0000
Subject: [OpenWrt-Devel] [PATCH v2] procd: rework makefile,
	split ujail/seccomp
Message-ID: <1440544308-43687-1-git-send-email-champetier.etienne@gmail.com>

this need to be applied after my work on ujail (procd git)
ujail doesn't depend on seccomp and some archs dont support seccomp

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 package/system/procd/Makefile | 50 +++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index 2c7ea3b..3752332 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -24,7 +24,8 @@ PKG_LICENSE_FILES:=
 
 PKG_MAINTAINER:=John Crispin <blogic at openwrt.org>
 
-PKG_CONFIG_DEPENDS:= CONFIG_KERNEL_SECCOMP CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS CONFIG_PROCD_JAIL_SUPPORT
+PKG_CONFIG_DEPENDS:= CONFIG_KERNEL_SECCOMP CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \
+	CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
@@ -38,12 +39,18 @@ define Package/procd
   TITLE:=OpenWrt system process manager
 endef
 
-define Package/procd-jail
+define Package/procd-ujail
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=procd + at KERNEL_NAMESPACES + at KERNEL_UTS_NS + at KERNEL_IPC_NS + at KERNEL_PID_NS @PROCD_JAIL_SUPPORT
-  TITLE:=OpenWrt process jail
-  DEFAULT:=n
+  DEPENDS:=@KERNEL_NAMESPACES + at KERNEL_UTS_NS + at KERNEL_IPC_NS + at KERNEL_PID_NS +libubox +libblobmsg-json
+  TITLE:=OpenWrt process jail helper
+endef
+
+define Package/procd-seccomp
+  SECTION:=base
+  CATEGORY:=Base system
+  DEPENDS:=@arm||@armeb||@mips||@mipsel||@i386||@x86_64 @!TARGET_uml @KERNEL_SECCOMP +libubox +libblobmsg-json
+  TITLE:=OpenWrt process seccomp helper + utrace
 endef
 
 define Package/procd-nand
@@ -73,16 +80,6 @@ config PROCD_ZRAM_TMPFS
 	bool
 	default n
 	prompt "Mount /tmp using zram."
-
-config PROCD_JAIL_SUPPORT
-	bool
-	default y
-	depends on (arm || armeb || mips || mipsel || i386 || x86_64) && PROCD_SECCOMP_SUPPORT
-
-config PROCD_SECCOMP_SUPPORT
-	bool
-	default y
-	depends on (arm || armeb || mips || mipsel || i386 || x86_64) && !TARGET_uml && @KERNEL_SECCOMP
 endmenu
 endef
 
@@ -99,12 +96,12 @@ ifeq ($(CONFIG_PROCD_ZRAM_TMPFS),y)
   CMAKE_OPTIONS += -DZRAM_TMPFS=1
 endif
 
-ifeq ($(CONFIG_PROCD_JAIL_SUPPORT),y)
+ifdef CONFIG_PACKAGE_procd-ujail
   CMAKE_OPTIONS += -DJAIL_SUPPORT=1
 endif
 
-ifeq ($(CONFIG_PROCD_SECCOMP_SUPPORT),y)
-  CMAKE_OPTIONS += -DSECCOMP_SUPPORT=1
+ifdef CONFIG_PACKAGE_procd-seccomp
+  CMAKE_OPTIONS += -DSECCOMP_SUPPORT=1 -DUTRACE_SUPPORT=1
 endif
 
 define Package/procd/install
@@ -115,15 +112,17 @@ define Package/procd/install
 	$(INSTALL_BIN) ./files/reload_config $(1)/sbin/
 	$(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
 	$(INSTALL_DATA) ./files/procd.sh $(1)/lib/functions/
-ifeq ($(CONFIG_PROCD_SECCOMP_SUPPORT),y)
-	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
-endif
 endef
 
-define Package/procd-jail/install
-	$(INSTALL_DIR) $(1)/sbin $(1)/lib
+define Package/procd-ujail/install
+	$(INSTALL_DIR) $(1)/sbin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ujail $(1)/sbin/
+endef
 
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{utrace,ujail} $(1)/sbin/
+define Package/procd-seccomp/install
+	$(INSTALL_DIR) $(1)/sbin $(1)/lib
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
 	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
 endef
 
@@ -141,6 +140,7 @@ define Package/procd-nand-firstboot/install
 endef
 
 $(eval $(call BuildPackage,procd))
-$(eval $(call BuildPackage,procd-jail))
+$(eval $(call BuildPackage,procd-ujail))
+$(eval $(call BuildPackage,procd-seccomp))
 $(eval $(call BuildPackage,procd-nand))
 $(eval $(call BuildPackage,procd-nand-firstboot))
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tesarmar at gmail.com  Wed Aug 26 01:09:53 2015
From: tesarmar at gmail.com (=?UTF-8?Q?Martin_Tesa=C5=99?=)
Date: Wed, 26 Aug 2015 07:09:53 +0200
Subject: [OpenWrt-Devel] [PATCH] brcm63xx: add Comtrend VR-3026e support
Message-ID: <CALvx54fA+u4Lm_oO2oJHvnib6PpiAtE69U_uybRcd1p2q_Lp1g@mail.gmail.com>

Hi,

here is an updated patch.

Regards,
Martin

2015-08-24 11:53 GMT+02:00 Jonas Gorski <jogo at openwrt.org>:

> Hi,
>
> On Sun, Aug 23, 2015 at 5:21 PM, Martin Tesar <tesarmar at gmail.com> wrote:
>
> A few words about the device would be nice. Please try to avoid an
> empty commit message.
>
> > Signed-off-by: Martin Tesar <tesarmar at gmail.com>
>
> Codewise it looks good, but you used spaces for indentation; please
> replace them with tabs as used everywhere else.
>
> > ---
> >  target/linux/brcm63xx/base-files/etc/diag.sh       |  3 +
> >  .../base-files/etc/uci-defaults/02_network         |  3 +-
> >  .../base-files/etc/uci-defaults/09_fix_crc         |  1 +
> >  target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
> >  .../lib/preinit/05_init_interfaces_brcm63xx        |  1 +
> >  target/linux/brcm63xx/dts/vr-3026e.dts             | 84
> ++++++++++++++++++++++
> >  target/linux/brcm63xx/image/Makefile               |  2 +
> >  .../brcm63xx/patches-4.1/805-board_VR-3026e.patch  | 81
> +++++++++++++++++++++
>
> Also currently there is still 3.18 support, so please also add the patch
> there.
>
> >  target/linux/brcm63xx/profiles/comtrend.mk         |  9 +++
> >  9 files changed, 186 insertions(+), 1 deletion(-)
> >  create mode 100644 target/linux/brcm63xx/dts/vr-3026e.dts
> >  create mode 100644
> target/linux/brcm63xx/patches-4.1/805-board_VR-3026e.patch
>
>
> Regards
> Jonas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150826/512ee919/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PATCH-v2-bcm63xx-add-Comtrend-VR-3026e-v1-support.patch
Type: text/x-patch
Size: 11651 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150826/512ee919/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From rraptorr at nails.eu.org  Wed Aug 26 06:31:39 2015
From: rraptorr at nails.eu.org (Janusz Dziemidowicz)
Date: Wed, 26 Aug 2015 12:31:39 +0200
Subject: [OpenWrt-Devel] [PATCH] [package] Properly enable 802.11w support
	in hostapd
Message-ID: <1440585099-17554-1-git-send-email-rraptorr@nails.eu.org>

Add CONFIG_IEEE80211W variable to DRIVER_MAKEOPTS so that 802.11w
support is properly compiled in full variant.

This fixes #20179

Signed-off-by: Janusz Dziemidowicz <rraptorr at nails.eu.org>
---
 package/network/services/hostapd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 3dff7b4..c16cb11 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -71,7 +71,7 @@ DRIVER_MAKEOPTS= \
 	CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
 
 ifeq ($(LOCAL_VARIANT),full)
-  CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k)
+  DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k)
 endif
 
 ifneq ($(LOCAL_TYPE),hostapd)
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Wed Aug 26 09:07:00 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Wed, 26 Aug 2015 15:07:00 +0200
Subject: [OpenWrt-Devel] [PATCH] brcm63xx: add Comtrend VR-3026e support
In-Reply-To: <CALvx54fA+u4Lm_oO2oJHvnib6PpiAtE69U_uybRcd1p2q_Lp1g@mail.gmail.com>
References: <CALvx54fA+u4Lm_oO2oJHvnib6PpiAtE69U_uybRcd1p2q_Lp1g@mail.gmail.com>
Message-ID: <CAOiHx=n3ZoqXjtGxVZ_NrST8sfqvkYC4_e0M8CiSx-nmGDe03g@mail.gmail.com>

Hi,

On Wed, Aug 26, 2015 at 7:09 AM, Martin Tesa? <tesarmar at gmail.com> wrote:
> Hi,
>
> here is an updated patch.

Please send the patch inline like you did the first time (easier to
review and comment on), and:

diff --git a/target/linux/brcm63xx/patches-3.18/999-board_VR-3026e.patch
b/target/linux/brcm63xx/patches-3.18/999-board_VR-3026e.patch
new file mode 100644
index 0000000..3142f84
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.18/999-board_VR-3026e.patch

Please use the next free number in the 5xx range (which is intended
for board support patches).


Regards
Jonas
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From blogic at openwrt.org  Wed Aug 26 09:48:23 2015
From: blogic at openwrt.org (John Crispin)
Date: Wed, 26 Aug 2015 15:48:23 +0200
Subject: [OpenWrt-Devel] [PATCH procd v2 0/5] jail work
In-Reply-To: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <55DDC3A7.3050505@openwrt.org>



On 26/08/2015 01:00, Etienne CHAMPETIER wrote:
> This patch series rework a bit ujail,
> and add capabilities support to it

nice

> 
> Seccomp filter are very powerful but not totally generic,
> each arch can have different set of syscalls,
> each libc can use different syscall for the same function,
> and seccomp isn't supported on all arch.
> 
> Capabilities are more high level, but still can restrict
> jail to a sane minimum of privileges.


> 
> Patch 4 is a bit big and i can split it if needed, just tell me how

will have a closer look next few days

there seem to be a way to escape from the rebind mount jail that QCA has
found and i have not had the time yet to finish my jailfs module. it
runs and loads, i can do mounts and access files inside them using
normal shell calls. however if is point a jail instance at the
mountpoint it oops horribly. i suspect that i am either using vfs wrong
or am missing locking/ref-counting somewhere. i'll throw the code onto
github later today or tomorrow and post the link. maybe someone with
more knowledge of vfs can help fix it.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From lynxis at fe80.eu  Wed Aug 26 12:13:10 2015
From: lynxis at fe80.eu (Alexander Couzens)
Date: Wed, 26 Aug 2015 18:13:10 +0200
Subject: [OpenWrt-Devel] [PATCH] uci: add import call
Message-ID: <1440605590-22669-1-git-send-email-lynxis@fe80.eu>

similiar to import from uci cli.
import removes all old configs and import the new config.

example:
ubus call uci import \
  '{"config": "dhcp", "values": { "srv": { ".type": "host", ".name": "srv", "mac": "00:11:22:33:44:55", "ip": "192.168.1.2" } } }'
---
 uci.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 152 insertions(+)

diff --git a/uci.c b/uci.c
index 8b5dafd..86c3b6e 100644
--- a/uci.c
+++ b/uci.c
@@ -32,6 +32,21 @@ static struct ubus_context *apply_ctx;
 static char apply_sid[RPC_SID_LEN + 1];
 
 enum {
+  RPC_ADD_TYPE,
+  RPC_ADD_NAME,
+  RPC_ADD_ANONYMOUS,
+  RPC_ADD_INDEX,
+  __RPC_ADD_MAX,
+};
+
+static const struct blobmsg_policy rpc_uci_add_section_policy[__RPC_ADD_MAX] = {
+  [RPC_ADD_TYPE]      = { .name = ".type",       .type = BLOBMSG_TYPE_STRING },
+  [RPC_ADD_NAME]      = { .name = ".name",       .type = BLOBMSG_TYPE_STRING },
+  [RPC_ADD_ANONYMOUS] = { .name = ".anonymous",  .type = BLOBMSG_TYPE_BOOL   },
+  [RPC_ADD_INDEX]     = { .name = ".index",      .type = BLOBMSG_TYPE_INT32  },
+};
+
+enum {
 	RPC_G_CONFIG,
 	RPC_G_SECTION,
 	RPC_G_OPTION,
@@ -90,6 +105,20 @@ static const struct blobmsg_policy rpc_uci_set_policy[__RPC_S_MAX] = {
 };
 
 enum {
+	RPC_I_CONFIG,
+	RPC_I_VALUES,
+	RPC_I_SESSION,
+	__RPC_I_MAX,
+};
+
+static const struct blobmsg_policy rpc_uci_import_policy[__RPC_I_MAX] = {
+	[RPC_I_CONFIG]  = { .name = "config",   .type = BLOBMSG_TYPE_STRING },
+	[RPC_I_VALUES]  = { .name = "values",   .type = BLOBMSG_TYPE_TABLE  },
+	[RPC_I_SESSION] = { .name = "ubus_rpc_session",
+	                                        .type = BLOBMSG_TYPE_STRING },
+};
+
+enum {
 	RPC_D_CONFIG,
 	RPC_D_SECTION,
 	RPC_D_TYPE,
@@ -179,6 +208,9 @@ static const struct blobmsg_policy rpc_uci_rollback_policy[__RPC_B_MAX] = {
 	                                        .type = BLOBMSG_TYPE_STRING },
 };
 
+static void
+rpc_uci_merge_delete(struct blob_attr *opt, struct uci_ptr *ptr);
+
 /*
  * Turn uci error state into ubus return code
  */
@@ -729,6 +761,125 @@ rpc_uci_merge_set(struct blob_attr *opt, struct uci_ptr *ptr)
 }
 
 static int
+rpc_uci_add_section(struct uci_package *p, struct blob_attr *msg)
+{
+  struct uci_section *s;
+  struct uci_ptr ptr = { 0 };
+  struct blob_attr *cur, *elem;
+  struct blob_attr *tb[__RPC_ADD_MAX];
+  int rem, rem2;
+
+  blobmsg_parse(rpc_uci_add_section_policy, __RPC_ADD_MAX, tb,
+              blobmsg_data(msg), blobmsg_len(msg));
+
+  ptr.package = p->e.name;
+
+  if (!tb[RPC_ADD_TYPE])
+    goto out;
+
+  /* add named section */
+  if (tb[RPC_ADD_NAME])
+  {
+    ptr.section = blobmsg_data(tb[RPC_ADD_NAME]);
+    ptr.value   = blobmsg_data(tb[RPC_ADD_TYPE]);
+    ptr.option  = NULL;
+
+    if (rpc_uci_lookup(&ptr) || uci_set(cursor, &ptr))
+      goto out;
+  } else {
+    if (uci_add_section(cursor, p, blobmsg_data(tb[RPC_ADD_TYPE]), &s) || !s)
+      goto out;
+
+    ptr.section = s->e.name;
+  }
+
+  blobmsg_for_each_attr(cur, msg, rem)
+  {
+    if (!strcmp(blobmsg_name(cur), ".type") ||
+        !strcmp(blobmsg_name(cur), ".anonymous") ||
+        !strcmp(blobmsg_name(cur), ".name") ||
+        !strcmp(blobmsg_name(cur), ".index"))
+      continue;
+    ptr.o = NULL;
+    ptr.option = blobmsg_name(cur);
+
+    if (rpc_uci_lookup(&ptr) || !ptr.s)
+      continue;
+
+    switch (blobmsg_type(cur))
+    {
+    case BLOBMSG_TYPE_ARRAY:
+      blobmsg_for_each_attr(elem, cur, rem2)
+        if (rpc_uci_format_blob(elem, &ptr.value))
+          uci_add_list(cursor, &ptr);
+      break;
+
+    default:
+      if (rpc_uci_format_blob(cur, &ptr.value))
+        uci_set(cursor, &ptr);
+      break;
+    }
+  }
+
+  return 0;
+
+out:
+  return 1;
+}
+
+/* blobmsg example: { "wan": { ".type": "interface", ".name":"wan", ".anonymous": false }, .. } */
+static int
+rpc_uci_import(struct ubus_context *ctx, struct ubus_object *obj,
+            struct ubus_request_data *req, const char *method,
+            struct blob_attr *msg)
+{
+  struct blob_attr *tb[__RPC_I_MAX];
+	struct blob_attr *cur;
+	struct uci_package *p = NULL;
+  struct uci_element *e, *tmp;
+	struct uci_ptr ptr = { 0 };
+  int rem;
+
+
+	blobmsg_parse(rpc_uci_import_policy, __RPC_I_MAX, tb,
+			blob_data(msg), blob_len(msg));
+
+	if (!tb[RPC_I_CONFIG] || !tb[RPC_I_VALUES])
+		return UBUS_STATUS_INVALID_ARGUMENT;
+
+	if (!rpc_uci_write_access(tb[RPC_I_SESSION], tb[RPC_I_CONFIG]))
+		return UBUS_STATUS_PERMISSION_DENIED;
+
+	ptr.package = blobmsg_data(tb[RPC_I_CONFIG]);
+
+	if (uci_load(cursor, ptr.package, &p))
+		return rpc_uci_status();
+
+  /* delete all section within package */
+  uci_foreach_element_safe(&p->sections, tmp, e)
+  {
+    ptr.s = NULL;
+    ptr.section = e->name;
+    rpc_uci_merge_delete(NULL, &ptr);
+  }
+
+  /* add new sections */
+  blobmsg_for_each_attr(cur, tb[RPC_I_VALUES], rem)
+  {
+    if (rpc_uci_add_section(p,  cur))
+      goto out;
+  }
+
+	uci_save(cursor, p);
+
+out:
+	uci_unload(cursor, p);
+
+	return rpc_uci_status();
+}
+
+
+static int
 rpc_uci_set(struct ubus_context *ctx, struct ubus_object *obj,
             struct ubus_request_data *req, const char *method,
             struct blob_attr *msg)
@@ -1538,6 +1689,7 @@ int rpc_uci_api_init(struct ubus_context *ctx)
 		UBUS_METHOD("apply",    rpc_uci_apply,    rpc_uci_apply_policy),
 		UBUS_METHOD("confirm",  rpc_uci_confirm,  rpc_uci_rollback_policy),
 		UBUS_METHOD("rollback", rpc_uci_rollback, rpc_uci_rollback_policy),
+		UBUS_METHOD("import",   rpc_uci_import,   rpc_uci_import_policy),
 	};
 
 	static struct ubus_object_type uci_type =
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From lynxis at fe80.eu  Wed Aug 26 12:17:27 2015
From: lynxis at fe80.eu (Alexander Couzens)
Date: Wed, 26 Aug 2015 18:17:27 +0200
Subject: [OpenWrt-Devel] [PATCH] uci: add import call
In-Reply-To: <1440605590-22669-1-git-send-email-lynxis@fe80.eu>
References: <1440605590-22669-1-git-send-email-lynxis@fe80.eu>
Message-ID: <20150826181727.4206f35a@lazus.yip>

Sorry I forgot an rpcd prefix in the subject. This is a patch for rpcd.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 26 12:20:24 2015
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Wed, 26 Aug 2015 18:20:24 +0200
Subject: [OpenWrt-Devel] [PATCH procd v2 0/5] jail work
In-Reply-To: <55DDC3A7.3050505@openwrt.org>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
 <55DDC3A7.3050505@openwrt.org>
Message-ID: <CAOdf3gqxJsCsUhRis1hso7szNNpjVxYjEBBjdOJ=MqVDKb8EAA@mail.gmail.com>

2015-08-26 15:48 GMT+02:00 John Crispin <blogic at openwrt.org>:

>
>
> On 26/08/2015 01:00, Etienne CHAMPETIER wrote:
> > This patch series rework a bit ujail,
> > and add capabilities support to it
>
> nice
>
> >
> > Seccomp filter are very powerful but not totally generic,
> > each arch can have different set of syscalls,
> > each libc can use different syscall for the same function,
> > and seccomp isn't supported on all arch.
> >
> > Capabilities are more high level, but still can restrict
> > jail to a sane minimum of privileges.
>
>
> >
> > Patch 4 is a bit big and i can split it if needed, just tell me how
>
> will have a closer look next few days
>
forgot to say it's tested on ar71xx with CC (and also on ubuntu 14.04)


there seem to be a way to escape from the rebind mount jail that QCA has
> found

more than one ;) can you share? (with root rights you can kexec, mount
/dev, ...)
that's why you really need to limit rights with capabilities drop or
seccomp filter
(i'm adding a vague warning in usage)


> and i have not had the time yet to finish my jailfs module.

with my patches you don't see all the bind mount anymore ("in the host"),
they are only in the jail mount namespace.

to see the mounts inside the jail you can still do
cat /proc/<jailed process pid>/mounts

it
> runs and loads, i can do mounts and access files inside them using
> normal shell calls. however if is point a jail instance at the
> mountpoint it oops horribly. i suspect that i am either using vfs wrong
> or am missing locking/ref-counting somewhere. i'll throw the code onto
> github later today or tomorrow and post the link. maybe someone with
> more knowledge of vfs can help fix it.
>
what problem are you fixing with jailfs? (real question/to be sure there is
no simpler solution)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150826/07ceb75e/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From tesarmar at gmail.com  Wed Aug 26 13:18:13 2015
From: tesarmar at gmail.com (Martin Tesar)
Date: Wed, 26 Aug 2015 19:18:13 +0200
Subject: [OpenWrt-Devel] [PATCH v3] bcm63xx: add Comtrend VR-3026e support
Message-ID: <1440609494-13148-1-git-send-email-tesarmar@gmail.com>

Here is the third version. I hope it will be fine, finally.

Regards,
Martin
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tesarmar at gmail.com  Wed Aug 26 13:18:14 2015
From: tesarmar at gmail.com (Martin Tesar)
Date: Wed, 26 Aug 2015 19:18:14 +0200
Subject: [OpenWrt-Devel] [PATCH v3] bcm63xx: add Comtrend VR-3026e support
In-Reply-To: <1440609494-13148-1-git-send-email-tesarmar@gmail.com>
References: <1440609494-13148-1-git-send-email-tesarmar@gmail.com>
Message-ID: <1440609494-13148-2-git-send-email-tesarmar@gmail.com>

Add support for Comtrend VR-3026e v1.
The device is almost identical to the Comtrend VR-3025un.

Signed-off-by: Martin Tesar <tesarmar at gmail.com>
---
 target/linux/brcm63xx/base-files/etc/diag.sh       |  3 +
 .../base-files/etc/uci-defaults/02_network         |  3 +-
 .../base-files/etc/uci-defaults/09_fix_crc         |  1 +
 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
 .../lib/preinit/05_init_interfaces_brcm63xx        |  1 +
 target/linux/brcm63xx/dts/vr-3026e.dts             | 88 ++++++++++++++++++++++
 target/linux/brcm63xx/image/Makefile               |  2 +
 .../brcm63xx/patches-3.18/572-board_VR-3026e.patch | 79 +++++++++++++++++++
 .../brcm63xx/patches-4.1/572-board_VR-3026e.patch  | 79 +++++++++++++++++++
 target/linux/brcm63xx/profiles/comtrend.mk         |  9 +++
 10 files changed, 267 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/brcm63xx/dts/vr-3026e.dts
 create mode 100644 target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch
 create mode 100644 target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch

diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
index 7916ac2..7826fad 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -39,6 +39,9 @@ set_state() {
 	vr-3025u)
 		status_led="VR-3025u:green:power"
 		;;
+	vr-3026e)
+		status_led="VR-3026e:green:power"
+		;;
 	wap-5813n)
 		status_led="WAP-5813n:green:power"
 		;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 2ff9e45..4de861c 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -94,8 +94,9 @@ fast2504n |\
 fast2704v2 |\
 hg655b |\
 p870hw-51a_v2 |\
+vr-3025u |\
 vr-3025un |\
-vr-3025u)
+vr-3026e)
 	ucidef_set_interface_lan "eth0.1"
 	ucidef_add_switch "eth0" "1" "1"
 	ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t"
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index 4a167dc..f307a4c 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -30,6 +30,7 @@ case "$(brcm63xx_board_name)" in
 	v2500v_bb |\
 	vr-3025u |\
 	vr-3025un |\
+	vr-3026e |\
 	wap-5813n)
 		do_fixcrc
 		;;
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 92fa5f2..1a97c86 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -102,6 +102,9 @@ brcm63xx_dt_detect() {
 	"Comtrend VR-3025un")
 		board_name="vr-3025un"
 		;;
+	"Comtrend VR-3026e")
+		board_name="vr-3026e"
+		;;
 	"Comtrend WAP-5813n")
 		board_name="wap-5813n"
 		;;
diff --git a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
index d6ec537..abf5b89 100644
--- a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
+++ b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
@@ -32,6 +32,7 @@ set_preinit_iface() {
 	v2110 |\
 	vr-3025un |\
 	vr-3025u |\
+	vr-3026e |\
 	wap-5813n)
 		ifname=eth0
 		;;
diff --git a/target/linux/brcm63xx/dts/vr-3026e.dts b/target/linux/brcm63xx/dts/vr-3026e.dts
new file mode 100644
index 0000000..49790e2
--- /dev/null
+++ b/target/linux/brcm63xx/dts/vr-3026e.dts
@@ -0,0 +1,88 @@
+/dts-v1/;
+
+#include "bcm6368.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Comtrend VR-3026e";
+	compatible = "comtrend,vr-3026e", "brcm,bcm6368";
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		debounce-interval = <60>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 2 1>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		dsl_green {
+			label = "VR-3026e:green:dsl";
+			gpios = <&gpio0 2 1>;
+		};
+		inet_green {
+			label = "VR-3026e:green:inet";
+			gpios = <&gpio0 5 0>;
+		};
+		lan1_green {
+			label = "VR-3026e:green:lan1";
+			gpios = <&gpio0 6 1>;
+		};
+		lan2_green {
+			label = "VR-3026e:green:lan2";
+			gpios = <&gpio0 7 1>;
+		};
+		lan3_green {
+			label = "VR-3026e:green:lan3";
+			gpios = <&gpio0 8 1>;
+		};
+		lan4_green {
+			label = "VR-3026e:green:lan4";
+			gpios = <&gpio0 9 1>;
+		};
+		power_green {
+			label = "VR-3026e:green:power";
+			gpios = <&gpio0 22 0>;
+			default-state = "on";
+		};
+		power_red {
+			label = "VR-3026e:red:power";
+			gpios = <&gpio0 24 0>;
+		};
+		inet_red {
+			label = "VR-3026e:red:inet";
+			gpios = <&gpio0 31 0>;
+		};
+	};
+};
+
+&pflash {
+	status = "ok";
+
+	linux,part-probe = "bcm63xxpart";
+
+	cfe at 0 {
+		label = "CFE";
+		reg = <0x000000 0x010000>;
+		read-only;
+	};
+
+	linux at 10000 {
+		label = "linux";
+		reg = <0x010000 0x7e0000>;
+	};
+
+	nvram at 7f0000 {
+		label = "nvram";
+		reg = <0x7f0000 0x010000>;
+	};
+};
diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
index 90b9fa6..9d3ec9f 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -535,6 +535,8 @@ $(eval $(call bcm63xxCfe,CT6373,CT-6373,ct-6373,CT6373-1,6358))
 $(eval $(call bcm63xxCfe,VR3025u,VR-3025u,vr-3025u,96368M-1541N,6368,--pad 16 --image-offset 0x20000 --block-size 0x20000))
 # Comtrend VR-3025un
 $(eval $(call bcm63xxCfe,VR3025un,VR-3025un,vr-3025un,96368M-1341N,6368,--pad 4))
+# Comtrend VR-3026e
+$(eval $(call bcm63xxCfe,VR3026e,VR-3026e,vr-3026e,96368MT-1341N1,6368,--pad 4))
 # Comtrend WAP-5813n
 $(eval $(call bcm63xxCfe,WAP5813n,WAP-5813n,wap-5813n,96369R-1231N,6368,--pad 4))
 # D-Link DSL-2640B, rev B2
diff --git a/target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch b/target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch
new file mode 100644
index 0000000..3142f84
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch
@@ -0,0 +1,79 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2168,6 +2168,60 @@ static struct board_info __initdata boar
+	},
+ };
+
++static struct sprom_fixup __initdata vr3026e_fixups[] = {
++	{ .offset = 97, .value = 0xfeb3 },
++	{ .offset = 98, .value = 0x1618 },
++	{ .offset = 99, .value = 0xfab0 },
++	{ .offset = 113, .value = 0xfed1 },
++	{ .offset = 114, .value = 0x1609 },
++	{ .offset = 115, .value = 0xfad9 },
++};
++
++static struct board_info __initdata board_VR3026e = {
++	.name					= "96368MT-1341N1",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0				= 1,
++	.has_pci				= 1,
++	.use_fallback_sprom			= 1,
++	.has_ohci0				= 1,
++	.has_ehci0				= 1,
++
++	.has_enetsw				= 1,
++	.enetsw = {
++		.used_ports = {
++			[0] = {
++				.used		= 1,
++				.phy_id		= 1,
++				.name		= "port1",
++			},
++			[1] = {
++				.used		= 1,
++				.phy_id		= 2,
++				.name		= "port2",
++			},
++			[2] = {
++				.used		= 1,
++				.phy_id		= 3,
++				.name		= "port3",
++			},
++			[3] = {
++				.used		= 1,
++				.phy_id		= 4,
++				.name		= "port4",
++			},
++		},
++	},
++
++	.fallback_sprom = {
++		.type				= SPROM_BCM43222,
++		.pci_bus			= 0,
++		.pci_dev			= 1,
++		.board_fixups			= vr3026e_fixups,
++		.num_board_fixups		= ARRAY_SIZE(vr3026e_fixups),
++	},
++};
++
+ static struct b53_platform_data WAP5813n_b53_pdata = {
+	.alias = "eth0",
+ };
+@@ -2472,6 +2526,7 @@ static const struct board_info __initcon
+	&board_P870HW51A_V2,
+	&board_VR3025u,
+	&board_VR3025un,
++	&board_VR3026e,
+	&board_WAP5813n,
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
+@@ -2572,6 +2627,7 @@ static struct of_device_id const bcm963x
+	{ .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, },
+	{ .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, },
+	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
++	{ .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, },
+	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
+	{ .compatible = "huawei,hg655b", .data = &board_HG655b, },
+	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
diff --git a/target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch b/target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch
new file mode 100644
index 0000000..3142f84
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch
@@ -0,0 +1,79 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2168,6 +2168,60 @@ static struct board_info __initdata boar
+	},
+ };
+
++static struct sprom_fixup __initdata vr3026e_fixups[] = {
++	{ .offset = 97, .value = 0xfeb3 },
++	{ .offset = 98, .value = 0x1618 },
++	{ .offset = 99, .value = 0xfab0 },
++	{ .offset = 113, .value = 0xfed1 },
++	{ .offset = 114, .value = 0x1609 },
++	{ .offset = 115, .value = 0xfad9 },
++};
++
++static struct board_info __initdata board_VR3026e = {
++	.name					= "96368MT-1341N1",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0				= 1,
++	.has_pci				= 1,
++	.use_fallback_sprom			= 1,
++	.has_ohci0				= 1,
++	.has_ehci0				= 1,
++
++	.has_enetsw				= 1,
++	.enetsw = {
++		.used_ports = {
++			[0] = {
++				.used		= 1,
++				.phy_id		= 1,
++				.name		= "port1",
++			},
++			[1] = {
++				.used		= 1,
++				.phy_id		= 2,
++				.name		= "port2",
++			},
++			[2] = {
++				.used		= 1,
++				.phy_id		= 3,
++				.name		= "port3",
++			},
++			[3] = {
++				.used		= 1,
++				.phy_id		= 4,
++				.name		= "port4",
++			},
++		},
++	},
++
++	.fallback_sprom = {
++		.type				= SPROM_BCM43222,
++		.pci_bus			= 0,
++		.pci_dev			= 1,
++		.board_fixups			= vr3026e_fixups,
++		.num_board_fixups		= ARRAY_SIZE(vr3026e_fixups),
++	},
++};
++
+ static struct b53_platform_data WAP5813n_b53_pdata = {
+	.alias = "eth0",
+ };
+@@ -2472,6 +2526,7 @@ static const struct board_info __initcon
+	&board_P870HW51A_V2,
+	&board_VR3025u,
+	&board_VR3025un,
++	&board_VR3026e,
+	&board_WAP5813n,
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
+@@ -2572,6 +2627,7 @@ static struct of_device_id const bcm963x
+	{ .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, },
+	{ .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, },
+	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
++	{ .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, },
+	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
+	{ .compatible = "huawei,hg655b", .data = &board_HG655b, },
+	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
diff --git a/target/linux/brcm63xx/profiles/comtrend.mk b/target/linux/brcm63xx/profiles/comtrend.mk
index 8c1b862..99fec4a 100644
--- a/target/linux/brcm63xx/profiles/comtrend.mk
+++ b/target/linux/brcm63xx/profiles/comtrend.mk
@@ -73,6 +73,15 @@ define Profile/VR3025un/Description
 endef
 $(eval $(call Profile,VR3025un))
 
+define Profile/VR3026e
+  NAME:=Comtrend VR-3026e
+  PACKAGES:=kmod-b43 wpad-mini
+endef
+define Profile/VR3026e/Description
+  Package set optimized for VR-3026e.
+endef
+$(eval $(call Profile,VR3026e))
+
 define Profile/WAP5813n
   NAME:=Comtrend WAP-5813n
   PACKAGES:=kmod-b43 wpad-mini \
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Wed Aug 26 14:11:22 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Wed, 26 Aug 2015 21:11:22 +0300
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of uClibc-ng
Message-ID: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>

uClibc-ng is a spin-off of original uClibc, see http://www.uclibc-ng.org/

We try to regularly add changes from uClibc to uClibc-ng.
We even sent patches and bug reports to the uClibc mailing list.
The config file is compatible between uClibc-ng 1.0 and uClibc git master.
This might change in the future.

Our main goal is to provide regularly a stable and tested release
to make embedded system developers happy.

The main advantage of uClibc-ng over olde good uClibc is regular releases
so there's no need to keep tons of patches on top of years old
0.9.33.2

Build-tested for
 [1] ARM: Sunxi generic
 [2] MIPS: Netgear WNDR3600/3700/3800

Run-tested for [yet out of the tree] Synopsys Designware ARC AXS101.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Waldemar Brodkorb <wbx at uclibc-ng.org>
Cc: Mathieu Olivari <mathieu at codeaurora.org>
Cc: Felix Fietkau <nbd at openwrt.org>
Cc: John Crispin <blogic at openwrt.org>
---
 toolchain/uClibc/Config.in                     |   4 +
 toolchain/uClibc/Config.version                |   4 +
 toolchain/uClibc/common.mk                     |  15 +-
 toolchain/uClibc/config-ng-1.0.6/arm           |   9 +
 toolchain/uClibc/config-ng-1.0.6/armeb         |   9 +
 toolchain/uClibc/config-ng-1.0.6/common        | 223 +++++++++++++++++++++++++
 toolchain/uClibc/config-ng-1.0.6/debug         |   6 +
 toolchain/uClibc/config-ng-1.0.6/i386          |  21 +++
 toolchain/uClibc/config-ng-1.0.6/i686          |  21 +++
 toolchain/uClibc/config-ng-1.0.6/m68k          |   6 +
 toolchain/uClibc/config-ng-1.0.6/mips          |  18 ++
 toolchain/uClibc/config-ng-1.0.6/mips64        |  18 ++
 toolchain/uClibc/config-ng-1.0.6/mips64.32     |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64.64     |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64.n32    |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64el      |  18 ++
 toolchain/uClibc/config-ng-1.0.6/mips64el.32   |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64el.64   |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64el.n32  |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mipsel        |  18 ++
 toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt |  18 ++
 toolchain/uClibc/config-ng-1.0.6/powerpc       |   6 +
 toolchain/uClibc/config-ng-1.0.6/powerpc.e500  |   6 +
 toolchain/uClibc/config-ng-1.0.6/sparc         |   8 +
 toolchain/uClibc/config-ng-1.0.6/sparc.leon    |   8 +
 toolchain/uClibc/config-ng-1.0.6/x86_64        |   6 +
 26 files changed, 553 insertions(+), 3 deletions(-)
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/arm
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/armeb
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/common
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/debug
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/i386
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/i686
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/m68k
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.32
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.64
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.n32
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.32
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.64
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.n32
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mipsel
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/powerpc
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/powerpc.e500
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/sparc
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/sparc.leon
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/x86_64

diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
index 08ea00a..c923bc0 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"
+
 endchoice
 
 # Debug version.
diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
index dd302f2..b6aa471 100644
--- a/toolchain/uClibc/Config.version
+++ b/toolchain/uClibc/Config.version
@@ -2,8 +2,12 @@ config UCLIBC_VERSION
 	string
 	depends on USE_UCLIBC
 	default "0.9.33.2"       if UCLIBC_VERSION_0_9_33
+	default "1.0.6"          if UCLIBC_VERSION_NG
 	default "0.9.33.2"
 
 config UCLIBC_VERSION_0_9_33
 	default y if !TOOLCHAINOPTS && USE_UCLIBC
 	bool
+
+config UCLIBC_VERSION_NG
+	bool
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index 53a8443..026d69d 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -7,15 +7,24 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/target.mk
 
-PKG_NAME:=uClibc
 PKG_VERSION:=$(call qstrip,$(CONFIG_UCLIBC_VERSION))
+
+ifeq ($(CONFIG_UCLIBC_VERSION_NG),y)
+PKG_NAME:=uClibc-ng
+PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/
+PATCH_DIR:=$(PATH_PREFIX)/patches-ng-$(PKG_VERSION)
+CONFIG_DIR:=$(PATH_PREFIX)/config-ng-$(PKG_VERSION)
+else
+PKG_NAME:=uClibc
 PKG_SOURCE_URL:=http://www.uclibc.org/downloads
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-LIBC_SO_VERSION:=$(PKG_VERSION)
 PATCH_DIR:=$(PATH_PREFIX)/patches-$(PKG_VERSION)
 CONFIG_DIR:=$(PATH_PREFIX)/config-$(PKG_VERSION)
+endif
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+LIBC_SO_VERSION:=$(PKG_VERSION)
 
 PKG_MD5SUM_0.9.33.2 = a338aaffc56f0f5040e6d9fa8a12eda1
+PKG_MD5SUM_1.0.6 = dfcc780bf2c7e2e42209bbb572e035cf
 PKG_MD5SUM=$(PKG_MD5SUM_$(PKG_VERSION))
 
 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
diff --git a/toolchain/uClibc/config-ng-1.0.6/arm b/toolchain/uClibc/config-ng-1.0.6/arm
new file mode 100644
index 0000000..41a60b1
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/arm
@@ -0,0 +1,9 @@
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# COMPILE_IN_THUMB_MODE is not set
+TARGET_ARCH="arm"
+TARGET_arm=y
+# USE_BX is not set
+CONFIG_ARM_EABI=y
+
diff --git a/toolchain/uClibc/config-ng-1.0.6/armeb b/toolchain/uClibc/config-ng-1.0.6/armeb
new file mode 100644
index 0000000..2e46dd6
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/armeb
@@ -0,0 +1,9 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_WANTS_BIG_ENDIAN=y
+# COMPILE_IN_THUMB_MODE is not set
+TARGET_ARCH="arm"
+TARGET_arm=y
+# USE_BX is not set
+CONFIG_ARM_EABI=y
+
diff --git a/toolchain/uClibc/config-ng-1.0.6/common b/toolchain/uClibc/config-ng-1.0.6/common
new file mode 100644
index 0000000..ddaf600
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/common
@@ -0,0 +1,223 @@
+# ARCH_ANY_ENDIAN is not set
+ARCH_HAS_MMU=y
+# ARCH_HAS_NO_LDSO is not set
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_LITTLE_ENDIAN is not set
+ARCH_USE_MMU=y
+# ARCH_WANTS_BIG_ENDIAN is not set
+# ARCH_WANTS_LITTLE_ENDIAN is not set
+ASSUME_DEVPTS=y
+# COMPAT_ATEXIT is not set
+CROSS_COMPILER_PREFIX=""
+DEVEL_PREFIX="/usr/"
+# DOASSERTS is not set
+# DODEBUG is not set
+# DODEBUG_PT is not set
+# DOMULTI is not set
+DOPIC=y
+DOSTRIP=y
+DO_C99_MATH=y
+# DO_XSI_MATH is not set
+# EXTRA_WARNINGS is not set
+FORCE_OPTIONS_FOR_ARCH=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+# HARDWIRED_ABSPATH is not set
+# HAS_NO_THREADS is not set
+HAVE_DOT_CONFIG=y
+# HAVE_NO_PIC is not set
+# HAVE_NO_SSP is not set
+HAVE_SHARED=y
+KERNEL_HEADERS="."
+LDSO_BASE_FILENAME="ld.so"
+LDSO_CACHE_SUPPORT=y
+# LDSO_GNU_HASH_SUPPORT is not set
+LDSO_LD_LIBRARY_PATH=y
+LDSO_LDD_SUPPORT=y
+# LDSO_NO_CLEANUP is not set
+# LDSO_PRELINK_SUPPORT is not set
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_PRELOAD_ENV_SUPPORT=y
+LDSO_RUNPATH=y
+LDSO_SAFE_RUNPATH=y
+# LDSO_RUNPATH_OF_EXECUTABLE is not set
+# LDSO_SEARCH_INTERP_PATH is not set
+# LDSO_STANDALONE_SUPPORT is not set
+# LINUXTHREADS_NEW is not set
+# LINUXTHREADS_OLD is not set
+# UCLIBC_HAS_BACKTRACE is not set
+UCLIBC_HAS_THREADS_NATIVE=y
+# MALLOC is not set
+MALLOC_GLIBC_COMPAT=y
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MULTILIB_DIR="lib"
+PTHREADS_DEBUG_SUPPORT=y
+RUNTIME_PREFIX="/"
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+TARGET_SUBARCH=""
+# TARGET_alpha is not set
+# TARGET_arc is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_c6x is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_metag is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_BUILD_NOEXECSTACK=y
+# UCLIBC_BUILD_NOW is not set
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_BUILD_RELRO=y
+UCLIBC_CTOR_DTOR=y
+UCLIBC_DYNAMIC_ATEXIT=y
+UCLIBC_EXTRA_CFLAGS=""
+UCLIBC_GRP_BUFFER_SIZE=256
+UCLIBC_HAS_ADVANCED_REALTIME=y
+# UCLIBC_HAS_ARC4RANDOM is not set
+UCLIBC_HAS_BSD_ERR=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+# UCLIBC_HAS_COMPAT_RES_STATE is not set
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_CTYPE_SIGNED=y
+UCLIBC_HAS_CTYPE_TABLES=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
+# UCLIBC_HAS_FENV is not set
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+# UCLIBC_HAS_FPU is not set
+UCLIBC_HAS_FTS=y
+UCLIBC_HAS_FTW=y
+# UCLIBC_HAS_FULL_RPC is not set
+UCLIBC_HAS_GETPT=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+UCLIBC_HAS_GNU_GLOB=y
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_IPV4=y
+UCLIBC_HAS_IPV6=y
+UCLIBC_HAS_LFS=y
+UCLIBC_HAS_LIBNSL_STUB=y
+UCLIBC_HAS_LIBRESOLV_STUB=y
+UCLIBC_HAS_LIBUTIL=y
+# UCLIBC_HAS_LOCALE is not set
+# UCLIBC_BUILD_ALL_LOCALE is not set
+# UCLIBC_BUILD_MINIMAL_LOCALE is not set
+# UCLIBC_PREGENERATED_LOCALE_DATA is not set
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_NFTW=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+UCLIBC_HAS_PRINTF_M_SPEC=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS_PTY=y
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_REENTRANT_RPC is not set
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_RESOLVER_SUPPORT=y
+# UCLIBC_HAS_RPC is not set
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
+# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_SOFT_FLOAT=y
+# UCLIBC_HAS_SSP is not set
+# UCLIBC_HAS_SSP_COMPAT is not set
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SYSLOG=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_THREADS=y
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_HAS_UTMPX=y
+UCLIBC_HAS_UTMP=y
+UCLIBC_HAS_WCHAR=y
+UCLIBC_HAS_WORDEXP=y
+# UCLIBC_HAS_XATTR is not set
+# UCLIBC_HAS_XLOCALE is not set
+UCLIBC_HAS___PROGNAME=y
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_MODULE_26=y
+UCLIBC_LINUX_SPECIFIC=y
+# UCLIBC_MALLOC_DEBUGGING is not set
+# UCLIBC_MJN3_ONLY is not set
+# UCLIBC_NTP_LEGACY is not set
+# USE_OLD_VFPRINTF is not set
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_PWD_BUFFER_SIZE=256
+# UCLIBC_STATIC_LDCONFIG is not set
+# UCLIBC_STRICT_HEADERS is not set
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_SUSV3_LEGACY=y
+UCLIBC_SUSV3_LEGACY_MACROS=y
+UCLIBC_SUSV4_LEGACY=y
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set
+UCLIBC_USE_NETLINK=y
+# UNIX98PTY_ONLY is not set
+USE_BX=y
+WARNINGS="-Wall"
+# UCLIBC_HAS_OBSTACK is not set
+# UCLIBC_SUSV2_LEGACY is not set
+# UCLIBC_HAS_CONTEXT_FUNCS is not set
+UCLIBC_HAS_GETOPT_LONG=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/debug b/toolchain/uClibc/config-ng-1.0.6/debug
new file mode 100644
index 0000000..b366e66
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/debug
@@ -0,0 +1,6 @@
+DODEBUG=y
+DODEBUG_PT=y
+PTHREADS_DEBUG_SUPPORT=y
+SUPPORT_LD_DEBUG=y
+SUPPORT_LD_DEBUG_EARLY=y
+UCLIBC_MALLOC_DEBUGGING=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/i386 b/toolchain/uClibc/config-ng-1.0.6/i386
new file mode 100644
index 0000000..5ef264c
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/i386
@@ -0,0 +1,21 @@
+ARCH_LITTLE_ENDIAN=y
+# CONFIG_386 is not set
+CONFIG_486=y
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_ELAN is not set
+# CONFIG_GENERIC_386 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_NEHEMIAH is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_WINCHIPC6 is not set
+TARGET_ARCH="i386"
+TARGET_i386=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/i686 b/toolchain/uClibc/config-ng-1.0.6/i686
new file mode 100644
index 0000000..ba615f6
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/i686
@@ -0,0 +1,21 @@
+ARCH_LITTLE_ENDIAN=y
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+CONFIG_686=y
+# CONFIG_CRUSOE is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_ELAN is not set
+# CONFIG_GENERIC_386 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_NEHEMIAH is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_WINCHIPC6 is not set
+TARGET_ARCH="i386"
+TARGET_i386=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/m68k b/toolchain/uClibc/config-ng-1.0.6/m68k
new file mode 100644
index 0000000..14ce5ae
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/m68k
@@ -0,0 +1,6 @@
+ARCH_BIG_ENDIAN=y
+LINUXTHREADS_OLD=y
+TARGET_ARCH="m68k"
+TARGET_SUBARCH=""
+TARGET_m68k=y
+# UCLIBC_HAS_THREADS_NATIVE is not set
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips b/toolchain/uClibc/config-ng-1.0.6/mips
new file mode 100644
index 0000000..8cec22f
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64 b/toolchain/uClibc/config-ng-1.0.6/mips64
new file mode 100644
index 0000000..566d87a
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips64
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64.32 b/toolchain/uClibc/config-ng-1.0.6/mips64.32
new file mode 100644
index 0000000..b7ea8f4
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips64.32
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64.64 b/toolchain/uClibc/config-ng-1.0.6/mips64.64
new file mode 100644
index 0000000..2a0b755
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips64.64
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64.n32 b/toolchain/uClibc/config-ng-1.0.6/mips64.n32
new file mode 100644
index 0000000..f8def58
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips64.n32
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+CONFIG_MIPS_N32_ABI=y
+# CONFIG_MIPS_N64_ABI is not set
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64el b/toolchain/uClibc/config-ng-1.0.6/mips64el
new file mode 100644
index 0000000..5358078
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips64el
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64el.32 b/toolchain/uClibc/config-ng-1.0.6/mips64el.32
new file mode 100644
index 0000000..a10840b
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips64el.32
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64el.64 b/toolchain/uClibc/config-ng-1.0.6/mips64el.64
new file mode 100644
index 0000000..8b90a54
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips64el.64
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64el.n32 b/toolchain/uClibc/config-ng-1.0.6/mips64el.n32
new file mode 100644
index 0000000..4ac4d06
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mips64el.n32
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+CONFIG_MIPS_N32_ABI=y
+# CONFIG_MIPS_N64_ABI is not set
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+TARGET_SUBARCH="mips64"
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mipsel b/toolchain/uClibc/config-ng-1.0.6/mipsel
new file mode 100644
index 0000000..d9dedbb
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mipsel
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt b/toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt
new file mode 100644
index 0000000..1d42a70
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt
@@ -0,0 +1,18 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+CONFIG_MIPS_ISA_3=y
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+# CONFIG_MIPS_ISA_MIPS64R2 is not set
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+CONFIG_MIPS_O32_ABI=y
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/powerpc b/toolchain/uClibc/config-ng-1.0.6/powerpc
new file mode 100644
index 0000000..5b1292d
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/powerpc
@@ -0,0 +1,6 @@
+ARCH_BIG_ENDIAN=y
+CONFIG_CLASSIC=y
+# CONFIG_E500 is not set
+TARGET_ARCH="powerpc"
+TARGET_SUBARCH="classic"
+TARGET_powerpc=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/powerpc.e500 b/toolchain/uClibc/config-ng-1.0.6/powerpc.e500
new file mode 100644
index 0000000..a835c3d
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/powerpc.e500
@@ -0,0 +1,6 @@
+ARCH_BIG_ENDIAN=y
+# CONFIG_CLASSIC is not set
+CONFIG_E500=y
+TARGET_ARCH="powerpc"
+TARGET_SUBARCH="classic"
+TARGET_powerpc=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/sparc b/toolchain/uClibc/config-ng-1.0.6/sparc
new file mode 100644
index 0000000..e1596c4
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/sparc
@@ -0,0 +1,8 @@
+ARCH_BIG_ENDIAN=y
+# CONFIG_SPARC_V7 is not set
+# CONFIG_SPARC_V8 is not set
+CONFIG_SPARC_V9=y
+# CONFIG_SPARC_V9B is not set
+TARGET_ARCH="sparc"
+TARGET_sparc=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/sparc.leon b/toolchain/uClibc/config-ng-1.0.6/sparc.leon
new file mode 100644
index 0000000..eb725ac
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/sparc.leon
@@ -0,0 +1,8 @@
+ARCH_BIG_ENDIAN=y
+# CONFIG_SPARC_V7 is not set
+CONFIG_SPARC_V8=y
+# CONFIG_SPARC_V9 is not set
+# CONFIG_SPARC_V9B is not set
+TARGET_ARCH="sparc"
+TARGET_sparc=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
diff --git a/toolchain/uClibc/config-ng-1.0.6/x86_64 b/toolchain/uClibc/config-ng-1.0.6/x86_64
new file mode 100644
index 0000000..b6dc2c2
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/x86_64
@@ -0,0 +1,6 @@
+ARCH_LITTLE_ENDIAN=y
+# LINUXTHREADS_NEW is not set
+TARGET_ARCH="x86_64"
+TARGET_x86_64=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_FPU=y
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Wed Aug 26 14:20:33 2015
From: blogic at openwrt.org (John Crispin)
Date: Wed, 26 Aug 2015 20:20:33 +0200
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
	uClibc-ng
In-Reply-To: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
Message-ID: <55DE0371.4080600@openwrt.org>

Hi,

On 26/08/2015 20:11, Alexey Brodkin wrote:
> uClibc-ng is a spin-off of original uClibc, see http://www.uclibc-ng.org/
> 
> We try to regularly add changes from uClibc to uClibc-ng.
> We even sent patches and bug reports to the uClibc mailing list.
> The config file is compatible between uClibc-ng 1.0 and uClibc git master.
> This might change in the future.
> 
> Our main goal is to provide regularly a stable and tested release
> to make embedded system developers happy.
> 
> The main advantage of uClibc-ng over olde good uClibc is regular releases
> so there's no need to keep tons of patches on top of years old
> 0.9.33.2
> 

why do you not use musl ? it is actively support rather than being
hooked on life support.

	John



> Build-tested for
>  [1] ARM: Sunxi generic
>  [2] MIPS: Netgear WNDR3600/3700/3800
> 
> Run-tested for [yet out of the tree] Synopsys Designware ARC AXS101.
> 
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> Cc: Waldemar Brodkorb <wbx at uclibc-ng.org>
> Cc: Mathieu Olivari <mathieu at codeaurora.org>
> Cc: Felix Fietkau <nbd at openwrt.org>
> Cc: John Crispin <blogic at openwrt.org>
> ---
>  toolchain/uClibc/Config.in                     |   4 +
>  toolchain/uClibc/Config.version                |   4 +
>  toolchain/uClibc/common.mk                     |  15 +-
>  toolchain/uClibc/config-ng-1.0.6/arm           |   9 +
>  toolchain/uClibc/config-ng-1.0.6/armeb         |   9 +
>  toolchain/uClibc/config-ng-1.0.6/common        | 223 +++++++++++++++++++++++++
>  toolchain/uClibc/config-ng-1.0.6/debug         |   6 +
>  toolchain/uClibc/config-ng-1.0.6/i386          |  21 +++
>  toolchain/uClibc/config-ng-1.0.6/i686          |  21 +++
>  toolchain/uClibc/config-ng-1.0.6/m68k          |   6 +
>  toolchain/uClibc/config-ng-1.0.6/mips          |  18 ++
>  toolchain/uClibc/config-ng-1.0.6/mips64        |  18 ++
>  toolchain/uClibc/config-ng-1.0.6/mips64.32     |  19 +++
>  toolchain/uClibc/config-ng-1.0.6/mips64.64     |  19 +++
>  toolchain/uClibc/config-ng-1.0.6/mips64.n32    |  19 +++
>  toolchain/uClibc/config-ng-1.0.6/mips64el      |  18 ++
>  toolchain/uClibc/config-ng-1.0.6/mips64el.32   |  19 +++
>  toolchain/uClibc/config-ng-1.0.6/mips64el.64   |  19 +++
>  toolchain/uClibc/config-ng-1.0.6/mips64el.n32  |  19 +++
>  toolchain/uClibc/config-ng-1.0.6/mipsel        |  18 ++
>  toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt |  18 ++
>  toolchain/uClibc/config-ng-1.0.6/powerpc       |   6 +
>  toolchain/uClibc/config-ng-1.0.6/powerpc.e500  |   6 +
>  toolchain/uClibc/config-ng-1.0.6/sparc         |   8 +
>  toolchain/uClibc/config-ng-1.0.6/sparc.leon    |   8 +
>  toolchain/uClibc/config-ng-1.0.6/x86_64        |   6 +
>  26 files changed, 553 insertions(+), 3 deletions(-)
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/arm
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/armeb
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/common
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/debug
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/i386
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/i686
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/m68k
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.32
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.64
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.n32
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.32
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.64
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.n32
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mipsel
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/powerpc
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/powerpc.e500
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/sparc
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/sparc.leon
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/x86_64
> 
> diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
> index 08ea00a..c923bc0 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"
> +
>  endchoice
>  
>  # Debug version.
> diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
> index dd302f2..b6aa471 100644
> --- a/toolchain/uClibc/Config.version
> +++ b/toolchain/uClibc/Config.version
> @@ -2,8 +2,12 @@ config UCLIBC_VERSION
>  	string
>  	depends on USE_UCLIBC
>  	default "0.9.33.2"       if UCLIBC_VERSION_0_9_33
> +	default "1.0.6"          if UCLIBC_VERSION_NG
>  	default "0.9.33.2"
>  
>  config UCLIBC_VERSION_0_9_33
>  	default y if !TOOLCHAINOPTS && USE_UCLIBC
>  	bool
> +
> +config UCLIBC_VERSION_NG
> +	bool
> diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
> index 53a8443..026d69d 100644
> --- a/toolchain/uClibc/common.mk
> +++ b/toolchain/uClibc/common.mk
> @@ -7,15 +7,24 @@
>  include $(TOPDIR)/rules.mk
>  include $(INCLUDE_DIR)/target.mk
>  
> -PKG_NAME:=uClibc
>  PKG_VERSION:=$(call qstrip,$(CONFIG_UCLIBC_VERSION))
> +
> +ifeq ($(CONFIG_UCLIBC_VERSION_NG),y)
> +PKG_NAME:=uClibc-ng
> +PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/
> +PATCH_DIR:=$(PATH_PREFIX)/patches-ng-$(PKG_VERSION)
> +CONFIG_DIR:=$(PATH_PREFIX)/config-ng-$(PKG_VERSION)
> +else
> +PKG_NAME:=uClibc
>  PKG_SOURCE_URL:=http://www.uclibc.org/downloads
> -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
> -LIBC_SO_VERSION:=$(PKG_VERSION)
>  PATCH_DIR:=$(PATH_PREFIX)/patches-$(PKG_VERSION)
>  CONFIG_DIR:=$(PATH_PREFIX)/config-$(PKG_VERSION)
> +endif
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
> +LIBC_SO_VERSION:=$(PKG_VERSION)
>  
>  PKG_MD5SUM_0.9.33.2 = a338aaffc56f0f5040e6d9fa8a12eda1
> +PKG_MD5SUM_1.0.6 = dfcc780bf2c7e2e42209bbb572e035cf
>  PKG_MD5SUM=$(PKG_MD5SUM_$(PKG_VERSION))
>  
>  HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
> diff --git a/toolchain/uClibc/config-ng-1.0.6/arm b/toolchain/uClibc/config-ng-1.0.6/arm
> new file mode 100644
> index 0000000..41a60b1
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/arm
> @@ -0,0 +1,9 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_LITTLE_ENDIAN=y
> +ARCH_WANTS_LITTLE_ENDIAN=y
> +# COMPILE_IN_THUMB_MODE is not set
> +TARGET_ARCH="arm"
> +TARGET_arm=y
> +# USE_BX is not set
> +CONFIG_ARM_EABI=y
> +
> diff --git a/toolchain/uClibc/config-ng-1.0.6/armeb b/toolchain/uClibc/config-ng-1.0.6/armeb
> new file mode 100644
> index 0000000..2e46dd6
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/armeb
> @@ -0,0 +1,9 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_BIG_ENDIAN=y
> +ARCH_WANTS_BIG_ENDIAN=y
> +# COMPILE_IN_THUMB_MODE is not set
> +TARGET_ARCH="arm"
> +TARGET_arm=y
> +# USE_BX is not set
> +CONFIG_ARM_EABI=y
> +
> diff --git a/toolchain/uClibc/config-ng-1.0.6/common b/toolchain/uClibc/config-ng-1.0.6/common
> new file mode 100644
> index 0000000..ddaf600
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/common
> @@ -0,0 +1,223 @@
> +# ARCH_ANY_ENDIAN is not set
> +ARCH_HAS_MMU=y
> +# ARCH_HAS_NO_LDSO is not set
> +# ARCH_HAS_NO_SHARED is not set
> +# ARCH_LITTLE_ENDIAN is not set
> +ARCH_USE_MMU=y
> +# ARCH_WANTS_BIG_ENDIAN is not set
> +# ARCH_WANTS_LITTLE_ENDIAN is not set
> +ASSUME_DEVPTS=y
> +# COMPAT_ATEXIT is not set
> +CROSS_COMPILER_PREFIX=""
> +DEVEL_PREFIX="/usr/"
> +# DOASSERTS is not set
> +# DODEBUG is not set
> +# DODEBUG_PT is not set
> +# DOMULTI is not set
> +DOPIC=y
> +DOSTRIP=y
> +DO_C99_MATH=y
> +# DO_XSI_MATH is not set
> +# EXTRA_WARNINGS is not set
> +FORCE_OPTIONS_FOR_ARCH=y
> +# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
> +# HARDWIRED_ABSPATH is not set
> +# HAS_NO_THREADS is not set
> +HAVE_DOT_CONFIG=y
> +# HAVE_NO_PIC is not set
> +# HAVE_NO_SSP is not set
> +HAVE_SHARED=y
> +KERNEL_HEADERS="."
> +LDSO_BASE_FILENAME="ld.so"
> +LDSO_CACHE_SUPPORT=y
> +# LDSO_GNU_HASH_SUPPORT is not set
> +LDSO_LD_LIBRARY_PATH=y
> +LDSO_LDD_SUPPORT=y
> +# LDSO_NO_CLEANUP is not set
> +# LDSO_PRELINK_SUPPORT is not set
> +# LDSO_PRELOAD_FILE_SUPPORT is not set
> +LDSO_PRELOAD_ENV_SUPPORT=y
> +LDSO_RUNPATH=y
> +LDSO_SAFE_RUNPATH=y
> +# LDSO_RUNPATH_OF_EXECUTABLE is not set
> +# LDSO_SEARCH_INTERP_PATH is not set
> +# LDSO_STANDALONE_SUPPORT is not set
> +# LINUXTHREADS_NEW is not set
> +# LINUXTHREADS_OLD is not set
> +# UCLIBC_HAS_BACKTRACE is not set
> +UCLIBC_HAS_THREADS_NATIVE=y
> +# MALLOC is not set
> +MALLOC_GLIBC_COMPAT=y
> +# MALLOC_SIMPLE is not set
> +MALLOC_STANDARD=y
> +MULTILIB_DIR="lib"
> +PTHREADS_DEBUG_SUPPORT=y
> +RUNTIME_PREFIX="/"
> +# SUPPORT_LD_DEBUG is not set
> +# SUPPORT_LD_DEBUG_EARLY is not set
> +TARGET_SUBARCH=""
> +# TARGET_alpha is not set
> +# TARGET_arc is not set
> +# TARGET_arm is not set
> +# TARGET_avr32 is not set
> +# TARGET_bfin is not set
> +# TARGET_c6x is not set
> +# TARGET_cris is not set
> +# TARGET_e1 is not set
> +# TARGET_frv is not set
> +# TARGET_h8300 is not set
> +# TARGET_hppa is not set
> +# TARGET_i386 is not set
> +# TARGET_i960 is not set
> +# TARGET_ia64 is not set
> +# TARGET_m68k is not set
> +# TARGET_metag is not set
> +# TARGET_microblaze is not set
> +# TARGET_mips is not set
> +# TARGET_nios is not set
> +# TARGET_nios2 is not set
> +# TARGET_powerpc is not set
> +# TARGET_sh is not set
> +# TARGET_sh64 is not set
> +# TARGET_sparc is not set
> +# TARGET_v850 is not set
> +# TARGET_vax is not set
> +# TARGET_x86_64 is not set
> +# TARGET_xtensa is not set
> +UCLIBC_BSD_SPECIFIC=y
> +UCLIBC_BUILD_NOEXECSTACK=y
> +# UCLIBC_BUILD_NOW is not set
> +# UCLIBC_BUILD_PIE is not set
> +UCLIBC_BUILD_RELRO=y
> +UCLIBC_CTOR_DTOR=y
> +UCLIBC_DYNAMIC_ATEXIT=y
> +UCLIBC_EXTRA_CFLAGS=""
> +UCLIBC_GRP_BUFFER_SIZE=256
> +UCLIBC_HAS_ADVANCED_REALTIME=y
> +# UCLIBC_HAS_ARC4RANDOM is not set
> +UCLIBC_HAS_BSD_ERR=y
> +UCLIBC_HAS_BSD_RES_CLOSE=y
> +# UCLIBC_HAS_COMPAT_RES_STATE is not set
> +UCLIBC_HAS_CRYPT=y
> +UCLIBC_HAS_CRYPT_IMPL=y
> +UCLIBC_HAS_CTYPE_CHECKED=y
> +# UCLIBC_HAS_CTYPE_ENFORCED is not set
> +UCLIBC_HAS_CTYPE_SIGNED=y
> +UCLIBC_HAS_CTYPE_TABLES=y
> +# UCLIBC_HAS_CTYPE_UNSAFE is not set
> +UCLIBC_HAS_EPOLL=y
> +UCLIBC_HAS_ERRNO_MESSAGES=y
> +# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
> +# UCLIBC_HAS_FENV is not set
> +UCLIBC_HAS_FLOATS=y
> +UCLIBC_HAS_FNMATCH=y
> +UCLIBC_HAS_FNMATCH_OLD=y
> +# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
> +UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
> +# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
> +# UCLIBC_HAS_FPU is not set
> +UCLIBC_HAS_FTS=y
> +UCLIBC_HAS_FTW=y
> +# UCLIBC_HAS_FULL_RPC is not set
> +UCLIBC_HAS_GETPT=y
> +UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
> +UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
> +# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set
> +UCLIBC_HAS_GLOB=y
> +UCLIBC_HAS_GNU_ERROR=y
> +UCLIBC_HAS_GNU_GETOPT=y
> +UCLIBC_HAS_GNU_GETSUBOPT=y
> +UCLIBC_HAS_GNU_GLOB=y
> +UCLIBC_HAS_HEXADECIMAL_FLOATS=y
> +UCLIBC_HAS_IPV4=y
> +UCLIBC_HAS_IPV6=y
> +UCLIBC_HAS_LFS=y
> +UCLIBC_HAS_LIBNSL_STUB=y
> +UCLIBC_HAS_LIBRESOLV_STUB=y
> +UCLIBC_HAS_LIBUTIL=y
> +# UCLIBC_HAS_LOCALE is not set
> +# UCLIBC_BUILD_ALL_LOCALE is not set
> +# UCLIBC_BUILD_MINIMAL_LOCALE is not set
> +# UCLIBC_PREGENERATED_LOCALE_DATA is not set
> +UCLIBC_HAS_LONG_DOUBLE_MATH=y
> +UCLIBC_HAS_NETWORK_SUPPORT=y
> +UCLIBC_HAS_NFTW=y
> +# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
> +# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
> +UCLIBC_HAS_PRINTF_M_SPEC=y
> +# UCLIBC_HAS_PROFILING is not set
> +UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
> +UCLIBC_HAS_PTY=y
> +UCLIBC_HAS_REALTIME=y
> +# UCLIBC_HAS_REENTRANT_RPC is not set
> +UCLIBC_HAS_REGEX=y
> +UCLIBC_HAS_REGEX_OLD=y
> +UCLIBC_HAS_RESOLVER_SUPPORT=y
> +# UCLIBC_HAS_RPC is not set
> +UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
> +# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
> +# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
> +UCLIBC_HAS_SHADOW=y
> +UCLIBC_HAS_SIGNUM_MESSAGES=y
> +UCLIBC_HAS_SOCKET=y
> +UCLIBC_HAS_SOFT_FLOAT=y
> +# UCLIBC_HAS_SSP is not set
> +# UCLIBC_HAS_SSP_COMPAT is not set
> +UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
> +# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
> +# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
> +# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
> +UCLIBC_HAS_STDIO_BUFSIZ_4096=y
> +# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
> +# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
> +# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
> +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
> +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
> +UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
> +UCLIBC_HAS_STDIO_GETC_MACRO=y
> +UCLIBC_HAS_STDIO_PUTC_MACRO=y
> +# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
> +UCLIBC_HAS_STRING_ARCH_OPT=y
> +UCLIBC_HAS_STRING_GENERIC_OPT=y
> +# UCLIBC_HAS_STUBS is not set
> +UCLIBC_HAS_SYSLOG=y
> +# UCLIBC_HAS_SYS_ERRLIST is not set
> +# UCLIBC_HAS_SYS_SIGLIST is not set
> +UCLIBC_HAS_THREADS=y
> +UCLIBC_HAS_TM_EXTENSIONS=y
> +UCLIBC_HAS_TZ_CACHING=y
> +UCLIBC_HAS_TZ_FILE=y
> +UCLIBC_HAS_TZ_FILE_READ_MANY=y
> +UCLIBC_HAS_UTMPX=y
> +UCLIBC_HAS_UTMP=y
> +UCLIBC_HAS_WCHAR=y
> +UCLIBC_HAS_WORDEXP=y
> +# UCLIBC_HAS_XATTR is not set
> +# UCLIBC_HAS_XLOCALE is not set
> +UCLIBC_HAS___PROGNAME=y
> +# UCLIBC_LINUX_MODULE_24 is not set
> +UCLIBC_LINUX_MODULE_26=y
> +UCLIBC_LINUX_SPECIFIC=y
> +# UCLIBC_MALLOC_DEBUGGING is not set
> +# UCLIBC_MJN3_ONLY is not set
> +# UCLIBC_NTP_LEGACY is not set
> +# USE_OLD_VFPRINTF is not set
> +UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
> +UCLIBC_PWD_BUFFER_SIZE=256
> +# UCLIBC_STATIC_LDCONFIG is not set
> +# UCLIBC_STRICT_HEADERS is not set
> +UCLIBC_SUPPORT_AI_ADDRCONFIG=y
> +UCLIBC_SUSV3_LEGACY=y
> +UCLIBC_SUSV3_LEGACY_MACROS=y
> +UCLIBC_SUSV4_LEGACY=y
> +# UCLIBC_SV4_DEPRECATED is not set
> +UCLIBC_TZ_FILE_PATH="/etc/TZ"
> +# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set
> +UCLIBC_USE_NETLINK=y
> +# UNIX98PTY_ONLY is not set
> +USE_BX=y
> +WARNINGS="-Wall"
> +# UCLIBC_HAS_OBSTACK is not set
> +# UCLIBC_SUSV2_LEGACY is not set
> +# UCLIBC_HAS_CONTEXT_FUNCS is not set
> +UCLIBC_HAS_GETOPT_LONG=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/debug b/toolchain/uClibc/config-ng-1.0.6/debug
> new file mode 100644
> index 0000000..b366e66
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/debug
> @@ -0,0 +1,6 @@
> +DODEBUG=y
> +DODEBUG_PT=y
> +PTHREADS_DEBUG_SUPPORT=y
> +SUPPORT_LD_DEBUG=y
> +SUPPORT_LD_DEBUG_EARLY=y
> +UCLIBC_MALLOC_DEBUGGING=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/i386 b/toolchain/uClibc/config-ng-1.0.6/i386
> new file mode 100644
> index 0000000..5ef264c
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/i386
> @@ -0,0 +1,21 @@
> +ARCH_LITTLE_ENDIAN=y
> +# CONFIG_386 is not set
> +CONFIG_486=y
> +# CONFIG_586 is not set
> +# CONFIG_586MMX is not set
> +# CONFIG_686 is not set
> +# CONFIG_CRUSOE is not set
> +# CONFIG_CYRIXIII is not set
> +# CONFIG_ELAN is not set
> +# CONFIG_GENERIC_386 is not set
> +# CONFIG_K6 is not set
> +# CONFIG_K7 is not set
> +# CONFIG_NEHEMIAH is not set
> +# CONFIG_PENTIUM4 is not set
> +# CONFIG_PENTIUMII is not set
> +# CONFIG_PENTIUMIII is not set
> +# CONFIG_WINCHIP2 is not set
> +# CONFIG_WINCHIPC6 is not set
> +TARGET_ARCH="i386"
> +TARGET_i386=y
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/i686 b/toolchain/uClibc/config-ng-1.0.6/i686
> new file mode 100644
> index 0000000..ba615f6
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/i686
> @@ -0,0 +1,21 @@
> +ARCH_LITTLE_ENDIAN=y
> +# CONFIG_386 is not set
> +# CONFIG_486 is not set
> +# CONFIG_586 is not set
> +# CONFIG_586MMX is not set
> +CONFIG_686=y
> +# CONFIG_CRUSOE is not set
> +# CONFIG_CYRIXIII is not set
> +# CONFIG_ELAN is not set
> +# CONFIG_GENERIC_386 is not set
> +# CONFIG_K6 is not set
> +# CONFIG_K7 is not set
> +# CONFIG_NEHEMIAH is not set
> +# CONFIG_PENTIUM4 is not set
> +# CONFIG_PENTIUMII is not set
> +# CONFIG_PENTIUMIII is not set
> +# CONFIG_WINCHIP2 is not set
> +# CONFIG_WINCHIPC6 is not set
> +TARGET_ARCH="i386"
> +TARGET_i386=y
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/m68k b/toolchain/uClibc/config-ng-1.0.6/m68k
> new file mode 100644
> index 0000000..14ce5ae
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/m68k
> @@ -0,0 +1,6 @@
> +ARCH_BIG_ENDIAN=y
> +LINUXTHREADS_OLD=y
> +TARGET_ARCH="m68k"
> +TARGET_SUBARCH=""
> +TARGET_m68k=y
> +# UCLIBC_HAS_THREADS_NATIVE is not set
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips b/toolchain/uClibc/config-ng-1.0.6/mips
> new file mode 100644
> index 0000000..8cec22f
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips
> @@ -0,0 +1,18 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_BIG_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_WANTS_BIG_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +CONFIG_MIPS_ISA_MIPS32=y
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +# CONFIG_MIPS_ISA_MIPS64 is not set
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +# CONFIG_MIPS_N64_ABI is not set
> +CONFIG_MIPS_O32_ABI=y
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64 b/toolchain/uClibc/config-ng-1.0.6/mips64
> new file mode 100644
> index 0000000..566d87a
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips64
> @@ -0,0 +1,18 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_BIG_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_WANTS_BIG_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +CONFIG_MIPS_ISA_MIPS64=y
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +CONFIG_MIPS_N64_ABI=y
> +# CONFIG_MIPS_O32_ABI is not set
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64.32 b/toolchain/uClibc/config-ng-1.0.6/mips64.32
> new file mode 100644
> index 0000000..b7ea8f4
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips64.32
> @@ -0,0 +1,19 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_BIG_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_WANTS_BIG_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +CONFIG_MIPS_ISA_MIPS64=y
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +# CONFIG_MIPS_N64_ABI is not set
> +CONFIG_MIPS_O32_ABI=y
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +TARGET_SUBARCH="mips64"
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64.64 b/toolchain/uClibc/config-ng-1.0.6/mips64.64
> new file mode 100644
> index 0000000..2a0b755
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips64.64
> @@ -0,0 +1,19 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_BIG_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_WANTS_BIG_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +CONFIG_MIPS_ISA_MIPS64=y
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +CONFIG_MIPS_N64_ABI=y
> +# CONFIG_MIPS_O32_ABI is not set
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +TARGET_SUBARCH="mips64"
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64.n32 b/toolchain/uClibc/config-ng-1.0.6/mips64.n32
> new file mode 100644
> index 0000000..f8def58
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips64.n32
> @@ -0,0 +1,19 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_BIG_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_WANTS_BIG_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +CONFIG_MIPS_ISA_MIPS64=y
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +CONFIG_MIPS_N32_ABI=y
> +# CONFIG_MIPS_N64_ABI is not set
> +# CONFIG_MIPS_O32_ABI is not set
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +TARGET_SUBARCH="mips64"
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64el b/toolchain/uClibc/config-ng-1.0.6/mips64el
> new file mode 100644
> index 0000000..5358078
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips64el
> @@ -0,0 +1,18 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_LITTLE_ENDIAN=y
> +ARCH_WANTS_LITTLE_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +CONFIG_MIPS_ISA_MIPS64=y
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +CONFIG_MIPS_N64_ABI=y
> +# CONFIG_MIPS_O32_ABI is not set
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64el.32 b/toolchain/uClibc/config-ng-1.0.6/mips64el.32
> new file mode 100644
> index 0000000..a10840b
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips64el.32
> @@ -0,0 +1,19 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_LITTLE_ENDIAN=y
> +ARCH_WANTS_LITTLE_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +CONFIG_MIPS_ISA_MIPS64=y
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +# CONFIG_MIPS_N64_ABI is not set
> +CONFIG_MIPS_O32_ABI=y
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +TARGET_SUBARCH="mips64"
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64el.64 b/toolchain/uClibc/config-ng-1.0.6/mips64el.64
> new file mode 100644
> index 0000000..8b90a54
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips64el.64
> @@ -0,0 +1,19 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_LITTLE_ENDIAN=y
> +ARCH_WANTS_LITTLE_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +CONFIG_MIPS_ISA_MIPS64=y
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +CONFIG_MIPS_N64_ABI=y
> +# CONFIG_MIPS_O32_ABI is not set
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +TARGET_SUBARCH="mips64"
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mips64el.n32 b/toolchain/uClibc/config-ng-1.0.6/mips64el.n32
> new file mode 100644
> index 0000000..4ac4d06
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mips64el.n32
> @@ -0,0 +1,19 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_LITTLE_ENDIAN=y
> +ARCH_WANTS_LITTLE_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +CONFIG_MIPS_ISA_MIPS64=y
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +CONFIG_MIPS_N32_ABI=y
> +# CONFIG_MIPS_N64_ABI is not set
> +# CONFIG_MIPS_O32_ABI is not set
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +TARGET_SUBARCH="mips64"
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mipsel b/toolchain/uClibc/config-ng-1.0.6/mipsel
> new file mode 100644
> index 0000000..d9dedbb
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mipsel
> @@ -0,0 +1,18 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_LITTLE_ENDIAN=y
> +ARCH_WANTS_LITTLE_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +# CONFIG_MIPS_ISA_3 is not set
> +# CONFIG_MIPS_ISA_4 is not set
> +CONFIG_MIPS_ISA_MIPS32=y
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +# CONFIG_MIPS_ISA_MIPS64 is not set
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +# CONFIG_MIPS_N64_ABI is not set
> +CONFIG_MIPS_O32_ABI=y
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt b/toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt
> new file mode 100644
> index 0000000..1d42a70
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt
> @@ -0,0 +1,18 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_CFLAGS="-mno-split-addresses"
> +ARCH_LITTLE_ENDIAN=y
> +ARCH_WANTS_LITTLE_ENDIAN=y
> +# CONFIG_MIPS_ISA_1 is not set
> +# CONFIG_MIPS_ISA_2 is not set
> +CONFIG_MIPS_ISA_3=y
> +# CONFIG_MIPS_ISA_4 is not set
> +# CONFIG_MIPS_ISA_MIPS32 is not set
> +# CONFIG_MIPS_ISA_MIPS32R2 is not set
> +# CONFIG_MIPS_ISA_MIPS64 is not set
> +# CONFIG_MIPS_ISA_MIPS64R2 is not set
> +# CONFIG_MIPS_N32_ABI is not set
> +# CONFIG_MIPS_N64_ABI is not set
> +CONFIG_MIPS_O32_ABI=y
> +TARGET_ARCH="mips"
> +TARGET_mips=y
> +UCLIBC_HAS_FPU=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/powerpc b/toolchain/uClibc/config-ng-1.0.6/powerpc
> new file mode 100644
> index 0000000..5b1292d
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/powerpc
> @@ -0,0 +1,6 @@
> +ARCH_BIG_ENDIAN=y
> +CONFIG_CLASSIC=y
> +# CONFIG_E500 is not set
> +TARGET_ARCH="powerpc"
> +TARGET_SUBARCH="classic"
> +TARGET_powerpc=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/powerpc.e500 b/toolchain/uClibc/config-ng-1.0.6/powerpc.e500
> new file mode 100644
> index 0000000..a835c3d
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/powerpc.e500
> @@ -0,0 +1,6 @@
> +ARCH_BIG_ENDIAN=y
> +# CONFIG_CLASSIC is not set
> +CONFIG_E500=y
> +TARGET_ARCH="powerpc"
> +TARGET_SUBARCH="classic"
> +TARGET_powerpc=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/sparc b/toolchain/uClibc/config-ng-1.0.6/sparc
> new file mode 100644
> index 0000000..e1596c4
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/sparc
> @@ -0,0 +1,8 @@
> +ARCH_BIG_ENDIAN=y
> +# CONFIG_SPARC_V7 is not set
> +# CONFIG_SPARC_V8 is not set
> +CONFIG_SPARC_V9=y
> +# CONFIG_SPARC_V9B is not set
> +TARGET_ARCH="sparc"
> +TARGET_sparc=y
> +UCLIBC_HAS_LONG_DOUBLE_MATH=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/sparc.leon b/toolchain/uClibc/config-ng-1.0.6/sparc.leon
> new file mode 100644
> index 0000000..eb725ac
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/sparc.leon
> @@ -0,0 +1,8 @@
> +ARCH_BIG_ENDIAN=y
> +# CONFIG_SPARC_V7 is not set
> +CONFIG_SPARC_V8=y
> +# CONFIG_SPARC_V9 is not set
> +# CONFIG_SPARC_V9B is not set
> +TARGET_ARCH="sparc"
> +TARGET_sparc=y
> +UCLIBC_HAS_LONG_DOUBLE_MATH=y
> diff --git a/toolchain/uClibc/config-ng-1.0.6/x86_64 b/toolchain/uClibc/config-ng-1.0.6/x86_64
> new file mode 100644
> index 0000000..b6dc2c2
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/x86_64
> @@ -0,0 +1,6 @@
> +ARCH_LITTLE_ENDIAN=y
> +# LINUXTHREADS_NEW is not set
> +TARGET_ARCH="x86_64"
> +TARGET_x86_64=y
> +UCLIBC_BSD_SPECIFIC=y
> +UCLIBC_HAS_FPU=y
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Wed Aug 26 14:28:08 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Wed, 26 Aug 2015 18:28:08 +0000
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
	uClibc-ng
In-Reply-To: <55DE0371.4080600@openwrt.org>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org>
Message-ID: <1440613687.15478.58.camel@synopsys.com>

Hi John,

On Wed, 2015-08-26 at 20:20 +0200, John Crispin wrote:
> Hi,
> 
> On 26/08/2015 20:11, Alexey Brodkin wrote:
> > uClibc-ng is a spin-off of original uClibc, see http://www.uclibc-ng.org/
> > 
> > We try to regularly add changes from uClibc to uClibc-ng.
> > We even sent patches and bug reports to the uClibc mailing list.
> > The config file is compatible between uClibc-ng 1.0 and uClibc git master.
> > This might change in the future.
> > 
> > Our main goal is to provide regularly a stable and tested release
> > to make embedded system developers happy.
> > 
> > The main advantage of uClibc-ng over olde good uClibc is regular releases
> > so there's no need to keep tons of patches on top of years old
> > 0.9.33.2
> > 
> 
> why do you not use musl ? it is actively support rather than being
> hooked on life support.

The point is I'm about to submit patch with support of new architecture (ARC)
in OpenWRT. And unfortunately the only libc we have now is uClibc.

And since "original" uClibc lack recent releases (where ARC support might exist
as we're in uclibc's master branch for quite some time already) I went forward
with uClibc-ng which sees releases much more often and in released tarballs
we already have support of ARC.

So I understand that other architectures may not benefit a lot from newer
uClibc but for us (ARC) there's no other way.

Hope that makes sense.

-Alexey
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From eschultz at prplfoundation.org  Wed Aug 26 15:43:27 2015
From: eschultz at prplfoundation.org (Eric Schultz)
Date: Wed, 26 Aug 2015 14:43:27 -0500
Subject: [OpenWrt-Devel] OpenWrt Summit Session Deadline - this FRIDAY,
	August 28
Message-ID: <CAMkzgA4OXXXjP8rDeHZ8Y7R59fYuBR2HESrYDmmWXdpLMHhoRw@mail.gmail.com>

First, I promise this is the last reminder of the OpenWrt Summit Session
deadline. :)

I just wanted to remind folks that the deadline for submitting OpenWrt
Summit sessions is this Friday, August 28. We have some great session
submissions but we're still looking for YOUR session submission. If you
have a topic on OpenWrt you'd like to discuss or want to show off some
great work, the OpenWrt Summit is the place to do it!

You can submit a session by visiting http://summit.prplfoundation.org and
following the instructions. We've tried to make the form simple and
straightforward but if you have any questions, don't hesitate to contact me
(eschultz at prplfoundation.org)

If you've never presented at a conference before, we welcome your
submissions and participation. We want your views and experiences shared.
I'm also happy to help anyone who would like help with their submissions.

Lastly, OpenWrt Summit is a welcoming conference and we value the
participation of all people. In particular, I want to encourage folks from
marginalized communities to submit their sessions, including women and
people of color. Your experiences are part of OpenWrt and we welcome your
sessions. As always, please contact me if you have any questions or
concerns.

I look forward to seeing the final sessions that come in from everyone.

Thanks everyone again,

Eric
-- 
Eric Schultz, Community Manager, prpl Foundation
http://www.prplfoundation.org
eschultz at prplfoundation.org
cell: 920-539-0404
skype: ericschultzwi
@EricPrpl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150826/566828be/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From champetier.etienne at gmail.com  Wed Aug 26 19:26:40 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Wed, 26 Aug 2015 23:26:40 +0000
Subject: [OpenWrt-Devel] [PATCH procd v3 0/7] jail work
Message-ID: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>

v3 of my (u)jail work, you can now use separately
namespaces jail, capabilities and seccomp

Openwrt procd Makefile patch v2 is still ok
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 26 19:26:41 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Wed, 26 Aug 2015 23:26:41 +0000
Subject: [OpenWrt-Devel] [PATCH procd v3 1/7] add UTRACE_SUPPORT build option
In-Reply-To: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
References: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440631607-63520-2-git-send-email-champetier.etienne@gmail.com>

we can now build preload-seccomp, ujail, utrace separately

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6af17a3..805e2ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,7 +84,9 @@ TARGET_LINK_LIBRARIES(ujail ubox)
 INSTALL(TARGETS ujail
 	RUNTIME DESTINATION sbin
 )
+endif()
 
+IF(UTRACE_SUPPORT)
 ADD_EXECUTABLE(utrace trace/trace.c)
 TARGET_LINK_LIBRARIES(utrace ubox ${json} blobmsg_json)
 INSTALL(TARGETS utrace
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 26 19:26:42 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Wed, 26 Aug 2015 23:26:42 +0000
Subject: [OpenWrt-Devel] [PATCH procd v3 2/7] jail,
	seccomp: fix typo/improve log prefix
In-Reply-To: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
References: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440631607-63520-3-git-send-email-champetier.etienne@gmail.com>

(perload-jail -> preload-seccomp)

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/seccomp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/jail/seccomp.h b/jail/seccomp.h
index 6c585ad..c44a607 100644
--- a/jail/seccomp.h
+++ b/jail/seccomp.h
@@ -12,8 +12,8 @@
  */
 
 #define INFO(fmt, ...) do { \
-	syslog(0,"perload-jail: "fmt, ## __VA_ARGS__); \
-	fprintf(stderr,"perload-jail: "fmt, ## __VA_ARGS__); \
+	syslog(0,"preload-seccomp: "fmt, ## __VA_ARGS__); \
+	fprintf(stderr,"preload-seccomp: "fmt, ## __VA_ARGS__); \
 	} while (0)
 
 int install_syscall_filter(const char *argv, const char *file);
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 26 19:26:43 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Wed, 26 Aug 2015 23:26:43 +0000
Subject: [OpenWrt-Devel] [PATCH procd v3 3/7] jail,
	seccomp: remove useless root check
In-Reply-To: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
References: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440631607-63520-4-git-send-email-champetier.etienne@gmail.com>

prctl(PR_SET_NO_NEW_PRIVS, 1) is enough, we don't require CAP_SYS_ADMIN
see
https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt
https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/preload.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/jail/preload.c b/jail/preload.c
index 97ac44d..a1cc0b6 100644
--- a/jail/preload.c
+++ b/jail/preload.c
@@ -27,14 +27,8 @@ static main_t __main__;
 
 static int __preload_main__(int argc, char **argv, char **envp)
 {
-	uid_t uid = getuid();
 	char *env_file = getenv("SECCOMP_FILE");
 
-	if (uid) {
-		INFO("preload-seccomp: %s: not root, cannot install seccomp filter\n", *argv);
-		return -1;
-	}
-
 	if (install_syscall_filter(*argv, env_file))
 		return -1;
 
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 26 19:26:44 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Wed, 26 Aug 2015 23:26:44 +0000
Subject: [OpenWrt-Devel] [PATCH procd v3 4/7] jail: reworks & cleanups
In-Reply-To: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
References: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440631607-63520-5-git-send-email-champetier.etienne@gmail.com>

-use EXIT_SUCCESS/EXIT_FAILURE (not -1)
-parse every option in main, put them in opts struct
-add CLONE_NEWIPC to the clone() call (it's already compiled in openwrt kernel)
-return the exit status of the jailed process, or the num of the signal that killed it
-add missing options to usage()
-add a warning in usage() about ujail security
-debug option can now take an int as parameter (~debug level),
  with -d2 you now activate "LD_DEBUG=all" for exemple
-do not depend on libpreload-seccomp.so if -S is not present
-there is now only one ujail process instead of two

jail creation is now as follow:
1) create jail root dir (mkdir)
2) create new namespace (clone)
(in the parent wait for the child with uloop)
3) build the jail root fs (mount bind all the libs/bins ...),
pivot_root and mount special fs (procfs, sysfs) (build_jail_fs())
4) build envp (LD_PRELOAD the seccomp helper or ...)
5) drop capabilities (next patch)
6) execve the jailed bin
7) remove jail root dir (once child is dead)

there is no need to umount anything because we are already in a namespace

Todo:
-allow signals from the parent to the child

Feature request:
-when we add a file or dir, detect if it's an exec and add it's dependencies

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/jail.c | 393 ++++++++++++++++++++++++------------------------------------
 1 file changed, 157 insertions(+), 236 deletions(-)

diff --git a/jail/jail.c b/jail/jail.c
index 2bba292..f8139b8 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -43,7 +43,17 @@
 #include <libubox/uloop.h>
 
 #define STACK_SIZE	(1024 * 1024)
-#define OPT_ARGS	"P:S:n:r:w:psuldo"
+#define OPT_ARGS	"P:S:n:r:w:d:psulo"
+
+static struct {
+	char *path;
+	char *name;
+	char **jail_argv;
+	char *seccomp;
+	int procfs;
+	int ronly;
+	int sysfs;
+} opts;
 
 struct extra {
 	struct list_head list;
@@ -125,7 +135,7 @@ static int mount_bind(const char *root, const char *path, const char *name, int
 		return -1;
 	}
 
-	if (readonly && mount(old, new, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL)) {
+	if (readonly && mount(NULL, new, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL)) {
 		ERROR("failed to remount ro %s: %s\n", new, strerror(errno));
 		return -1;
 	}
@@ -135,80 +145,75 @@ static int mount_bind(const char *root, const char *path, const char *name, int
 	return 0;
 }
 
-static int build_jail(const char *path)
+static int build_jail_fs()
 {
 	struct library *l;
 	struct extra *m;
-	int ret = 0;
 
-	mkdir(path, 0755);
-
-	if (mount("tmpfs", path, "tmpfs", MS_NOATIME, "mode=0755")) {
+	if (mount("tmpfs", opts.path, "tmpfs", MS_NOATIME, "mode=0755")) {
 		ERROR("tmpfs mount failed %s\n", strerror(errno));
 		return -1;
 	}
 
-	avl_for_each_element(&libraries, l, avl)
-		if (mount_bind(path, l->path, l->name, 1, -1))
-			return -1;
-
-	list_for_each_entry(m, &extras, list)
-		if (mount_bind(path, m->path, m->name, m->readonly, 0))
-			return -1;
-
-	return ret;
-}
+	if (chdir(opts.path)) {
+		ERROR("failed to chdir() in the jail root\n");
+		return -1;
+	}
 
-static void _umount(const char *root, const char *path)
-{
-	char *buf = NULL;
+	avl_init(&libraries, avl_strcmp, false, NULL);
+	alloc_library_path("/lib64");
+	alloc_library_path("/lib");
+	alloc_library_path("/usr/lib");
+	load_ldso_conf("/etc/ld.so.conf");
 
-	if (asprintf(&buf, "%s%s", root, path) < 0) {
-		ERROR("failed to alloc umount buffer: %s\n", strerror(errno));
-	} else {
-		DEBUG("umount %s\n", buf);
-		umount(buf);
-		free(buf);
+	if (elf_load_deps(*opts.jail_argv)) {
+		ERROR("failed to load dependencies\n");
+		return -1;
 	}
-}
 
-static int stop_jail(const char *root)
-{
-	struct library *l;
-	struct extra *m;
+	if (opts.seccomp && elf_load_deps("libpreload-seccomp.so")) {
+		ERROR("failed to load libpreload-seccomp.so\n");
+		return -1;
+	}
 
-	avl_for_each_element(&libraries, l, avl) {
-		char path[256];
-		char *p = l->path;
+	avl_for_each_element(&libraries, l, avl)
+		if (mount_bind(opts.path, l->path, l->name, 1, -1))
+			return -1;
 
-		if (strstr(p, "local"))
-			p = "/lib";
+	list_for_each_entry(m, &extras, list)
+		if (mount_bind(opts.path, m->path, m->name, m->readonly, 0))
+			return -1;
 
-		snprintf(path, sizeof(path), "%s%s/%s", root, p, l->name);
-		DEBUG("umount %s\n", path);
-		umount(path);
+	char *mpoint;
+	if (asprintf(&mpoint, "%s/old", opts.path) < 0) {
+		ERROR("failed to alloc pivot path: %s\n", strerror(errno));
+		return -1;
 	}
-
-	list_for_each_entry(m, &extras, list) {
-		char path[256];
-
-		snprintf(path, sizeof(path), "%s%s/%s", root, m->path, m->name);
-		DEBUG("umount %s\n", path);
-		umount(path);
+	mkdir_p(mpoint, 0755);
+	if (pivot_root(opts.path, mpoint) == -1) {
+		ERROR("pivot_root failed:%s\n", strerror(errno));
+		free(mpoint);
+		return -1;
 	}
-
-	_umount(root, "/proc");
-	_umount(root, "/sys");
-
-	DEBUG("umount %s\n", root);
-	umount(root);
-	rmdir(root);
+	free(mpoint);
+	umount2("/old", MNT_DETACH);
+	rmdir("/old");
+	if (opts.procfs) {
+		mkdir("/proc", 0755);
+		mount("proc", "/proc", "proc", MS_NOATIME, 0);
+	}
+	if (opts.sysfs) {
+		mkdir("/sys", 0755);
+		mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
+	}
+	if (opts.ronly)
+		mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
 
 	return 0;
 }
 
 #define MAX_ENVP	8
-static char** build_envp(const char *seccomp, int debug)
+static char** build_envp(const char *seccomp)
 {
 	static char *envp[MAX_ENVP];
 	static char preload_var[64];
@@ -227,177 +232,77 @@ static char** build_envp(const char *seccomp, int debug)
 		snprintf(preload_var, sizeof(preload_var), "LD_PRELOAD=%s", preload_lib);
 		envp[count++] = preload_var;
 	}
-	if (debug)
+	if (debug > 1)
 		envp[count++] = debug_var;
 
 	return envp;
 }
 
-static int spawn(const char *path, char **argv, const char *seccomp)
-{
-	pid_t pid = fork();
-
-	if (pid < 0) {
-		ERROR("failed to spawn %s: %s\n", *argv, strerror(errno));
-		return -1;
-	} else if (!pid) {
-		char **envp = build_envp(seccomp, 0);
-
-		INFO("spawning %s\n", *argv);
-		execve(*argv, argv, envp);
-		ERROR("failed to spawn child %s: %s\n", *argv, strerror(errno));
-		exit(-1);
-	}
-
-	return pid;
-}
-
-static int usage(void)
+static void usage(void)
 {
-	fprintf(stderr, "jail <options> -D <binary> <params ...>\n");
+	fprintf(stderr, "ujail <options> -- <binary> <params ...>\n");
 	fprintf(stderr, "  -P <path>\tpath where the jail will be staged\n");
 	fprintf(stderr, "  -S <file>\tseccomp filter\n");
 	fprintf(stderr, "  -n <name>\tthe name of the jail\n");
 	fprintf(stderr, "  -r <file>\treadonly files that should be staged\n");
 	fprintf(stderr, "  -w <file>\twriteable files that should be staged\n");
-	fprintf(stderr, "  -p\t\tjail has /proc\t\n");
-	fprintf(stderr, "  -s\t\tjail has /sys\t\n");
-	fprintf(stderr, "  -l\t\tjail has /dev/log\t\n");
-	fprintf(stderr, "  -u\t\tjail has a ubus socket\t\n");
-
-	return -1;
+	fprintf(stderr, "  -d <num>\tshow debug log (increase num to increase verbosity)\n");
+	fprintf(stderr, "  -p\t\tjail has /proc\n");
+	fprintf(stderr, "  -s\t\tjail has /sys\n");
+	fprintf(stderr, "  -l\t\tjail has /dev/log\n");
+	fprintf(stderr, "  -u\t\tjail has a ubus socket\n");
+	fprintf(stderr, "  -o\t\tremont jail root (/) read only\n");
+	fprintf(stderr, "\nWarning: by default root inside the jail is the same\n\
+and he has the same powers as root outside the jail,\n\
+thus he can escape the jail and/or break stuff.\n\
+Please use an appropriate seccomp filter (-S) to restrict his powers\n");
 }
 
-static int child_running = 1;
-
-static void child_process_handler(struct uloop_process *c, int ret)
-{
-	INFO("child (%d) exited: %d\n", c->pid, ret);
-	uloop_end();
-	child_running = 0;
-}
-
-struct uloop_process child_process = {
-	.cb = child_process_handler,
-};
-
-static int spawn_child(void *arg)
+static int spawn_jail(void *arg)
 {
-	char *path = get_current_dir_name();
-	int procfs = 0, sysfs = 0;
-	char *seccomp = NULL;
-	char **argv = arg;
-	int argc = 0, ch;
-	char *mpoint;
-	int ronly = 0;
-
-	while (argv[argc])
-		argc++;
-
-	optind = 0;
-	while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
-		switch (ch) {
-		case 'd':
-			debug = 1;
-			break;
-		case 'S':
-			seccomp = optarg;
-			break;
-		case 'p':
-			procfs = 1;
-			break;
-		case 'o':
-			ronly = 1;
-			break;
-		case 's':
-			sysfs = 1;
-			break;
-		case 'n':
-			if (sethostname(optarg, strlen(optarg)))
-				ERROR("failed to sethostname: %s\n", strerror(errno));
-			break;
-		}
+	if (opts.name && sethostname(opts.name, strlen(opts.name))) {
+		ERROR("failed to sethostname: %s\n", strerror(errno));
 	}
 
-	if (asprintf(&mpoint, "%s/old", path) < 0) {
-		ERROR("failed to alloc pivot path: %s\n", strerror(errno));
-		return -1;
-	}
-	mkdir_p(mpoint, 0755);
-	if (pivot_root(path, mpoint) == -1) {
-		ERROR("pivot_root failed:%s\n", strerror(errno));
-		return -1;
-	}
-	free(mpoint);
-	umount2("/old", MNT_DETACH);
-	rmdir("/old");
-	if (procfs) {
-		mkdir("/proc", 0755);
-		mount("proc", "/proc", "proc", MS_NOATIME, 0);
-	}
-	if (sysfs) {
-		mkdir("/sys", 0755);
-		mount("sysfs", "/sys", "sysfs", MS_NOATIME, 0);
+	if (build_jail_fs()) {
+		ERROR("failed to build jail fs");
+		exit(EXIT_FAILURE);
 	}
-	if (ronly)
-		mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0);
 
-	uloop_init();
+	char **envp = build_envp(opts.seccomp);
+	if (!envp)
+		exit(EXIT_FAILURE);
 
-	child_process.pid = spawn(path, &argv[optind], seccomp);
-	uloop_process_add(&child_process);
-	uloop_run();
-	uloop_done();
-	if (child_running) {
-		kill(child_process.pid, SIGTERM);
-		waitpid(child_process.pid, NULL, 0);
-	}
+	//TODO: drop capabilities() here
+	//prctl(PR_CAPBSET_DROP, ..., 0, 0, 0);
 
-	return 0;
+	INFO("exec-ing %s\n", *opts.jail_argv);
+	execve(*opts.jail_argv, opts.jail_argv, envp);
+	//we get there only if execve fails
+	ERROR("failed to execve %s: %s\n", *opts.jail_argv, strerror(errno));
+	exit(EXIT_FAILURE);
 }
 
-static int namespace_running = 1;
+static int jail_running = 1;
+static int jail_return_code = 0;
 
-static void namespace_process_handler(struct uloop_process *c, int ret)
+static void jail_process_handler(struct uloop_process *c, int ret)
 {
-	INFO("namespace (%d) exited: %d\n", c->pid, ret);
+	if (WIFEXITED(ret)) {
+		jail_return_code = WEXITSTATUS(ret);
+		INFO("jail (%d) exited with exit: %d\n", c->pid, jail_return_code);
+	} else {
+		jail_return_code = WTERMSIG(ret);
+		INFO("jail (%d) exited with signal: %d\n", c->pid, jail_return_code);
+	}
+	jail_running = 0;
 	uloop_end();
-	namespace_running = 0;
 }
 
-struct uloop_process namespace_process = {
-	.cb = namespace_process_handler,
+static struct uloop_process jail_process = {
+	.cb = jail_process_handler,
 };
 
-static void spawn_namespace(const char *path, int argc, char **argv)
-{
-	char *dir = get_current_dir_name();
-
-	uloop_init();
-	if (chdir(path)) {
-		ERROR("failed to chdir() into the jail\n");
-		return;
-	}
-	namespace_process.pid = clone(spawn_child,
-			child_stack + STACK_SIZE,
-			CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | SIGCHLD, argv);
-
-	if (namespace_process.pid != -1) {
-		if (chdir(dir))
-			ERROR("failed to chdir() out of the jail\n");
-		free(dir);
-		uloop_process_add(&namespace_process);
-		uloop_run();
-		uloop_done();
-		if (namespace_running) {
-			kill(namespace_process.pid, SIGTERM);
-			waitpid(namespace_process.pid, NULL, 0);
-		}
-	} else {
-		ERROR("failed to spawn namespace: %s\n", strerror(errno));
-	}
-}
-
 static void add_extra(char *name, int readonly)
 {
 	struct extra *f;
@@ -419,16 +324,14 @@ static void add_extra(char *name, int readonly)
 int main(int argc, char **argv)
 {
 	uid_t uid = getuid();
-	const char *name = NULL;
-	char *path = NULL;
-	struct stat s;
-	int ch, ret;
 	char log[] = "/dev/log";
 	char ubus[] = "/var/run/ubus.sock";
+	int ret = EXIT_SUCCESS;
+	int ch;
 
 	if (uid) {
 		ERROR("not root, aborting: %s\n", strerror(errno));
-		return -1;
+		return EXIT_FAILURE;
 	}
 
 	umask(022);
@@ -436,15 +339,27 @@ int main(int argc, char **argv)
 	while ((ch = getopt(argc, argv, OPT_ARGS)) != -1) {
 		switch (ch) {
 		case 'd':
-			debug = 1;
+			debug = atoi(optarg);
+			break;
+		case 'p':
+			opts.procfs = 1;
+			break;
+		case 'o':
+			opts.ronly = 1;
+			break;
+		case 's':
+			opts.sysfs = 1;
+			break;
+		case 'S':
+			opts.seccomp = optarg;
+			add_extra(optarg, 1);
 			break;
 		case 'P':
-			path = optarg;
+			opts.path = optarg;
 			break;
 		case 'n':
-			name = optarg;
+			opts.name = optarg;
 			break;
-		case 'S':
 		case 'r':
 			add_extra(optarg, 1);
 			break;
@@ -460,46 +375,52 @@ int main(int argc, char **argv)
 		}
 	}
 
-	if (argc - optind < 1)
-		return usage();
-
-	if (!path && asprintf(&path, "/tmp/%s", basename(argv[optind])) == -1) {
-		ERROR("failed to set root path\n: %s", strerror(errno));
-		return -1;
+	//no <binary> param found
+	if (argc - optind < 1) {
+		usage();
+		return EXIT_FAILURE;
 	}
 
-	if (!stat(path, &s)) {
-		ERROR("%s already exists: %s\n", path, strerror(errno));
-		return -1;
-	}
+	opts.jail_argv = &argv[optind];
 
-	if (name)
-		prctl(PR_SET_NAME, name, NULL, NULL, NULL);
+	if (opts.name)
+		prctl(PR_SET_NAME, opts.name, NULL, NULL, NULL);
 
-	avl_init(&libraries, avl_strcmp, false, NULL);
-	alloc_library_path("/lib64");
-	alloc_library_path("/lib");
-	alloc_library_path("/usr/lib");
-	load_ldso_conf("/etc/ld.so.conf");
-
-	if (elf_load_deps(argv[optind])) {
-		ERROR("failed to load dependencies\n");
-		return -1;
+	if (!opts.path && asprintf(&opts.path, "/tmp/%s", basename(*opts.jail_argv)) == -1) {
+		ERROR("failed to asprintf root path: %s\n", strerror(errno));
+		return EXIT_FAILURE;
 	}
 
-	if (elf_load_deps("libpreload-seccomp.so")) {
-		ERROR("failed to load libpreload-seccomp.so\n");
-		return -1;
+	if (mkdir(opts.path, 0755)) {
+		ERROR("unable to create root path: %s (%s)\n", opts.path, strerror(errno));
+		return EXIT_FAILURE;
 	}
 
-	ret = build_jail(path);
+	uloop_init();
+	jail_process.pid = clone(spawn_jail,
+			child_stack + STACK_SIZE,
+			CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | SIGCHLD, argv);
 
-	if (!ret)
-		spawn_namespace(path, argc, argv);
-	else
-		ERROR("failed to build jail\n");
+	if (jail_process.pid != -1) {
+		uloop_process_add(&jail_process);
+		uloop_run();
+		uloop_done();
+		if (jail_running) {
+			kill(jail_process.pid, SIGTERM);
+			waitpid(jail_process.pid, NULL, 0);
+		}
+	} else {
+		ERROR("failed to spawn namespace: %s\n", strerror(errno));
+		ret = EXIT_FAILURE;
+	}
 
-	stop_jail(path);
+	if (rmdir(opts.path)) {
+		ERROR("Unable to remove root path: %s (%s)\n", opts.path, strerror(errno));
+		ret = EXIT_FAILURE;
+	}
 
-	return ret;
+	if (ret)
+		return ret;
+
+	return jail_return_code;
 }
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 26 19:26:45 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Wed, 26 Aug 2015 23:26:45 +0000
Subject: [OpenWrt-Devel] [PATCH procd v3 5/7] jail: add capabilities support
In-Reply-To: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
References: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440631607-63520-6-git-send-email-champetier.etienne@gmail.com>

If there is one or more capabilities in cap.keep,
drop all capabilities not in cap.keep.
Always drop all capabalities in cap.drop

exemple json syntax:
{
"cap.keep": [
        "cap_net_raw"
],
"cap.drop": []
}

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 CMakeLists.txt         |  18 +++++---
 jail/capabilities.c    | 116 +++++++++++++++++++++++++++++++++++++++++++++++++
 jail/capabilities.h    |  14 ++++++
 jail/jail.c            |  15 +++++--
 make_capabilities_h.sh |  10 +++++
 5 files changed, 164 insertions(+), 9 deletions(-)
 create mode 100644 jail/capabilities.c
 create mode 100644 jail/capabilities.h
 create mode 100755 make_capabilities_h.sh

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 805e2ed..cc1e4a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,7 +67,14 @@ ADD_CUSTOM_COMMAND(
 	COMMAND ./make_syscall_h.sh ${CMAKE_C_COMPILER} > ./syscall-names.h
 	DEPENDS ./make_syscall_h.sh
 )
-ADD_CUSTOM_TARGET(headers DEPENDS syscall-names.h)
+ADD_CUSTOM_TARGET(syscall-names-h DEPENDS syscall-names.h)
+
+ADD_CUSTOM_COMMAND(
+	OUTPUT capabilities-names.h
+	COMMAND ./make_capabilities_h.sh ${CMAKE_C_COMPILER} > ./capabilities-names.h
+	DEPENDS ./make_capabilities_h.sh
+)
+ADD_CUSTOM_TARGET(capabilities-names-h DEPENDS capabilities-names.h)
 
 IF(SECCOMP_SUPPORT)
 ADD_LIBRARY(preload-seccomp SHARED jail/preload.c jail/seccomp.c)
@@ -75,15 +82,16 @@ TARGET_LINK_LIBRARIES(preload-seccomp dl ubox blobmsg_json)
 INSTALL(TARGETS preload-seccomp
 	LIBRARY DESTINATION lib
 )
-ADD_DEPENDENCIES(preload-seccomp headers)
+ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
 endif()
 
 IF(JAIL_SUPPORT)
-ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c)
-TARGET_LINK_LIBRARIES(ujail ubox)
+ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
+TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
 INSTALL(TARGETS ujail
 	RUNTIME DESTINATION sbin
 )
+ADD_DEPENDENCIES(ujail capabilities-names-h)
 endif()
 
 IF(UTRACE_SUPPORT)
@@ -92,7 +100,7 @@ TARGET_LINK_LIBRARIES(utrace ubox ${json} blobmsg_json)
 INSTALL(TARGETS utrace
 	RUNTIME DESTINATION sbin
 )
-ADD_DEPENDENCIES(utrace headers)
+ADD_DEPENDENCIES(utrace syscall-names-h)
 
 ADD_LIBRARY(preload-trace SHARED trace/preload.c)
 TARGET_LINK_LIBRARIES(preload-trace dl)
diff --git a/jail/capabilities.c b/jail/capabilities.c
new file mode 100644
index 0000000..b5ea965
--- /dev/null
+++ b/jail/capabilities.c
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2015 Etienne CHAMPETIER <champetier.etienne at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#define _GNU_SOURCE 1
+#include <syslog.h>
+#include <sys/prctl.h>
+
+#include <libubox/blobmsg.h>
+#include <libubox/blobmsg_json.h>
+
+#include "log.h"
+#include "../capabilities-names.h"
+#include "capabilities.h"
+
+static int find_capabilities(const char *name)
+{
+	int i;
+
+	for (i = 0; i <= CAP_LAST_CAP; i++)
+		if (capabilities_names[i] && !strcmp(capabilities_names[i], name))
+			return i;
+
+	return -1;
+}
+
+int drop_capabilities(const char *file)
+{
+	enum {
+		CAP_KEEP,
+		CAP_DROP,
+		__CAP_MAX
+	};
+	static const struct blobmsg_policy policy[__CAP_MAX] = {
+		[CAP_KEEP] = { .name = "cap.keep", .type = BLOBMSG_TYPE_ARRAY },
+		[CAP_DROP] = { .name = "cap.drop", .type = BLOBMSG_TYPE_ARRAY },
+	};
+	struct blob_buf b = { 0 };
+	struct blob_attr *tb[__CAP_MAX];
+	struct blob_attr *cur;
+	int rem, cap;
+	char *name;
+	uint64_t capdrop = 0LLU;
+
+	DEBUG("dropping capabilities\n");
+
+	blob_buf_init(&b, 0);
+	if (!blobmsg_add_json_from_file(&b, file)) {
+		ERROR("failed to load %s\n", file);
+		return -1;
+	}
+
+	blobmsg_parse(policy, __CAP_MAX, tb, blob_data(b.head), blob_len(b.head));
+	if (!tb[CAP_KEEP] && !tb[CAP_DROP]) {
+		ERROR("failed to parse %s\n", file);
+		return -1;
+	}
+
+	blobmsg_for_each_attr(cur, tb[CAP_KEEP], rem) {
+		name = blobmsg_get_string(cur);
+		if (!name) {
+			ERROR("invalid capability name in cap.keep\n");
+			return -1;
+		}
+		cap = find_capabilities(name);
+		if (cap == -1) {
+			ERROR("unknown capability %s in cap.keep\n", name);
+			return -1;
+		}
+		capdrop |= (1LLU << cap);
+	}
+
+	if (capdrop == 0LLU) {
+		DEBUG("cap.keep empty -> only dropping capabilities from cap.drop (blacklist)\n");
+		capdrop = 0xffffffffffffffffLLU;
+	} else {
+		DEBUG("cap.keep has at least one capability -> dropping every capabilities not in cap.keep (whitelist)\n");
+	}
+
+	blobmsg_for_each_attr(cur, tb[CAP_DROP], rem) {
+		name = blobmsg_get_string(cur);
+		if (!name) {
+			ERROR("invalid capability name in cap.drop\n");
+			return -1;
+		}
+		cap = find_capabilities(name);
+		if (cap == -1) {
+			ERROR("unknown capability %s in cap.drop\n", name);
+			return -1;
+		}
+		capdrop &= ~(1LLU << cap);
+	}
+
+	for (cap = 0; cap <= CAP_LAST_CAP; cap++) {
+		if ( (capdrop & (1LLU << cap)) == 0) {
+			DEBUG("dropping capability %s (%d)\n", capabilities_names[cap], cap);
+			if (prctl(PR_CAPBSET_DROP, cap, 0, 0, 0)) {
+				ERROR("prctl(PR_CAPBSET_DROP, %d) failed: %s\n", cap, strerror(errno));
+				return errno;
+			}
+		} else {
+			DEBUG("keeping capability %s (%d)\n", capabilities_names[cap], cap);
+		}
+	}
+
+	return 0;
+}
diff --git a/jail/capabilities.h b/jail/capabilities.h
new file mode 100644
index 0000000..e6699e9
--- /dev/null
+++ b/jail/capabilities.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2015 Etienne CHAMPETIER <champetier.etienne at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+int drop_capabilities(const char *file);
diff --git a/jail/jail.c b/jail/jail.c
index f8139b8..3d0830e 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -37,19 +37,21 @@
 #include <sched.h>
 
 #include "elf.h"
+#include "capabilities.h"
 
 #include <libubox/utils.h>
 #include <libubox/list.h>
 #include <libubox/uloop.h>
 
 #define STACK_SIZE	(1024 * 1024)
-#define OPT_ARGS	"P:S:n:r:w:d:psulo"
+#define OPT_ARGS	"P:S:C:n:r:w:d:psulo"
 
 static struct {
 	char *path;
 	char *name;
 	char **jail_argv;
 	char *seccomp;
+	char *capabilities;
 	int procfs;
 	int ronly;
 	int sysfs;
@@ -243,6 +245,7 @@ static void usage(void)
 	fprintf(stderr, "ujail <options> -- <binary> <params ...>\n");
 	fprintf(stderr, "  -P <path>\tpath where the jail will be staged\n");
 	fprintf(stderr, "  -S <file>\tseccomp filter\n");
+	fprintf(stderr, "  -C <file>\tcapabilities drop config\n");
 	fprintf(stderr, "  -n <name>\tthe name of the jail\n");
 	fprintf(stderr, "  -r <file>\treadonly files that should be staged\n");
 	fprintf(stderr, "  -w <file>\twriteable files that should be staged\n");
@@ -255,7 +258,7 @@ static void usage(void)
 	fprintf(stderr, "\nWarning: by default root inside the jail is the same\n\
 and he has the same powers as root outside the jail,\n\
 thus he can escape the jail and/or break stuff.\n\
-Please use an appropriate seccomp filter (-S) to restrict his powers\n");
+Please use an appropriate seccomp/capabilities filter (-S/-C) to restrict his powers\n");
 }
 
 static int spawn_jail(void *arg)
@@ -273,8 +276,8 @@ static int spawn_jail(void *arg)
 	if (!envp)
 		exit(EXIT_FAILURE);
 
-	//TODO: drop capabilities() here
-	//prctl(PR_CAPBSET_DROP, ..., 0, 0, 0);
+	if (opts.capabilities && drop_capabilities(opts.capabilities))
+		exit(EXIT_FAILURE);
 
 	INFO("exec-ing %s\n", *opts.jail_argv);
 	execve(*opts.jail_argv, opts.jail_argv, envp);
@@ -354,6 +357,10 @@ int main(int argc, char **argv)
 			opts.seccomp = optarg;
 			add_extra(optarg, 1);
 			break;
+		case 'C':
+			opts.capabilities = optarg;
+			add_extra(optarg, 1);
+			break;
 		case 'P':
 			opts.path = optarg;
 			break;
diff --git a/make_capabilities_h.sh b/make_capabilities_h.sh
new file mode 100755
index 0000000..635e740
--- /dev/null
+++ b/make_capabilities_h.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+CC=$1
+[ -n "$TARGET_CC_NOCACHE" ] && CC=$TARGET_CC_NOCACHE
+
+echo "#include <linux/capability.h>"
+echo "static const char *capabilities_names[] = {"
+echo "#include <linux/capability.h>" | ${CC} -E -dM - | grep '#define CAP' | grep -vE '(CAP_TO|CAP_LAST_CAP)' | \
+	awk '{print $3" "$2}' | sort -n | awk '{print "   ["$1"]\t= \""tolower($2)"\","}'
+echo "};"
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 26 19:26:46 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Wed, 26 Aug 2015 23:26:46 +0000
Subject: [OpenWrt-Devel] [PATCH procd v3 6/7] jail: cleanup include
In-Reply-To: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
References: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440631607-63520-7-git-send-email-champetier.etienne@gmail.com>

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/elf.c  | 14 --------------
 jail/jail.c | 10 ----------
 jail/log.h  |  1 +
 3 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/jail/elf.c b/jail/elf.c
index c198599..cbb3051 100644
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -12,33 +12,19 @@
  */
 
 #define _GNU_SOURCE
-#include <sys/syscall.h>
 #include <sys/mman.h>
-#include <sys/utsname.h>
-#include <sys/types.h>
-#include <sys/wait.h>
 
 #include <stdlib.h>
 #include <unistd.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/mount.h>
-#include <values.h>
-#include <errno.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <syslog.h>
 #include <libgen.h>
 #include <glob.h>
 #include <elf.h>
 
-#include <libubox/avl.h>
-#include <libubox/avl-cmp.h>
 #include <libubox/utils.h>
-#include <libubox/list.h>
-#include <libubox/uloop.h>
 
 #include "elf.h"
 
diff --git a/jail/jail.c b/jail/jail.c
index 3d0830e..40b7558 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -12,12 +12,6 @@
  */
 
 #define _GNU_SOURCE
-#include <sys/syscall.h>
-#include <sys/mman.h>
-#include <sys/utsname.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
 #include <sys/mount.h>
 #include <sys/prctl.h>
 #include <sys/wait.h>
@@ -30,16 +24,12 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <syslog.h>
 #include <libgen.h>
-#include <glob.h>
-#include <elf.h>
 #include <sched.h>
 
 #include "elf.h"
 #include "capabilities.h"
 
-#include <libubox/utils.h>
 #include <libubox/list.h>
 #include <libubox/uloop.h>
 
diff --git a/jail/log.h b/jail/log.h
index f8590b3..b1d201e 100644
--- a/jail/log.h
+++ b/jail/log.h
@@ -12,6 +12,7 @@
  */
 
 extern int debug;
+#include <syslog.h>
 
 #define INFO(fmt, ...) do { \
 	printf("jail: "fmt, ## __VA_ARGS__); \
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Wed Aug 26 19:26:47 2015
From: champetier.etienne at gmail.com (Etienne CHAMPETIER)
Date: Wed, 26 Aug 2015 23:26:47 +0000
Subject: [OpenWrt-Devel] [PATCH procd v3 7/7] jail: allow to not use
	namespaces
In-Reply-To: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
References: <1440631607-63520-1-git-send-email-champetier.etienne@gmail.com>
Message-ID: <1440631607-63520-8-git-send-email-champetier.etienne@gmail.com>

building a generic jail can be hard,
choosing to drop some capabilities can be easier.

This commit permit to use namespaces, capabilities
and seccomp combined as you like.

Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com>
---
 jail/jail.c | 76 +++++++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 56 insertions(+), 20 deletions(-)

diff --git a/jail/jail.c b/jail/jail.c
index 40b7558..f459a5e 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -42,6 +42,7 @@ static struct {
 	char **jail_argv;
 	char *seccomp;
 	char *capabilities;
+	int namespace;
 	int procfs;
 	int ronly;
 	int sysfs;
@@ -233,13 +234,14 @@ static char** build_envp(const char *seccomp)
 static void usage(void)
 {
 	fprintf(stderr, "ujail <options> -- <binary> <params ...>\n");
-	fprintf(stderr, "  -P <path>\tpath where the jail will be staged\n");
-	fprintf(stderr, "  -S <file>\tseccomp filter\n");
+	fprintf(stderr, "  -d <num>\tshow debug log (increase num to increase verbosity)\n");
+	fprintf(stderr, "  -S <file>\tseccomp filter config\n");
 	fprintf(stderr, "  -C <file>\tcapabilities drop config\n");
 	fprintf(stderr, "  -n <name>\tthe name of the jail\n");
+	fprintf(stderr, "namespace jail options:\n");
+	fprintf(stderr, "  -P <path>\tpath where the jail will be staged\n");
 	fprintf(stderr, "  -r <file>\treadonly files that should be staged\n");
 	fprintf(stderr, "  -w <file>\twriteable files that should be staged\n");
-	fprintf(stderr, "  -d <num>\tshow debug log (increase num to increase verbosity)\n");
 	fprintf(stderr, "  -p\t\tjail has /proc\n");
 	fprintf(stderr, "  -s\t\tjail has /sys\n");
 	fprintf(stderr, "  -l\t\tjail has /dev/log\n");
@@ -248,20 +250,14 @@ static void usage(void)
 	fprintf(stderr, "\nWarning: by default root inside the jail is the same\n\
 and he has the same powers as root outside the jail,\n\
 thus he can escape the jail and/or break stuff.\n\
-Please use an appropriate seccomp/capabilities filter (-S/-C) to restrict his powers\n");
+Please use seccomp/capabilities (-S/-C) to restrict his powers\n\n\
+If you use none of the namespace jail options,\n\
+ujail will not use namespace/build a jail,\n\
+and will only drop capabilities/apply seccomp filter.\n\n");
 }
 
-static int spawn_jail(void *arg)
+static int exec_jail()
 {
-	if (opts.name && sethostname(opts.name, strlen(opts.name))) {
-		ERROR("failed to sethostname: %s\n", strerror(errno));
-	}
-
-	if (build_jail_fs()) {
-		ERROR("failed to build jail fs");
-		exit(EXIT_FAILURE);
-	}
-
 	char **envp = build_envp(opts.seccomp);
 	if (!envp)
 		exit(EXIT_FAILURE);
@@ -276,6 +272,20 @@ static int spawn_jail(void *arg)
 	exit(EXIT_FAILURE);
 }
 
+static int spawn_jail(void *arg)
+{
+	if (opts.name && sethostname(opts.name, strlen(opts.name))) {
+		ERROR("failed to sethostname: %s\n", strerror(errno));
+	}
+
+	if (build_jail_fs()) {
+		ERROR("failed to build jail fs");
+		exit(EXIT_FAILURE);
+	}
+
+	return exec_jail();
+}
+
 static int jail_running = 1;
 static int jail_return_code = 0;
 
@@ -335,12 +345,15 @@ int main(int argc, char **argv)
 			debug = atoi(optarg);
 			break;
 		case 'p':
+			opts.namespace = 1;
 			opts.procfs = 1;
 			break;
 		case 'o':
+			opts.namespace = 1;
 			opts.ronly = 1;
 			break;
 		case 's':
+			opts.namespace = 1;
 			opts.sysfs = 1;
 			break;
 		case 'S':
@@ -352,21 +365,26 @@ int main(int argc, char **argv)
 			add_extra(optarg, 1);
 			break;
 		case 'P':
+			opts.namespace = 1;
 			opts.path = optarg;
 			break;
 		case 'n':
 			opts.name = optarg;
 			break;
 		case 'r':
+			opts.namespace = 1;
 			add_extra(optarg, 1);
 			break;
 		case 'w':
+			opts.namespace = 1;
 			add_extra(optarg, 0);
 			break;
 		case 'u':
+			opts.namespace = 1;
 			add_extra(ubus, 0);
 			break;
 		case 'l':
+			opts.namespace = 1;
 			add_extra(log, 0);
 			break;
 		}
@@ -377,41 +395,59 @@ int main(int argc, char **argv)
 		usage();
 		return EXIT_FAILURE;
 	}
+	if (!(opts.namespace||opts.capabilities||opts.seccomp)) {
+		ERROR("Not using namespaces, capabilities or seccomp !!!\n\n");
+		usage();
+		return EXIT_FAILURE;
+	}
+	DEBUG("Using namespaces(%d), capabilities(%d), seccomp(%d)\n",
+		opts.namespace,
+		opts.capabilities != 0,
+		opts.seccomp != 0);
 
 	opts.jail_argv = &argv[optind];
 
 	if (opts.name)
 		prctl(PR_SET_NAME, opts.name, NULL, NULL, NULL);
 
-	if (!opts.path && asprintf(&opts.path, "/tmp/%s", basename(*opts.jail_argv)) == -1) {
+	if (opts.namespace && !opts.path && asprintf(&opts.path, "/tmp/%s", basename(*opts.jail_argv)) == -1) {
 		ERROR("failed to asprintf root path: %s\n", strerror(errno));
 		return EXIT_FAILURE;
 	}
 
-	if (mkdir(opts.path, 0755)) {
+	if (opts.namespace && mkdir(opts.path, 0755)) {
 		ERROR("unable to create root path: %s (%s)\n", opts.path, strerror(errno));
 		return EXIT_FAILURE;
 	}
 
 	uloop_init();
-	jail_process.pid = clone(spawn_jail,
+	if (opts.namespace) {
+		jail_process.pid = clone(spawn_jail,
 			child_stack + STACK_SIZE,
 			CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | SIGCHLD, argv);
+	} else {
+		jail_process.pid = fork();
+	}
 
-	if (jail_process.pid != -1) {
+	if (jail_process.pid > 0) {
+		//parent process
 		uloop_process_add(&jail_process);
 		uloop_run();
 		uloop_done();
 		if (jail_running) {
+			DEBUG("uloop interrupted, killing jail process\n");
 			kill(jail_process.pid, SIGTERM);
 			waitpid(jail_process.pid, NULL, 0);
 		}
+	} else if (jail_process.pid == 0) {
+		//fork child process
+		return exec_jail();
 	} else {
-		ERROR("failed to spawn namespace: %s\n", strerror(errno));
+		ERROR("failed to clone/fork: %s\n", strerror(errno));
 		ret = EXIT_FAILURE;
 	}
 
-	if (rmdir(opts.path)) {
+	if (opts.namespace && rmdir(opts.path)) {
 		ERROR("Unable to remove root path: %s (%s)\n", opts.path, strerror(errno));
 		ret = EXIT_FAILURE;
 	}
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From adamk at mcservices.com.au  Wed Aug 26 19:48:58 2015
From: adamk at mcservices.com.au (Adam Kuklycz)
Date: Thu, 27 Aug 2015 09:48:58 +1000
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
 uClibc-ng
In-Reply-To: <1440613687.15478.58.camel@synopsys.com>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org> <1440613687.15478.58.camel@synopsys.com>
Message-ID: <55DE506A.6000504@mcservices.com.au>

Hi all,

I was wondering why OpenWRT switched to musl -- is it purely because 
uclibc hasn't actually maintained their code properly?

One of the things I have noticed since the CC trunk builds I did with 
kernel 3.18.11 + uclibc is that the image sizes have ballooned out by a 
fair bit.

For example, a build on trunk r45705 which uses uclibc and kernel 
3.18.11 would allow for most features to be included in a build e.g. 
openvpn, luci + ssl support, more connecting protocols than just pppoe 
and so on with a router sporting 8MB of flash.

Now with recent trunk builds, with musl and kernel 4.1.x, I've had to 
cut features considerably just to make it fit.  Just adding openvpn with 
openssl support means that an image prior that built at 7MB would 
balloon out to 8MB which would mean that the image would not be produced 
as it is too big.

I've yet to do a separate build with latest trunk and uclibc but 
certainly something has caused image build sizes to grow quite a bit 
recently, though in testing I've done at least, it hasn't impacted on 
router performance for now.

Cheers
Adam


On 27/08/15 04:28, Alexey Brodkin wrote:
> Hi John,
>
> On Wed, 2015-08-26 at 20:20 +0200, John Crispin wrote:
>> Hi,
>>
>> On 26/08/2015 20:11, Alexey Brodkin wrote:
>>> uClibc-ng is a spin-off of original uClibc, see http://www.uclibc-ng.org/
>>>
>>> We try to regularly add changes from uClibc to uClibc-ng.
>>> We even sent patches and bug reports to the uClibc mailing list.
>>> The config file is compatible between uClibc-ng 1.0 and uClibc git master.
>>> This might change in the future.
>>>
>>> Our main goal is to provide regularly a stable and tested release
>>> to make embedded system developers happy.
>>>
>>> The main advantage of uClibc-ng over olde good uClibc is regular releases
>>> so there's no need to keep tons of patches on top of years old
>>> 0.9.33.2
>>>
>> why do you not use musl ? it is actively support rather than being
>> hooked on life support.
> The point is I'm about to submit patch with support of new architecture (ARC)
> in OpenWRT. And unfortunately the only libc we have now is uClibc.
>
> And since "original" uClibc lack recent releases (where ARC support might exist
> as we're in uclibc's master branch for quite some time already) I went forward
> with uClibc-ng which sees releases much more often and in released tarballs
> we already have support of ARC.
>
> So I understand that other architectures may not benefit a lot from newer
> uClibc but for us (ARC) there's no other way.
>
> Hope that makes sense.
>
> -Alexey
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Thu Aug 27 00:02:42 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Thu, 27 Aug 2015 06:02:42 +0200
Subject: [OpenWrt-Devel] [PATCH] malta: disable mips16
Message-ID: <1440648162-20177-1-git-send-email-dirkneukirchen@web.de>

- it causes issues with qemu versions < 2.2
should fix issues with Ubuntu 14.03 LTS (qemu 2.0)
errors are:
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004

see ticket #16881

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 target/linux/malta/be/target.mk | 2 +-
 target/linux/malta/le/target.mk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/malta/be/target.mk b/target/linux/malta/be/target.mk
index 92ae58e..b505e3b 100644
--- a/target/linux/malta/be/target.mk
+++ b/target/linux/malta/be/target.mk
@@ -2,7 +2,7 @@ ARCH:=mips
 ARCH_PACKAGES:=malta_mips
 SUBTARGET:=be
 BOARDNAME:=Big Endian
-FEATURES:=ramdisk mips16
+FEATURES:=ramdisk
 
 define Target/Description
 	Build BE firmware images for MIPS Malta CoreLV board running in
diff --git a/target/linux/malta/le/target.mk b/target/linux/malta/le/target.mk
index 35fcf4c..7906aa7 100644
--- a/target/linux/malta/le/target.mk
+++ b/target/linux/malta/le/target.mk
@@ -2,7 +2,7 @@ ARCH:=mipsel
 ARCH_PACKAGES:=malta_mipsel
 SUBTARGET:=le
 BOARDNAME:=Little Endian
-FEATURES:=ramdisk mips16
+FEATURES:=ramdisk
 
 define Target/Description
 	Build LE firmware images for MIPS Malta CoreLV board running in
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From yszhou4tech at gmail.com  Thu Aug 27 03:27:31 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Thu, 27 Aug 2015 15:27:31 +0800
Subject: [OpenWrt-Devel] [PATCH] malta: disable mips16
In-Reply-To: <1440648162-20177-1-git-send-email-dirkneukirchen@web.de>
References: <1440648162-20177-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <CAECwjAgkUDHaZrBz5_aHdh1vHxT0OxVGnci4YHeXVwBjNyQzwg@mail.gmail.com>

On 27 August 2015 at 12:02, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
> - it causes issues with qemu versions < 2.2
> should fix issues with Ubuntu 14.03 LTS (qemu 2.0)
> errors are:
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
>

But it's a bug within qemu.  I have a simple script [1] for building
qemu at least v2.3.0 from source code.

 [1] https://github.com/yousong/build-scripts/blob/master/build-qemu.sh

                yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Thu Aug 27 04:50:09 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Thu, 27 Aug 2015 10:50:09 +0200
Subject: [OpenWrt-Devel] [PATCH] malta: disable mips16
In-Reply-To: <CAECwjAgkUDHaZrBz5_aHdh1vHxT0OxVGnci4YHeXVwBjNyQzwg@mail.gmail.com>
References: <1440648162-20177-1-git-send-email-dirkneukirchen@web.de>
 <CAECwjAgkUDHaZrBz5_aHdh1vHxT0OxVGnci4YHeXVwBjNyQzwg@mail.gmail.com>
Message-ID: <55DECF41.8040409@web.de>

On 27.08.2015 09:27, Yousong Zhou wrote:
> On 27 August 2015 at 12:02, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
>> - it causes issues with qemu versions < 2.2
>> should fix issues with Ubuntu 14.03 LTS (qemu 2.0)
>> errors are:
>> Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
>>
> 
> But it's a bug within qemu.  I have a simple script [1] for building
> qemu at least v2.3.0 from source code.
> 
>  [1] https://github.com/yousong/build-scripts/blob/master/build-qemu.sh
> 
>                 yousong
> 

MIPS16 is still deactivated on 44 packages so it still can be considered "unstable" 
/imho

Other reasons to fix:
- potential code size reduction by using MIPS16 is not important qemu targets
- compiling qemu might break and that requires more user action
- some ppl dont like to compile software thats available in distro packages
- Ubuntu LTS will keep 2.0
- Debian 8/jessie has 2.1
- its unlikely that qemu will backport fixes to 2.0 version
- its unclear if/when Ubuntu will backport that fix

Reasons not to fix:
- Malta targets developers that want to test features / build test environments ....
it is expected mostly developers use this target and they know how to either
handle or circumvent this known issue.

Most people do not seem to read wiki or search bugtracker for open/known issues.
Is putting a README into the bin/ dir on "half broken" platforms a better solution ?
Some prefix/suffix indicating which qemu version is working with that file ?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From zajec5 at gmail.com  Thu Aug 27 04:55:10 2015
From: zajec5 at gmail.com (=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?=)
Date: Thu, 27 Aug 2015 10:55:10 +0200
Subject: [OpenWrt-Devel] [PATCH] uci: add import call
In-Reply-To: <1440605590-22669-1-git-send-email-lynxis@fe80.eu>
References: <1440605590-22669-1-git-send-email-lynxis@fe80.eu>
Message-ID: <CACna6rzfNNQMbLbTnNPBFD7wcQFd8j0G9Ln_5DLfRsDdG45S3w@mail.gmail.com>

On 26 August 2015 at 18:13, Alexander Couzens <lynxis at fe80.eu> wrote:
> similiar to import from uci cli.
> import removes all old configs and import the new config.
>
> example:
> ubus call uci import \
>   '{"config": "dhcp", "values": { "srv": { ".type": "host", ".name": "srv", "mac": "00:11:22:33:44:55", "ip": "192.168.1.2" } } }'

There is a spaces vs. tabs mess. Please stick to the coding style
already used in the project.

You didn't use tabs in most of the code and rpc_uci_import looks like
a random mix of both.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Thu Aug 27 05:23:25 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Thu, 27 Aug 2015 11:23:25 +0200
Subject: [OpenWrt-Devel] [PATCH v3] bcm63xx: add Comtrend VR-3026e
	support
In-Reply-To: <1440609494-13148-2-git-send-email-tesarmar@gmail.com>
References: <1440609494-13148-1-git-send-email-tesarmar@gmail.com>
 <1440609494-13148-2-git-send-email-tesarmar@gmail.com>
Message-ID: <CAOiHx=k4_jVyvZ_mKTOXwsXCJ5aq2Z-o0tNNUWercbf3qH86=A@mail.gmail.com>

On Wed, Aug 26, 2015 at 7:18 PM, Martin Tesar <tesarmar at gmail.com> wrote:
> Add support for Comtrend VR-3026e v1.
> The device is almost identical to the Comtrend VR-3025un.
>
> Signed-off-by: Martin Tesar <tesarmar at gmail.com>
> ---
>  target/linux/brcm63xx/base-files/etc/diag.sh       |  3 +
>  .../base-files/etc/uci-defaults/02_network         |  3 +-
>  .../base-files/etc/uci-defaults/09_fix_crc         |  1 +
>  target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
>  .../lib/preinit/05_init_interfaces_brcm63xx        |  1 +
>  target/linux/brcm63xx/dts/vr-3026e.dts             | 88 ++++++++++++++++++++++
>  target/linux/brcm63xx/image/Makefile               |  2 +
>  .../brcm63xx/patches-3.18/572-board_VR-3026e.patch | 79 +++++++++++++++++++
>  .../brcm63xx/patches-4.1/572-board_VR-3026e.patch  | 79 +++++++++++++++++++
>  target/linux/brcm63xx/profiles/comtrend.mk         |  9 +++
>  10 files changed, 267 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/brcm63xx/dts/vr-3026e.dts
>  create mode 100644 target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch
>  create mode 100644 target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch
>
> diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
> index 7916ac2..7826fad 100644
> --- a/target/linux/brcm63xx/base-files/etc/diag.sh
> +++ b/target/linux/brcm63xx/base-files/etc/diag.sh
> @@ -39,6 +39,9 @@ set_state() {
>         vr-3025u)
>                 status_led="VR-3025u:green:power"
>                 ;;
> +       vr-3026e)
> +               status_led="VR-3026e:green:power"
> +               ;;
>         wap-5813n)
>                 status_led="WAP-5813n:green:power"
>                 ;;
> diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
> index 2ff9e45..4de861c 100644
> --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
> @@ -94,8 +94,9 @@ fast2504n |\
>  fast2704v2 |\
>  hg655b |\
>  p870hw-51a_v2 |\
> +vr-3025u |\
>  vr-3025un |\
> -vr-3025u)
> +vr-3026e)

Why did you change the order of vr-3025u and vr-3025un here? You
didn't do this in your previous versions. Please do not add random
cleanups/changes to your patches.


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


From blogic at openwrt.org  Thu Aug 27 05:29:45 2015
From: blogic at openwrt.org (John Crispin)
Date: Thu, 27 Aug 2015 11:29:45 +0200
Subject: [OpenWrt-Devel] [PATCH] malta: disable mips16
In-Reply-To: <55DECF41.8040409@web.de>
References: <1440648162-20177-1-git-send-email-dirkneukirchen@web.de>
 <CAECwjAgkUDHaZrBz5_aHdh1vHxT0OxVGnci4YHeXVwBjNyQzwg@mail.gmail.com>
 <55DECF41.8040409@web.de>
Message-ID: <55DED889.1060209@openwrt.org>



On 27/08/2015 10:50, Dirk Neukirchen wrote:
> On 27.08.2015 09:27, Yousong Zhou wrote:
>> On 27 August 2015 at 12:02, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
>>> - it causes issues with qemu versions < 2.2
>>> should fix issues with Ubuntu 14.03 LTS (qemu 2.0)
>>> errors are:
>>> Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
>>>
>>
>> But it's a bug within qemu.  I have a simple script [1] for building
>> qemu at least v2.3.0 from source code.
>>
>>  [1] https://github.com/yousong/build-scripts/blob/master/build-qemu.sh
>>
>>                 yousong
>>
> 
> MIPS16 is still deactivated on 44 packages so it still can be considered "unstable" 
> /imho

rather then make it 45 and add the kernel i think we should fix stuff.

personally i dont see it feasible to force everyone to use no mips16
because your distro is outdated

that is like saying "lets force 11b always as some users still have
ancient wifi dongles"



> 
> Other reasons to fix:
> - potential code size reduction by using MIPS16 is not important qemu targets

hjaving ne eminent need for size reduction does not mean bloat is acceptable


> - compiling qemu might break and that requires more user action

works fine for me and i had no reports of it being broken so far

> - some ppl dont like to compile software thats available in distro packages

some people just use distros that ship up to date packages

> - Ubuntu LTS will keep 2.0

ermm ... well .. that is ubuntu

> - Debian 8/jessie has 2.1

backports ?

> - its unlikely that qemu will backport fixes to 2.0 version

sure that is why we dont use ancient software

> - its unclear if/when Ubuntu will backport that fix

ermm ... well .. that is ubuntu



> 
> Reasons not to fix:
> - Malta targets developers that want to test features / build test environments ....
> it is expected mostly developers use this target and they know how to either
> handle or circumvent this known issue.

exactly and i think it is fair to expect a developer to be able to setup
a development env

> 
> Most people do not seem to read wiki or search bugtracker for open/known
issues.

some people dont respect the read light and some people dont read
forums, that is not our problem


> Is putting a README into the bin/ dir on "half broken" platforms a better solution ?

as i said before if something is broken fix it rather than hiding the
details

> Some prefix/suffix indicating which qemu version is working with that file ?

HEAD tends to work ;)



> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From john at phrozen.org  Thu Aug 27 05:31:12 2015
From: john at phrozen.org (John Crispin)
Date: Thu, 27 Aug 2015 11:31:12 +0200
Subject: [OpenWrt-Devel] [PATCH] malta: disable mips16
In-Reply-To: <55DED889.1060209@openwrt.org>
References: <1440648162-20177-1-git-send-email-dirkneukirchen@web.de>
 <CAECwjAgkUDHaZrBz5_aHdh1vHxT0OxVGnci4YHeXVwBjNyQzwg@mail.gmail.com>
 <55DECF41.8040409@web.de> <55DED889.1060209@openwrt.org>
Message-ID: <55DED8E0.90600@phrozen.org>



On 27/08/2015 11:29, John Crispin wrote:
> hjaving ne eminent need for size reduction does not mean bloat is acceptable

typo tastic ... note to self: "dont send mails on the ipad when you have
a kid in one arm" ;)
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Thu Aug 27 05:33:15 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Thu, 27 Aug 2015 11:33:15 +0200
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
 uClibc-ng
In-Reply-To: <55DE506A.6000504@mcservices.com.au>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org> <1440613687.15478.58.camel@synopsys.com>
 <55DE506A.6000504@mcservices.com.au>
Message-ID: <55DED95B.2080809@openwrt.org>

On 2015-08-27 01:48, Adam Kuklycz wrote:
> Hi all,
> 
> I was wondering why OpenWRT switched to musl -- is it purely because 
> uclibc hasn't actually maintained their code properly?
That's only part of the reason. Aside from the maintainenance, the code
quality of uClibc is also poor compared to musl.
musl also has better runtime performance and uses less RAM.

> One of the things I have noticed since the CC trunk builds I did with 
> kernel 3.18.11 + uclibc is that the image sizes have ballooned out by a 
> fair bit.
> 
> For example, a build on trunk r45705 which uses uclibc and kernel 
> 3.18.11 would allow for most features to be included in a build e.g. 
> openvpn, luci + ssl support, more connecting protocols than just pppoe 
> and so on with a router sporting 8MB of flash.
> 
> Now with recent trunk builds, with musl and kernel 4.1.x, I've had to 
> cut features considerably just to make it fit.  Just adding openvpn with 
> openssl support means that an image prior that built at 7MB would 
> balloon out to 8MB which would mean that the image would not be produced 
> as it is too big.
Last time I compared musl vs uClibc images, the size difference was
neglegible. I'd say it's more likely that the switch to Linux 4.1 caused
the size increase (the kernel does get more bloated with each new release).

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From yszhou4tech at gmail.com  Thu Aug 27 05:50:40 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Thu, 27 Aug 2015 17:50:40 +0800
Subject: [OpenWrt-Devel] [PATCH] malta: disable mips16
In-Reply-To: <55DED889.1060209@openwrt.org>
References: <1440648162-20177-1-git-send-email-dirkneukirchen@web.de>
 <CAECwjAgkUDHaZrBz5_aHdh1vHxT0OxVGnci4YHeXVwBjNyQzwg@mail.gmail.com>
 <55DECF41.8040409@web.de> <55DED889.1060209@openwrt.org>
Message-ID: <CAECwjAgR7WyoFzvbEaxDDrJ6+QfUcy9WcvWe5GQMYUOeBjLSuQ@mail.gmail.com>

On 27 August 2015 at 17:29, John Crispin <blogic at openwrt.org> wrote:
>
>
> On 27/08/2015 10:50, Dirk Neukirchen wrote:
>> On 27.08.2015 09:27, Yousong Zhou wrote:
>>> On 27 August 2015 at 12:02, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
>>>> - it causes issues with qemu versions < 2.2
>>>> should fix issues with Ubuntu 14.03 LTS (qemu 2.0)
>>>> errors are:
>>>> Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
>>>>
>>>
>>> But it's a bug within qemu.  I have a simple script [1] for building
>>> qemu at least v2.3.0 from source code.
>>>
>>>  [1] https://github.com/yousong/build-scripts/blob/master/build-qemu.sh
>>>
>>>                 yousong
>>>
>>
>> MIPS16 is still deactivated on 44 packages so it still can be considered "unstable"
>> /imho
>
> rather then make it 45 and add the kernel i think we should fix stuff.
>

Well, I contributed one to that number just yesterday and I am now
testing a fix on QEMU Malta to revert it...  It's a live case that we
need QEMU Malta with MIPS16 for development of smaller firmwares (at
least) for other targets.  Doing a full build is really time-consuming
and it's a pain just thinking about having to flash those intermediate
results to a physical board with all those dumb wiring and interactive
work.

BTW. I did not know that the code size reduction could be so
significant with MIPS16.  Output of `ls -l
../ipkg-ar71xx/reaver/usr/bin/'

    -rwxr-xr-x 1 yousong yousong 410416 Aug 27 10:55 reaver
    -rwxr-xr-x 1 yousong yousong 227528 Aug 27 10:55 wash

    -rwxr-xr-x 1 yousong yousong 389936 Aug 27 10:59 reaver
    -rwxr-xr-x 1 yousong yousong 211140 Aug 27 10:59 wash

 [1] https://github.com/openwrt/packages/commit/1e29676a8ac74f797f8ca799364681cec575ae6f

               yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Thu Aug 27 06:18:21 2015
From: blogic at openwrt.org (John Crispin)
Date: Thu, 27 Aug 2015 12:18:21 +0200
Subject: [OpenWrt-Devel] [PATCH procd v2 0/5] jail work
In-Reply-To: <CAOdf3gqxJsCsUhRis1hso7szNNpjVxYjEBBjdOJ=MqVDKb8EAA@mail.gmail.com>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
 <55DDC3A7.3050505@openwrt.org>
 <CAOdf3gqxJsCsUhRis1hso7szNNpjVxYjEBBjdOJ=MqVDKb8EAA@mail.gmail.com>
Message-ID: <55DEE3ED.2020103@openwrt.org>



On 26/08/2015 18:20, Etienne Champetier wrote:
> 
> 
> 2015-08-26 15:48 GMT+02:00 John Crispin <blogic at openwrt.org
> <mailto:blogic at openwrt.org>>:
> 
> 
> 
>     On 26/08/2015 01:00, Etienne CHAMPETIER wrote:
>     > This patch series rework a bit ujail,
>     > and add capabilities support to it
> 
>     nice
> 
>     >
>     > Seccomp filter are very powerful but not totally generic,
>     > each arch can have different set of syscalls,
>     > each libc can use different syscall for the same function,
>     > and seccomp isn't supported on all arch.
>     >
>     > Capabilities are more high level, but still can restrict
>     > jail to a sane minimum of privileges.
> 
> 
>     >
>     > Patch 4 is a bit big and i can split it if needed, just tell me how
> 
>     will have a closer look next few days
> 
> forgot to say it's tested on ar71xx with CC (and also on ubuntu 14.04)
>  
> 
>     there seem to be a way to escape from the rebind mount jail that QCA has
>     found
> 
> more than one ;) can you share? (with root rights you can kexec, mount
> /dev, ...)

well if you are root you are root and can delete the bootloader. the
idea of the jail is that you are not root.

i will prvide details later on

> that's why you really need to limit rights with capabilities drop or
> seccomp filter
> (i'm adding a vague warning in usage)

why do you want to run a privileged user and restrict is perms rather
than just use an unprivileged user ?

>  
> 
>     and i have not had the time yet to finish my jailfs module.
> 
> with my patches you don't see all the bind mount anymore ("in the host"),
> they are only in the jail mount namespace.
> 
> to see the mounts inside the jail you can still do
> cat /proc/<jailed process pid>/mounts

we dont want rebind mounts at all, they were only an intermediate solution

> 
>     it
>     runs and loads, i can do mounts and access files inside them using
>     normal shell calls. however if is point a jail instance at the
>     mountpoint it oops horribly. i suspect that i am either using vfs wrong
>     or am missing locking/ref-counting somewhere. i'll throw the code onto
>     github later today or tomorrow and post the link. maybe someone with
>     more knowledge of vfs can help fix it.
> 
> what problem are you fixing with jailfs? (real question/to be sure there
> is no simpler solution)
> 


jailfs is similar overlayfs as it has a lower dir that we overlay but
now with changes but with a set of filter rules ... consider it like a
firewall for file i/o

> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tesarmar at gmail.com  Thu Aug 27 06:41:25 2015
From: tesarmar at gmail.com (Martin Tesar)
Date: Thu, 27 Aug 2015 12:41:25 +0200
Subject: [OpenWrt-Devel] [PATCH v3] bcm63xx: add Comtrend VR-3026e
	support
In-Reply-To: <CAOiHx=k4_jVyvZ_mKTOXwsXCJ5aq2Z-o0tNNUWercbf3qH86=A@mail.gmail.com>
References: <1440609494-13148-1-git-send-email-tesarmar@gmail.com>
 <1440609494-13148-2-git-send-email-tesarmar@gmail.com>
 <CAOiHx=k4_jVyvZ_mKTOXwsXCJ5aq2Z-o0tNNUWercbf3qH86=A@mail.gmail.com>
Message-ID: <0C740CDC-9F5E-4F0B-8475-499C0C500DB3@gmail.com>

Hi,

it's just a cosmetic change. Now I understand I shouldn't do that.
Should I create a new patch?

Regards,
Martin

27. 8. 2015 v 11:23, Jonas Gorski <jogo at openwrt.org>:

>> On Wed, Aug 26, 2015 at 7:18 PM, Martin Tesar <tesarmar at gmail.com> wrote:
>> Add support for Comtrend VR-3026e v1.
>> The device is almost identical to the Comtrend VR-3025un.
>> 
>> Signed-off-by: Martin Tesar <tesarmar at gmail.com>
>> ---
>> target/linux/brcm63xx/base-files/etc/diag.sh       |  3 +
>> .../base-files/etc/uci-defaults/02_network         |  3 +-
>> .../base-files/etc/uci-defaults/09_fix_crc         |  1 +
>> target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
>> .../lib/preinit/05_init_interfaces_brcm63xx        |  1 +
>> target/linux/brcm63xx/dts/vr-3026e.dts             | 88 ++++++++++++++++++++++
>> target/linux/brcm63xx/image/Makefile               |  2 +
>> .../brcm63xx/patches-3.18/572-board_VR-3026e.patch | 79 +++++++++++++++++++
>> .../brcm63xx/patches-4.1/572-board_VR-3026e.patch  | 79 +++++++++++++++++++
>> target/linux/brcm63xx/profiles/comtrend.mk         |  9 +++
>> 10 files changed, 267 insertions(+), 1 deletion(-)
>> create mode 100644 target/linux/brcm63xx/dts/vr-3026e.dts
>> create mode 100644 target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch
>> create mode 100644 target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch
>> 
>> diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
>> index 7916ac2..7826fad 100644
>> --- a/target/linux/brcm63xx/base-files/etc/diag.sh
>> +++ b/target/linux/brcm63xx/base-files/etc/diag.sh
>> @@ -39,6 +39,9 @@ set_state() {
>>        vr-3025u)
>>                status_led="VR-3025u:green:power"
>>                ;;
>> +       vr-3026e)
>> +               status_led="VR-3026e:green:power"
>> +               ;;
>>        wap-5813n)
>>                status_led="WAP-5813n:green:power"
>>                ;;
>> diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
>> index 2ff9e45..4de861c 100644
>> --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
>> +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
>> @@ -94,8 +94,9 @@ fast2504n |\
>> fast2704v2 |\
>> hg655b |\
>> p870hw-51a_v2 |\
>> +vr-3025u |\
>> vr-3025un |\
>> -vr-3025u)
>> +vr-3026e)
> 
> Why did you change the order of vr-3025u and vr-3025un here? You
> didn't do this in your previous versions. Please do not add random
> cleanups/changes to your patches.
> 
> 
> Jonas
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Thu Aug 27 06:47:28 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Thu, 27 Aug 2015 12:47:28 +0200
Subject: [OpenWrt-Devel] [PATCH v3] bcm63xx: add Comtrend VR-3026e
	support
In-Reply-To: <0C740CDC-9F5E-4F0B-8475-499C0C500DB3@gmail.com>
References: <1440609494-13148-1-git-send-email-tesarmar@gmail.com>
 <1440609494-13148-2-git-send-email-tesarmar@gmail.com>
 <CAOiHx=k4_jVyvZ_mKTOXwsXCJ5aq2Z-o0tNNUWercbf3qH86=A@mail.gmail.com>
 <0C740CDC-9F5E-4F0B-8475-499C0C500DB3@gmail.com>
Message-ID: <CAOiHx=m76Y_Bn0cMEnn51OpDFJj--7euh2O2F6oHw3c5Z0sB9w@mail.gmail.com>

On Thu, Aug 27, 2015 at 12:41 PM, Martin Tesar <tesarmar at gmail.com> wrote:
> Hi,
>
> it's just a cosmetic change. Now I understand I shouldn't do that.
> Should I create a new patch?

Yes, please. I don't mind the cosmetic change per se, it just should
be in a separate patch.


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


From Alexey.Brodkin at synopsys.com  Thu Aug 27 07:03:50 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Thu, 27 Aug 2015 14:03:50 +0300
Subject: [OpenWrt-Devel] [PATCH 0/3] Add support of ARC architecture
Message-ID: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>

This patch series adds support for the Synopsys DesignWare ARC architecture.

DesignWare ARC700 is family of 32-bit CPUs developed by Synopsys, Inc.

Since version 3.9 ARC architecture is supported in mainline Linux developemnt.
Since version 2014.04 ARC architecture is supported in mainline U-Boot.
For quite some time ARC architecture is supported in upstream uClibc
development but since there were no recent releases of uClibc support of
ARC is available from uClibc's fork uClibc-ng now.

Here we add toolchain for ARC architecture and 2 target boards that could
be used for trying OpenWRT on ARC.

Alexey Brodkin (3):
  toolchain: add support of ARC architecture
  ARC: specify location of output elf
  linux: add support of Synopsys ARC boards

 include/kernel-defaults.mk                         |   4 +
 include/kernel.mk                                  |   2 +
 include/site/arc                                   |  30 +
 include/target.mk                                  |   4 +
 target/Config.in                                   |   9 +
 target/linux/arc/Makefile                          |  28 +
 target/linux/arc/axs10x/README                     |  19 +
 .../linux/arc/axs10x/base-files/etc/config/network |  18 +
 target/linux/arc/axs10x/base-files/etc/inittab     |   5 +
 target/linux/arc/axs10x/config-4.1                 | 127 +++
 target/linux/arc/axs10x/target.mk                  |   8 +
 target/linux/arc/image/Makefile                    |  12 +
 target/linux/arc/nsim/README                       |  19 +
 target/linux/arc/nsim/base-files/etc/inittab       |   5 +
 target/linux/arc/nsim/config-4.1                   |  88 ++
 target/linux/arc/nsim/target.mk                    |   9 +
 ...Add-support-for-AXS101-SDP-software-devel.patch | 911 +++++++++++++++++++++
 ...Tweak-DDR-port-aperture-mappings-for-perf.patch |  65 ++
 ...ARC-axs101-Add-missing-__init-annotations.patch |  71 ++
 .../0004-ARC-RIP-broken-64bit-RTSC.patch           | 186 +++++
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 +
 .../0006-ARC-axs101-support-early-8250-uart.patch  |  67 ++
 toolchain/Config.in                                |   9 +-
 toolchain/binutils/Config.in                       |  12 +-
 toolchain/binutils/Makefile                        |  27 +-
 toolchain/gcc/Config.in                            |   5 +
 toolchain/gcc/Config.version                       |   9 +-
 toolchain/gcc/common.mk                            |  34 +-
 .../001-revert_register_mode_search.patch          |  65 ++
 .../patches/arc-2015.06/002-weak_data_fix.patch    |  42 +
 .../arc-2015.06/003-universal_initializer.patch    |  94 +++
 .../patches/arc-2015.06/004-case_insensitive.patch |  14 +
 .../patches/arc-2015.06/010-documentation.patch    |  23 +
 .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +
 .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +
 .../210-disable_libsanitizer_off_t_check.patch     |  11 +
 .../arc-2015.06/800-arc-disablelibgmon.patch       |  18 +
 .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +
 .../arc-2015.06/850-use_shared_libgcc.patch        |  47 ++
 .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
 .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 +
 .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
 .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
 .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 ++++++
 .../arc-2015.06/920-specs_nonfatal_getenv.patch    |  14 +
 .../arc-2015.06/940-no-clobber-stamp-bits.patch    |  11 +
 toolchain/gdb/Makefile                             |  19 +-
 toolchain/uClibc/Config.in                         |   2 +
 toolchain/uClibc/Config.version                    |   3 +-
 toolchain/uClibc/common.mk                         |   1 +
 toolchain/uClibc/config-ng-1.0.6/arc               |  12 +
 51 files changed, 2593 insertions(+), 28 deletions(-)
 create mode 100644 include/site/arc
 create mode 100644 target/linux/arc/Makefile
 create mode 100644 target/linux/arc/axs10x/README
 create mode 100644 target/linux/arc/axs10x/base-files/etc/config/network
 create mode 100644 target/linux/arc/axs10x/base-files/etc/inittab
 create mode 100644 target/linux/arc/axs10x/config-4.1
 create mode 100644 target/linux/arc/axs10x/target.mk
 create mode 100644 target/linux/arc/image/Makefile
 create mode 100644 target/linux/arc/nsim/README
 create mode 100644 target/linux/arc/nsim/base-files/etc/inittab
 create mode 100644 target/linux/arc/nsim/config-4.1
 create mode 100644 target/linux/arc/nsim/target.mk
 create mode 100644 target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch
 create mode 100644 target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch
 create mode 100644 target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch
 create mode 100644 target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch
 create mode 100644 target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 target/linux/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/010-documentation.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/arc

-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Thu Aug 27 07:03:51 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Thu, 27 Aug 2015 14:03:51 +0300
Subject: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC
	architecture
In-Reply-To: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
Message-ID: <1440673433-25446-2-git-send-email-abrodkin@synopsys.com>

This includes binutils, gcc, gdb and uClibc-ng.

Latest release of ARC gcc (as of today it is "arc-2015.06")
is based on upstream gcc 4.8.4.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/gcc

Latest release of ARC binutils (as of today it is "arc-2015.06")
is based on upstream binutils 2.23.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06

Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
is based on upstream gdb 7.9.1.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb

Note that for binutils and gdb that come from unified git repository
(which is the case for upstream binutils/gdb today) we need to disable
building of gdb in binutils and binutils in gdb hence in binutils:
------>8------
--disable-sim
--disable-gdb
------>8------

and in gdb:
------>8------
--disable-binutils
--disable-ld
--disable-gas
------>8------

Also in gdb we disable sim because if the following breakage while
building with it:
------------>8------------
/usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
        -mono -fast -pbb -switch sem5-switch.c \
        -cpu a5f -infile ./mloop5.in \
        -outfile-suffix 5
unknown option: bash
Makefile:699: recipe for target 'stamp-5mloop' failed
make[7]: *** [stamp-5mloop] Error 1
------------>8------------

Prerequisites are:
 [1] http://patchwork.ozlabs.org/patch/510985 which adds uClibc-ng support.
 [2] http://patchwork.ozlabs.org/patch/502022 which updates config.guess
 and config.sub

Cc: Felix Fietkau <nbd at openwrt.org>
Cc: John Crispin <blogic at openwrt.org>
Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
---
 include/site/arc                                   |  30 +++
 include/target.mk                                  |   4 +
 toolchain/Config.in                                |   9 +-
 toolchain/binutils/Config.in                       |  12 +-
 toolchain/binutils/Makefile                        |  27 ++-
 toolchain/gcc/Config.in                            |   5 +
 toolchain/gcc/Config.version                       |   9 +-
 toolchain/gcc/common.mk                            |  34 ++-
 .../001-revert_register_mode_search.patch          |  65 ++++++
 .../patches/arc-2015.06/002-weak_data_fix.patch    |  42 ++++
 .../arc-2015.06/003-universal_initializer.patch    |  94 ++++++++
 .../patches/arc-2015.06/004-case_insensitive.patch |  14 ++
 .../patches/arc-2015.06/010-documentation.patch    |  23 ++
 .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +++
 .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +++
 .../210-disable_libsanitizer_off_t_check.patch     |  11 +
 .../arc-2015.06/800-arc-disablelibgmon.patch       |  18 ++
 .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +++
 .../arc-2015.06/850-use_shared_libgcc.patch        |  47 ++++
 .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
 .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 ++++
 .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
 .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
 .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 +++++++++++++++++++++
 .../arc-2015.06/920-specs_nonfatal_getenv.patch    |  14 ++
 .../arc-2015.06/940-no-clobber-stamp-bits.patch    |  11 +
 toolchain/gdb/Makefile                             |  19 +-
 toolchain/uClibc/Config.in                         |   2 +
 toolchain/uClibc/Config.version                    |   3 +-
 toolchain/uClibc/common.mk                         |   1 +
 toolchain/uClibc/config-ng-1.0.6/arc               |  12 +
 31 files changed, 904 insertions(+), 28 deletions(-)
 create mode 100644 include/site/arc
 create mode 100644 toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/010-documentation.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/arc

diff --git a/include/site/arc b/include/site/arc
new file mode 100644
index 0000000..72a3805
--- /dev/null
+++ b/include/site/arc
@@ -0,0 +1,30 @@
+#!/bin/sh
+. $TOPDIR/include/site/linux
+ac_cv_c_littleendian=${ac_cv_c_littleendian=yes}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
+
+ac_cv_sizeof___int64=0
+ac_cv_sizeof_char=1
+ac_cv_sizeof_int=4
+ac_cv_sizeof_int16_t=2
+ac_cv_sizeof_int32_t=4
+ac_cv_sizeof_int64_t=8
+ac_cv_sizeof_long_int=4
+ac_cv_sizeof_long_long=8
+ac_cv_sizeof_long=4
+ac_cv_sizeof_off_t=8
+ac_cv_sizeof_short_int=2
+ac_cv_sizeof_short=2
+ac_cv_sizeof_size_t=4
+ac_cv_sizeof_ssize_t=4
+ac_cv_sizeof_u_int16_t=2
+ac_cv_sizeof_u_int32_t=4
+ac_cv_sizeof_u_int64_t=8
+ac_cv_sizeof_uint16_t=2
+ac_cv_sizeof_uint32_t=4
+ac_cv_sizeof_uint64_t=8
+ac_cv_sizeof_unsigned_int=4
+ac_cv_sizeof_unsigned_long=4
+ac_cv_sizeof_unsigned_long_long=8
+ac_cv_sizeof_unsigned_short=2
+ac_cv_sizeof_void_p=4
diff --git a/include/target.mk b/include/target.mk
index 3e7f17d..fdf6370 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -259,6 +259,10 @@ ifeq ($(DUMP),1)
     CPU_TYPE ?= armv8-a
     CPU_CFLAGS_armv8-a = -mcpu=armv8-a
   endif
+  ifeq ($(ARCH),arc)
+    CPU_TYPE ?= arc700
+    CPU_CFLAGS_arc700 = -marc700
+  endif
   DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
 endif
 
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 1e94602..2b3ade1 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -211,7 +211,7 @@ comment "C Library"
 
 choice
 	prompt "C Library implementation" if TOOLCHAINOPTS
-	default LIBC_USE_UCLIBC if mips64 || mips64el
+	default LIBC_USE_UCLIBC if arc || mips64 || mips64el
 	default LIBC_USE_MUSL
 	help
 	  Select the C library implementation.
@@ -219,6 +219,7 @@ choice
 	config LIBC_USE_GLIBC
 		bool "Use (e)glibc"
 		select USE_GLIBC
+		depends on !arc
 
 	config LIBC_USE_UCLIBC
 		select USE_UCLIBC
@@ -228,7 +229,7 @@ choice
 	config LIBC_USE_MUSL
 		select USE_MUSL
 		bool "Use musl"
-		depends on !(mips64 || mips64el)
+		depends on !(arc || mips64 || mips64el)
 
 endchoice
 
@@ -259,11 +260,11 @@ config USE_GLIBC
 	bool
 
 config USE_UCLIBC
-	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (mips64 || mips64el)
+	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc || mips64 || mips64el)
 	bool
 
 config USE_MUSL
-	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(mips64 || mips64el)
+	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || mips64 || mips64el)
 	bool
 
 config USE_EXTERNAL_LIBC
diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in
index 8d91223..0f670f1 100644
--- a/toolchain/binutils/Config.in
+++ b/toolchain/binutils/Config.in
@@ -2,13 +2,19 @@
 
 choice
 	prompt "Binutils Version" if TOOLCHAINOPTS
-	default BINUTILS_VERSION_LINARO
+	default BINUTILS_VERSION_ARC if arc
+	default BINUTILS_VERSION_LINARO if !arc
 	help
 	  Select the version of binutils you wish to use.
 
 	config BINUTILS_VERSION_LINARO
+		depends on !arc
 		bool "Linaro binutils 2.24"
 
+	config BINUTILS_VERSION_ARC
+		depends on arc
+		bool "ARC binutils 2015.06"
+
 endchoice
 
 config EXTRA_BINUTILS_CONFIG_OPTIONS
@@ -21,5 +27,5 @@ config EXTRA_BINUTILS_CONFIG_OPTIONS
 config BINUTILS_VERSION
 	string
 	prompt "Binutils Version" if (TOOLCHAINOPTS && NULL)
-	default "linaro"          if BINUTILS_VERSION_LINARO
-	default "linaro"
+	default "linaro"          if BINUTILS_VERSION_LINARO || (!TOOLCHAINOPTS && !arc)
+	default "arc"             if BINUTILS_VERSION_ARC || (!TOOLCHAINOPTS && arc)
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index 0276512..d420802 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -10,11 +10,20 @@ PKG_NAME:=binutils
 PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
 BIN_VERSION:=$(PKG_VERSION)
 
-PKG_SOURCE_URL:=https://releases.linaro.org/14.09/components/toolchain/binutils-linaro/
-PKG_REV:=2.24.0-2014.09
-PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.xz
-PKG_MD5SUM:=8f9b2b2e049d59b1b86ce9657802a353
-BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
+ifeq ($(findstring arc, $(CONFIG_BINUTILS_VERSION)),arc)
+	PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2015.06/
+	PKG_REV:=2015.06
+	PKG_SOURCE:=$(PKG_NAME)-arc-$(PKG_REV).tar.gz
+	PKG_MD5SUM:=961a3564de857238c255c381f8e4360b
+	BINUTILS_DIR:=$(PKG_NAME)-gdb-arc-$(PKG_REV)
+else
+	PKG_SOURCE_URL:=https://releases.linaro.org/14.09/components/toolchain/binutils-linaro/
+	PKG_REV:=2.24.0-2014.09
+	PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.xz
+	PKG_MD5SUM:=8f9b2b2e049d59b1b86ce9657802a353
+	BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
+endif
+
 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
 
 HOST_BUILD_PARALLEL:=1
@@ -37,6 +46,8 @@ BINUTILS_CONFIGURE:= \
 		--disable-multilib \
 		--disable-werror \
 		--disable-nls \
+		--disable-sim \
+		--disable-gdb \
 		$(GRAPHITE_CONFIGURE) \
 		$(SOFT_FLOAT_CONFIG_OPTION) \
 		$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) 
@@ -82,6 +93,12 @@ define Host/Install
 	$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
 	$(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
 	$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
+	# ARC gcc requires extlib.
+	# If extlib is not available in "initial" folder
+	# initial gcc will fail to build libc.
+	if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
+		$(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
+	fi
 endef
 
 define Host/Clean
diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
index f5de52d..b0d47db 100644
--- a/toolchain/gcc/Config.in
+++ b/toolchain/gcc/Config.in
@@ -3,6 +3,7 @@
 choice
 	prompt "GCC compiler Version" if TOOLCHAINOPTS
 	default GCC_USE_VERSION_4_6_LINARO if TARGET_octeon
+	default GCC_USE_VERSION_4_8_ARC if arc
 	default GCC_USE_VERSION_4_8_LINARO
 	help
 	  Select the version of gcc you wish to use.
@@ -14,6 +15,10 @@ choice
 	config GCC_USE_VERSION_4_8_LINARO
 		select GCC_VERSION_4_8_LINARO
 		bool "gcc 4.8.x with Linaro enhancements"
+		
+	config GCC_USE_VERSION_4_8_ARC
+		select GCC_VERSION_4_8_ARC
+		bool "gcc 4.8.x with support of ARC cores"
 
 	config GCC_USE_VERSION_4_9_LINARO
 		select GCC_VERSION_4_9_LINARO
diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version
index c5cf232..e94b631 100644
--- a/toolchain/gcc/Config.version
+++ b/toolchain/gcc/Config.version
@@ -3,12 +3,16 @@ config GCC_VERSION_4_6_LINARO
 	bool
 
 config GCC_VERSION_4_8_LINARO
-	default y if (!TOOLCHAINOPTS && !TARGET_octeon)
+	default y if (!TOOLCHAINOPTS && !(TARGET_octeon || arc))
 	bool
 
 config GCC_VERSION_4_9_LINARO
 	bool
 
+config GCC_VERSION_4_8_ARC
+	default y if (!TOOLCHAINOPTS && arc)
+	bool
+
 config GCC_VERSION
 	string
 	default "4.6.3"	    if GCC_VERSION_4_6_3
@@ -16,6 +20,7 @@ config GCC_VERSION
 	default "4.6-linaro"    if GCC_VERSION_4_6_LINARO
 	default "4.8-linaro"    if GCC_VERSION_4_8_LINARO
 	default "4.9-linaro"    if GCC_VERSION_4_9_LINARO
+	default "arc-2015.06"   if GCC_VERSION_4_8_ARC
 	default "4.6-linaro"
 
 config GCC_VERSION_4_6
@@ -24,7 +29,7 @@ config GCC_VERSION_4_6
 
 config GCC_VERSION_4_8
 	bool
-	default y	if GCC_VERSION_4_8_LINARO
+	default y	if (GCC_VERSION_4_8_LINARO || GCC_VERSION_4_8_ARC)
 
 config GCC_VERSION_4_9
 	bool
diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index bc5a732..bbffa5b 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -25,6 +25,19 @@ GCC_VERSION:=$(call qstrip,$(CONFIG_GCC_VERSION))
 PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION)))
 GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION)
 
+PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+
+ifeq ($(PKG_VERSION),4.6.3)
+  PKG_MD5SUM:=773092fe5194353b02bb0110052a972e
+endif
+ifeq ($(PKG_VERSION),4.8.0)
+  PKG_MD5SUM:=e6040024eb9e761c3bea348d1fa5abb0
+endif
+ifeq ($(PKG_VERSION),5.2.0)
+  PKG_MD5SUM:=a51bcfeb3da7dd4c623e27207ed43467
+endif
+
 ifeq ($(findstring linaro, $(CONFIG_GCC_VERSION)),linaro)
     LINARO_RELEASE:=
     ifeq ($(CONFIG_GCC_VERSION),"4.6-linaro")
@@ -57,19 +70,16 @@ ifeq ($(findstring linaro, $(CONFIG_GCC_VERSION)),linaro)
     PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.$(PKG_COMP)
     GCC_DIR:=gcc-linaro-$(PKG_REV)
     HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GCC_DIR)
-else
-  PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
-  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+endif
 
-  ifeq ($(PKG_VERSION),4.6.3)
-    PKG_MD5SUM:=773092fe5194353b02bb0110052a972e
-  endif
-  ifeq ($(PKG_VERSION),4.8.0)
-    PKG_MD5SUM:=e6040024eb9e761c3bea348d1fa5abb0
-  endif
-  ifeq ($(PKG_VERSION),5.2.0)
-    PKG_MD5SUM:=a51bcfeb3da7dd4c623e27207ed43467
-  endif
+ifneq ($(CONFIG_GCC_VERSION_4_8_ARC),)
+    PKG_VERSION:=4.8.4
+    PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/archive/arc-2015.06
+    PKG_SOURCE:=$(PKG_NAME)-$(GCC_VERSION).tar.gz
+    PKG_MD5SUM:=25007ebb02a5f6c32532b103bb5984a0
+    PKG_REV:=2015.06
+    GCC_DIR:=gcc-arc-$(PKG_REV)
+    HOST_BUILD_DIR = $(BUILD_DIR_HOST)/$(PKG_NAME)-$(GCC_VERSION)
 endif
 
 PATCH_DIR=../patches/$(GCC_VERSION)
diff --git a/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch b/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
new file mode 100644
index 0000000..162d651
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
@@ -0,0 +1,65 @@
+Revert of:
+
+commit 275035b56823b26d5fb7e90fad945b998648edf2
+Author: bergner <bergner at 138bc75d-0d04-0410-961f-82ee72b054a4>
+Date:   Thu Sep 5 14:09:07 2013 +0000
+
+        PR target/58139
+        * reginfo.c (choose_hard_reg_mode): Scan through all mode classes
+        looking for widest mode.
+
+
+    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk at 202286 138bc75d-0d04-0410-961f-82ee72b054a4
+
+
+--- a/gcc/reginfo.c
++++ b/gcc/reginfo.c
+@@ -620,35 +620,40 @@ choose_hard_reg_mode (unsigned int regno
+        mode = GET_MODE_WIDER_MODE (mode))
+     if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ 	&& HARD_REGNO_MODE_OK (regno, mode)
+-	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+-	&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+       found_mode = mode;
+ 
++  if (found_mode != VOIDmode)
++    return found_mode;
++
+   for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
+        mode != VOIDmode;
+        mode = GET_MODE_WIDER_MODE (mode))
+     if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ 	&& HARD_REGNO_MODE_OK (regno, mode)
+-	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+-	&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+       found_mode = mode;
+ 
++  if (found_mode != VOIDmode)
++    return found_mode;
++
+   for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
+        mode != VOIDmode;
+        mode = GET_MODE_WIDER_MODE (mode))
+     if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ 	&& HARD_REGNO_MODE_OK (regno, mode)
+-	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+-	&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+       found_mode = mode;
+ 
++  if (found_mode != VOIDmode)
++    return found_mode;
++
+   for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
+        mode != VOIDmode;
+        mode = GET_MODE_WIDER_MODE (mode))
+     if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ 	&& HARD_REGNO_MODE_OK (regno, mode)
+-	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+-	&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+       found_mode = mode;
+ 
+   if (found_mode != VOIDmode)
diff --git a/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch b/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
new file mode 100644
index 0000000..a740b4c
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
@@ -0,0 +1,42 @@
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/visibility-21.c
+@@ -0,0 +1,14 @@
++/* PR target/32219 */
++/* { dg-do run } */
++/* { dg-require-visibility "" } */
++/* { dg-options "-fPIC" { target fpic } } */
++
++extern void f() __attribute__((weak,visibility("hidden")));
++extern int puts( char const* );
++int main()
++{
++	if (f)
++		f();
++	return 0;
++}
++
+--- a/gcc/varasm.c
++++ b/gcc/varasm.c
+@@ -6677,6 +6677,10 @@ default_binds_local_p_1 (const_tree exp,
+   /* Static variables are always local.  */
+   else if (! TREE_PUBLIC (exp))
+     local_p = true;
++  /* hidden weak can't be overridden by something non-local, all
++     that is possible is that it is not defined at all. */
++  else if (DECL_WEAK (exp))
++    local_p = false;
+   /* A variable is local if the user has said explicitly that it will
+      be.  */
+   else if ((DECL_VISIBILITY_SPECIFIED (exp)
+@@ -6690,11 +6694,6 @@ default_binds_local_p_1 (const_tree exp,
+      local.  */
+   else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
+     local_p = true;
+-  /* Default visibility weak data can be overridden by a strong symbol
+-     in another module and so are not local.  */
+-  else if (DECL_WEAK (exp)
+-	   && !resolved_locally)
+-    local_p = false;
+   /* If PIC, then assume that any global name can be overridden by
+      symbols resolved from other modules.  */
+   else if (shlib)
diff --git a/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch b/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
new file mode 100644
index 0000000..1b9a5b3
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
@@ -0,0 +1,94 @@
+--- a/gcc/c/c-typeck.c
++++ b/gcc/c/c-typeck.c
+@@ -62,9 +62,9 @@ int in_typeof;
+    if expr.original_code == SIZEOF_EXPR.  */
+ tree c_last_sizeof_arg;
+ 
+-/* Nonzero if we've already printed a "missing braces around initializer"
+-   message within this initializer.  */
+-static int missing_braces_mentioned;
++/* Nonzero if we might need to print a "missing braces around
++   initializer" message within this initializer.  */
++static int found_missing_braces;
+ 
+ static int require_constant_value;
+ static int require_constant_elements;
+@@ -6363,6 +6363,9 @@ static int constructor_nonconst;
+ /* 1 if this constructor is erroneous so far.  */
+ static int constructor_erroneous;
+ 
++/* 1 if this constructor is the universal zero initializer { 0 }.  */
++static int constructor_zeroinit;
++
+ /* Structure for managing pending initializer elements, organized as an
+    AVL tree.  */
+ 
+@@ -6524,7 +6527,7 @@ start_init (tree decl, tree asmspec_tree
+   constructor_stack = 0;
+   constructor_range_stack = 0;
+ 
+-  missing_braces_mentioned = 0;
++  found_missing_braces = 0;
+ 
+   spelling_base = 0;
+   spelling_size = 0;
+@@ -6619,6 +6622,7 @@ really_start_incremental_init (tree type
+   constructor_type = type;
+   constructor_incremental = 1;
+   constructor_designated = 0;
++  constructor_zeroinit = 1;
+   designator_depth = 0;
+   designator_erroneous = 0;
+ 
+@@ -6816,11 +6820,8 @@ push_init_level (int implicit, struct ob
+ 	set_nonincremental_init (braced_init_obstack);
+     }
+ 
+-  if (implicit == 1 && warn_missing_braces && !missing_braces_mentioned)
+-    {
+-      missing_braces_mentioned = 1;
+-      warning_init (OPT_Wmissing_braces, "missing braces around initializer");
+-    }
++  if (implicit == 1)
++    found_missing_braces = 1;
+ 
+   if (TREE_CODE (constructor_type) == RECORD_TYPE
+ 	   || TREE_CODE (constructor_type) == UNION_TYPE)
+@@ -6953,16 +6954,23 @@ pop_init_level (int implicit, struct obs
+ 	}
+     }
+ 
++  if (vec_safe_length (constructor_elements) != 1)
++    constructor_zeroinit = 0;
++
++  /* Warn when some structs are initialized with direct aggregation.  */
++  if (!implicit && found_missing_braces && warn_missing_braces
++      && !constructor_zeroinit)
++    {
++      warning_init (OPT_Wmissing_braces,
++		    "missing braces around initializer");
++    }
++
+   /* Warn when some struct elements are implicitly initialized to zero.  */
+   if (warn_missing_field_initializers
+       && constructor_type
+       && TREE_CODE (constructor_type) == RECORD_TYPE
+       && constructor_unfilled_fields)
+     {
+-	bool constructor_zeroinit =
+-	 (vec_safe_length (constructor_elements) == 1
+-	  && integer_zerop ((*constructor_elements)[0].value));
+-
+ 	/* Do not warn for flexible array members or zero-length arrays.  */
+ 	while (constructor_unfilled_fields
+ 	       && (!DECL_SIZE (constructor_unfilled_fields)
+@@ -8077,6 +8085,9 @@ process_init_element (struct c_expr valu
+   designator_depth = 0;
+   designator_erroneous = 0;
+ 
++  if (!implicit && value.value && !integer_zerop (value.value))
++    constructor_zeroinit = 0;
++
+   /* Handle superfluous braces around string cst as in
+      char x[] = {"foo"}; */
+   if (string_flag
diff --git a/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch b/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
new file mode 100644
index 0000000..b3d2dbe
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
@@ -0,0 +1,14 @@
+--- a/include/filenames.h
++++ b/include/filenames.h
+@@ -43,11 +43,6 @@ extern "C" {
+ #  define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
+ #  define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
+ #else /* not DOSish */
+-#  if defined(__APPLE__)
+-#    ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
+-#      define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
+-#    endif
+-#  endif /* __APPLE__ */
+ #  define HAS_DRIVE_SPEC(f) (0)
+ #  define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
+ #  define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
diff --git a/toolchain/gcc/patches/arc-2015.06/010-documentation.patch b/toolchain/gcc/patches/arc-2015.06/010-documentation.patch
new file mode 100644
index 0000000..5548069
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/010-documentation.patch
@@ -0,0 +1,23 @@
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -4327,18 +4327,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
+ doc/gccint.info: $(TEXI_GCCINT_FILES)
+ doc/cppinternals.info: $(TEXI_CPPINT_FILES)
+ 
+-doc/%.info: %.texi
+-	if [ x$(BUILD_INFO) = xinfo ]; then \
+-		$(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
+-			-I $(gcc_docdir)/include -o $@ $<; \
+-	fi
++doc/%.info:
+ 
+ # Duplicate entry to handle renaming of gccinstall.info
+-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
+-	if [ x$(BUILD_INFO) = xinfo ]; then \
+-		$(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
+-			-I $(gcc_docdir)/include -o $@ $<; \
+-	fi
++doc/gccinstall.info:
+ 
+ doc/cpp.dvi: $(TEXI_CPP_FILES)
+ doc/gcc.dvi: $(TEXI_GCC_FILES)
diff --git a/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch b/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
new file mode 100644
index 0000000..b225376
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
@@ -0,0 +1,28 @@
+--- a/gcc/calls.c
++++ b/gcc/calls.c
+@@ -176,6 +176,12 @@ prepare_call_address (tree fndecl, rtx f
+ 	       && targetm.small_register_classes_for_mode_p (FUNCTION_MODE))
+ 	      ? force_not_mem (memory_address (FUNCTION_MODE, funexp))
+ 	      : memory_address (FUNCTION_MODE, funexp));
++  else if (flag_pic && !flag_plt && fndecl
++	   && TREE_CODE (fndecl) == FUNCTION_DECL
++	   && !targetm.binds_local_p (fndecl))
++    {
++      funexp = force_reg (Pmode, funexp);
++    }
+   else if (! sibcallp)
+     {
+ #ifndef NO_FUNCTION_CSE
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -1617,6 +1617,10 @@ fpie
+ Common Report Var(flag_pie,1) Negative(fPIC)
+ Generate position-independent code for executables if possible (small mode)
+ 
++fplt
++Common Report Var(flag_plt) Init(1)
++Use PLT for PIC calls (-fno-plt: load the address from GOT at call site)
++
+ fplugin=
+ Common Joined RejectNegative Var(common_deferred_options) Defer
+ Specify a plugin to load
diff --git a/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch b/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
new file mode 100644
index 0000000..ff9ad94
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
@@ -0,0 +1,33 @@
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
+  then
+   make all-gdb all-dejagnu all-ld || exit 1
+   make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++  make all-gdb all-dejagnu all-ld || exit 1
++  make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+   make bootstrap || exit 1
+   make install || exit 1
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
+ 
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+ 
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   version_type=linux
+   need_lib_prefix=no
+   need_version=no
diff --git a/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch b/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
new file mode 100644
index 0000000..5608469
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
@@ -0,0 +1,11 @@
+--- a/libsanitizer/interception/interception_type_test.cc
++++ b/libsanitizer/interception/interception_type_test.cc
+@@ -31,7 +31,7 @@ COMPILER_CHECK(sizeof(OFF64_T) == sizeof
+ // rest (they depend on _FILE_OFFSET_BITS setting when building an application).
+ # if defined(__ANDROID__) || !defined _FILE_OFFSET_BITS || \
+   _FILE_OFFSET_BITS != 64
+-COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
++// COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
+ # endif
+ 
+ #endif
diff --git a/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch b/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
new file mode 100644
index 0000000..612883c
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
@@ -0,0 +1,18 @@
+diff --git a/libgcc/config.host b/libgcc/config.host
+index e768389..aec10c7 100644
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -320,11 +320,11 @@ alpha*-dec-*vms*)
+ 	;;
+ arc*-*-elf*)
+ 	tmake_file="arc/t-arc-newlib arc/t-arc"
+-	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o crttls_r25.o crttls_r30.o"
++	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o crtg.o crtgend.o crttls_r25.o crttls_r30.o"
+ 	;;
+ arc*-*-linux-uclibc*)
+ 	tmake_file="${tmake_file} t-slibgcc-libgcc t-slibgcc-nolc-override arc/t-arc700-uClibc arc/t-arc"
+-	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o"
++	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o crtg.o crtgend.o"
+ 	;;
+ arm-wrs-vxworks)
+ 	tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
diff --git a/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch b/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
new file mode 100644
index 0000000..7a0ac73
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
@@ -0,0 +1,36 @@
+--- a/libgcc/Makefile.in
++++ b/libgcc/Makefile.in
+@@ -865,11 +865,12 @@ $(libgcov-objects): %$(objext): $(srcdir
+ 
+ # Static libraries.
+ libgcc.a: $(libgcc-objects)
++libgcc_pic.a: $(libgcc-s-objects)
+ libgcov.a: $(libgcov-objects)
+ libunwind.a: $(libunwind-objects)
+ libgcc_eh.a: $(libgcc-eh-objects)
+ 
+-libgcc.a libgcov.a libunwind.a libgcc_eh.a:
++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a:
+ 	-rm -f $@
+ 
+ 	objects="$(objects)";					\
+@@ -891,7 +892,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E
+ endif
+ 
+ ifeq ($(enable_shared),yes)
+-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT)
+ ifneq ($(LIBUNWIND),)
+ all: libunwind$(SHLIB_EXT)
+ endif
+@@ -1058,6 +1059,10 @@ install-shared:
+ 	chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+ 	$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+ 
++	$(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/
++	chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a
++	$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a
++
+ 	$(subst @multilib_dir@,$(MULTIDIR),$(subst \
+ 		@shlib_base_name@,libgcc_s,$(subst \
+ 		@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
diff --git a/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch b/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
new file mode 100644
index 0000000..6934bc9
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
@@ -0,0 +1,47 @@
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -131,10 +131,6 @@
+ #define ENDFILE_SPEC \
+   LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+ 
+-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
+-   do not use -lfloat.  */
+-#undef LIBGCC_SPEC
+-
+ /* Clear the instruction cache from `beg' to `end'.  This is
+    implemented in lib1funcs.S, so ensure an error if this definition
+    is used.  */
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI
+ 	builtin_assert ("system=posix");			\
+     } while (0)
+ 
++#ifndef LIBGCC_SPEC
++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
++#endif
++
+ /* Determine which dynamic linker to use depending on whether GLIBC or
+    uClibc or Bionic is the default C library and whether
+    -muclibc or -mglibc or -mbionic has been passed to change the default.  */
+--- a/libgcc/mkmap-symver.awk
++++ b/libgcc/mkmap-symver.awk
+@@ -132,5 +132,5 @@ function output(lib) {
+   else if (inherit[lib])
+     printf("} %s;\n", inherit[lib]);
+   else
+-    printf ("\n  local:\n\t*;\n};\n");
++    printf ("\n\t*;\n};\n");
+ }
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -61,6 +61,9 @@
+ #undef  CPLUSPLUS_CPP_SPEC
+ #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
+ 
++#undef LIBGCC_SPEC
++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
++
+ #undef  LINK_SHLIB_SPEC
+ #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
+ 
diff --git a/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch b/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
new file mode 100644
index 0000000..80c3476
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
@@ -0,0 +1,12 @@
+--- a/libgcc/config/t-libunwind
++++ b/libgcc/config/t-libunwind
+@@ -2,8 +2,7 @@
+ 
+ HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
+ 
+-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+-  $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+ LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+ 
+ # Override the default value from t-slibgcc-elf-ver and mention -lunwind
diff --git a/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch b/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
new file mode 100644
index 0000000..1ac83fe
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
@@ -0,0 +1,42 @@
+--- a/libgcc/unwind-dw2-fde-dip.c
++++ b/libgcc/unwind-dw2-fde-dip.c
+@@ -46,33 +46,13 @@
+ #include "unwind-compat.h"
+ #include "gthr.h"
+ 
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+-    && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+-	|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+-# define USE_PT_GNU_EH_FRAME
+-#endif
+-
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+-    && defined(__BIONIC__)
+-# define USE_PT_GNU_EH_FRAME
+-#endif
+-
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+-    && defined(__FreeBSD__) && __FreeBSD__ >= 7
+-# define ElfW __ElfN
+-# define USE_PT_GNU_EH_FRAME
+-#endif
+-
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+-    && defined(__OpenBSD__)
+-# define ElfW(type) Elf_##type
+-# define USE_PT_GNU_EH_FRAME
+-#endif
+-
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+-    && defined(TARGET_DL_ITERATE_PHDR) \
+-    && defined(__sun__) && defined(__svr4__)
++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR)
+ # define USE_PT_GNU_EH_FRAME
++# ifdef __OpenBSD__
++#  define ElfW(type) Elf_##type
++# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
++#  define ElfW __ElfN
++# endif
+ #endif
+ 
+ #if defined(USE_PT_GNU_EH_FRAME)
diff --git a/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
new file mode 100644
index 0000000..4b7fcbd
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
@@ -0,0 +1,11 @@
+--- a/gcc/config/rs6000/rs6000.c
++++ b/gcc/config/rs6000/rs6000.c
+@@ -17662,7 +17662,7 @@ rs6000_savres_strategy (rs6000_stack_t *
+   /* Define cutoff for using out-of-line functions to save registers.  */
+   if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
+     {
+-      if (!optimize_size)
++      if (1)
+ 	{
+ 	  strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
+ 	  strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
diff --git a/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch b/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
new file mode 100644
index 0000000..def6c9f
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
@@ -0,0 +1,11 @@
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI
+ /* If we have named section and we support weak symbols, then use the
+    .jcr section for recording java classes which need to be registered
+    at program start-up time.  */
+-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
++#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
+ #ifndef JCR_SECTION_NAME
+ #define JCR_SECTION_NAME ".jcr"
+ #endif
diff --git a/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch b/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
new file mode 100644
index 0000000..5387f8e
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
@@ -0,0 +1,253 @@
+
+	This patch brings over a few features from MirBSD:
+	* -fhonour-copts
+	  If this option is not given, it's warned (depending
+	  on environment variables). This is to catch errors
+	  of misbuilt packages which override CFLAGS themselves.
+	* -Werror-maybe-reset
+	  Has the effect of -Wno-error if GCC_NO_WERROR is
+	  set and not '0', a no-operation otherwise. This is
+	  to be able to use -Werror in "make" but prevent
+	  GNU autoconf generated configure scripts from
+	  freaking out.
+	* Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
+	  the default for -O2/-Os, because they trigger gcc bugs
+	  and can delete code with security implications.
+
+	This patch was authored by Thorsten Glaser <tg at mirbsd.de>
+	with copyright assignment to the FSF in effect.
+
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -104,6 +104,9 @@ static size_t include_cursor;
+ /* Whether any standard preincluded header has been preincluded.  */
+ static bool done_preinclude;
+ 
++/* Check if a port honours COPTS.  */
++static int honour_copts = 0;
++
+ static void handle_OPT_d (const char *);
+ static void set_std_cxx98 (int);
+ static void set_std_cxx11 (int);
+@@ -383,6 +386,9 @@ c_common_handle_option (size_t scode, co
+       cpp_opts->warn_endif_labels = value;
+       break;
+ 
++    case OPT_Werror_maybe_reset:
++      break;
++
+     case OPT_Winvalid_pch:
+       cpp_opts->warn_invalid_pch = value;
+       break;
+@@ -491,6 +497,12 @@ c_common_handle_option (size_t scode, co
+       flag_no_builtin = !value;
+       break;
+ 
++    case OPT_fhonour_copts:
++      if (c_language == clk_c) {
++        honour_copts++;
++      }
++      break;
++
+     case OPT_fconstant_string_class_:
+       constant_string_class_name = arg;
+       break;
+@@ -1027,6 +1039,47 @@ c_common_init (void)
+       return false;
+     }
+ 
++  if (c_language == clk_c) {
++    char *ev = getenv ("GCC_HONOUR_COPTS");
++    int evv;
++    if (ev == NULL)
++      evv = -1;
++    else if ((*ev == '0') || (*ev == '\0'))
++      evv = 0;
++    else if (*ev == '1')
++      evv = 1;
++    else if (*ev == '2')
++      evv = 2;
++    else if (*ev == 's')
++      evv = -1;
++    else {
++      warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
++      evv = 1; /* maybe depend this on something like MIRBSD_NATIVE?  */
++    }
++    if (evv == 1) {
++      if (honour_copts == 0) {
++        error ("someone does not honour COPTS at all in lenient mode");
++        return false;
++      } else if (honour_copts != 1) {
++        warning (0, "someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++      }
++    } else if (evv == 2) {
++      if (honour_copts == 0) {
++        error ("someone does not honour COPTS at all in strict mode");
++        return false;
++      } else if (honour_copts != 1) {
++        error ("someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++        return false;
++      }
++    } else if (evv == 0) {
++      if (honour_copts != 1)
++        inform (0, "someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++    }
++  }
++
+   return true;
+ }
+ 
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -379,6 +379,10 @@ Werror-implicit-function-declaration
+ C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
+ This switch is deprecated; use -Werror=implicit-function-declaration instead
+ 
++Werror-maybe-reset
++C ObjC C++ ObjC++
++; Documented in common.opt
++
+ Wfloat-equal
+ C ObjC C++ ObjC++ Var(warn_float_equal) Warning
+ Warn if testing floating point numbers for equality
+@@ -949,6 +953,9 @@ C++ ObjC++ Optimization Alias(fexception
+ fhonor-std
+ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
+ 
++fhonour-copts
++C ObjC C++ ObjC++ RejectNegative
++
+ fhosted
+ C ObjC
+ Assume normal C execution environment
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -541,6 +541,10 @@ Werror=
+ Common Joined
+ Treat specified warning as error
+ 
++Werror-maybe-reset
++Common
++If environment variable GCC_NO_WERROR is set, act as -Wno-error
++
+ Wextra
+ Common Var(extra_warnings) Warning
+ Print extra (possibly unwanted) warnings
+@@ -1242,6 +1246,9 @@ fguess-branch-probability
+ Common Report Var(flag_guess_branch_prob) Optimization
+ Enable guessing of branch probabilities
+ 
++fhonour-copts
++Common RejectNegative
++
+ ; Nonzero means ignore `#ident' directives.  0 means handle them.
+ ; Generate position-independent code for executables if possible
+ ; On SVR4 targets, it also controls whether or not to emit a
+--- a/gcc/opts.c
++++ b/gcc/opts.c
+@@ -468,8 +468,6 @@ static const struct default_options defa
+     { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 },
+ #endif
+     { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 },
+-    { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
+-    { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 },
+     { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 },
+     { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 },
+     { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
+@@ -489,6 +487,8 @@ static const struct default_options defa
+     { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
+ 
+     /* -O3 optimizations.  */
++    { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 },
++    { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 },
+     { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
+     { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
+     /* Inlining of functions reducing size is a good idea with -Os
+@@ -1435,6 +1435,17 @@ common_handle_option (struct gcc_options
+ 			       opts, opts_set, loc, dc);
+       break;
+ 
++    case OPT_Werror_maybe_reset:
++      {
++        char *ev = getenv ("GCC_NO_WERROR");
++        if ((ev != NULL) && (*ev != '0'))
++          warnings_are_errors = 0;
++      }
++      break;
++
++    case OPT_fhonour_copts:
++      break;
++
+     case OPT_Wlarger_than_:
+       opts->x_larger_than_size = value;
+       opts->x_warn_larger_than = value != -1;
+--- a/gcc/doc/cppopts.texi
++++ b/gcc/doc/cppopts.texi
+@@ -163,6 +163,11 @@ in older programs.  This warning is on b
+ Make all warnings into hard errors.  Source code which triggers warnings
+ will be rejected.
+ 
++ at item -Werror-maybe-reset
++ at opindex Werror-maybe-reset
++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
++variable is set to anything other than 0 or empty.
++
+ @item -Wsystem-headers
+ @opindex Wsystem-headers
+ Issue warnings for code in system headers.  These are normally unhelpful
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
+ -Wno-deprecated-declarations -Wdisabled-optimization  @gol
+ -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
+--Wno-endif-labels -Werror  -Werror=* @gol
++-Wno-endif-labels -Werror  -Werror=* -Werror-maybe-reset @gol
+ -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
+ -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
+ -Wformat-security  -Wformat-y2k @gol
+@@ -4817,6 +4817,22 @@ This option is only supported for C and 
+ @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
+ @option{-Wno-pointer-sign}.
+ 
++ at item -Werror-maybe-reset
++ at opindex Werror-maybe-reset
++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
++variable is set to anything other than 0 or empty.
++
++ at item -fhonour-copts
++ at opindex fhonour-copts
++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
++given at least once, and warn if it is given more than once.
++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
++given exactly once.
++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
++is not given exactly once.
++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
++This flag and environment variable only affect the C language.
++
+ @item -Wstack-protector
+ @opindex Wstack-protector
+ @opindex Wno-stack-protector
+@@ -6928,7 +6944,7 @@ so, the first branch is redirected to ei
+ second branch or a point immediately following it, depending on whether
+ the condition is known to be true or false.
+ 
+-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
++Enabled at levels @option{-O3}.
+ 
+ @item -fsplit-wide-types
+ @opindex fsplit-wide-types
+--- a/gcc/java/jvspec.c
++++ b/gcc/java/jvspec.c
+@@ -626,6 +626,7 @@ lang_specific_pre_link (void)
+      class name.  Append dummy `.c' that can be stripped by set_input so %b
+      is correct.  */ 
+   set_input (concat (main_class_name, "main.c", NULL));
++  putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack!  */
+   err = do_spec (jvgenmain_spec);
+   if (err == 0)
+     {
diff --git a/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
new file mode 100644
index 0000000..09768f5
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
@@ -0,0 +1,14 @@
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -8029,7 +8029,10 @@ getenv_spec_function (int argc, const ch
+ 
+   value = getenv (argv[0]);
+   if (!value)
+-    fatal_error ("environment variable %qs not defined", argv[0]);
++    {
++      warning (0, "environment variable %qs not defined", argv[0]);
++      value = "";
++    }
+ 
+   /* We have to escape every character of the environment variable so
+      they are not interpreted as active spec characters.  A
diff --git a/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
new file mode 100644
index 0000000..dbecef2
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
@@ -0,0 +1,11 @@
+--- a/libstdc++-v3/include/Makefile.in
++++ b/libstdc++-v3/include/Makefile.in
+@@ -1342,7 +1342,7 @@
+ 	@$(STAMP) stamp-bits
+ 
+ stamp-bits-sup: stamp-bits ${bits_sup_headers}
+-	@-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
++	@-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null
+ 	@$(STAMP) stamp-bits-sup
+ 
+ stamp-c_base: ${c_base_headers}
diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index fa5179a..8b848c2 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -7,11 +7,24 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gdb
+
+ifeq ($(CONFIG_arc),y)
+PKG_VERSION:=arc-2015.06-gdb
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2015.06-gdb/
+PKG_MD5SUM:=d318829bfd2ed62714817f0d25706825
+GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
+else
 PKG_VERSION:=7.8
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/gdb
 PKG_MD5SUM:=bd958fe9019d7c7896f29f6724a764ed
+GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
+endif
+
+HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
 
 HOST_BUILD_PARALLEL:=1
 
@@ -30,7 +43,11 @@ HOST_CONFIGURE_ARGS = \
 	--disable-tui --disable-gdbtk --without-x \
 	--without-included-gettext \
 	--enable-threads \
-	--with-expat
+	--with-expat \
+	--disable-binutils \
+	--disable-ld \
+	--disable-gas \
+	--disable-sim
 
 define Host/Install
 	mkdir -p $(TOOLCHAIN_DIR)/bin
diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
index c923bc0..27215b6 100644
--- a/toolchain/uClibc/Config.in
+++ b/toolchain/uClibc/Config.in
@@ -3,6 +3,7 @@
 choice
 	prompt "uClibc Version"
 	depends on TOOLCHAINOPTS && USE_UCLIBC
+	default UCLIBC_USE_VERSION_NG if arc
 	default UCLIBC_USE_VERSION_0_9_33
 	help
 	  Select the version of uClibc you wish to use.
@@ -10,6 +11,7 @@ choice
 	config UCLIBC_USE_VERSION_0_9_33
 		select UCLIBC_VERSION_0_9_33
 		bool "uClibc 0.9.33.2"
+		depends on !arc
 
 	config UCLIBC_USE_VERSION_NG
 		select UCLIBC_VERSION_NG
diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
index b6aa471..3ecd584 100644
--- a/toolchain/uClibc/Config.version
+++ b/toolchain/uClibc/Config.version
@@ -6,8 +6,9 @@ config UCLIBC_VERSION
 	default "0.9.33.2"
 
 config UCLIBC_VERSION_0_9_33
-	default y if !TOOLCHAINOPTS && USE_UCLIBC
+	default y if !TOOLCHAINOPTS && USE_UCLIBC && !arc
 	bool
 
 config UCLIBC_VERSION_NG
+	default y if !TOOLCHAINOPTS && USE_UCLIBC && arc
 	bool
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index 026d69d..273e477 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -32,6 +32,7 @@ HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
 include $(INCLUDE_DIR)/toolchain-build.mk
 
 UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
+		-e 's/arc.*/arc/' \
 		-e 's/i.86/i386/' \
 		-e 's/sparc.*/sparc/' \
 		-e 's/arm.*/arm/g' \
diff --git a/toolchain/uClibc/config-ng-1.0.6/arc b/toolchain/uClibc/config-ng-1.0.6/arc
new file mode 100644
index 0000000..7fb83f7
--- /dev/null
+++ b/toolchain/uClibc/config-ng-1.0.6/arc
@@ -0,0 +1,12 @@
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# COMPILE_IN_THUMB_MODE is not set
+TARGET_ARCH="arc"
+TARGET_arc=y
+CONFIG_ARC_CPU_700=y
+# CONFIG_ARC_CPU_HS is not set
+CONFIG_ARC_PAGE_SIZE_8K=y
+# CONFIG_ARC_PAGE_SIZE_16K is not set
+# CONFIG_ARC_PAGE_SIZE_4K is not set
+
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Thu Aug 27 07:03:52 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Thu, 27 Aug 2015 14:03:52 +0300
Subject: [OpenWrt-Devel] [PATCH 2/3] ARC: specify location of output elf
In-Reply-To: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
Message-ID: <1440673433-25446-3-git-send-email-abrodkin@synopsys.com>

For now on ARC we deal with vmlinux output file which is created in
the root of kernel build folder.

Once we move to uImage we'll be able to use default location in
arch/arc/boot.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
---
 include/kernel-defaults.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 24d2630..8f4cd91 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -131,6 +131,10 @@ ifeq ($(LINUX_KARCH),x86_64)
 IMAGES_DIR:=../../x86/boot
 endif
 
+ifeq ($(LINUX_KARCH),arc)
+IMAGES_DIR:=../../../
+endif
+
 define Kernel/CopyImage
 	$(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1)
 	$(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Thu Aug 27 07:03:53 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Thu, 27 Aug 2015 14:03:53 +0300
Subject: [OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC
	boards
In-Reply-To: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
Message-ID: <1440673433-25446-4-git-send-email-abrodkin@synopsys.com>

This patch introduces support of new boards with ARC cores.

 [1] Synopsys SDP board
     This is a new-generation development board from Synopsys that
     consists of base-board and CPU tile-board (which might have a real
     ASIC or FPGA with CPU image).
     It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
     etc and is intended to be used for early development of ARC-based
     products.

 [2] nSIM
     This is a virtual board implemented in Synopsys proprietary
     software simulator (even though available for free for open source
     community). This board has only serial port as a peripheral and so
     it is meant to be used for runtime testing which is especially
     useful during bring-up of new tools and platforms.
     What's also important ARC cores are very configurable so there're
     many variations of options like cache sizes, their line lengths,
     additional hardware blocks like multipliers, dividers etc. And this
     board could be used to make sure built software still runs on
     different HW configurations.

Note there's a prerequisite http://patchwork.ozlabs.org/patch/502081/

Cc: Felix Fietkau <nbd at openwrt.org>
Cc: Jo-Philipp Wich <jow at openwrt.org>
Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
---
 include/kernel.mk                                  |   2 +
 target/Config.in                                   |   9 +
 target/linux/arc/Makefile                          |  28 +
 target/linux/arc/axs10x/README                     |  19 +
 .../linux/arc/axs10x/base-files/etc/config/network |  18 +
 target/linux/arc/axs10x/base-files/etc/inittab     |   5 +
 target/linux/arc/axs10x/config-4.1                 | 127 +++
 target/linux/arc/axs10x/target.mk                  |   8 +
 target/linux/arc/image/Makefile                    |  12 +
 target/linux/arc/nsim/README                       |  19 +
 target/linux/arc/nsim/base-files/etc/inittab       |   5 +
 target/linux/arc/nsim/config-4.1                   |  88 ++
 target/linux/arc/nsim/target.mk                    |   9 +
 ...Add-support-for-AXS101-SDP-software-devel.patch | 911 +++++++++++++++++++++
 ...Tweak-DDR-port-aperture-mappings-for-perf.patch |  65 ++
 ...ARC-axs101-Add-missing-__init-annotations.patch |  71 ++
 .../0004-ARC-RIP-broken-64bit-RTSC.patch           | 186 +++++
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 +
 .../0006-ARC-axs101-support-early-8250-uart.patch  |  67 ++
 19 files changed, 1685 insertions(+)
 create mode 100644 target/linux/arc/Makefile
 create mode 100644 target/linux/arc/axs10x/README
 create mode 100644 target/linux/arc/axs10x/base-files/etc/config/network
 create mode 100644 target/linux/arc/axs10x/base-files/etc/inittab
 create mode 100644 target/linux/arc/axs10x/config-4.1
 create mode 100644 target/linux/arc/axs10x/target.mk
 create mode 100644 target/linux/arc/image/Makefile
 create mode 100644 target/linux/arc/nsim/README
 create mode 100644 target/linux/arc/nsim/base-files/etc/inittab
 create mode 100644 target/linux/arc/nsim/config-4.1
 create mode 100644 target/linux/arc/nsim/target.mk
 create mode 100644 target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch
 create mode 100644 target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch
 create mode 100644 target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch
 create mode 100644 target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch
 create mode 100644 target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 target/linux/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch

diff --git a/include/kernel.mk b/include/kernel.mk
index 6a613fe..878a366 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -64,6 +64,8 @@ ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
 else ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be ))
   LINUX_KARCH := arm64
+else ifneq (,$(findstring $(ARCH) , arceb ))
+  LINUX_KARCH := arc
 else ifneq (,$(findstring $(ARCH) , armeb ))
   LINUX_KARCH := arm
 else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
diff --git a/target/Config.in b/target/Config.in
index baae8d6..571b06e 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -100,6 +100,13 @@ config aarch64_be
 	select BIG_ENDIAN
 	bool
 
+config arc
+	bool
+
+config arceb
+	select BIG_ENDIAN
+	bool
+
 config arm
 	bool
 
@@ -179,6 +186,8 @@ config ARCH
 	string
 	default "aarch64"   if aarch64
 	default "aarch64_be" if aarch64_be
+	default "arc"       if arc
+	default "arceb"     if arceb
 	default "arm"       if arm
 	default "armeb"     if armeb
 	default "i386"      if i386
diff --git a/target/linux/arc/Makefile b/target/linux/arc/Makefile
new file mode 100644
index 0000000..ad252cb
--- /dev/null
+++ b/target/linux/arc/Makefile
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+ARCH:=arc
+BOARD:=arc
+BOARDNAME:=Synopsys DesignWare
+CFLAGS:=-Os -pipe -fno-caller-saves -matomic
+MAINTAINER:=Alexey Brodkin <abrodkin at synopsys.com>
+SUBTARGETS:=axs10x nsim
+
+KERNEL_PATCHVER:=4.1
+
+KERNELNAME:=vmlinux
+
+DEVICE_TYPE:=developerboard
+
+include $(INCLUDE_DIR)/target.mk
+
+define Target/Description
+	Synopsys DesignWare boards
+endef
+
+$(eval $(call BuildTarget))
diff --git a/target/linux/arc/axs10x/README b/target/linux/arc/axs10x/README
new file mode 100644
index 0000000..fcefeeb
--- /dev/null
+++ b/target/linux/arc/axs10x/README
@@ -0,0 +1,19 @@
+The AXS10x Platform consists of a DesignWare AXC001 CPU
+Card (with ARC 770D core) in case of AXS101 or AXC003 CPU Card
+(typically with ARC HS38 core) in case of AXS103 mounted on an
+ARC Software Development Platform Mainboard with DesignWare peripherals:
+ * SD/MMC contoller
+ * Gigabit network contoller
+ * Serial ports (8250-compatible)
+ * USB 2.0
+ * SPI
+ * I2C
+
+As of today we build vmlinux image for that board and that image
+could be loaded in board's memory via JTAG.
+
+If Digilent USB JTAG probe is used following command line could be used:
+-------->8-------
+mdb -digilent vmlinux
+-------->8-------
+
diff --git a/target/linux/arc/axs10x/base-files/etc/config/network b/target/linux/arc/axs10x/base-files/etc/config/network
new file mode 100644
index 0000000..1d46510
--- /dev/null
+++ b/target/linux/arc/axs10x/base-files/etc/config/network
@@ -0,0 +1,18 @@
+config interface 'loopback'
+        option ifname 'lo'
+        option proto 'static'
+        option ipaddr '127.0.0.1'
+        option netmask '255.0.0.0'
+
+config interface 'lan'
+        option ifname 'eth0'
+        option type 'bridge'
+        option proto 'dhcp'
+
+config interface 'wan6'
+        option ifname '@wan'
+        option proto 'dhcpv6'
+
+config globals 'globals'
+        option ula_prefix 'fdd3:b396:94ac::/48'
+
diff --git a/target/linux/arc/axs10x/base-files/etc/inittab b/target/linux/arc/axs10x/base-files/etc/inittab
new file mode 100644
index 0000000..672cbba
--- /dev/null
+++ b/target/linux/arc/axs10x/base-files/etc/inittab
@@ -0,0 +1,5 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+tts/0::askfirst:/bin/ash --login
+ttyS3::askfirst:/bin/ash --login
+tty1::askfirst:/bin/ash --login
diff --git a/target/linux/arc/axs10x/config-4.1 b/target/linux/arc/axs10x/config-4.1
new file mode 100644
index 0000000..2cd3471
--- /dev/null
+++ b/target/linux/arc/axs10x/config-4.1
@@ -0,0 +1,127 @@
+#
+# ARC Architecture Configuration
+#
+CONFIG_ARC=y
+
+#
+# ARC Platform/SoC/Board
+#
+# CONFIG_ARC_PLAT_FPGA_LEGACY is not set
+# CONFIG_ARC_PLAT_TB10X is not set
+CONFIG_ARC_PLAT_AXS10X=y
+CONFIG_AXS101=y
+
+#
+# ARC CPU Configuration
+#
+# CONFIG_ARC_CPU_750D is not set
+CONFIG_ARC_CPU_770=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+# CONFIG_SMP is not set
+CONFIG_ARC_CACHE=y
+CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_ARC_HAS_ICACHE=y
+CONFIG_ARC_HAS_DCACHE=y
+CONFIG_ARC_CACHE_PAGES=y
+# CONFIG_ARC_CACHE_VIPT_ALIASING is not set
+# CONFIG_ARC_HAS_ICCM is not set
+# CONFIG_ARC_HAS_DCCM is not set
+CONFIG_ARC_HAS_HW_MPY=y
+# CONFIG_ARC_MMU_V1 is not set
+# CONFIG_ARC_MMU_V2 is not set
+CONFIG_ARC_MMU_V3=y
+CONFIG_ARC_PAGE_SIZE_8K=y
+# CONFIG_ARC_PAGE_SIZE_16K is not set
+# CONFIG_ARC_PAGE_SIZE_4K is not set
+# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set
+# CONFIG_ARC_FPU_SAVE_RESTORE is not set
+# CONFIG_ARC_CANT_LLSC is not set
+CONFIG_ARC_CPU_REL_4_10=y
+CONFIG_ARC_HAS_LLSC=y
+CONFIG_ARC_HAS_SWAPE=y
+CONFIG_LINUX_LINK_BASE=0x80000000
+CONFIG_ARC_CURR_IN_REG=y
+# CONFIG_ARC_EMUL_UNALIGNED is not set
+CONFIG_HZ=100
+# CONFIG_ARC_METAWARE_HLINK is not set
+CONFIG_ARC_DBG=y
+CONFIG_ARC_DW2_UNWIND=y
+# CONFIG_ARC_DBG_TLB_PARANOIA is not set
+# CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
+CONFIG_ARC_BUILTIN_DTB_NAME="axs101"
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_COUNT=y
+
+#
+# Distributed Switch Architecture drivers
+#
+CONFIG_ETHERNET=y
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+CONFIG_NET_VENDOR_STMICRO=y
+CONFIG_STMMAC_ETH=y
+CONFIG_STMMAC_PLATFORM=y
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+
+#
+# MII PHY device drivers
+#
+CONFIG_PHYLIB=y
+CONFIG_NATIONAL_PHY=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_EARLYCON=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+CONFIG_SERIAL_8250_DW=y
+
+#
+# Character devices
+#
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_SUPPORT=y
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_IDMAC=y
+CONFIG_MMC_DW_PLTFM=y
+# CONFIG_MMC_DW_EXYNOS is not set
+# CONFIG_MMC_DW_K3 is not set
+
+#
+# Misc options to make OpenWRT buildsystem happy
+#
+# CONFIG_RCU_BOOST is not set
+# CONFIG_FS_DAX is not set
+# CONFIG_16KSTACKS is not set
diff --git a/target/linux/arc/axs10x/target.mk b/target/linux/arc/axs10x/target.mk
new file mode 100644
index 0000000..69c5c47
--- /dev/null
+++ b/target/linux/arc/axs10x/target.mk
@@ -0,0 +1,8 @@
+BOARDNAME:=AXS10x
+
+define Target/Description
+	Synopsys Designware SDP board.
+endef
+
+FEATURES += ramdisk usb
+DEFAULT_PACKAGES += kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci
diff --git a/target/linux/arc/image/Makefile b/target/linux/arc/image/Makefile
new file mode 100644
index 0000000..df19461
--- /dev/null
+++ b/target/linux/arc/image/Makefile
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/image.mk
+
+# use default targets for everything
+
+$(eval $(call BuildImage))
diff --git a/target/linux/arc/nsim/README b/target/linux/arc/nsim/README
new file mode 100644
index 0000000..2ab98b0
--- /dev/null
+++ b/target/linux/arc/nsim/README
@@ -0,0 +1,19 @@
+This is a simulator of pretty simple board with ARC770 CPU and
+serial port as the only peripheral.
+
+Still this is useful for runtime smoke testing.
+
+Free instance of the simulator is available here after simple registration
+and approval from Synopsys staff:
+    http://www.synopsys.com/cgi-bin/dwarcnsim/req1.cgi
+
+Once downloaded and extracted it might be executed like that:
+
+nsimdrv -prop=nsim_isa_family=a700 -prop=nsim_isa_atomic_option=1 \
+        -prop=nsim_mmu=3 -prop=icache=32768,64,2,0 -prop=dcache=32768,64,4,0 \
+        -prop=nsim_isa_dpfp=none -prop=nsim_isa_shift_option=2 \
+        -prop=nsim_isa_swap_option=1 -prop=nsim_isa_bitscan_option=1 \
+        -prop=nsim_isa_sat=1 -prop=nsim_isa_mpy32=1 \
+        -prop=nsim_isa_enable_timer_0=1 -prop=nsim_isa_enable_timer_1=1 \
+        -prop=nsim_mem-dev=uart0 vmlinux
+
diff --git a/target/linux/arc/nsim/base-files/etc/inittab b/target/linux/arc/nsim/base-files/etc/inittab
new file mode 100644
index 0000000..a855c34
--- /dev/null
+++ b/target/linux/arc/nsim/base-files/etc/inittab
@@ -0,0 +1,5 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+tts/0::askfirst:/bin/ash --login
+ttyARC0::askfirst:/bin/ash --login
+tty1::askfirst:/bin/ash --login
diff --git a/target/linux/arc/nsim/config-4.1 b/target/linux/arc/nsim/config-4.1
new file mode 100644
index 0000000..f53c763
--- /dev/null
+++ b/target/linux/arc/nsim/config-4.1
@@ -0,0 +1,88 @@
+#
+# ARC Architecture Configuration
+#
+CONFIG_ARC=y
+
+#
+# ARC Platform/SoC/Board
+#
+CONFIG_ARC_PLAT_FPGA_LEGACY=y
+# CONFIG_ARC_PLAT_TB10X is not set
+# CONFIG_ARC_PLAT_AXS10X is not set
+
+#
+# ARC CPU Configuration
+#
+# CONFIG_ARC_CPU_750D is not set
+CONFIG_ARC_CPU_770=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+# CONFIG_SMP is not set
+CONFIG_ARC_CACHE=y
+CONFIG_ARC_CACHE_LINE_SHIFT=6
+CONFIG_ARC_HAS_ICACHE=y
+CONFIG_ARC_HAS_DCACHE=y
+CONFIG_ARC_CACHE_PAGES=y
+# CONFIG_ARC_CACHE_VIPT_ALIASING is not set
+# CONFIG_ARC_HAS_ICCM is not set
+# CONFIG_ARC_HAS_DCCM is not set
+CONFIG_ARC_HAS_HW_MPY=y
+# CONFIG_ARC_MMU_V1 is not set
+# CONFIG_ARC_MMU_V2 is not set
+CONFIG_ARC_MMU_V3=y
+CONFIG_ARC_PAGE_SIZE_8K=y
+# CONFIG_ARC_PAGE_SIZE_16K is not set
+# CONFIG_ARC_PAGE_SIZE_4K is not set
+# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set
+# CONFIG_ARC_FPU_SAVE_RESTORE is not set
+# CONFIG_ARC_CANT_LLSC is not set
+CONFIG_ARC_CPU_REL_4_10=y
+CONFIG_ARC_HAS_LLSC=y
+CONFIG_ARC_HAS_SWAPE=y
+CONFIG_LINUX_LINK_BASE=0x80000000
+CONFIG_ARC_CURR_IN_REG=y
+# CONFIG_ARC_EMUL_UNALIGNED is not set
+CONFIG_HZ=100
+# CONFIG_ARC_METAWARE_HLINK is not set
+CONFIG_ARC_DBG=y
+CONFIG_ARC_DW2_UNWIND=y
+# CONFIG_ARC_DBG_TLB_PARANOIA is not set
+# CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
+CONFIG_ARC_BUILTIN_DTB_NAME="angel4"
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_COUNT=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_EARLYCON=y
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_SCCNXP is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+CONFIG_SERIAL_ARC=y
+CONFIG_SERIAL_ARC_CONSOLE=y
+CONFIG_SERIAL_ARC_NR_PORTS=1
+# CONFIG_SERIAL_FSL_LPUART is not set
+# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
+# CONFIG_TTY_PRINTK is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+
+#
+# Misc options to make OpenWRT buildsystem happy
+#
+# CONFIG_RCU_BOOST is not set
+# CONFIG_FS_DAX is not set
+# CONFIG_16KSTACKS is not set
diff --git a/target/linux/arc/nsim/target.mk b/target/linux/arc/nsim/target.mk
new file mode 100644
index 0000000..a36d98b
--- /dev/null
+++ b/target/linux/arc/nsim/target.mk
@@ -0,0 +1,9 @@
+BOARDNAME:=nSIM
+
+define Target/Description
+	Simple nSIM simulator of ARC cores.
+	Its only peripheral is serial port.
+	Useful for simple smoke-testing.
+endef
+
+FEATURES += ramdisk
\ No newline at end of file
diff --git a/target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch b/target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch
new file mode 100644
index 0000000..ce1bc21
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch
@@ -0,0 +1,911 @@
+From 0c5983abe8ead78d8f5adde75660cc05ec4b74bc Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin <abrodkin at synopsys.com>
+Date: Mon, 27 Jan 2014 14:51:34 +0100
+Subject: [PATCH 1/4] ARC: [axs101] Add support for AXS101 SDP (software
+ development platform)
+
+The AXS10x platforms consist of a mainboard with peripherals,
+on which several daughter cards can be placed. The daughter cards
+typically contain a CPU and memory.
+
+Signed-off-by: Mischa Jonker <mjonker at synopsys.com>
+Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
+Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
+---
+ Documentation/devicetree/bindings/arc/axs101.txt |   7 +
+ MAINTAINERS                                      |   7 +
+ arch/arc/Kconfig                                 |   1 +
+ arch/arc/Makefile                                |   1 +
+ arch/arc/boot/dts/axc001.dtsi                    |  79 ++++++
+ arch/arc/boot/dts/axs101.dts                     |  21 ++
+ arch/arc/boot/dts/axs10x_mb.dtsi                 | 223 +++++++++++++++++
+ arch/arc/configs/axs101_defconfig                | 111 +++++++++
+ arch/arc/plat-axs10x/Kconfig                     |  35 +++
+ arch/arc/plat-axs10x/Makefile                    |   9 +
+ arch/arc/plat-axs10x/axs10x.c                    | 298 +++++++++++++++++++++++
+ 11 files changed, 792 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/arc/axs101.txt
+ create mode 100644 arch/arc/boot/dts/axc001.dtsi
+ create mode 100644 arch/arc/boot/dts/axs101.dts
+ create mode 100644 arch/arc/boot/dts/axs10x_mb.dtsi
+ create mode 100644 arch/arc/configs/axs101_defconfig
+ create mode 100644 arch/arc/plat-axs10x/Kconfig
+ create mode 100644 arch/arc/plat-axs10x/Makefile
+ create mode 100644 arch/arc/plat-axs10x/axs10x.c
+
+diff --git a/Documentation/devicetree/bindings/arc/axs101.txt b/Documentation/devicetree/bindings/arc/axs101.txt
+new file mode 100644
+index 0000000..568aa5f
+--- /dev/null
++++ b/Documentation/devicetree/bindings/arc/axs101.txt
+@@ -0,0 +1,7 @@
++Synopsys DesignWare ARC Software Development Platforms Device Tree Bindings
++---------------------------------------------------------------------------
++
++SDP Main Board with an AXC001 CPU Card hoisting ARC700 core in silicon
++
++Required root node properties:
++    - compatible = "snps,axs101";
+diff --git a/MAINTAINERS b/MAINTAINERS
+index d8afd29..c9381f7 100644
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -9583,6 +9583,13 @@ F:	arch/arc/
+ F:	Documentation/devicetree/bindings/arc/
+ F:	drivers/tty/serial/arc_uart.c
+ 
++SYNOPSYS ARC SDP platform support
++M:	Alexey Brodkin <abrodkin at synopsys.com>
++S:	Supported
++F:	arch/arc/plat-axs10x
++F:	arch/arc/boot/dts/ax*
++F:	Documentation/devicetree/bindings/arc/axs10*
++
+ SYSV FILESYSTEM
+ M:	Christoph Hellwig <hch at infradead.org>
+ S:	Maintained
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
+index df94ac1..13d4c26 100644
+--- a/arch/arc/Kconfig
++++ b/arch/arc/Kconfig
+@@ -83,6 +83,7 @@ menu "ARC Platform/SoC/Board"
+ 
+ source "arch/arc/plat-arcfpga/Kconfig"
+ source "arch/arc/plat-tb10x/Kconfig"
++source "arch/arc/plat-axs10x/Kconfig"
+ #New platform adds here
+ 
+ endmenu
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile
+index db72fec..562ac7d 100644
+--- a/arch/arc/Makefile
++++ b/arch/arc/Makefile
+@@ -83,6 +83,7 @@ core-y		+= arch/arc/boot/dts/
+ 
+ core-$(CONFIG_ARC_PLAT_FPGA_LEGACY)	+= arch/arc/plat-arcfpga/
+ core-$(CONFIG_ARC_PLAT_TB10X)		+= arch/arc/plat-tb10x/
++core-$(CONFIG_ARC_PLAT_AXS10X)		+= arch/arc/plat-axs10x/
+ 
+ drivers-$(CONFIG_OPROFILE)	+= arch/arc/oprofile/
+ 
+diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi
+new file mode 100644
+index 0000000..6990ca4
+--- /dev/null
++++ b/arch/arc/boot/dts/axc001.dtsi
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++ *
++ * 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.
++ */
++
++/*
++ * Device tree for AXC001 770D/EM6/AS221 CPU card
++ * Note that this file only supports the 770D CPU
++ */
++
++/ {
++	compatible = "snps,arc";
++	clock-frequency = <750000000>;	/* 750 MHZ */
++	#address-cells = <1>;
++	#size-cells = <1>;
++
++	cpu_card {
++		compatible = "simple-bus";
++		#address-cells = <1>;
++		#size-cells = <1>;
++
++		ranges = <0x00000000 0xf0000000 0x10000000>;
++
++		cpu_intc: arc700-intc at cpu {
++			compatible = "snps,arc700-intc";
++			interrupt-controller;
++			#interrupt-cells = <1>;
++		};
++
++		/*
++		 * this GPIO block ORs all interrupts on CPU card (creg,..)
++		 * to uplink only 1 IRQ to ARC core intc
++		 */
++		dw-apb-gpio at 0x2000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = < 0x2000 0x80 >;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			ictl_intc: gpio-controller at 0 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <30>;
++				reg = <0>;
++				interrupt-controller;
++				#interrupt-cells = <2>;
++				interrupt-parent = <&cpu_intc>;
++				interrupts = <15>;
++			};
++		};
++
++		debug_uart: dw-apb-uart at 0x5000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x5000 0x100>;
++			clock-frequency = <33333000>;
++			interrupt-parent = <&ictl_intc>;
++			interrupts = <19 4>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		arcpmu0: pmu {
++			compatible = "snps,arc700-pct";
++		};
++	};
++
++	memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges = <0x00000000 0x80000000 0x40000000>;
++		device_type = "memory";
++		reg = <0x00000000 0x20000000>;	/* 512MiB */
++	};
++};
+diff --git a/arch/arc/boot/dts/axs101.dts b/arch/arc/boot/dts/axs101.dts
+new file mode 100644
+index 0000000..6c3391d
+--- /dev/null
++++ b/arch/arc/boot/dts/axs101.dts
+@@ -0,0 +1,21 @@
++/*
++ * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++ *
++ * ARC AXS101 S/W development platform
++ *
++ * 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.
++ */
++/dts-v1/;
++
++/include/ "axc001.dtsi"
++/include/ "axs10x_mb.dtsi"
++
++/ {
++	compatible = "snps,axs101";
++
++	chosen {
++		bootargs = "console=tty0 console=ttyS3,115200n8 consoleblank=0";
++	};
++};
+diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
+new file mode 100644
+index 0000000..255c712
+--- /dev/null
++++ b/arch/arc/boot/dts/axs10x_mb.dtsi
+@@ -0,0 +1,223 @@
++/*
++ * Support for peripherals on the AXS10x mainboard
++ *
++ * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++ *
++ * 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.
++ */
++
++/ {
++	axs10x_mb {
++		compatible = "simple-bus";
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges = <0x00000000 0xe0000000 0x10000000>;
++		interrupt-parent = <&mb_intc>;
++
++		clocks {
++			i2cclk: i2cclk {
++				compatible = "fixed-clock";
++				clock-frequency = <50000000>;
++				#clock-cells = <0>;
++			};
++
++			apbclk: apbclk {
++				compatible = "fixed-clock";
++				clock-frequency = <50000000>;
++				#clock-cells = <0>;
++			};
++
++			mmcclk: mmcclk {
++				compatible = "fixed-clock";
++				clock-frequency = <50000000>;
++				#clock-cells = <0>;
++			};
++		};
++
++		/*
++		 * This INTC is actually connected to DW APB GPIO
++		 * which acts as a wire between MB INTC and CPU INTC.
++		 * GPIO INTC is configured in platform init code
++		 * and here we mimic direct connection from MB INTC to
++		 * CPU INTC, thus we set "interrupts = <7>" instead of
++		 * "interrupts = <12>"
++		 */
++		mb_intc: dw-apb-ictl at 0x12000 {
++			#interrupt-cells = <1>;
++			compatible = "snps,dw-apb-ictl";
++			reg = < 0x12000 0x200 >;
++			interrupt-controller;
++			interrupt-parent = <&cpu_intc>;
++			interrupts = < 7 >;
++		};
++
++		ethernet at 0x18000 {
++			#interrupt-cells = <1>;
++			compatible = "snps,dwmac";
++			reg = < 0x18000 0x2000 >;
++			interrupts = < 4 >;
++			interrupt-names = "macirq";
++			phy-mode = "rgmii";
++			snps,pbl = < 32 >;
++			clocks = <&apbclk>;
++			clock-names = "stmmaceth";
++		};
++
++		ehci at 0x40000 {
++			compatible = "generic-ehci";
++			reg = < 0x40000 0x100 >;
++			interrupts = < 8 >;
++		};
++
++		ohci at 0x60000 {
++			compatible = "generic-ohci";
++			reg = < 0x60000 0x100 >;
++			interrupts = < 8 >;
++		};
++
++		mmc at 0x15000 {
++			compatible = "snps,dw-mshc";
++			reg = < 0x15000 0x400 >;
++			num-slots = < 1 >;
++			fifo-depth = < 16 >;
++			card-detect-delay = < 200 >;
++			clocks = <&apbclk>, <&mmcclk>;
++			clock-names = "biu", "ciu";
++			interrupts = < 7 >;
++			bus-width = < 4 >;
++		};
++
++		uart at 0x20000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x20000 0x100>;
++			clock-frequency = <33333333>;
++			interrupts = <17>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		uart at 0x21000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x21000 0x100>;
++			clock-frequency = <33333333>;
++			interrupts = <18>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		/* UART muxed with USB data port (ttyS3) */
++		uart at 0x22000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x22000 0x100>;
++			clock-frequency = <33333333>;
++			interrupts = <19>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		i2c at 0x1d000 {
++			compatible = "snps,designware-i2c";
++			reg = <0x1d000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <14>;
++		};
++
++		i2c at 0x1e000 {
++			compatible = "snps,designware-i2c";
++			reg = <0x1e000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <15>;
++		};
++
++		i2c at 0x1f000 {
++			compatible = "snps,designware-i2c";
++			#address-cells = <1>;
++			#size-cells = <0>;
++			reg = <0x1f000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <16>;
++
++			eeprom at 0x54{
++				compatible = "24c01";
++				reg = <0x54>;
++				pagesize = <0x8>;
++			};
++
++			eeprom at 0x57{
++				compatible = "24c04";
++				reg = <0x57>;
++				pagesize = <0x8>;
++			};
++		};
++
++		gpio0:gpio at 13000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = <0x13000 0x1000>;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			gpio0_banka: gpio-controller at 0 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <32>;
++				reg = <0>;
++			};
++
++			gpio0_bankb: gpio-controller at 1 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <8>;
++				reg = <1>;
++			};
++
++			gpio0_bankc: gpio-controller at 2 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <8>;
++				reg = <2>;
++			};
++		};
++
++		gpio1:gpio at 14000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = <0x14000 0x1000>;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			gpio1_banka: gpio-controller at 0 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <30>;
++				reg = <0>;
++			};
++
++			gpio1_bankb: gpio-controller at 1 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <10>;
++				reg = <1>;
++			};
++
++			gpio1_bankc: gpio-controller at 2 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <8>;
++				reg = <2>;
++			};
++		};
++	};
++};
+diff --git a/arch/arc/configs/axs101_defconfig b/arch/arc/configs/axs101_defconfig
+new file mode 100644
+index 0000000..562dac6
+--- /dev/null
++++ b/arch/arc/configs/axs101_defconfig
+@@ -0,0 +1,111 @@
++CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
++CONFIG_DEFAULT_HOSTNAME="ARCLinux"
++# CONFIG_SWAP is not set
++CONFIG_SYSVIPC=y
++CONFIG_POSIX_MQUEUE=y
++# CONFIG_CROSS_MEMORY_ATTACH is not set
++CONFIG_NO_HZ_IDLE=y
++CONFIG_HIGH_RES_TIMERS=y
++CONFIG_IKCONFIG=y
++CONFIG_IKCONFIG_PROC=y
++CONFIG_NAMESPACES=y
++# CONFIG_UTS_NS is not set
++# CONFIG_PID_NS is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE="../arc_initramfs/"
++CONFIG_EMBEDDED=y
++CONFIG_PERF_EVENTS=y
++# CONFIG_VM_EVENT_COUNTERS is not set
++# CONFIG_SLUB_DEBUG is not set
++# CONFIG_COMPAT_BRK is not set
++CONFIG_MODULES=y
++CONFIG_PARTITION_ADVANCED=y
++CONFIG_ARC_PLAT_AXS10X=y
++CONFIG_AXS101=y
++CONFIG_ARC_CACHE_LINE_SHIFT=5
++CONFIG_ARC_BUILTIN_DTB_NAME="axs101"
++CONFIG_PREEMPT=y
++# CONFIG_COMPACTION is not set
++CONFIG_NET=y
++CONFIG_PACKET=y
++CONFIG_UNIX=y
++CONFIG_NET_KEY=y
++CONFIG_INET=y
++CONFIG_IP_PNP=y
++CONFIG_IP_PNP_DHCP=y
++CONFIG_IP_PNP_BOOTP=y
++CONFIG_IP_PNP_RARP=y
++# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
++# CONFIG_INET_XFRM_MODE_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_BEET is not set
++# CONFIG_IPV6 is not set
++# CONFIG_STANDALONE is not set
++# CONFIG_PREVENT_FIRMWARE_BUILD is not set
++# CONFIG_FIRMWARE_IN_KERNEL is not set
++CONFIG_SCSI=y
++CONFIG_BLK_DEV_SD=y
++CONFIG_NETDEVICES=y
++# CONFIG_NET_VENDOR_ARC is not set
++# CONFIG_NET_VENDOR_BROADCOM is not set
++# CONFIG_NET_VENDOR_INTEL is not set
++# CONFIG_NET_VENDOR_MARVELL is not set
++# CONFIG_NET_VENDOR_MICREL is not set
++# CONFIG_NET_VENDOR_NATSEMI is not set
++# CONFIG_NET_VENDOR_SEEQ is not set
++CONFIG_STMMAC_ETH=y
++# CONFIG_NET_VENDOR_VIA is not set
++# CONFIG_NET_VENDOR_WIZNET is not set
++CONFIG_NATIONAL_PHY=y
++# CONFIG_USB_NET_DRIVERS is not set
++CONFIG_INPUT_EVDEV=y
++CONFIG_MOUSE_PS2_TOUCHKIT=y
++CONFIG_MOUSE_SERIAL=y
++CONFIG_MOUSE_SYNAPTICS_USB=y
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_DEVKMEM is not set
++CONFIG_SERIAL_8250=y
++CONFIG_SERIAL_8250_CONSOLE=y
++CONFIG_SERIAL_8250_DW=y
++CONFIG_SERIAL_OF_PLATFORM=y
++# CONFIG_HW_RANDOM is not set
++CONFIG_I2C=y
++CONFIG_I2C_CHARDEV=y
++CONFIG_I2C_DESIGNWARE_PLATFORM=y
++# CONFIG_HWMON is not set
++CONFIG_FB=y
++# CONFIG_VGA_CONSOLE is not set
++CONFIG_FRAMEBUFFER_CONSOLE=y
++CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
++CONFIG_LOGO=y
++# CONFIG_LOGO_LINUX_MONO is not set
++# CONFIG_LOGO_LINUX_VGA16 is not set
++# CONFIG_LOGO_LINUX_CLUT224 is not set
++CONFIG_USB_EHCI_HCD=y
++CONFIG_USB_EHCI_HCD_PLATFORM=y
++CONFIG_USB_OHCI_HCD=y
++CONFIG_USB_OHCI_HCD_PLATFORM=y
++CONFIG_USB_STORAGE=y
++CONFIG_MMC=y
++CONFIG_MMC_SDHCI=y
++CONFIG_MMC_SDHCI_PLTFM=y
++CONFIG_MMC_DW=y
++CONFIG_MMC_DW_IDMAC=y
++# CONFIG_IOMMU_SUPPORT is not set
++CONFIG_EXT3_FS=y
++CONFIG_EXT4_FS=y
++CONFIG_MSDOS_FS=y
++CONFIG_VFAT_FS=y
++CONFIG_NTFS_FS=y
++CONFIG_TMPFS=y
++CONFIG_JFFS2_FS=y
++CONFIG_NFS_FS=y
++CONFIG_NLS_CODEPAGE_437=y
++CONFIG_NLS_ISO8859_1=y
++# CONFIG_ENABLE_WARN_DEPRECATED is not set
++# CONFIG_ENABLE_MUST_CHECK is not set
++CONFIG_STRIP_ASM_SYMS=y
++CONFIG_LOCKUP_DETECTOR=y
++CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
++# CONFIG_SCHED_DEBUG is not set
++# CONFIG_DEBUG_PREEMPT is not set
++# CONFIG_FTRACE is not set
+diff --git a/arch/arc/plat-axs10x/Kconfig b/arch/arc/plat-axs10x/Kconfig
+new file mode 100644
+index 0000000..45641ca
+--- /dev/null
++++ b/arch/arc/plat-axs10x/Kconfig
+@@ -0,0 +1,35 @@
++#
++# Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++#
++# 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.
++#
++
++config ARC_PLAT_AXS10X
++	bool "Synopsys ARC AXS10x Software Development Platforms"
++	select DW_APB_ICTL
++	select GPIO_DWAPB
++	select OF_GPIO
++	select GENERIC_IRQ_CHIP
++	select ARCH_REQUIRE_GPIOLIB
++	help
++	  Support for the ARC AXS10x Software Development Platforms.
++
++	  The AXS10x Platforms consist of a mainboard with peripherals,
++	  on which several daughter cards can be placed. The daughter cards
++	  typically contain a CPU and memory.
++
++if ARC_PLAT_AXS10X
++
++config AXS101
++	bool "AXS101 with AXC001 CPU Card (ARC 770D/EM6/AS221)"
++	help
++	  This adds support for the 770D/EM6/AS221 CPU Card. Only the ARC
++	  770D is supported in Linux.
++
++	  The AXS101 Platform consists of an AXS10x mainboard with
++	  this daughtercard. Please use the axs101.dts device tree
++	  with this configuration.
++
++endif
+diff --git a/arch/arc/plat-axs10x/Makefile b/arch/arc/plat-axs10x/Makefile
+new file mode 100644
+index 0000000..d4748f2
+--- /dev/null
++++ b/arch/arc/plat-axs10x/Makefile
+@@ -0,0 +1,9 @@
++#
++# Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++#
++# 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.
++#
++
++obj-$(CONFIG_ARC_PLAT_AXS10X) += axs10x.o
+diff --git a/arch/arc/plat-axs10x/axs10x.c b/arch/arc/plat-axs10x/axs10x.c
+new file mode 100644
+index 0000000..2e7686d
+--- /dev/null
++++ b/arch/arc/plat-axs10x/axs10x.c
+@@ -0,0 +1,298 @@
++/*
++ * AXS101 Software Development Platform
++ *
++ * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++ *
++ * 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.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ */
++
++#include <linux/of_platform.h>
++#include <asm/mach_desc.h>
++#include <asm/io.h>
++
++#define AXS_MB_CGU		0xE0010000
++#define AXS_MB_CREG		0xE0011000
++
++#define CREG_MB_IRQ_MUX		(AXS_MB_CREG + 0x214)
++#define CREG_MB_SW_RESET	(AXS_MB_CREG + 0x220)
++#define CREG_MB_VER		(AXS_MB_CREG + 0x230)
++#define CREG_MB_CONFIG		(AXS_MB_CREG + 0x234)
++
++#define AXC001_CREG		0xF0001000
++#define AXC001_GPIO_INTC	0xF0003000
++
++#define CREG_CPU_ADDR_770	(AXC001_CREG + 0x20)
++#define CREG_CPU_ADDR_TUNN	(AXC001_CREG + 0x60)
++#define CREG_CPU_ADDR_770_UPD	(AXC001_CREG + 0x34)
++#define CREG_CPU_ADDR_TUNN_UPD	(AXC001_CREG + 0x74)
++
++#define CREG_CPU_ARC770_IRQ_MUX	(AXC001_CREG + 0x114)
++#define CREG_CPU_GPIO_UART_MUX	(AXC001_CREG + 0x120)
++
++static void enable_gpio_intc_wire(void)
++{
++	/*
++	 * Peripherals on CPU Card and Mother Board are wired to cpu intc via
++	 * intermediate DW APB GPIO blocks (mainly for debouncing)
++	 *
++	 *         ---------------------
++	 *        |  snps,arc700-intc |
++	 *        ---------------------
++	 *          | #7          | #15
++	 * -------------------   -------------------
++	 * | snps,dw-apb-gpio |  | snps,dw-apb-gpio |
++	 * -------------------   -------------------
++	 *        |                         |
++	 *        |                 [ Debug UART on cpu card ]
++	 *        |
++	 * ------------------------
++	 * | snps,dw-apb-intc (MB)|
++	 * ------------------------
++	 *  |      |       |      |
++	 * [eth] [uart]        [... other perip on Main Board]
++	 *
++	 * Current implementation of "irq-dw-apb-ictl" driver doesn't work well
++	 * with stacked INTCs. In particular problem happens if its master INTC
++	 * not yet instantiated. See discussion here -
++	 * https://lkml.org/lkml/2015/3/4/755
++	 *
++	 * So setup the first gpio block as a passive pass thru and hide it from
++	 * DT hardware topology - connect MB intc directly to cpu intc
++	 * The GPIO "wire" needs to be init nevertheless (here)
++	 *
++	 * One side adv is that peripheral interrupt handling avoids one nested
++	 * intc ISR hop
++	 */
++#define GPIO_INTEN		(AXC001_GPIO_INTC + 0x30)
++#define GPIO_INTMASK		(AXC001_GPIO_INTC + 0x34)
++#define GPIO_INTTYPE_LEVEL	(AXC001_GPIO_INTC + 0x38)
++#define GPIO_INT_POLARITY	(AXC001_GPIO_INTC + 0x3c)
++#define MB_TO_GPIO_IRQ		12
++
++	iowrite32(~(1 << MB_TO_GPIO_IRQ), (void __iomem *) GPIO_INTMASK);
++	iowrite32(0, (void __iomem *) GPIO_INTTYPE_LEVEL);
++	iowrite32(~0, (void __iomem *) GPIO_INT_POLARITY);
++	iowrite32(1 << MB_TO_GPIO_IRQ, (void __iomem *) GPIO_INTEN);
++}
++
++static void axs10x_print_board_ver(unsigned int creg, const char *str)
++{
++	union ver {
++		struct {
++#ifdef CONFIG_CPU_BIG_ENDIAN
++			unsigned int pad:11, y:12, m:4, d:5;
++#else
++			unsigned int d:5, m:4, y:12, pad:11;
++#endif
++		};
++		unsigned int val;
++	} board;
++
++	board.val = ioread32((void __iomem *)creg);
++	pr_info("AXS: %s FPGA Date: %u-%u-%u\n", str, board.d, board.m,
++		board.y);
++}
++
++static void axs10x_early_init(void)
++{
++	int mb_rev;
++	char mb[32];
++
++	/* Determine motherboard version */
++	if (ioread32((void __iomem *) CREG_MB_CONFIG) & (1 << 28))
++		mb_rev = 3;	/* HT-3 (rev3.0) */
++	else
++		mb_rev = 2;	/* HT-2 (rev2.0) */
++
++	enable_gpio_intc_wire();
++
++	scnprintf(mb, 32, "MainBoard v%d", mb_rev);
++	axs10x_print_board_ver(CREG_MB_VER, mb);
++}
++
++/*
++ * Set up System Memory Map for ARC cpu / peripherals controllers
++ *
++ * Each AXI master has a 4GB memory map specified as 16 apertures of 256MB, each
++ * of which maps to a corresponding 256MB aperture in Target slave memory map.
++ *
++ * e.g. ARC cpu AXI Master's aperture 8 (0x8000_0000) is mapped to aperture 0
++ * (0x0000_0000) of DDR Port 0 (slave #1)
++ *
++ * Access from cpu to MB controllers such as GMAC is setup using AXI Tunnel:
++ * which has master/slaves on both ends.
++ * e.g. aperture 14 (0xE000_0000) of ARC cpu is mapped to aperture 14
++ * (0xE000_0000) of CPU Card AXI Tunnel slave (slave #3) which is mapped to
++ * MB AXI Tunnel Master, which also has a mem map setup
++ *
++ * In the reverse direction, MB AXI Masters (e.g. GMAC) mem map is setup
++ * to map to MB AXI Tunnel slave which connects to CPU Card AXI Tunnel Master
++ */
++struct aperture {
++	unsigned int slave_sel:4, slave_off:4, pad:24;
++};
++
++/* CPU Card target slaves */
++#define AXC001_SLV_NONE			0
++#define AXC001_SLV_DDR_PORT0		1
++#define AXC001_SLV_SRAM			2
++#define AXC001_SLV_AXI_TUNNEL		3
++#define AXC001_SLV_AXI2APB		6
++#define AXC001_SLV_DDR_PORT1		7
++
++/* MB AXI Target slaves */
++#define AXS_MB_SLV_NONE			0
++#define AXS_MB_SLV_AXI_TUNNEL_CPU	1
++#define AXS_MB_SLV_AXI_TUNNEL_HAPS	2
++#define AXS_MB_SLV_SRAM			3
++#define AXS_MB_SLV_CONTROL		4
++
++/* MB AXI masters */
++#define AXS_MB_MST_TUNNEL_CPU		0
++#define AXS_MB_MST_USB_OHCI		10
++
++/*
++ * memmap for ARC core on CPU Card
++ */
++static const struct aperture axc001_memmap[16] = {
++	{AXC001_SLV_AXI_TUNNEL,		0x0},
++	{AXC001_SLV_AXI_TUNNEL,		0x1},
++	{AXC001_SLV_SRAM,		0x0}, /* 0x2000_0000: Local SRAM */
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_DDR_PORT0,		0x0}, /* 0x8000_0000: DDR   0..256M */
++	{AXC001_SLV_DDR_PORT0,		0x1}, /* 0x9000_0000: DDR 256..512M */
++	{AXC001_SLV_DDR_PORT1,		0x0},
++	{AXC001_SLV_DDR_PORT1,		0x1},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_AXI_TUNNEL,		0xD},
++	{AXC001_SLV_AXI_TUNNEL,		0xE}, /* MB: CREG, CGU... */
++	{AXC001_SLV_AXI2APB,		0x0}, /* CPU Card local CREG, CGU... */
++};
++
++/*
++ * memmap for CPU Card AXI Tunnel Master (for access by MB controllers)
++ * GMAC (MB) -> MB AXI Tunnel slave -> CPU Card AXI Tunnel Master -> DDR
++ */
++static const struct aperture axc001_axi_tunnel_memmap[16] = {
++	{AXC001_SLV_AXI_TUNNEL,		0x0},
++	{AXC001_SLV_AXI_TUNNEL,		0x1},
++	{AXC001_SLV_SRAM,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_DDR_PORT0,		0x0},
++	{AXC001_SLV_DDR_PORT0,		0x1},
++	{AXC001_SLV_DDR_PORT1,		0x0},
++	{AXC001_SLV_DDR_PORT1,		0x1},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_AXI_TUNNEL,		0xD},
++	{AXC001_SLV_AXI_TUNNEL,		0xE},
++	{AXC001_SLV_AXI2APB,		0x0},
++};
++
++/*
++ * memmap for MB AXI Masters
++ * Same mem map for all perip controllers as well as MB AXI Tunnel Master
++ */
++static const struct aperture axs_mb_memmap[16] = {
++	{AXS_MB_SLV_SRAM,		0x0},
++	{AXS_MB_SLV_SRAM,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0x8},	/* DDR on CPU Card */
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0x9},	/* DDR on CPU Card */
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0xA},
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0xB},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_AXI_TUNNEL_HAPS,	0xD},
++	{AXS_MB_SLV_CONTROL,		0x0},	/* MB Local CREG, CGU... */
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0xF},
++};
++
++static noinline void
++axs101_set_memmap(void __iomem *base, const struct aperture map[16])
++{
++	unsigned int slave_select, slave_offset;
++	int i;
++
++	slave_select = slave_offset = 0;
++	for (i = 0; i < 8; i++) {
++		slave_select |= map[i].slave_sel << (i << 2);
++		slave_offset |= map[i].slave_off << (i << 2);
++	}
++
++	iowrite32(slave_select, base + 0x0);	/* SLV0 */
++	iowrite32(slave_offset, base + 0x8);	/* OFFSET0 */
++
++	slave_select = slave_offset = 0;
++	for (i = 0; i < 8; i++) {
++		slave_select |= map[i+8].slave_sel << (i << 2);
++		slave_offset |= map[i+8].slave_off << (i << 2);
++	}
++
++	iowrite32(slave_select, base + 0x4);	/* SLV1 */
++	iowrite32(slave_offset, base + 0xC);	/* OFFSET1 */
++}
++
++static void axs101_early_init(void)
++{
++	int i;
++
++	/* ARC 770D memory view */
++	axs101_set_memmap((void __iomem *) CREG_CPU_ADDR_770, axc001_memmap);
++	iowrite32(1, (void __iomem *) CREG_CPU_ADDR_770_UPD);
++
++	/* AXI tunnel memory map (incoming traffic from MB into CPU Card */
++	axs101_set_memmap((void __iomem *) CREG_CPU_ADDR_TUNN,
++			      axc001_axi_tunnel_memmap);
++	iowrite32(1, (void __iomem *) CREG_CPU_ADDR_TUNN_UPD);
++
++	/* MB peripherals memory map */
++	for (i = AXS_MB_MST_TUNNEL_CPU; i <= AXS_MB_MST_USB_OHCI; i++)
++		axs101_set_memmap((void __iomem *) AXS_MB_CREG + (i << 4),
++				      axs_mb_memmap);
++
++	iowrite32(0x3ff, (void __iomem *) AXS_MB_CREG + 0x100); /* Update */
++
++	/* GPIO pins 18 and 19 are used as UART rx and tx, respectively. */
++	iowrite32(0x01, (void __iomem *) CREG_CPU_GPIO_UART_MUX);
++
++	/* Set up the MB interrupt system: mux interrupts to GPIO7) */
++	iowrite32(0x01, (void __iomem *) CREG_MB_IRQ_MUX);
++
++	/* reset ethernet and ULPI interfaces */
++	iowrite32(0x18, (void __iomem *) CREG_MB_SW_RESET);
++
++	/* map GPIO 14:10 to ARC 9:5 (IRQ mux change for MB v2 onwards) */
++	iowrite32(0x52, (void __iomem *) CREG_CPU_ARC770_IRQ_MUX);
++
++	axs10x_early_init();
++}
++
++static const char *axs101_compat[] __initconst = {
++	"snps,axs101",
++	NULL,
++};
++
++MACHINE_START(AXS101, "axs101")
++	.dt_compat	= axs101_compat,
++	.init_early	= axs101_early_init,
++MACHINE_END
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch b/target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch
new file mode 100644
index 0000000..171000c
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch
@@ -0,0 +1,65 @@
+From c38cc2a321a9cd2dfbd6be45c85e7bd4ea11febd Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta at synopsys.com>
+Date: Tue, 27 May 2014 19:27:37 +0530
+Subject: [PATCH 2/4] ARC: [axs101] Tweak DDR port aperture mappings for
+ performance
+
+Route all MB originated traffic to DDR Port 1 and keep Port 0 for CPU
+traffic only
+
+Basic system parameters
+--------------------------------------------------------------------------------------
+        Host                 OS Description 				Mhz  tlb   cache  mem   scal
+                                                			    pages  line   par   load
+                                                      				   bytes
+----------------- ------------- --------------------------------------- ---- ----- ----- ------ ----
+axs101-sd-2-new-f Linux 3.13.0+ axs101-sd-2-new-fw-old-img-rerun    	739  	8    32 1.1100    1
+axs101-sd-3-arc-3 Linux 3.13.9+ axs101-sd-3-arc-3.13-tip-regression 	735  	8    32 1.1000    1
+axs101-sd-9-diffe Linux 3.13.11 axs101-sd-9-different-tweak         	740  	8    32 1.0000    1
+
+Processor, Processes - times in microseconds - smaller is better
+------------------------------------------------------------------------------
+Host                 OS  Mhz null null      open slct sig  sig  fork exec sh
+                             call  I/O stat clos TCP  inst hndl proc proc proc
+--------- ------------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+axs101-sd Linux 3.13.0+  739 0.50 0.88 5.38 14.6 34.1 0.92 5.18 2135 6555 12.K
+axs101-sd Linux 3.13.9+  735 0.50 0.90 5.89 19.2 81.4 0.94 4.08 2560 8559 15.K
+axs101-sd Linux 3.13.11  740 0.50 0.88 4.45 17.8 34.4 0.94 3.25 2052 6493 12.K
+                                                 ^^^^                     ^^^^
+
+Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
+---
+ arch/arc/plat-axs10x/axs10x.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arc/plat-axs10x/axs10x.c b/arch/arc/plat-axs10x/axs10x.c
+index 2e7686d..759a7a1 100644
+--- a/arch/arc/plat-axs10x/axs10x.c
++++ b/arch/arc/plat-axs10x/axs10x.c
+@@ -173,8 +173,8 @@ static const struct aperture axc001_memmap[16] = {
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_DDR_PORT0,		0x0}, /* 0x8000_0000: DDR   0..256M */
+ 	{AXC001_SLV_DDR_PORT0,		0x1}, /* 0x9000_0000: DDR 256..512M */
+-	{AXC001_SLV_DDR_PORT1,		0x0},
+-	{AXC001_SLV_DDR_PORT1,		0x1},
++	{AXC001_SLV_DDR_PORT0,		0x2},
++	{AXC001_SLV_DDR_PORT0,		0x3},
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_AXI_TUNNEL,		0xD},
+ 	{AXC001_SLV_AXI_TUNNEL,		0xE}, /* MB: CREG, CGU... */
+@@ -194,10 +194,10 @@ static const struct aperture axc001_axi_tunnel_memmap[16] = {
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_NONE,		0x0},
+-	{AXC001_SLV_DDR_PORT0,		0x0},
+-	{AXC001_SLV_DDR_PORT0,		0x1},
+ 	{AXC001_SLV_DDR_PORT1,		0x0},
+ 	{AXC001_SLV_DDR_PORT1,		0x1},
++	{AXC001_SLV_DDR_PORT1,		0x2},
++	{AXC001_SLV_DDR_PORT1,		0x3},
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_AXI_TUNNEL,		0xD},
+ 	{AXC001_SLV_AXI_TUNNEL,		0xE},
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch b/target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch
new file mode 100644
index 0000000..7bf28de
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch
@@ -0,0 +1,71 @@
+From f6fddfaa10c334281744258a7b7056539c3fa518 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta at synopsys.com>
+Date: Sun, 7 Jun 2015 11:17:34 +0530
+Subject: [PATCH 3/4] ARC: [axs101] Add missing __init annotations
+
+Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
+---
+ arch/arc/plat-axs10x/axs10x.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arc/plat-axs10x/axs10x.c b/arch/arc/plat-axs10x/axs10x.c
+index 759a7a1..a1cecda 100644
+--- a/arch/arc/plat-axs10x/axs10x.c
++++ b/arch/arc/plat-axs10x/axs10x.c
+@@ -37,7 +37,7 @@
+ #define CREG_CPU_ARC770_IRQ_MUX	(AXC001_CREG + 0x114)
+ #define CREG_CPU_GPIO_UART_MUX	(AXC001_CREG + 0x120)
+ 
+-static void enable_gpio_intc_wire(void)
++static void __init axs10x_enable_gpio_intc_wire(void)
+ {
+ 	/*
+ 	 * Peripherals on CPU Card and Mother Board are wired to cpu intc via
+@@ -83,7 +83,7 @@ static void enable_gpio_intc_wire(void)
+ 	iowrite32(1 << MB_TO_GPIO_IRQ, (void __iomem *) GPIO_INTEN);
+ }
+ 
+-static void axs10x_print_board_ver(unsigned int creg, const char *str)
++static void __init axs10x_print_board_ver(unsigned int creg, const char *str)
+ {
+ 	union ver {
+ 		struct {
+@@ -101,7 +101,7 @@ static void axs10x_print_board_ver(unsigned int creg, const char *str)
+ 		board.y);
+ }
+ 
+-static void axs10x_early_init(void)
++static void __init axs10x_early_init(void)
+ {
+ 	int mb_rev;
+ 	char mb[32];
+@@ -112,7 +112,7 @@ static void axs10x_early_init(void)
+ 	else
+ 		mb_rev = 2;	/* HT-2 (rev2.0) */
+ 
+-	enable_gpio_intc_wire();
++	axs10x_enable_gpio_intc_wire();
+ 
+ 	scnprintf(mb, 32, "MainBoard v%d", mb_rev);
+ 	axs10x_print_board_ver(CREG_MB_VER, mb);
+@@ -227,7 +227,7 @@ static const struct aperture axs_mb_memmap[16] = {
+ 	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0xF},
+ };
+ 
+-static noinline void
++static noinline void __init
+ axs101_set_memmap(void __iomem *base, const struct aperture map[16])
+ {
+ 	unsigned int slave_select, slave_offset;
+@@ -252,7 +252,7 @@ axs101_set_memmap(void __iomem *base, const struct aperture map[16])
+ 	iowrite32(slave_offset, base + 0xC);	/* OFFSET1 */
+ }
+ 
+-static void axs101_early_init(void)
++static void __init axs101_early_init(void)
+ {
+ 	int i;
+ 
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch b/target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch
new file mode 100644
index 0000000..0b4dc9f
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch
@@ -0,0 +1,186 @@
+From e7bb2d5eca38f10aa9c49506ede6f8736d89d038 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta at synopsys.com>
+Date: Sat, 7 Mar 2015 17:06:09 +0530
+Subject: [PATCH 4/4] ARC: RIP broken 64bit RTSC
+
+Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
+---
+ arch/arc/Kconfig                    |  6 -----
+ arch/arc/Makefile                   |  2 +-
+ arch/arc/configs/nsim_700_defconfig |  1 -
+ arch/arc/configs/nsimosci_defconfig |  1 -
+ arch/arc/configs/tb10x_defconfig    |  1 -
+ arch/arc/kernel/setup.c             |  8 ++----
+ arch/arc/kernel/time.c              | 49 +------------------------------------
+ 7 files changed, 4 insertions(+), 64 deletions(-)
+
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
+index 13d4c26..cf96ef2 100644
+--- a/arch/arc/Kconfig
++++ b/arch/arc/Kconfig
+@@ -324,12 +324,6 @@ config ARC_HAS_SWAPE
+ 	default y
+ 	depends on ARC_CPU_REL_4_10
+ 
+-config ARC_HAS_RTSC
+-	bool "Insn: RTSC (64-bit r/o cycle counter)"
+-	default y
+-	depends on ARC_CPU_REL_4_10
+-	depends on !SMP
+-
+ endmenu   # "ARC CPU Configuration"
+ 
+ config LINUX_LINK_BASE
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile
+index 562ac7d..547f375 100644
+--- a/arch/arc/Makefile
++++ b/arch/arc/Makefile
+@@ -33,7 +33,7 @@ cflags-$(atleast_gcc44)			+= -fsection-anchors
+ 
+ cflags-$(CONFIG_ARC_HAS_LLSC)		+= -mlock
+ cflags-$(CONFIG_ARC_HAS_SWAPE)		+= -mswape
+-cflags-$(CONFIG_ARC_HAS_RTSC)		+= -mrtsc
++
+ cflags-$(CONFIG_ARC_DW2_UNWIND)		+= -fasynchronous-unwind-tables
+ 
+ # By default gcc 4.8 generates dwarf4 which kernel unwinder can't grok
+diff --git a/arch/arc/configs/nsim_700_defconfig b/arch/arc/configs/nsim_700_defconfig
+index ef4d3bc..33eaaa9 100644
+--- a/arch/arc/configs/nsim_700_defconfig
++++ b/arch/arc/configs/nsim_700_defconfig
+@@ -23,7 +23,6 @@ CONFIG_MODULES=y
+ # CONFIG_IOSCHED_DEADLINE is not set
+ # CONFIG_IOSCHED_CFQ is not set
+ CONFIG_ARC_PLAT_FPGA_LEGACY=y
+-# CONFIG_ARC_HAS_RTSC is not set
+ CONFIG_ARC_BUILTIN_DTB_NAME="angel4"
+ CONFIG_PREEMPT=y
+ # CONFIG_COMPACTION is not set
+diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig
+index d2ac4e5..59238b4 100644
+--- a/arch/arc/configs/nsimosci_defconfig
++++ b/arch/arc/configs/nsimosci_defconfig
+@@ -24,7 +24,6 @@ CONFIG_MODULES=y
+ # CONFIG_IOSCHED_DEADLINE is not set
+ # CONFIG_IOSCHED_CFQ is not set
+ CONFIG_ARC_PLAT_FPGA_LEGACY=y
+-# CONFIG_ARC_HAS_RTSC is not set
+ CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci"
+ # CONFIG_COMPACTION is not set
+ CONFIG_NET=y
+diff --git a/arch/arc/configs/tb10x_defconfig b/arch/arc/configs/tb10x_defconfig
+index 6be6492..fbed989 100644
+--- a/arch/arc/configs/tb10x_defconfig
++++ b/arch/arc/configs/tb10x_defconfig
+@@ -26,7 +26,6 @@ CONFIG_MODULE_UNLOAD=y
+ # CONFIG_BLOCK is not set
+ CONFIG_ARC_PLAT_TB10X=y
+ CONFIG_ARC_CACHE_LINE_SHIFT=5
+-# CONFIG_ARC_HAS_RTSC is not set
+ CONFIG_ARC_STACK_NONEXEC=y
+ CONFIG_HZ=250
+ CONFIG_ARC_BUILTIN_DTB_NAME="abilis_tb100_dvk"
+diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
+index 1d167c6..5086c75 100644
+--- a/arch/arc/kernel/setup.c
++++ b/arch/arc/kernel/setup.c
+@@ -180,10 +180,9 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
+ 		       (unsigned int)(arc_get_core_freq() / 1000000),
+ 		       (unsigned int)(arc_get_core_freq() / 10000) % 100);
+ 
+-	n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s\nISA Extn\t: ",
++	n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s\nISA Extn\t: ",
+ 		       IS_AVAIL1(cpu->timers.t0, "Timer0 "),
+-		       IS_AVAIL1(cpu->timers.t1, "Timer1 "),
+-		       IS_AVAIL2(cpu->timers.rtsc, "64-bit RTSC ", CONFIG_ARC_HAS_RTSC));
++		       IS_AVAIL1(cpu->timers.t1, "Timer1 "));
+ 
+ 	n += i = scnprintf(buf + n, len - n, "%s%s",
+ 			   IS_AVAIL2(atomic, "atomic ", CONFIG_ARC_HAS_LLSC));
+@@ -254,9 +253,6 @@ static void arc_chk_core_config(void)
+ 	if (!cpu->timers.t1)
+ 		panic("Timer1 is not present!\n");
+ 
+-	if (IS_ENABLED(CONFIG_ARC_HAS_RTSC) && !cpu->timers.rtsc)
+-		panic("RTSC is not present\n");
+-
+ #ifdef CONFIG_ARC_HAS_DCCM
+ 	/*
+ 	 * DCCM can be arbit placed in hardware.
+diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
+index dbe74f4..9307f87 100644
+--- a/arch/arc/kernel/time.c
++++ b/arch/arc/kernel/time.c
+@@ -26,6 +26,7 @@
+  * while TIMER1 for free running (clocksource)
+  *
+  * Newer ARC700 cores have 64bit clk fetching RTSC insn, preferred over TIMER1
++ * which however is currently broken
+  */
+ 
+ #include <linux/spinlock.h>
+@@ -59,52 +60,6 @@
+ 
+ /********** Clock Source Device *********/
+ 
+-#ifdef CONFIG_ARC_HAS_RTSC
+-
+-int arc_counter_setup(void)
+-{
+-	/*
+-	 * For SMP this needs to be 0. However Kconfig glue doesn't
+-	 * enable this option for SMP configs
+-	 */
+-	return 1;
+-}
+-
+-static cycle_t arc_counter_read(struct clocksource *cs)
+-{
+-	unsigned long flags;
+-	union {
+-#ifdef CONFIG_CPU_BIG_ENDIAN
+-		struct { u32 high, low; };
+-#else
+-		struct { u32 low, high; };
+-#endif
+-		cycle_t  full;
+-	} stamp;
+-
+-	flags = arch_local_irq_save();
+-
+-	__asm__ __volatile(
+-	"	.extCoreRegister tsch, 58,  r, cannot_shortcut	\n"
+-	"	rtsc %0, 0	\n"
+-	"	mov  %1, 0	\n"
+-	: "=r" (stamp.low), "=r" (stamp.high));
+-
+-	arch_local_irq_restore(flags);
+-
+-	return stamp.full;
+-}
+-
+-static struct clocksource arc_counter = {
+-	.name   = "ARC RTSC",
+-	.rating = 300,
+-	.read   = arc_counter_read,
+-	.mask   = CLOCKSOURCE_MASK(32),
+-	.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+-};
+-
+-#else /* !CONFIG_ARC_HAS_RTSC */
+-
+ static bool is_usable_as_clocksource(void)
+ {
+ #ifdef CONFIG_SMP
+@@ -139,8 +94,6 @@ static struct clocksource arc_counter = {
+ 	.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+ };
+ 
+-#endif
+-
+ /********** Clock Event Device *********/
+ 
+ /*
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch b/target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
new file mode 100644
index 0000000..53f8074
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
@@ -0,0 +1,36 @@
+From 271777096a31e76b2ffd750bc44efde9656de857 Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin <abrodkin at synopsys.com>
+Date: Thu, 13 Aug 2015 01:56:02 +0300
+Subject: [PATCH] openwrt: arc - remove dependency on DEVTMPFS
+
+OpenWRT builds initramfs so that it doesn't require DEVTMPFS so dropping
+this dependency. That helps to escape 2 separate kernel rebuilds with
+and without initramfs.
+
+2 builds happen because OpenWRT first builds kernel and later modules.
+When building entire kernel with simple "make" INITRAMFS sets to a real
+value and so was triggering DEVTMPFS selection. Then when building only
+modules with "make modules" command INITRAMFS is zeroed and so kernel
+config was changing that lead to full kernel rebuild.
+
+Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
+---
+ arch/arc/Kconfig | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
+index cf96ef2..f0c6d4c 100644
+--- a/arch/arc/Kconfig
++++ b/arch/arc/Kconfig
+@@ -11,8 +11,6 @@ config ARC
+ 	select BUILDTIME_EXTABLE_SORT
+ 	select COMMON_CLK
+ 	select CLONE_BACKWARDS
+-	# ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev
+-	select DEVTMPFS if !INITRAMFS_SOURCE=""
+ 	select GENERIC_ATOMIC64
+ 	select GENERIC_CLOCKEVENTS
+ 	select GENERIC_FIND_FIRST_BIT
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch b/target/linux/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch
new file mode 100644
index 0000000..1e8dbae
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch
@@ -0,0 +1,67 @@
+From c9e83055b21edb14f7a82efe82d3f9a16f97b723 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta at synopsys.com>
+Date: Mon, 2 Feb 2015 19:23:21 +0530
+Subject: [PATCH] ARC: [axs101] support early 8250 uart
+
+Earlycon calculates UART clock as "BASE_BAUD * 16". In case of ARC
+"BASE_BAUD" is calculated dynamically in runtime, basically it is an
+alias to arc_early_base_baud(), which in turn just does
+"arc_base_baud/16".
+
+8250 UART on AXS/SDP board uses 33.3MHz clock source which is set in
+"arc_base_baud" with this change.
+
+Additional compatibility string "snps,arc-sdp" is introduced as well
+because there're different flavours of AXS boards but they all share the
+same motherboard and so it's possible to re-use the same code for
+motherbord even if CPU daughterboard changes.
+
+Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
+---
+ Documentation/devicetree/bindings/arc/axs101.txt | 2 +-
+ arch/arc/boot/dts/axs101.dts                     | 4 ++--
+ arch/arc/kernel/devtree.c                        | 2 ++
+ 3 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/arc/axs101.txt b/Documentation/devicetree/bindings/arc/axs101.txt
+index 568aa5f..48290d5 100644
+--- a/Documentation/devicetree/bindings/arc/axs101.txt
++++ b/Documentation/devicetree/bindings/arc/axs101.txt
+@@ -4,4 +4,4 @@ Synopsys DesignWare ARC Software Development Platforms Device Tree Bindings
+ SDP Main Board with an AXC001 CPU Card hoisting ARC700 core in silicon
+ 
+ Required root node properties:
+-    - compatible = "snps,axs101";
++    - compatible = "snps,axs101", "snps,arc-sdp";
+diff --git a/arch/arc/boot/dts/axs101.dts b/arch/arc/boot/dts/axs101.dts
+index 6c3391d..3f9b058 100644
+--- a/arch/arc/boot/dts/axs101.dts
++++ b/arch/arc/boot/dts/axs101.dts
+@@ -13,9 +13,9 @@
+ /include/ "axs10x_mb.dtsi"
+ 
+ / {
+-	compatible = "snps,axs101";
++	compatible = "snps,axs101", "snps,arc-sdp";
+ 
+ 	chosen {
+-		bootargs = "console=tty0 console=ttyS3,115200n8 consoleblank=0";
++		bootargs = "earlycon=uart8250,mmio32,0xe0022000,115200n8 console=tty0 console=ttyS3,115200n8 consoleblank=0";
+ 	};
+ };
+diff --git a/arch/arc/kernel/devtree.c b/arch/arc/kernel/devtree.c
+index e32b54a..f801d46 100644
+--- a/arch/arc/kernel/devtree.c
++++ b/arch/arc/kernel/devtree.c
+@@ -32,6 +32,8 @@ static void __init arc_set_early_base_baud(unsigned long dt_root)
+ 
+ 	if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x"))
+ 		arc_base_baud = core_clk/3;
++	else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp"))
++		arc_base_baud = 33333333;	/* Fixed 33MHz clk */
+ 	else
+ 		arc_base_baud = core_clk;
+ }
+-- 
+2.4.3
+
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From champetier.etienne at gmail.com  Thu Aug 27 07:25:13 2015
From: champetier.etienne at gmail.com (Etienne Champetier)
Date: Thu, 27 Aug 2015 13:25:13 +0200
Subject: [OpenWrt-Devel] [PATCH procd v2 0/5] jail work
In-Reply-To: <55DEE3ED.2020103@openwrt.org>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
 <55DDC3A7.3050505@openwrt.org>
 <CAOdf3gqxJsCsUhRis1hso7szNNpjVxYjEBBjdOJ=MqVDKb8EAA@mail.gmail.com>
 <55DEE3ED.2020103@openwrt.org>
Message-ID: <CAOdf3grUwi3iYsRoG79SGPnhmGYQt2fDVv5HN9Hf5s8NnGd=Qw@mail.gmail.com>

2015-08-27 12:18 GMT+02:00 John Crispin <blogic at openwrt.org>:

>
>
> On 26/08/2015 18:20, Etienne Champetier wrote:
> >
> >
> > 2015-08-26 15:48 GMT+02:00 John Crispin <blogic at openwrt.org
> > <mailto:blogic at openwrt.org>>:
> >
> >     On 26/08/2015 01:00, Etienne CHAMPETIER wrote:
> >     > This patch series rework a bit ujail,
> >     > and add capabilities support to it
> >
> >     nice
> >
> >     >
> >     > Seccomp filter are very powerful but not totally generic,
> >     > each arch can have different set of syscalls,
> >     > each libc can use different syscall for the same function,
> >     > and seccomp isn't supported on all arch.
> >     >
> >     > Capabilities are more high level, but still can restrict
> >     > jail to a sane minimum of privileges.
> >
> >     >
> >     > Patch 4 is a bit big and i can split it if needed, just tell me how
> >
> >     will have a closer look next few days
> >
> > forgot to say it's tested on ar71xx with CC (and also on ubuntu 14.04)
> >
> >     there seem to be a way to escape from the rebind mount jail that QCA
> has
> >     found
> >
> > more than one ;) can you share? (with root rights you can kexec, mount
> > /dev, ...)
>
> well if you are root you are root and can delete the bootloader. the
> idea of the jail is that you are not root.
>

Totaly disagree on that.
Many core program need 1 or a few capabilities, but don't start if you are
not root
take for exemple busybox ntpd,
http://git.busybox.net/busybox/tree/networking/ntpd.c#n2122
i'm pretty sure it only need CAP_SYS_TIME, but it check for root rights :)

root give you 2 things:
all the capabilities,
read write access on root file
there is no uid==0 in the kernel, only capabilities check

If you drop all capabilities, root is a normal user,
with the exception that he is in general the owner of most or all the file
(that's when namespaces come into play)

For me the idea of the jail is to restrict the daemon as much as possible,
without patching it, so if it need to be root ...


> i will prvide details later on
>
cool


>
> > that's why you really need to limit rights with capabilities drop or
> > seccomp filter
> > (i'm adding a vague warning in usage)
>
> why do you want to run a privileged user and restrict is perms rather
> than just use an unprivileged user ?
>
see comment before


>
> >
> >
> >     and i have not had the time yet to finish my jailfs module.
> >
> > with my patches you don't see all the bind mount anymore ("in the host"),
> > they are only in the jail mount namespace.
> >
> > to see the mounts inside the jail you can still do
> > cat /proc/<jailed process pid>/mounts
>
> we dont want rebind mounts at all, they were only an intermediate solution
>

why? what's the problem with rebind mounts?
It work for me TM :)


>
> >
> >     it
> >     runs and loads, i can do mounts and access files inside them using
> >     normal shell calls. however if is point a jail instance at the
> >     mountpoint it oops horribly. i suspect that i am either using vfs
> wrong
> >     or am missing locking/ref-counting somewhere. i'll throw the code
> onto
> >     github later today or tomorrow and post the link. maybe someone with
> >     more knowledge of vfs can help fix it.
> >
> > what problem are you fixing with jailfs? (real question/to be sure there
> > is no simpler solution)
> >
>
> jailfs is similar overlayfs as it has a lower dir that we overlay but
> now with changes but with a set of filter rules ... consider it like a
> firewall for file i/o
>

My question is what features does jailfs provides that you can't do now?
I'm not writing that to criticize or discourage you, just want to know ;)

In any case thanks for your work

Etienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150827/b16a48a9/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From blogic at openwrt.org  Thu Aug 27 07:38:58 2015
From: blogic at openwrt.org (John Crispin)
Date: Thu, 27 Aug 2015 13:38:58 +0200
Subject: [OpenWrt-Devel] [PATCH procd v2 0/5] jail work
In-Reply-To: <CAOdf3grUwi3iYsRoG79SGPnhmGYQt2fDVv5HN9Hf5s8NnGd=Qw@mail.gmail.com>
References: <1440543643-43546-1-git-send-email-champetier.etienne@gmail.com>
 <55DDC3A7.3050505@openwrt.org>
 <CAOdf3gqxJsCsUhRis1hso7szNNpjVxYjEBBjdOJ=MqVDKb8EAA@mail.gmail.com>
 <55DEE3ED.2020103@openwrt.org>
 <CAOdf3grUwi3iYsRoG79SGPnhmGYQt2fDVv5HN9Hf5s8NnGd=Qw@mail.gmail.com>
Message-ID: <55DEF6D2.4050607@openwrt.org>



On 27/08/2015 13:25, Etienne Champetier wrote:
> 
> 
> 2015-08-27 12:18 GMT+02:00 John Crispin <blogic at openwrt.org
> <mailto:blogic at openwrt.org>>:
> 
> 
> 
>     On 26/08/2015 18:20, Etienne Champetier wrote:
>     >
>     >
>     > 2015-08-26 15:48 GMT+02:00 John Crispin <blogic at openwrt.org <mailto:blogic at openwrt.org>
>     > <mailto:blogic at openwrt.org <mailto:blogic at openwrt.org>>>:
>     >
>     >     On 26/08/2015 01:00, Etienne CHAMPETIER wrote:
>     >     > This patch series rework a bit ujail,
>     >     > and add capabilities support to it
>     >
>     >     nice
>     >
>     >     >
>     >     > Seccomp filter are very powerful but not totally generic,
>     >     > each arch can have different set of syscalls,
>     >     > each libc can use different syscall for the same function,
>     >     > and seccomp isn't supported on all arch.
>     >     >
>     >     > Capabilities are more high level, but still can restrict
>     >     > jail to a sane minimum of privileges.
>     >
>     >     >
>     >     > Patch 4 is a bit big and i can split it if needed, just tell me how
>     >
>     >     will have a closer look next few days
>     >
>     > forgot to say it's tested on ar71xx with CC (and also on ubuntu 14.04)
>     >
>     >     there seem to be a way to escape from the rebind mount jail that QCA has
>     >     found
>     >
>     > more than one ;) can you share? (with root rights you can kexec, mount
>     > /dev, ...)
> 
>     well if you are root you are root and can delete the bootloader. the
>     idea of the jail is that you are not root.
> 
>  
> Totaly disagree on that.
> Many core program need 1 or a few capabilities, but don't start if you
> are not root
> take for exemple busybox ntpd,
> http://git.busybox.net/busybox/tree/networking/ntpd.c#n2122
> i'm pretty sure it only need CAP_SYS_TIME, but it check for root rights :)
> 
> root give you 2 things:
> all the capabilities,
> read write access on root file
> there is no uid==0 in the kernel, only capabilities check
> 
> If you drop all capabilities, root is a normal user,
> with the exception that he is in general the owner of most or all the file
> (that's when namespaces come into play)
> 
> For me the idea of the jail is to restrict the daemon as much as possible,
> without patching it, so if it need to be root ...
> 


we just need support for the USERNS. i think but there will always be
apps that refuse to start if !root.

i had already added !root support to ubus using ACLs. this allows us to
run at least all the openwrt services in the jail as !root

so lets assume that we can run the majority of apps as !root but i agree
that for the left overs we can implement CAPS support and we also need
CGROUPS support i think. i hjope that i have time at the end of the year
or start of 2016 to add all these.

i think that we should always try to run as !root and only use real root
if there is no technical way to avoid this (and patching lots of
services is not a solution, as in remove the root check form ntp)


> 
>     i will prvide details later on
> 
> cool
>  
> 
> 
>     > that's why you really need to limit rights with capabilities drop or
>     > seccomp filter
>     > (i'm adding a vague warning in usage)
> 
>     why do you want to run a privileged user and restrict is perms rather
>     than just use an unprivileged user ?
> 
> see comment before
>  
> 
> 
>     >
>     >
>     >     and i have not had the time yet to finish my jailfs module.
>     >
>     > with my patches you don't see all the bind mount anymore ("in the host"),
>     > they are only in the jail mount namespace.
>     >
>     > to see the mounts inside the jail you can still do
>     > cat /proc/<jailed process pid>/mounts
> 
>     we dont want rebind mounts at all, they were only an intermediate
>     solution
> 
>  
> why? what's the problem with rebind mounts?
> It work for me TM :)
>  

sure we were also able to boot linux using shell scripts but the current
c  code is nicer i think. having a filesystem level implementation seems
much more powerful and clean to me.

> 
> 
>     >
>     >     it
>     >     runs and loads, i can do mounts and access files inside them using
>     >     normal shell calls. however if is point a jail instance at the
>     >     mountpoint it oops horribly. i suspect that i am either using vfs wrong
>     >     or am missing locking/ref-counting somewhere. i'll throw the code onto
>     >     github later today or tomorrow and post the link. maybe someone with
>     >     more knowledge of vfs can help fix it.
>     >
>     > what problem are you fixing with jailfs? (real question/to be sure there
>     > is no simpler solution)
>     >
> 
>     jailfs is similar overlayfs as it has a lower dir that we overlay but
>     now with changes but with a set of filter rules ... consider it like a
>     firewall for file i/o
> 
> 
> My question is what features does jailfs provides that you can't do now?
> I'm not writing that to criticize or discourage you, just want to know ;)

sure, what i would like to see added in the next months is

* USERNS
* jailfs
* cgroups
* CAPS (new on my list)

and whatever else might be useful.
	
	John


> 
> In any case thanks for your work
> 
> Etienne
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From zefir.kurtisi at neratec.com  Thu Aug 27 07:52:06 2015
From: zefir.kurtisi at neratec.com (Zefir Kurtisi)
Date: Thu, 27 Aug 2015 13:52:06 +0200
Subject: [OpenWrt-Devel]  ubus: potential regression in request processing
Message-ID: <55DEF9E6.601@neratec.com>

Hello all,

After upgrading from a rather old commit (4c4f35cf2230) to HEAD, I observe a
change in the ubus processing of requests / notifications which to me seems at
least strange if not wrong.

The scenario used is simple:
1) server with request handler that
   a) first sends a notification
   b) followed by response
2) client
   a) issuing a synchronous request via ubus_invoke()
   b) listening to notifications

The previous behaviour was that notifications sent by server during a request were
ignored (i.e. not reaching the client's notification handler). With the latest
version, the client receives the notification in the middle of the request, i.e.
from within ubus_invoke().

This is problematic in particular if the clients issues follow-up requests from
within its notification-handler - which generally should be ok if one expects
synchronous processing.


I don't understand ubus internals well enough to figure out if this is a bug or a
feature. Bisecting points to:

> commit 2d660c519d2fcff95248da9f4fd9b37d61f9eb09
> Author: Felix Fietkau <nbd at openwrt.org>
> Date:   Thu Jan 22 13:30:20 2015 +0100
> 
>     libubus: fix processing queued messages after blocking requests
>     
>     Signed-off-by: Felix Fietkau <nbd at openwrt.org>
> 
> diff --git a/libubus-req.c b/libubus-req.c
> index d44db51..2197f2a 100644
> --- a/libubus-req.c
> +++ b/libubus-req.c
> @@ -175,7 +175,7 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req,
>         if (!registered) {
>                 uloop_fd_delete(&ctx->sock);
>  
> -               if (ctx->stack_depth)
> +               if (!ctx->stack_depth)
>                         ctx->pending_timer.cb(&ctx->pending_timer);
>         }
>  
> 

which ensures that an initially unregistered client receives pending notifications
from within ubus_invoke() - which at one hand seems required (the client is
unregistered again and won't get the notification otherwise), but on the other
hand breaks the synchronism strictness.

Wouldn't it be better to drop processing of pending notifications completely at
that point?


Cheers
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Thu Aug 27 07:59:25 2015
From: blogic at openwrt.org (John Crispin)
Date: Thu, 27 Aug 2015 13:59:25 +0200
Subject: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC
	architecture
In-Reply-To: <1440673433-25446-2-git-send-email-abrodkin@synopsys.com>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
 <1440673433-25446-2-git-send-email-abrodkin@synopsys.com>
Message-ID: <55DEFB9D.4060501@openwrt.org>

Hi Alexey,

have you already sent these patches upstream to the gcc people ?

	John

On 27/08/2015 13:03, Alexey Brodkin wrote:
> This includes binutils, gcc, gdb and uClibc-ng.
> 
> Latest release of ARC gcc (as of today it is "arc-2015.06")
> is based on upstream gcc 4.8.4.
> 
> Sources are available on GitHub, see:
> https://github.com/foss-for-synopsys-dwc-arc-processors/gcc
> 
> Latest release of ARC binutils (as of today it is "arc-2015.06")
> is based on upstream binutils 2.23.
> 
> Sources are available on GitHub, see:
> https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06
> 
> Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
> is based on upstream gdb 7.9.1.
> 
> Sources are available on GitHub, see:
> https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb
> 
> Note that for binutils and gdb that come from unified git repository
> (which is the case for upstream binutils/gdb today) we need to disable
> building of gdb in binutils and binutils in gdb hence in binutils:
> ------>8------
> --disable-sim
> --disable-gdb
> ------>8------
> 
> and in gdb:
> ------>8------
> --disable-binutils
> --disable-ld
> --disable-gas
> ------>8------
> 
> Also in gdb we disable sim because if the following breakage while
> building with it:
> ------------>8------------
> /usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
>         -mono -fast -pbb -switch sem5-switch.c \
>         -cpu a5f -infile ./mloop5.in \
>         -outfile-suffix 5
> unknown option: bash
> Makefile:699: recipe for target 'stamp-5mloop' failed
> make[7]: *** [stamp-5mloop] Error 1
> ------------>8------------
> 
> Prerequisites are:
>  [1] http://patchwork.ozlabs.org/patch/510985 which adds uClibc-ng support.
>  [2] http://patchwork.ozlabs.org/patch/502022 which updates config.guess
>  and config.sub
> 
> Cc: Felix Fietkau <nbd at openwrt.org>
> Cc: John Crispin <blogic at openwrt.org>
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> ---
>  include/site/arc                                   |  30 +++
>  include/target.mk                                  |   4 +
>  toolchain/Config.in                                |   9 +-
>  toolchain/binutils/Config.in                       |  12 +-
>  toolchain/binutils/Makefile                        |  27 ++-
>  toolchain/gcc/Config.in                            |   5 +
>  toolchain/gcc/Config.version                       |   9 +-
>  toolchain/gcc/common.mk                            |  34 ++-
>  .../001-revert_register_mode_search.patch          |  65 ++++++
>  .../patches/arc-2015.06/002-weak_data_fix.patch    |  42 ++++
>  .../arc-2015.06/003-universal_initializer.patch    |  94 ++++++++
>  .../patches/arc-2015.06/004-case_insensitive.patch |  14 ++
>  .../patches/arc-2015.06/010-documentation.patch    |  23 ++
>  .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +++
>  .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +++
>  .../210-disable_libsanitizer_off_t_check.patch     |  11 +
>  .../arc-2015.06/800-arc-disablelibgmon.patch       |  18 ++
>  .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +++
>  .../arc-2015.06/850-use_shared_libgcc.patch        |  47 ++++
>  .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
>  .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 ++++
>  .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
>  .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
>  .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 +++++++++++++++++++++
>  .../arc-2015.06/920-specs_nonfatal_getenv.patch    |  14 ++
>  .../arc-2015.06/940-no-clobber-stamp-bits.patch    |  11 +
>  toolchain/gdb/Makefile                             |  19 +-
>  toolchain/uClibc/Config.in                         |   2 +
>  toolchain/uClibc/Config.version                    |   3 +-
>  toolchain/uClibc/common.mk                         |   1 +
>  toolchain/uClibc/config-ng-1.0.6/arc               |  12 +
>  31 files changed, 904 insertions(+), 28 deletions(-)
>  create mode 100644 include/site/arc
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/010-documentation.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
>  create mode 100644 toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
>  create mode 100644 toolchain/uClibc/config-ng-1.0.6/arc
> 
> diff --git a/include/site/arc b/include/site/arc
> new file mode 100644
> index 0000000..72a3805
> --- /dev/null
> +++ b/include/site/arc
> @@ -0,0 +1,30 @@
> +#!/bin/sh
> +. $TOPDIR/include/site/linux
> +ac_cv_c_littleendian=${ac_cv_c_littleendian=yes}
> +ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
> +
> +ac_cv_sizeof___int64=0
> +ac_cv_sizeof_char=1
> +ac_cv_sizeof_int=4
> +ac_cv_sizeof_int16_t=2
> +ac_cv_sizeof_int32_t=4
> +ac_cv_sizeof_int64_t=8
> +ac_cv_sizeof_long_int=4
> +ac_cv_sizeof_long_long=8
> +ac_cv_sizeof_long=4
> +ac_cv_sizeof_off_t=8
> +ac_cv_sizeof_short_int=2
> +ac_cv_sizeof_short=2
> +ac_cv_sizeof_size_t=4
> +ac_cv_sizeof_ssize_t=4
> +ac_cv_sizeof_u_int16_t=2
> +ac_cv_sizeof_u_int32_t=4
> +ac_cv_sizeof_u_int64_t=8
> +ac_cv_sizeof_uint16_t=2
> +ac_cv_sizeof_uint32_t=4
> +ac_cv_sizeof_uint64_t=8
> +ac_cv_sizeof_unsigned_int=4
> +ac_cv_sizeof_unsigned_long=4
> +ac_cv_sizeof_unsigned_long_long=8
> +ac_cv_sizeof_unsigned_short=2
> +ac_cv_sizeof_void_p=4
> diff --git a/include/target.mk b/include/target.mk
> index 3e7f17d..fdf6370 100644
> --- a/include/target.mk
> +++ b/include/target.mk
> @@ -259,6 +259,10 @@ ifeq ($(DUMP),1)
>      CPU_TYPE ?= armv8-a
>      CPU_CFLAGS_armv8-a = -mcpu=armv8-a
>    endif
> +  ifeq ($(ARCH),arc)
> +    CPU_TYPE ?= arc700
> +    CPU_CFLAGS_arc700 = -marc700
> +  endif
>    DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
>  endif
>  
> diff --git a/toolchain/Config.in b/toolchain/Config.in
> index 1e94602..2b3ade1 100644
> --- a/toolchain/Config.in
> +++ b/toolchain/Config.in
> @@ -211,7 +211,7 @@ comment "C Library"
>  
>  choice
>  	prompt "C Library implementation" if TOOLCHAINOPTS
> -	default LIBC_USE_UCLIBC if mips64 || mips64el
> +	default LIBC_USE_UCLIBC if arc || mips64 || mips64el
>  	default LIBC_USE_MUSL
>  	help
>  	  Select the C library implementation.
> @@ -219,6 +219,7 @@ choice
>  	config LIBC_USE_GLIBC
>  		bool "Use (e)glibc"
>  		select USE_GLIBC
> +		depends on !arc
>  
>  	config LIBC_USE_UCLIBC
>  		select USE_UCLIBC
> @@ -228,7 +229,7 @@ choice
>  	config LIBC_USE_MUSL
>  		select USE_MUSL
>  		bool "Use musl"
> -		depends on !(mips64 || mips64el)
> +		depends on !(arc || mips64 || mips64el)
>  
>  endchoice
>  
> @@ -259,11 +260,11 @@ config USE_GLIBC
>  	bool
>  
>  config USE_UCLIBC
> -	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (mips64 || mips64el)
> +	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc || mips64 || mips64el)
>  	bool
>  
>  config USE_MUSL
> -	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(mips64 || mips64el)
> +	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || mips64 || mips64el)
>  	bool
>  
>  config USE_EXTERNAL_LIBC
> diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in
> index 8d91223..0f670f1 100644
> --- a/toolchain/binutils/Config.in
> +++ b/toolchain/binutils/Config.in
> @@ -2,13 +2,19 @@
>  
>  choice
>  	prompt "Binutils Version" if TOOLCHAINOPTS
> -	default BINUTILS_VERSION_LINARO
> +	default BINUTILS_VERSION_ARC if arc
> +	default BINUTILS_VERSION_LINARO if !arc
>  	help
>  	  Select the version of binutils you wish to use.
>  
>  	config BINUTILS_VERSION_LINARO
> +		depends on !arc
>  		bool "Linaro binutils 2.24"
>  
> +	config BINUTILS_VERSION_ARC
> +		depends on arc
> +		bool "ARC binutils 2015.06"
> +
>  endchoice
>  
>  config EXTRA_BINUTILS_CONFIG_OPTIONS
> @@ -21,5 +27,5 @@ config EXTRA_BINUTILS_CONFIG_OPTIONS
>  config BINUTILS_VERSION
>  	string
>  	prompt "Binutils Version" if (TOOLCHAINOPTS && NULL)
> -	default "linaro"          if BINUTILS_VERSION_LINARO
> -	default "linaro"
> +	default "linaro"          if BINUTILS_VERSION_LINARO || (!TOOLCHAINOPTS && !arc)
> +	default "arc"             if BINUTILS_VERSION_ARC || (!TOOLCHAINOPTS && arc)
> diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
> index 0276512..d420802 100644
> --- a/toolchain/binutils/Makefile
> +++ b/toolchain/binutils/Makefile
> @@ -10,11 +10,20 @@ PKG_NAME:=binutils
>  PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
>  BIN_VERSION:=$(PKG_VERSION)
>  
> -PKG_SOURCE_URL:=https://releases.linaro.org/14.09/components/toolchain/binutils-linaro/
> -PKG_REV:=2.24.0-2014.09
> -PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.xz
> -PKG_MD5SUM:=8f9b2b2e049d59b1b86ce9657802a353
> -BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
> +ifeq ($(findstring arc, $(CONFIG_BINUTILS_VERSION)),arc)
> +	PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2015.06/
> +	PKG_REV:=2015.06
> +	PKG_SOURCE:=$(PKG_NAME)-arc-$(PKG_REV).tar.gz
> +	PKG_MD5SUM:=961a3564de857238c255c381f8e4360b
> +	BINUTILS_DIR:=$(PKG_NAME)-gdb-arc-$(PKG_REV)
> +else
> +	PKG_SOURCE_URL:=https://releases.linaro.org/14.09/components/toolchain/binutils-linaro/
> +	PKG_REV:=2.24.0-2014.09
> +	PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.xz
> +	PKG_MD5SUM:=8f9b2b2e049d59b1b86ce9657802a353
> +	BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
> +endif
> +
>  HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
>  
>  HOST_BUILD_PARALLEL:=1
> @@ -37,6 +46,8 @@ BINUTILS_CONFIGURE:= \
>  		--disable-multilib \
>  		--disable-werror \
>  		--disable-nls \
> +		--disable-sim \
> +		--disable-gdb \
>  		$(GRAPHITE_CONFIGURE) \
>  		$(SOFT_FLOAT_CONFIG_OPTION) \
>  		$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) 
> @@ -82,6 +93,12 @@ define Host/Install
>  	$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
>  	$(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
>  	$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
> +	# ARC gcc requires extlib.
> +	# If extlib is not available in "initial" folder
> +	# initial gcc will fail to build libc.
> +	if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
> +		$(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
> +	fi
>  endef
>  
>  define Host/Clean
> diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
> index f5de52d..b0d47db 100644
> --- a/toolchain/gcc/Config.in
> +++ b/toolchain/gcc/Config.in
> @@ -3,6 +3,7 @@
>  choice
>  	prompt "GCC compiler Version" if TOOLCHAINOPTS
>  	default GCC_USE_VERSION_4_6_LINARO if TARGET_octeon
> +	default GCC_USE_VERSION_4_8_ARC if arc
>  	default GCC_USE_VERSION_4_8_LINARO
>  	help
>  	  Select the version of gcc you wish to use.
> @@ -14,6 +15,10 @@ choice
>  	config GCC_USE_VERSION_4_8_LINARO
>  		select GCC_VERSION_4_8_LINARO
>  		bool "gcc 4.8.x with Linaro enhancements"
> +		
> +	config GCC_USE_VERSION_4_8_ARC
> +		select GCC_VERSION_4_8_ARC
> +		bool "gcc 4.8.x with support of ARC cores"
>  
>  	config GCC_USE_VERSION_4_9_LINARO
>  		select GCC_VERSION_4_9_LINARO
> diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version
> index c5cf232..e94b631 100644
> --- a/toolchain/gcc/Config.version
> +++ b/toolchain/gcc/Config.version
> @@ -3,12 +3,16 @@ config GCC_VERSION_4_6_LINARO
>  	bool
>  
>  config GCC_VERSION_4_8_LINARO
> -	default y if (!TOOLCHAINOPTS && !TARGET_octeon)
> +	default y if (!TOOLCHAINOPTS && !(TARGET_octeon || arc))
>  	bool
>  
>  config GCC_VERSION_4_9_LINARO
>  	bool
>  
> +config GCC_VERSION_4_8_ARC
> +	default y if (!TOOLCHAINOPTS && arc)
> +	bool
> +
>  config GCC_VERSION
>  	string
>  	default "4.6.3"	    if GCC_VERSION_4_6_3
> @@ -16,6 +20,7 @@ config GCC_VERSION
>  	default "4.6-linaro"    if GCC_VERSION_4_6_LINARO
>  	default "4.8-linaro"    if GCC_VERSION_4_8_LINARO
>  	default "4.9-linaro"    if GCC_VERSION_4_9_LINARO
> +	default "arc-2015.06"   if GCC_VERSION_4_8_ARC
>  	default "4.6-linaro"
>  
>  config GCC_VERSION_4_6
> @@ -24,7 +29,7 @@ config GCC_VERSION_4_6
>  
>  config GCC_VERSION_4_8
>  	bool
> -	default y	if GCC_VERSION_4_8_LINARO
> +	default y	if (GCC_VERSION_4_8_LINARO || GCC_VERSION_4_8_ARC)
>  
>  config GCC_VERSION_4_9
>  	bool
> diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
> index bc5a732..bbffa5b 100644
> --- a/toolchain/gcc/common.mk
> +++ b/toolchain/gcc/common.mk
> @@ -25,6 +25,19 @@ GCC_VERSION:=$(call qstrip,$(CONFIG_GCC_VERSION))
>  PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION)))
>  GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION)
>  
> +PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
> +
> +ifeq ($(PKG_VERSION),4.6.3)
> +  PKG_MD5SUM:=773092fe5194353b02bb0110052a972e
> +endif
> +ifeq ($(PKG_VERSION),4.8.0)
> +  PKG_MD5SUM:=e6040024eb9e761c3bea348d1fa5abb0
> +endif
> +ifeq ($(PKG_VERSION),5.2.0)
> +  PKG_MD5SUM:=a51bcfeb3da7dd4c623e27207ed43467
> +endif
> +
>  ifeq ($(findstring linaro, $(CONFIG_GCC_VERSION)),linaro)
>      LINARO_RELEASE:=
>      ifeq ($(CONFIG_GCC_VERSION),"4.6-linaro")
> @@ -57,19 +70,16 @@ ifeq ($(findstring linaro, $(CONFIG_GCC_VERSION)),linaro)
>      PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.$(PKG_COMP)
>      GCC_DIR:=gcc-linaro-$(PKG_REV)
>      HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GCC_DIR)
> -else
> -  PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
> -  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
> +endif
>  
> -  ifeq ($(PKG_VERSION),4.6.3)
> -    PKG_MD5SUM:=773092fe5194353b02bb0110052a972e
> -  endif
> -  ifeq ($(PKG_VERSION),4.8.0)
> -    PKG_MD5SUM:=e6040024eb9e761c3bea348d1fa5abb0
> -  endif
> -  ifeq ($(PKG_VERSION),5.2.0)
> -    PKG_MD5SUM:=a51bcfeb3da7dd4c623e27207ed43467
> -  endif
> +ifneq ($(CONFIG_GCC_VERSION_4_8_ARC),)
> +    PKG_VERSION:=4.8.4
> +    PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/archive/arc-2015.06
> +    PKG_SOURCE:=$(PKG_NAME)-$(GCC_VERSION).tar.gz
> +    PKG_MD5SUM:=25007ebb02a5f6c32532b103bb5984a0
> +    PKG_REV:=2015.06
> +    GCC_DIR:=gcc-arc-$(PKG_REV)
> +    HOST_BUILD_DIR = $(BUILD_DIR_HOST)/$(PKG_NAME)-$(GCC_VERSION)
>  endif
>  
>  PATCH_DIR=../patches/$(GCC_VERSION)
> diff --git a/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch b/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
> new file mode 100644
> index 0000000..162d651
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
> @@ -0,0 +1,65 @@
> +Revert of:
> +
> +commit 275035b56823b26d5fb7e90fad945b998648edf2
> +Author: bergner <bergner at 138bc75d-0d04-0410-961f-82ee72b054a4>
> +Date:   Thu Sep 5 14:09:07 2013 +0000
> +
> +        PR target/58139
> +        * reginfo.c (choose_hard_reg_mode): Scan through all mode classes
> +        looking for widest mode.
> +
> +
> +    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk at 202286 138bc75d-0d04-0410-961f-82ee72b054a4
> +
> +
> +--- a/gcc/reginfo.c
> ++++ b/gcc/reginfo.c
> +@@ -620,35 +620,40 @@ choose_hard_reg_mode (unsigned int regno
> +        mode = GET_MODE_WIDER_MODE (mode))
> +     if ((unsigned) hard_regno_nregs[regno][mode] == nregs
> + 	&& HARD_REGNO_MODE_OK (regno, mode)
> +-	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
> +-	&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
> ++	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
> +       found_mode = mode;
> + 
> ++  if (found_mode != VOIDmode)
> ++    return found_mode;
> ++
> +   for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
> +        mode != VOIDmode;
> +        mode = GET_MODE_WIDER_MODE (mode))
> +     if ((unsigned) hard_regno_nregs[regno][mode] == nregs
> + 	&& HARD_REGNO_MODE_OK (regno, mode)
> +-	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
> +-	&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
> ++	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
> +       found_mode = mode;
> + 
> ++  if (found_mode != VOIDmode)
> ++    return found_mode;
> ++
> +   for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
> +        mode != VOIDmode;
> +        mode = GET_MODE_WIDER_MODE (mode))
> +     if ((unsigned) hard_regno_nregs[regno][mode] == nregs
> + 	&& HARD_REGNO_MODE_OK (regno, mode)
> +-	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
> +-	&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
> ++	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
> +       found_mode = mode;
> + 
> ++  if (found_mode != VOIDmode)
> ++    return found_mode;
> ++
> +   for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
> +        mode != VOIDmode;
> +        mode = GET_MODE_WIDER_MODE (mode))
> +     if ((unsigned) hard_regno_nregs[regno][mode] == nregs
> + 	&& HARD_REGNO_MODE_OK (regno, mode)
> +-	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
> +-	&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
> ++	&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
> +       found_mode = mode;
> + 
> +   if (found_mode != VOIDmode)
> diff --git a/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch b/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
> new file mode 100644
> index 0000000..a740b4c
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
> @@ -0,0 +1,42 @@
> +--- /dev/null
> ++++ b/gcc/testsuite/gcc.dg/visibility-21.c
> +@@ -0,0 +1,14 @@
> ++/* PR target/32219 */
> ++/* { dg-do run } */
> ++/* { dg-require-visibility "" } */
> ++/* { dg-options "-fPIC" { target fpic } } */
> ++
> ++extern void f() __attribute__((weak,visibility("hidden")));
> ++extern int puts( char const* );
> ++int main()
> ++{
> ++	if (f)
> ++		f();
> ++	return 0;
> ++}
> ++
> +--- a/gcc/varasm.c
> ++++ b/gcc/varasm.c
> +@@ -6677,6 +6677,10 @@ default_binds_local_p_1 (const_tree exp,
> +   /* Static variables are always local.  */
> +   else if (! TREE_PUBLIC (exp))
> +     local_p = true;
> ++  /* hidden weak can't be overridden by something non-local, all
> ++     that is possible is that it is not defined at all. */
> ++  else if (DECL_WEAK (exp))
> ++    local_p = false;
> +   /* A variable is local if the user has said explicitly that it will
> +      be.  */
> +   else if ((DECL_VISIBILITY_SPECIFIED (exp)
> +@@ -6690,11 +6694,6 @@ default_binds_local_p_1 (const_tree exp,
> +      local.  */
> +   else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
> +     local_p = true;
> +-  /* Default visibility weak data can be overridden by a strong symbol
> +-     in another module and so are not local.  */
> +-  else if (DECL_WEAK (exp)
> +-	   && !resolved_locally)
> +-    local_p = false;
> +   /* If PIC, then assume that any global name can be overridden by
> +      symbols resolved from other modules.  */
> +   else if (shlib)
> diff --git a/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch b/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
> new file mode 100644
> index 0000000..1b9a5b3
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
> @@ -0,0 +1,94 @@
> +--- a/gcc/c/c-typeck.c
> ++++ b/gcc/c/c-typeck.c
> +@@ -62,9 +62,9 @@ int in_typeof;
> +    if expr.original_code == SIZEOF_EXPR.  */
> + tree c_last_sizeof_arg;
> + 
> +-/* Nonzero if we've already printed a "missing braces around initializer"
> +-   message within this initializer.  */
> +-static int missing_braces_mentioned;
> ++/* Nonzero if we might need to print a "missing braces around
> ++   initializer" message within this initializer.  */
> ++static int found_missing_braces;
> + 
> + static int require_constant_value;
> + static int require_constant_elements;
> +@@ -6363,6 +6363,9 @@ static int constructor_nonconst;
> + /* 1 if this constructor is erroneous so far.  */
> + static int constructor_erroneous;
> + 
> ++/* 1 if this constructor is the universal zero initializer { 0 }.  */
> ++static int constructor_zeroinit;
> ++
> + /* Structure for managing pending initializer elements, organized as an
> +    AVL tree.  */
> + 
> +@@ -6524,7 +6527,7 @@ start_init (tree decl, tree asmspec_tree
> +   constructor_stack = 0;
> +   constructor_range_stack = 0;
> + 
> +-  missing_braces_mentioned = 0;
> ++  found_missing_braces = 0;
> + 
> +   spelling_base = 0;
> +   spelling_size = 0;
> +@@ -6619,6 +6622,7 @@ really_start_incremental_init (tree type
> +   constructor_type = type;
> +   constructor_incremental = 1;
> +   constructor_designated = 0;
> ++  constructor_zeroinit = 1;
> +   designator_depth = 0;
> +   designator_erroneous = 0;
> + 
> +@@ -6816,11 +6820,8 @@ push_init_level (int implicit, struct ob
> + 	set_nonincremental_init (braced_init_obstack);
> +     }
> + 
> +-  if (implicit == 1 && warn_missing_braces && !missing_braces_mentioned)
> +-    {
> +-      missing_braces_mentioned = 1;
> +-      warning_init (OPT_Wmissing_braces, "missing braces around initializer");
> +-    }
> ++  if (implicit == 1)
> ++    found_missing_braces = 1;
> + 
> +   if (TREE_CODE (constructor_type) == RECORD_TYPE
> + 	   || TREE_CODE (constructor_type) == UNION_TYPE)
> +@@ -6953,16 +6954,23 @@ pop_init_level (int implicit, struct obs
> + 	}
> +     }
> + 
> ++  if (vec_safe_length (constructor_elements) != 1)
> ++    constructor_zeroinit = 0;
> ++
> ++  /* Warn when some structs are initialized with direct aggregation.  */
> ++  if (!implicit && found_missing_braces && warn_missing_braces
> ++      && !constructor_zeroinit)
> ++    {
> ++      warning_init (OPT_Wmissing_braces,
> ++		    "missing braces around initializer");
> ++    }
> ++
> +   /* Warn when some struct elements are implicitly initialized to zero.  */
> +   if (warn_missing_field_initializers
> +       && constructor_type
> +       && TREE_CODE (constructor_type) == RECORD_TYPE
> +       && constructor_unfilled_fields)
> +     {
> +-	bool constructor_zeroinit =
> +-	 (vec_safe_length (constructor_elements) == 1
> +-	  && integer_zerop ((*constructor_elements)[0].value));
> +-
> + 	/* Do not warn for flexible array members or zero-length arrays.  */
> + 	while (constructor_unfilled_fields
> + 	       && (!DECL_SIZE (constructor_unfilled_fields)
> +@@ -8077,6 +8085,9 @@ process_init_element (struct c_expr valu
> +   designator_depth = 0;
> +   designator_erroneous = 0;
> + 
> ++  if (!implicit && value.value && !integer_zerop (value.value))
> ++    constructor_zeroinit = 0;
> ++
> +   /* Handle superfluous braces around string cst as in
> +      char x[] = {"foo"}; */
> +   if (string_flag
> diff --git a/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch b/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
> new file mode 100644
> index 0000000..b3d2dbe
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
> @@ -0,0 +1,14 @@
> +--- a/include/filenames.h
> ++++ b/include/filenames.h
> +@@ -43,11 +43,6 @@ extern "C" {
> + #  define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
> + #  define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
> + #else /* not DOSish */
> +-#  if defined(__APPLE__)
> +-#    ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
> +-#      define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
> +-#    endif
> +-#  endif /* __APPLE__ */
> + #  define HAS_DRIVE_SPEC(f) (0)
> + #  define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
> + #  define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
> diff --git a/toolchain/gcc/patches/arc-2015.06/010-documentation.patch b/toolchain/gcc/patches/arc-2015.06/010-documentation.patch
> new file mode 100644
> index 0000000..5548069
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/010-documentation.patch
> @@ -0,0 +1,23 @@
> +--- a/gcc/Makefile.in
> ++++ b/gcc/Makefile.in
> +@@ -4327,18 +4327,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
> + doc/gccint.info: $(TEXI_GCCINT_FILES)
> + doc/cppinternals.info: $(TEXI_CPPINT_FILES)
> + 
> +-doc/%.info: %.texi
> +-	if [ x$(BUILD_INFO) = xinfo ]; then \
> +-		$(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
> +-			-I $(gcc_docdir)/include -o $@ $<; \
> +-	fi
> ++doc/%.info:
> + 
> + # Duplicate entry to handle renaming of gccinstall.info
> +-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
> +-	if [ x$(BUILD_INFO) = xinfo ]; then \
> +-		$(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
> +-			-I $(gcc_docdir)/include -o $@ $<; \
> +-	fi
> ++doc/gccinstall.info:
> + 
> + doc/cpp.dvi: $(TEXI_CPP_FILES)
> + doc/gcc.dvi: $(TEXI_GCC_FILES)
> diff --git a/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch b/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
> new file mode 100644
> index 0000000..b225376
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
> @@ -0,0 +1,28 @@
> +--- a/gcc/calls.c
> ++++ b/gcc/calls.c
> +@@ -176,6 +176,12 @@ prepare_call_address (tree fndecl, rtx f
> + 	       && targetm.small_register_classes_for_mode_p (FUNCTION_MODE))
> + 	      ? force_not_mem (memory_address (FUNCTION_MODE, funexp))
> + 	      : memory_address (FUNCTION_MODE, funexp));
> ++  else if (flag_pic && !flag_plt && fndecl
> ++	   && TREE_CODE (fndecl) == FUNCTION_DECL
> ++	   && !targetm.binds_local_p (fndecl))
> ++    {
> ++      funexp = force_reg (Pmode, funexp);
> ++    }
> +   else if (! sibcallp)
> +     {
> + #ifndef NO_FUNCTION_CSE
> +--- a/gcc/common.opt
> ++++ b/gcc/common.opt
> +@@ -1617,6 +1617,10 @@ fpie
> + Common Report Var(flag_pie,1) Negative(fPIC)
> + Generate position-independent code for executables if possible (small mode)
> + 
> ++fplt
> ++Common Report Var(flag_plt) Init(1)
> ++Use PLT for PIC calls (-fno-plt: load the address from GOT at call site)
> ++
> + fplugin=
> + Common Joined RejectNegative Var(common_deferred_options) Defer
> + Specify a plugin to load
> diff --git a/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch b/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
> new file mode 100644
> index 0000000..ff9ad94
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
> @@ -0,0 +1,33 @@
> +--- a/contrib/regression/objs-gcc.sh
> ++++ b/contrib/regression/objs-gcc.sh
> +@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
> +  then
> +   make all-gdb all-dejagnu all-ld || exit 1
> +   make install-gdb install-dejagnu install-ld || exit 1
> ++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
> ++ then
> ++  make all-gdb all-dejagnu all-ld || exit 1
> ++  make install-gdb install-dejagnu install-ld || exit 1
> + elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
> +   make bootstrap || exit 1
> +   make install || exit 1
> +--- a/libjava/classpath/ltconfig
> ++++ b/libjava/classpath/ltconfig
> +@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
> + 
> + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
> + case $host_os in
> +-linux-gnu*) ;;
> ++linux-gnu*|linux-uclibc*) ;;
> + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
> + esac
> + 
> +@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux
> +   ;;
> + 
> + # This must be Linux ELF.
> +-linux-gnu*)
> ++linux*)
> +   version_type=linux
> +   need_lib_prefix=no
> +   need_version=no
> diff --git a/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch b/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
> new file mode 100644
> index 0000000..5608469
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
> @@ -0,0 +1,11 @@
> +--- a/libsanitizer/interception/interception_type_test.cc
> ++++ b/libsanitizer/interception/interception_type_test.cc
> +@@ -31,7 +31,7 @@ COMPILER_CHECK(sizeof(OFF64_T) == sizeof
> + // rest (they depend on _FILE_OFFSET_BITS setting when building an application).
> + # if defined(__ANDROID__) || !defined _FILE_OFFSET_BITS || \
> +   _FILE_OFFSET_BITS != 64
> +-COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
> ++// COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
> + # endif
> + 
> + #endif
> diff --git a/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch b/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
> new file mode 100644
> index 0000000..612883c
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
> @@ -0,0 +1,18 @@
> +diff --git a/libgcc/config.host b/libgcc/config.host
> +index e768389..aec10c7 100644
> +--- a/libgcc/config.host
> ++++ b/libgcc/config.host
> +@@ -320,11 +320,11 @@ alpha*-dec-*vms*)
> + 	;;
> + arc*-*-elf*)
> + 	tmake_file="arc/t-arc-newlib arc/t-arc"
> +-	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o crttls_r25.o crttls_r30.o"
> ++	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o crtg.o crtgend.o crttls_r25.o crttls_r30.o"
> + 	;;
> + arc*-*-linux-uclibc*)
> + 	tmake_file="${tmake_file} t-slibgcc-libgcc t-slibgcc-nolc-override arc/t-arc700-uClibc arc/t-arc"
> +-	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o"
> ++	extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o crtg.o crtgend.o"
> + 	;;
> + arm-wrs-vxworks)
> + 	tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
> diff --git a/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch b/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
> new file mode 100644
> index 0000000..7a0ac73
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
> @@ -0,0 +1,36 @@
> +--- a/libgcc/Makefile.in
> ++++ b/libgcc/Makefile.in
> +@@ -865,11 +865,12 @@ $(libgcov-objects): %$(objext): $(srcdir
> + 
> + # Static libraries.
> + libgcc.a: $(libgcc-objects)
> ++libgcc_pic.a: $(libgcc-s-objects)
> + libgcov.a: $(libgcov-objects)
> + libunwind.a: $(libunwind-objects)
> + libgcc_eh.a: $(libgcc-eh-objects)
> + 
> +-libgcc.a libgcov.a libunwind.a libgcc_eh.a:
> ++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a:
> + 	-rm -f $@
> + 
> + 	objects="$(objects)";					\
> +@@ -891,7 +892,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E
> + endif
> + 
> + ifeq ($(enable_shared),yes)
> +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
> ++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT)
> + ifneq ($(LIBUNWIND),)
> + all: libunwind$(SHLIB_EXT)
> + endif
> +@@ -1058,6 +1059,10 @@ install-shared:
> + 	chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
> + 	$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
> + 
> ++	$(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/
> ++	chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a
> ++	$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a
> ++
> + 	$(subst @multilib_dir@,$(MULTIDIR),$(subst \
> + 		@shlib_base_name@,libgcc_s,$(subst \
> + 		@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
> diff --git a/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch b/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
> new file mode 100644
> index 0000000..6934bc9
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
> @@ -0,0 +1,47 @@
> +--- a/gcc/config/arm/linux-eabi.h
> ++++ b/gcc/config/arm/linux-eabi.h
> +@@ -131,10 +131,6 @@
> + #define ENDFILE_SPEC \
> +   LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
> + 
> +-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
> +-   do not use -lfloat.  */
> +-#undef LIBGCC_SPEC
> +-
> + /* Clear the instruction cache from `beg' to `end'.  This is
> +    implemented in lib1funcs.S, so ensure an error if this definition
> +    is used.  */
> +--- a/gcc/config/linux.h
> ++++ b/gcc/config/linux.h
> +@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI
> + 	builtin_assert ("system=posix");			\
> +     } while (0)
> + 
> ++#ifndef LIBGCC_SPEC
> ++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
> ++#endif
> ++
> + /* Determine which dynamic linker to use depending on whether GLIBC or
> +    uClibc or Bionic is the default C library and whether
> +    -muclibc or -mglibc or -mbionic has been passed to change the default.  */
> +--- a/libgcc/mkmap-symver.awk
> ++++ b/libgcc/mkmap-symver.awk
> +@@ -132,5 +132,5 @@ function output(lib) {
> +   else if (inherit[lib])
> +     printf("} %s;\n", inherit[lib]);
> +   else
> +-    printf ("\n  local:\n\t*;\n};\n");
> ++    printf ("\n\t*;\n};\n");
> + }
> +--- a/gcc/config/rs6000/linux.h
> ++++ b/gcc/config/rs6000/linux.h
> +@@ -61,6 +61,9 @@
> + #undef  CPLUSPLUS_CPP_SPEC
> + #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
> + 
> ++#undef LIBGCC_SPEC
> ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
> ++
> + #undef  LINK_SHLIB_SPEC
> + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
> + 
> diff --git a/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch b/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
> new file mode 100644
> index 0000000..80c3476
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
> @@ -0,0 +1,12 @@
> +--- a/libgcc/config/t-libunwind
> ++++ b/libgcc/config/t-libunwind
> +@@ -2,8 +2,7 @@
> + 
> + HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
> + 
> +-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
> +-  $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
> ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
> + LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
> + 
> + # Override the default value from t-slibgcc-elf-ver and mention -lunwind
> diff --git a/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch b/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
> new file mode 100644
> index 0000000..1ac83fe
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
> @@ -0,0 +1,42 @@
> +--- a/libgcc/unwind-dw2-fde-dip.c
> ++++ b/libgcc/unwind-dw2-fde-dip.c
> +@@ -46,33 +46,13 @@
> + #include "unwind-compat.h"
> + #include "gthr.h"
> + 
> +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
> +-    && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
> +-	|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
> +-# define USE_PT_GNU_EH_FRAME
> +-#endif
> +-
> +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
> +-    && defined(__BIONIC__)
> +-# define USE_PT_GNU_EH_FRAME
> +-#endif
> +-
> +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
> +-    && defined(__FreeBSD__) && __FreeBSD__ >= 7
> +-# define ElfW __ElfN
> +-# define USE_PT_GNU_EH_FRAME
> +-#endif
> +-
> +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
> +-    && defined(__OpenBSD__)
> +-# define ElfW(type) Elf_##type
> +-# define USE_PT_GNU_EH_FRAME
> +-#endif
> +-
> +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
> +-    && defined(TARGET_DL_ITERATE_PHDR) \
> +-    && defined(__sun__) && defined(__svr4__)
> ++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR)
> + # define USE_PT_GNU_EH_FRAME
> ++# ifdef __OpenBSD__
> ++#  define ElfW(type) Elf_##type
> ++# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
> ++#  define ElfW __ElfN
> ++# endif
> + #endif
> + 
> + #if defined(USE_PT_GNU_EH_FRAME)
> diff --git a/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
> new file mode 100644
> index 0000000..4b7fcbd
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
> @@ -0,0 +1,11 @@
> +--- a/gcc/config/rs6000/rs6000.c
> ++++ b/gcc/config/rs6000/rs6000.c
> +@@ -17662,7 +17662,7 @@ rs6000_savres_strategy (rs6000_stack_t *
> +   /* Define cutoff for using out-of-line functions to save registers.  */
> +   if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
> +     {
> +-      if (!optimize_size)
> ++      if (1)
> + 	{
> + 	  strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
> + 	  strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
> diff --git a/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch b/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
> new file mode 100644
> index 0000000..def6c9f
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
> @@ -0,0 +1,11 @@
> +--- a/gcc/defaults.h
> ++++ b/gcc/defaults.h
> +@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI
> + /* If we have named section and we support weak symbols, then use the
> +    .jcr section for recording java classes which need to be registered
> +    at program start-up time.  */
> +-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
> ++#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
> + #ifndef JCR_SECTION_NAME
> + #define JCR_SECTION_NAME ".jcr"
> + #endif
> diff --git a/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch b/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
> new file mode 100644
> index 0000000..5387f8e
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
> @@ -0,0 +1,253 @@
> +
> +	This patch brings over a few features from MirBSD:
> +	* -fhonour-copts
> +	  If this option is not given, it's warned (depending
> +	  on environment variables). This is to catch errors
> +	  of misbuilt packages which override CFLAGS themselves.
> +	* -Werror-maybe-reset
> +	  Has the effect of -Wno-error if GCC_NO_WERROR is
> +	  set and not '0', a no-operation otherwise. This is
> +	  to be able to use -Werror in "make" but prevent
> +	  GNU autoconf generated configure scripts from
> +	  freaking out.
> +	* Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
> +	  the default for -O2/-Os, because they trigger gcc bugs
> +	  and can delete code with security implications.
> +
> +	This patch was authored by Thorsten Glaser <tg at mirbsd.de>
> +	with copyright assignment to the FSF in effect.
> +
> +--- a/gcc/c-family/c-opts.c
> ++++ b/gcc/c-family/c-opts.c
> +@@ -104,6 +104,9 @@ static size_t include_cursor;
> + /* Whether any standard preincluded header has been preincluded.  */
> + static bool done_preinclude;
> + 
> ++/* Check if a port honours COPTS.  */
> ++static int honour_copts = 0;
> ++
> + static void handle_OPT_d (const char *);
> + static void set_std_cxx98 (int);
> + static void set_std_cxx11 (int);
> +@@ -383,6 +386,9 @@ c_common_handle_option (size_t scode, co
> +       cpp_opts->warn_endif_labels = value;
> +       break;
> + 
> ++    case OPT_Werror_maybe_reset:
> ++      break;
> ++
> +     case OPT_Winvalid_pch:
> +       cpp_opts->warn_invalid_pch = value;
> +       break;
> +@@ -491,6 +497,12 @@ c_common_handle_option (size_t scode, co
> +       flag_no_builtin = !value;
> +       break;
> + 
> ++    case OPT_fhonour_copts:
> ++      if (c_language == clk_c) {
> ++        honour_copts++;
> ++      }
> ++      break;
> ++
> +     case OPT_fconstant_string_class_:
> +       constant_string_class_name = arg;
> +       break;
> +@@ -1027,6 +1039,47 @@ c_common_init (void)
> +       return false;
> +     }
> + 
> ++  if (c_language == clk_c) {
> ++    char *ev = getenv ("GCC_HONOUR_COPTS");
> ++    int evv;
> ++    if (ev == NULL)
> ++      evv = -1;
> ++    else if ((*ev == '0') || (*ev == '\0'))
> ++      evv = 0;
> ++    else if (*ev == '1')
> ++      evv = 1;
> ++    else if (*ev == '2')
> ++      evv = 2;
> ++    else if (*ev == 's')
> ++      evv = -1;
> ++    else {
> ++      warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
> ++      evv = 1; /* maybe depend this on something like MIRBSD_NATIVE?  */
> ++    }
> ++    if (evv == 1) {
> ++      if (honour_copts == 0) {
> ++        error ("someone does not honour COPTS at all in lenient mode");
> ++        return false;
> ++      } else if (honour_copts != 1) {
> ++        warning (0, "someone does not honour COPTS correctly, passed %d times",
> ++         honour_copts);
> ++      }
> ++    } else if (evv == 2) {
> ++      if (honour_copts == 0) {
> ++        error ("someone does not honour COPTS at all in strict mode");
> ++        return false;
> ++      } else if (honour_copts != 1) {
> ++        error ("someone does not honour COPTS correctly, passed %d times",
> ++         honour_copts);
> ++        return false;
> ++      }
> ++    } else if (evv == 0) {
> ++      if (honour_copts != 1)
> ++        inform (0, "someone does not honour COPTS correctly, passed %d times",
> ++         honour_copts);
> ++    }
> ++  }
> ++
> +   return true;
> + }
> + 
> +--- a/gcc/c-family/c.opt
> ++++ b/gcc/c-family/c.opt
> +@@ -379,6 +379,10 @@ Werror-implicit-function-declaration
> + C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
> + This switch is deprecated; use -Werror=implicit-function-declaration instead
> + 
> ++Werror-maybe-reset
> ++C ObjC C++ ObjC++
> ++; Documented in common.opt
> ++
> + Wfloat-equal
> + C ObjC C++ ObjC++ Var(warn_float_equal) Warning
> + Warn if testing floating point numbers for equality
> +@@ -949,6 +953,9 @@ C++ ObjC++ Optimization Alias(fexception
> + fhonor-std
> + C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
> + 
> ++fhonour-copts
> ++C ObjC C++ ObjC++ RejectNegative
> ++
> + fhosted
> + C ObjC
> + Assume normal C execution environment
> +--- a/gcc/common.opt
> ++++ b/gcc/common.opt
> +@@ -541,6 +541,10 @@ Werror=
> + Common Joined
> + Treat specified warning as error
> + 
> ++Werror-maybe-reset
> ++Common
> ++If environment variable GCC_NO_WERROR is set, act as -Wno-error
> ++
> + Wextra
> + Common Var(extra_warnings) Warning
> + Print extra (possibly unwanted) warnings
> +@@ -1242,6 +1246,9 @@ fguess-branch-probability
> + Common Report Var(flag_guess_branch_prob) Optimization
> + Enable guessing of branch probabilities
> + 
> ++fhonour-copts
> ++Common RejectNegative
> ++
> + ; Nonzero means ignore `#ident' directives.  0 means handle them.
> + ; Generate position-independent code for executables if possible
> + ; On SVR4 targets, it also controls whether or not to emit a
> +--- a/gcc/opts.c
> ++++ b/gcc/opts.c
> +@@ -468,8 +468,6 @@ static const struct default_options defa
> +     { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 },
> + #endif
> +     { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 },
> +-    { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
> +-    { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 },
> +     { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 },
> +     { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 },
> +     { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
> +@@ -489,6 +487,8 @@ static const struct default_options defa
> +     { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
> + 
> +     /* -O3 optimizations.  */
> ++    { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 },
> ++    { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 },
> +     { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
> +     { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
> +     /* Inlining of functions reducing size is a good idea with -Os
> +@@ -1435,6 +1435,17 @@ common_handle_option (struct gcc_options
> + 			       opts, opts_set, loc, dc);
> +       break;
> + 
> ++    case OPT_Werror_maybe_reset:
> ++      {
> ++        char *ev = getenv ("GCC_NO_WERROR");
> ++        if ((ev != NULL) && (*ev != '0'))
> ++          warnings_are_errors = 0;
> ++      }
> ++      break;
> ++
> ++    case OPT_fhonour_copts:
> ++      break;
> ++
> +     case OPT_Wlarger_than_:
> +       opts->x_larger_than_size = value;
> +       opts->x_warn_larger_than = value != -1;
> +--- a/gcc/doc/cppopts.texi
> ++++ b/gcc/doc/cppopts.texi
> +@@ -163,6 +163,11 @@ in older programs.  This warning is on b
> + Make all warnings into hard errors.  Source code which triggers warnings
> + will be rejected.
> + 
> ++ at item -Werror-maybe-reset
> ++ at opindex Werror-maybe-reset
> ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
> ++variable is set to anything other than 0 or empty.
> ++
> + @item -Wsystem-headers
> + @opindex Wsystem-headers
> + Issue warnings for code in system headers.  These are normally unhelpful
> +--- a/gcc/doc/invoke.texi
> ++++ b/gcc/doc/invoke.texi
> +@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}.
> + -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
> + -Wno-deprecated-declarations -Wdisabled-optimization  @gol
> + -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
> +--Wno-endif-labels -Werror  -Werror=* @gol
> ++-Wno-endif-labels -Werror  -Werror=* -Werror-maybe-reset @gol
> + -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
> + -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
> + -Wformat-security  -Wformat-y2k @gol
> +@@ -4817,6 +4817,22 @@ This option is only supported for C and 
> + @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
> + @option{-Wno-pointer-sign}.
> + 
> ++ at item -Werror-maybe-reset
> ++ at opindex Werror-maybe-reset
> ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
> ++variable is set to anything other than 0 or empty.
> ++
> ++ at item -fhonour-copts
> ++ at opindex fhonour-copts
> ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
> ++given at least once, and warn if it is given more than once.
> ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
> ++given exactly once.
> ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
> ++is not given exactly once.
> ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
> ++This flag and environment variable only affect the C language.
> ++
> + @item -Wstack-protector
> + @opindex Wstack-protector
> + @opindex Wno-stack-protector
> +@@ -6928,7 +6944,7 @@ so, the first branch is redirected to ei
> + second branch or a point immediately following it, depending on whether
> + the condition is known to be true or false.
> + 
> +-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
> ++Enabled at levels @option{-O3}.
> + 
> + @item -fsplit-wide-types
> + @opindex fsplit-wide-types
> +--- a/gcc/java/jvspec.c
> ++++ b/gcc/java/jvspec.c
> +@@ -626,6 +626,7 @@ lang_specific_pre_link (void)
> +      class name.  Append dummy `.c' that can be stripped by set_input so %b
> +      is correct.  */ 
> +   set_input (concat (main_class_name, "main.c", NULL));
> ++  putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack!  */
> +   err = do_spec (jvgenmain_spec);
> +   if (err == 0)
> +     {
> diff --git a/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
> new file mode 100644
> index 0000000..09768f5
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
> @@ -0,0 +1,14 @@
> +--- a/gcc/gcc.c
> ++++ b/gcc/gcc.c
> +@@ -8029,7 +8029,10 @@ getenv_spec_function (int argc, const ch
> + 
> +   value = getenv (argv[0]);
> +   if (!value)
> +-    fatal_error ("environment variable %qs not defined", argv[0]);
> ++    {
> ++      warning (0, "environment variable %qs not defined", argv[0]);
> ++      value = "";
> ++    }
> + 
> +   /* We have to escape every character of the environment variable so
> +      they are not interpreted as active spec characters.  A
> diff --git a/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
> new file mode 100644
> index 0000000..dbecef2
> --- /dev/null
> +++ b/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
> @@ -0,0 +1,11 @@
> +--- a/libstdc++-v3/include/Makefile.in
> ++++ b/libstdc++-v3/include/Makefile.in
> +@@ -1342,7 +1342,7 @@
> + 	@$(STAMP) stamp-bits
> + 
> + stamp-bits-sup: stamp-bits ${bits_sup_headers}
> +-	@-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
> ++	@-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null
> + 	@$(STAMP) stamp-bits-sup
> + 
> + stamp-c_base: ${c_base_headers}
> diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
> index fa5179a..8b848c2 100644
> --- a/toolchain/gdb/Makefile
> +++ b/toolchain/gdb/Makefile
> @@ -7,11 +7,24 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=gdb
> +
> +ifeq ($(CONFIG_arc),y)
> +PKG_VERSION:=arc-2015.06-gdb
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> +PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2015.06-gdb/
> +PKG_MD5SUM:=d318829bfd2ed62714817f0d25706825
> +GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
> +else
>  PKG_VERSION:=7.8
>  
>  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
>  PKG_SOURCE_URL:=@GNU/gdb
>  PKG_MD5SUM:=bd958fe9019d7c7896f29f6724a764ed
> +GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
> +endif
> +
> +HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
>  
>  HOST_BUILD_PARALLEL:=1
>  
> @@ -30,7 +43,11 @@ HOST_CONFIGURE_ARGS = \
>  	--disable-tui --disable-gdbtk --without-x \
>  	--without-included-gettext \
>  	--enable-threads \
> -	--with-expat
> +	--with-expat \
> +	--disable-binutils \
> +	--disable-ld \
> +	--disable-gas \
> +	--disable-sim
>  
>  define Host/Install
>  	mkdir -p $(TOOLCHAIN_DIR)/bin
> diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
> index c923bc0..27215b6 100644
> --- a/toolchain/uClibc/Config.in
> +++ b/toolchain/uClibc/Config.in
> @@ -3,6 +3,7 @@
>  choice
>  	prompt "uClibc Version"
>  	depends on TOOLCHAINOPTS && USE_UCLIBC
> +	default UCLIBC_USE_VERSION_NG if arc
>  	default UCLIBC_USE_VERSION_0_9_33
>  	help
>  	  Select the version of uClibc you wish to use.
> @@ -10,6 +11,7 @@ choice
>  	config UCLIBC_USE_VERSION_0_9_33
>  		select UCLIBC_VERSION_0_9_33
>  		bool "uClibc 0.9.33.2"
> +		depends on !arc
>  
>  	config UCLIBC_USE_VERSION_NG
>  		select UCLIBC_VERSION_NG
> diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
> index b6aa471..3ecd584 100644
> --- a/toolchain/uClibc/Config.version
> +++ b/toolchain/uClibc/Config.version
> @@ -6,8 +6,9 @@ config UCLIBC_VERSION
>  	default "0.9.33.2"
>  
>  config UCLIBC_VERSION_0_9_33
> -	default y if !TOOLCHAINOPTS && USE_UCLIBC
> +	default y if !TOOLCHAINOPTS && USE_UCLIBC && !arc
>  	bool
>  
>  config UCLIBC_VERSION_NG
> +	default y if !TOOLCHAINOPTS && USE_UCLIBC && arc
>  	bool
> diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
> index 026d69d..273e477 100644
> --- a/toolchain/uClibc/common.mk
> +++ b/toolchain/uClibc/common.mk
> @@ -32,6 +32,7 @@ HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
>  include $(INCLUDE_DIR)/toolchain-build.mk
>  
>  UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
> +		-e 's/arc.*/arc/' \
>  		-e 's/i.86/i386/' \
>  		-e 's/sparc.*/sparc/' \
>  		-e 's/arm.*/arm/g' \
> diff --git a/toolchain/uClibc/config-ng-1.0.6/arc b/toolchain/uClibc/config-ng-1.0.6/arc
> new file mode 100644
> index 0000000..7fb83f7
> --- /dev/null
> +++ b/toolchain/uClibc/config-ng-1.0.6/arc
> @@ -0,0 +1,12 @@
> +ARCH_ANY_ENDIAN=y
> +ARCH_LITTLE_ENDIAN=y
> +ARCH_WANTS_LITTLE_ENDIAN=y
> +# COMPILE_IN_THUMB_MODE is not set
> +TARGET_ARCH="arc"
> +TARGET_arc=y
> +CONFIG_ARC_CPU_700=y
> +# CONFIG_ARC_CPU_HS is not set
> +CONFIG_ARC_PAGE_SIZE_8K=y
> +# CONFIG_ARC_PAGE_SIZE_16K is not set
> +# CONFIG_ARC_PAGE_SIZE_4K is not set
> +
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Thu Aug 27 08:06:55 2015
From: blogic at openwrt.org (John Crispin)
Date: Thu, 27 Aug 2015 14:06:55 +0200
Subject: [OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC
 boards
In-Reply-To: <1440673433-25446-4-git-send-email-abrodkin@synopsys.com>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
 <1440673433-25446-4-git-send-email-abrodkin@synopsys.com>
Message-ID: <55DEFD5F.8080806@openwrt.org>

Hi,

i just skimmed over the patch quickly and ...

On 27/08/2015 13:03, Alexey Brodkin wrote:
> diff --git a/target/linux/arc/axs10x/base-files/etc/config/network b/target/linux/arc/axs10x/base-files/etc/config/network
> new file mode 100644
> index 0000000..1d46510
> --- /dev/null
> +++ b/target/linux/arc/axs10x/base-files/etc/config/network
> @@ -0,0 +1,18 @@
> +config interface 'loopback'
> +        option ifname 'lo'
> +        option proto 'static'
> +        option ipaddr '127.0.0.1'
> +        option netmask '255.0.0.0'
> +
> +config interface 'lan'
> +        option ifname 'eth0'
> +        option type 'bridge'
> +        option proto 'dhcp'
> +
> +config interface 'wan6'
> +        option ifname '@wan'
> +        option proto 'dhcpv6'
> +
> +config globals 'globals'
> +        option ula_prefix 'fdd3:b396:94ac::/48'
> +


adding a network uci file that is custom requires you to also delete the
default one.

please duplicate this file into your target folder
-> target/linux/ramips/base-files.mk

it looks like at least 1 of the patches should also go upstream if not
more than one.

before sending a new series wait for further feedback please.

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


From Alexey.Brodkin at synopsys.com  Thu Aug 27 08:15:42 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Thu, 27 Aug 2015 12:15:42 +0000
Subject: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC
	architecture
In-Reply-To: <55DEFB9D.4060501@openwrt.org>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
 <1440673433-25446-2-git-send-email-abrodkin@synopsys.com>
 <55DEFB9D.4060501@openwrt.org>
Message-ID: <1440677741.15478.74.camel@synopsys.com>

Hi John,

On Thu, 2015-08-27 at 13:59 +0200, John Crispin wrote:
> Hi Alexey,
> 
> have you already sent these patches upstream to the gcc people ?

I'm not really sure which patches you're talking about.

If you're talking about patches I put in "toolchain/gcc/patches/arc-2015.06"
folder those are selected [mostly arch-independent] ones from
"toolchain/gcc/patches/4.8-linaro".

If you're talking about patches for GCC/binutils with support of ARC
then we're actively working on upstreaming both projects.

Moreover initial support of ARC is already in upstream GCC but that lacks many
recent improvements. We're looking forward to get all our work upstream in coming
months.

Hope I answered your question. Otherwise please feel free to clarify your
question and I'll answer it then.

-Alexey
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From adamk at mcservices.com.au  Thu Aug 27 08:17:42 2015
From: adamk at mcservices.com.au (Adam Kuklycz)
Date: Thu, 27 Aug 2015 22:17:42 +1000
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
 uClibc-ng
In-Reply-To: <55DED95B.2080809@openwrt.org>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org> <1440613687.15478.58.camel@synopsys.com>
 <55DE506A.6000504@mcservices.com.au> <55DED95B.2080809@openwrt.org>
Message-ID: <55DEFFE6.2010900@mcservices.com.au>

Hi Felix

Thanks for clarifying.  I've also noticed what appears to be a memory 
leak in my latest build as well which I am working on drilling down 
now.  After a couple days of uptime the device is out of memory.  It's 
much more pronounced when doing downloads with many connections 
simultaneously.

So all that said, yes I do agree there is always more bloat with each 
kernel update sadly.  I'm busy now doing builds with both uclibc and 
musl and will be interested to see the size comparisons. Will take 
several hours so will report back in the morning (Australian time)

Cheers


On 27/08/15 19:33, Felix Fietkau wrote:
> On 2015-08-27 01:48, Adam Kuklycz wrote:
>> Hi all,
>>
>> I was wondering why OpenWRT switched to musl -- is it purely because
>> uclibc hasn't actually maintained their code properly?
> That's only part of the reason. Aside from the maintainenance, the code
> quality of uClibc is also poor compared to musl.
> musl also has better runtime performance and uses less RAM.
>
>> One of the things I have noticed since the CC trunk builds I did with
>> kernel 3.18.11 + uclibc is that the image sizes have ballooned out by a
>> fair bit.
>>
>> For example, a build on trunk r45705 which uses uclibc and kernel
>> 3.18.11 would allow for most features to be included in a build e.g.
>> openvpn, luci + ssl support, more connecting protocols than just pppoe
>> and so on with a router sporting 8MB of flash.
>>
>> Now with recent trunk builds, with musl and kernel 4.1.x, I've had to
>> cut features considerably just to make it fit.  Just adding openvpn with
>> openssl support means that an image prior that built at 7MB would
>> balloon out to 8MB which would mean that the image would not be produced
>> as it is too big.
> Last time I compared musl vs uClibc images, the size difference was
> neglegible. I'd say it's more likely that the switch to Linux 4.1 caused
> the size increase (the kernel does get more bloated with each new release).
>
> - Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From blogic at openwrt.org  Thu Aug 27 08:25:04 2015
From: blogic at openwrt.org (John Crispin)
Date: Thu, 27 Aug 2015 14:25:04 +0200
Subject: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC
	architecture
In-Reply-To: <1440677741.15478.74.camel@synopsys.com>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>	
 <1440673433-25446-2-git-send-email-abrodkin@synopsys.com>	
 <55DEFB9D.4060501@openwrt.org> <1440677741.15478.74.camel@synopsys.com>
Message-ID: <55DF01A0.1070900@openwrt.org>



On 27/08/2015 14:15, Alexey Brodkin wrote:
> Hi John,
> 
> On Thu, 2015-08-27 at 13:59 +0200, John Crispin wrote:
>> Hi Alexey,
>>
>> have you already sent these patches upstream to the gcc people ?
> 
> I'm not really sure which patches you're talking about.
> 
> If you're talking about patches I put in "toolchain/gcc/patches/arc-2015.06"
> folder those are selected [mostly arch-independent] ones from
> "toolchain/gcc/patches/4.8-linaro".
> 
> If you're talking about patches for GCC/binutils with support of ARC
> then we're actively working on upstreaming both projects.
> 
> Moreover initial support of ARC is already in upstream GCC but that lacks many
> recent improvements. We're looking forward to get all our work upstream in coming
> months.
> 
> Hope I answered your question. Otherwise please feel free to clarify your
> question and I'll answer it then.
> 
> -Alexey
> 

great, i just wanted to make sure that you are aware of the real
upstream :) would hate to see patches bit rot in our tree

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


From Alexey.Brodkin at synopsys.com  Thu Aug 27 08:35:00 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Thu, 27 Aug 2015 12:35:00 +0000
Subject: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC
	architecture
In-Reply-To: <55DF01A0.1070900@openwrt.org>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
 <1440673433-25446-2-git-send-email-abrodkin@synopsys.com>
 <55DEFB9D.4060501@openwrt.org> <1440677741.15478.74.camel@synopsys.com>
 <55DF01A0.1070900@openwrt.org>
Message-ID: <1440678900.15478.93.camel@synopsys.com>

Hi John,

On Thu, 2015-08-27 at 14:25 +0200, John Crispin wrote:
> 
> On 27/08/2015 14:15, Alexey Brodkin wrote:
> > Hi John,
> > 
> > On Thu, 2015-08-27 at 13:59 +0200, John Crispin wrote:
> > > Hi Alexey,
> > > 
> > > have you already sent these patches upstream to the gcc people ?
> > 
> > I'm not really sure which patches you're talking about.
> > 
> > If you're talking about patches I put in "toolchain/gcc/patches/arc-2015.06"
> > folder those are selected [mostly arch-independent] ones from
> > "toolchain/gcc/patches/4.8-linaro".
> > 
> > If you're talking about patches for GCC/binutils with support of ARC
> > then we're actively working on upstreaming both projects.
> > 
> > Moreover initial support of ARC is already in upstream GCC but that lacks many
> > recent improvements. We're looking forward to get all our work upstream in coming
> > months.
> > 
> > Hope I answered your question. Otherwise please feel free to clarify your
> > question and I'll answer it then.
> > 
> > -Alexey
> > 
> 
> great, i just wanted to make sure that you are aware of the real
> upstream :) would hate to see patches bit rot in our tree

Well our position is we're working toward upstreaming.
Moreover we used to develop project on our GitHub and then submit things
upstream. But now when we have more experience and lots of stuff made its
way upstream we attempt to work literally upstream. Partially having maintainer's
repositories in upstream projects partially sending patches right away.

I mean I have no copy of OpenWRT tree on GitHub. I'm sending you guys
everything once I have anything to send :)

-Alexey
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tesarmar at gmail.com  Thu Aug 27 12:50:16 2015
From: tesarmar at gmail.com (Martin Tesar)
Date: Thu, 27 Aug 2015 18:50:16 +0200
Subject: [OpenWrt-Devel] [PATCH v4] bcm63xx: add Comtrend VR-3026e support
Message-ID: <1440694216-9953-1-git-send-email-tesarmar@gmail.com>

Add support for Comtrend VR-3026e v1.
The device is almost identical to the Comtrend VR-3025un.

Signed-off-by: Martin Tesar <tesarmar at gmail.com>
---
 target/linux/brcm63xx/base-files/etc/diag.sh       |  3 +
 .../base-files/etc/uci-defaults/02_network         |  3 +-
 .../base-files/etc/uci-defaults/09_fix_crc         |  1 +
 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |  3 +
 .../lib/preinit/05_init_interfaces_brcm63xx        |  1 +
 target/linux/brcm63xx/dts/vr-3026e.dts             | 88 ++++++++++++++++++++++
 target/linux/brcm63xx/image/Makefile               |  2 +
 .../brcm63xx/patches-3.18/572-board_VR-3026e.patch | 79 +++++++++++++++++++
 .../brcm63xx/patches-4.1/572-board_VR-3026e.patch  | 79 +++++++++++++++++++
 target/linux/brcm63xx/profiles/comtrend.mk         |  9 +++
 10 files changed, 267 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/brcm63xx/dts/vr-3026e.dts
 create mode 100644 target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch
 create mode 100644 target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch

diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
index 7916ac2..7826fad 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -39,6 +39,9 @@ set_state() {
 	vr-3025u)
 		status_led="VR-3025u:green:power"
 		;;
+	vr-3026e)
+		status_led="VR-3026e:green:power"
+		;;
 	wap-5813n)
 		status_led="WAP-5813n:green:power"
 		;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 11dd5b8..129514b 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -95,7 +95,8 @@ fast2704v2 |\
 hg655b |\
 p870hw-51a_v2 |\
 vr-3025un |\
-vr-3025u)
+vr-3025u |\
+vr-3026e)
 	ucidef_set_interface_lan "eth0.1"
 	ucidef_add_switch "eth0" "1" "1"
 	ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t"
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index 4a167dc..f307a4c 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -30,6 +30,7 @@ case "$(brcm63xx_board_name)" in
 	v2500v_bb |\
 	vr-3025u |\
 	vr-3025un |\
+	vr-3026e |\
 	wap-5813n)
 		do_fixcrc
 		;;
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 92fa5f2..1a97c86 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -102,6 +102,9 @@ brcm63xx_dt_detect() {
 	"Comtrend VR-3025un")
 		board_name="vr-3025un"
 		;;
+	"Comtrend VR-3026e")
+		board_name="vr-3026e"
+		;;
 	"Comtrend WAP-5813n")
 		board_name="wap-5813n"
 		;;
diff --git a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
index d6ec537..abf5b89 100644
--- a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
+++ b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
@@ -32,6 +32,7 @@ set_preinit_iface() {
 	v2110 |\
 	vr-3025un |\
 	vr-3025u |\
+	vr-3026e |\
 	wap-5813n)
 		ifname=eth0
 		;;
diff --git a/target/linux/brcm63xx/dts/vr-3026e.dts b/target/linux/brcm63xx/dts/vr-3026e.dts
new file mode 100644
index 0000000..49790e2
--- /dev/null
+++ b/target/linux/brcm63xx/dts/vr-3026e.dts
@@ -0,0 +1,88 @@
+/dts-v1/;
+
+#include "bcm6368.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Comtrend VR-3026e";
+	compatible = "comtrend,vr-3026e", "brcm,bcm6368";
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		debounce-interval = <60>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 2 1>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		dsl_green {
+			label = "VR-3026e:green:dsl";
+			gpios = <&gpio0 2 1>;
+		};
+		inet_green {
+			label = "VR-3026e:green:inet";
+			gpios = <&gpio0 5 0>;
+		};
+		lan1_green {
+			label = "VR-3026e:green:lan1";
+			gpios = <&gpio0 6 1>;
+		};
+		lan2_green {
+			label = "VR-3026e:green:lan2";
+			gpios = <&gpio0 7 1>;
+		};
+		lan3_green {
+			label = "VR-3026e:green:lan3";
+			gpios = <&gpio0 8 1>;
+		};
+		lan4_green {
+			label = "VR-3026e:green:lan4";
+			gpios = <&gpio0 9 1>;
+		};
+		power_green {
+			label = "VR-3026e:green:power";
+			gpios = <&gpio0 22 0>;
+			default-state = "on";
+		};
+		power_red {
+			label = "VR-3026e:red:power";
+			gpios = <&gpio0 24 0>;
+		};
+		inet_red {
+			label = "VR-3026e:red:inet";
+			gpios = <&gpio0 31 0>;
+		};
+	};
+};
+
+&pflash {
+	status = "ok";
+
+	linux,part-probe = "bcm63xxpart";
+
+	cfe at 0 {
+		label = "CFE";
+		reg = <0x000000 0x010000>;
+		read-only;
+	};
+
+	linux at 10000 {
+		label = "linux";
+		reg = <0x010000 0x7e0000>;
+	};
+
+	nvram at 7f0000 {
+		label = "nvram";
+		reg = <0x7f0000 0x010000>;
+	};
+};
diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
index 90b9fa6..9d3ec9f 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -535,6 +535,8 @@ $(eval $(call bcm63xxCfe,CT6373,CT-6373,ct-6373,CT6373-1,6358))
 $(eval $(call bcm63xxCfe,VR3025u,VR-3025u,vr-3025u,96368M-1541N,6368,--pad 16 --image-offset 0x20000 --block-size 0x20000))
 # Comtrend VR-3025un
 $(eval $(call bcm63xxCfe,VR3025un,VR-3025un,vr-3025un,96368M-1341N,6368,--pad 4))
+# Comtrend VR-3026e
+$(eval $(call bcm63xxCfe,VR3026e,VR-3026e,vr-3026e,96368MT-1341N1,6368,--pad 4))
 # Comtrend WAP-5813n
 $(eval $(call bcm63xxCfe,WAP5813n,WAP-5813n,wap-5813n,96369R-1231N,6368,--pad 4))
 # D-Link DSL-2640B, rev B2
diff --git a/target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch b/target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch
new file mode 100644
index 0000000..3142f84
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.18/572-board_VR-3026e.patch
@@ -0,0 +1,79 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2168,6 +2168,60 @@ static struct board_info __initdata boar
+	},
+ };
+
++static struct sprom_fixup __initdata vr3026e_fixups[] = {
++	{ .offset = 97, .value = 0xfeb3 },
++	{ .offset = 98, .value = 0x1618 },
++	{ .offset = 99, .value = 0xfab0 },
++	{ .offset = 113, .value = 0xfed1 },
++	{ .offset = 114, .value = 0x1609 },
++	{ .offset = 115, .value = 0xfad9 },
++};
++
++static struct board_info __initdata board_VR3026e = {
++	.name					= "96368MT-1341N1",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0				= 1,
++	.has_pci				= 1,
++	.use_fallback_sprom			= 1,
++	.has_ohci0				= 1,
++	.has_ehci0				= 1,
++
++	.has_enetsw				= 1,
++	.enetsw = {
++		.used_ports = {
++			[0] = {
++				.used		= 1,
++				.phy_id		= 1,
++				.name		= "port1",
++			},
++			[1] = {
++				.used		= 1,
++				.phy_id		= 2,
++				.name		= "port2",
++			},
++			[2] = {
++				.used		= 1,
++				.phy_id		= 3,
++				.name		= "port3",
++			},
++			[3] = {
++				.used		= 1,
++				.phy_id		= 4,
++				.name		= "port4",
++			},
++		},
++	},
++
++	.fallback_sprom = {
++		.type				= SPROM_BCM43222,
++		.pci_bus			= 0,
++		.pci_dev			= 1,
++		.board_fixups			= vr3026e_fixups,
++		.num_board_fixups		= ARRAY_SIZE(vr3026e_fixups),
++	},
++};
++
+ static struct b53_platform_data WAP5813n_b53_pdata = {
+	.alias = "eth0",
+ };
+@@ -2472,6 +2526,7 @@ static const struct board_info __initcon
+	&board_P870HW51A_V2,
+	&board_VR3025u,
+	&board_VR3025un,
++	&board_VR3026e,
+	&board_WAP5813n,
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
+@@ -2572,6 +2627,7 @@ static struct of_device_id const bcm963x
+	{ .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, },
+	{ .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, },
+	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
++	{ .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, },
+	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
+	{ .compatible = "huawei,hg655b", .data = &board_HG655b, },
+	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
diff --git a/target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch b/target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch
new file mode 100644
index 0000000..3142f84
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.1/572-board_VR-3026e.patch
@@ -0,0 +1,79 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2168,6 +2168,60 @@ static struct board_info __initdata boar
+	},
+ };
+
++static struct sprom_fixup __initdata vr3026e_fixups[] = {
++	{ .offset = 97, .value = 0xfeb3 },
++	{ .offset = 98, .value = 0x1618 },
++	{ .offset = 99, .value = 0xfab0 },
++	{ .offset = 113, .value = 0xfed1 },
++	{ .offset = 114, .value = 0x1609 },
++	{ .offset = 115, .value = 0xfad9 },
++};
++
++static struct board_info __initdata board_VR3026e = {
++	.name					= "96368MT-1341N1",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0				= 1,
++	.has_pci				= 1,
++	.use_fallback_sprom			= 1,
++	.has_ohci0				= 1,
++	.has_ehci0				= 1,
++
++	.has_enetsw				= 1,
++	.enetsw = {
++		.used_ports = {
++			[0] = {
++				.used		= 1,
++				.phy_id		= 1,
++				.name		= "port1",
++			},
++			[1] = {
++				.used		= 1,
++				.phy_id		= 2,
++				.name		= "port2",
++			},
++			[2] = {
++				.used		= 1,
++				.phy_id		= 3,
++				.name		= "port3",
++			},
++			[3] = {
++				.used		= 1,
++				.phy_id		= 4,
++				.name		= "port4",
++			},
++		},
++	},
++
++	.fallback_sprom = {
++		.type				= SPROM_BCM43222,
++		.pci_bus			= 0,
++		.pci_dev			= 1,
++		.board_fixups			= vr3026e_fixups,
++		.num_board_fixups		= ARRAY_SIZE(vr3026e_fixups),
++	},
++};
++
+ static struct b53_platform_data WAP5813n_b53_pdata = {
+	.alias = "eth0",
+ };
+@@ -2472,6 +2526,7 @@ static const struct board_info __initcon
+	&board_P870HW51A_V2,
+	&board_VR3025u,
+	&board_VR3025un,
++	&board_VR3026e,
+	&board_WAP5813n,
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
+@@ -2572,6 +2627,7 @@ static struct of_device_id const bcm963x
+	{ .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, },
+	{ .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, },
+	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
++	{ .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, },
+	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
+	{ .compatible = "huawei,hg655b", .data = &board_HG655b, },
+	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
diff --git a/target/linux/brcm63xx/profiles/comtrend.mk b/target/linux/brcm63xx/profiles/comtrend.mk
index 8c1b862..99fec4a 100644
--- a/target/linux/brcm63xx/profiles/comtrend.mk
+++ b/target/linux/brcm63xx/profiles/comtrend.mk
@@ -73,6 +73,15 @@ define Profile/VR3025un/Description
 endef
 $(eval $(call Profile,VR3025un))
 
+define Profile/VR3026e
+  NAME:=Comtrend VR-3026e
+  PACKAGES:=kmod-b43 wpad-mini
+endef
+define Profile/VR3026e/Description
+  Package set optimized for VR-3026e.
+endef
+$(eval $(call Profile,VR3026e))
+
 define Profile/WAP5813n
   NAME:=Comtrend WAP-5813n
   PACKAGES:=kmod-b43 wpad-mini \
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tw at wiznet.eu  Thu Aug 27 13:39:15 2015
From: tw at wiznet.eu (Tobias Welz)
Date: Thu, 27 Aug 2015 19:39:15 +0200
Subject: [OpenWrt-Devel] [PATCH] ramips: Added WIZnet WizFi630A Platform
	based on Ralink RT5350
In-Reply-To: <CAMTkhzObfiNnzydxbbd-OpteztQV-MKueSRfg+Yt8DGfi+WWcw@mail.gmail.com>
References: <CAMTkhzObfiNnzydxbbd-OpteztQV-MKueSRfg+Yt8DGfi+WWcw@mail.gmail.com>
Message-ID: <1440697155-1021-1-git-send-email-tw@wiznet.eu>

This patch is to add the WIZnet WizFi630A board as a new platform. 

Signed-off-by: Tobias Welz <tw at wiznet.eu>
---
 .../linux/ramips/base-files/etc/board.d/02_network |   10 ++
 target/linux/ramips/base-files/etc/diag.sh         |    3 +
 target/linux/ramips/base-files/lib/ramips.sh       |    3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
 target/linux/ramips/dts/WIZFI630A.dts              |  176 ++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |    4 +-
 target/linux/ramips/rt305x/profiles/wiznet.mk      |   17 ++
 7 files changed, 213 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
 create mode 100644 target/linux/ramips/rt305x/profiles/wiznet.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 6a2f042248d3..20f3367ac329 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -217,6 +217,12 @@ ramips_setup_interfaces()
 		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
 		ucidef_add_switch_vlan "switch0" "2" "5 6t"
 		;;
+	wizfi630a)
+		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+		ucidef_add_switch "switch0" "1" "1"
+		ucidef_add_switch_vlan "switch0" "1" "1 2 6t"
+		ucidef_add_switch_vlan "switch0" "2" "0 6t"
+		;;
 	y1s)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
@@ -327,6 +333,10 @@ ramips_setup_macs()
 		wan_mac=$(mtd_get_mac_binary factory 4)
 		lan_mac=$wan_mac
 		;;
+	wizfi630a)
+		lan_mac=$(mtd_get_mac_binary factory 4)
+		wan_mac=$(mtd_get_mac_binary factory 40)
+		;;
 	wsr-1166)
 		local index="$(find_mtd_index "board_data")"
 		wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index a4911b023cba..dfa0d02371ef 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -165,6 +165,9 @@ get_status_led() {
 	wzr-agl300nh)
 		status_led="$board:green:router"
 		;;
+	wizfi630a)
+		status_led="$board::run"
+		;;
 	wsr-1166|\
 	wsr-600)
 		status_led="$board:orange:diag"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 5cafd4593d60..7cdf22512afa 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -367,6 +367,9 @@ ramips_board_detect() {
 	*"WIZARD 8800")
 		name="wizard8800"
 		;;
+	*"WizFi630A")
+		name="wizfi630a"
+		;;                
 	*"WL-330N")
 		name="wl-330n"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 53e7070c99c9..b907faa57885 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -107,6 +107,7 @@ platform_check_image() {
 	whr-300hp2|\
 	whr-600d|\
 	whr-g300n|\
+	wizfi630a|\
 	wl-330n|\
 	wl-330n3g|\
 	wl-341v3|\
diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/WIZFI630A.dts
new file mode 100644
index 000000000000..545a7730af7d
--- /dev/null
+++ b/target/linux/ramips/dts/WIZFI630A.dts
@@ -0,0 +1,176 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "wizfi630a", "ralink,rt5350-soc";
+	model = "WIZnet WizFi630A";
+
+	chosen {
+		bootargs = "console=ttyS1,115200";
+	};
+
+	palmbus at 10000000 {
+		gpio1: gpio at 660 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "w25q128";
+				reg = <0>;
+				linux,modalias = "m25p80", "w25q128";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "uboot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "uboot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0xfb0000>;
+				};
+			};
+		};
+
+		uart at 500 {
+			compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+			reg = <0x500 0x100>;
+			resets = <&rstctrl 12>;
+			reset-names = "uart";
+			interrupt-parent = <&intc>;
+			interrupts = <5>;
+			reg-shift = <2>;
+			status = "okay";
+		};
+
+		uartlite at c00 {
+			compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+			reg = <0xc00 0x100>;
+			resets = <&rstctrl 19>;
+			reset-names = "uartl";
+			interrupt-parent = <&intc>;
+			interrupts = <12>;
+			reg-shift = <2>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&uartlite_pins>;
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag" ;
+				ralink,function = "gpio";
+			};
+		};
+
+		uartf_gpio_pins: uartf_gpio {
+			uartf_gpio {
+				ralink,group = "uartf";
+				ralink,function = "uartf";
+			};
+		};
+
+		uartlite_pins: uartlite {
+			uart {
+				ralink,group = "uartlite";
+				ralink,function = "uartlite";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x17>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		run {
+			label = "wizfi630a::run";
+			gpios = <&gpio0 1 1>;
+		};
+		uart1 {
+			label = "wizfi630a::uart1";
+			gpios = <&gpio0 18 1>;
+		};
+		uart2 {
+			label = "wizfi630a::uart2";
+			gpios = <&gpio0 21 1>;
+		};
+		wps {
+			label = "wizfi630a::wps";
+			gpios = <&gpio0 20 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 17 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
+		};
+		
+		scm1 {
+			label = "SCM1";
+			gpios = <&gpio0 19 1>;
+			linux,code = <0x100>;
+		};
+
+		scm2 {
+			label = "SCM2";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x101>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 2f4d4cbc617d..ac2e83cbb3de 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -608,7 +608,6 @@ Image/Build/Profile/W502U=$(call BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
 
 Image/Build/Profile/WCR150GN=$(call BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
 
-
 Image/Build/Profile/MZK-DP150N=$(call BuildFirmware/Default4M/$(1),$(1),mzk-dp150n,MZK-DP150N)
 
 buffalo_whrg300n_mtd_size=3801088
@@ -631,6 +630,8 @@ Image/Build/Profile/WHRG300N=$(call BuildFirmware/WHRG300N/$(1),$(1))
 
 Image/Build/Profile/WIZARD8800=$(call BuildFirmware/Default8M/$(1),$(1),wizard-8800,WIZARD8800,Linux Kernel Image)
 
+Image/Build/Profile/WIZFI630A=$(call BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
+
 Image/Build/Profile/WL-330N=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n,WL-330N)
 
 Image/Build/Profile/WL-330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL-330N3G)
@@ -763,6 +764,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/WCR150GN,$(1))
 	$(call Image/Build/Profile/WHRG300N,$(1))
 	$(call Image/Build/Profile/WIZARD8800,$(1))
+	$(call Image/Build/Profile/WIZFI630A,$(1))
 	$(call Image/Build/Profile/WL-330N,$(1))
 	$(call Image/Build/Profile/WL-330N3G,$(1))
 	$(call Image/Build/Profile/WL-341V3,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/wiznet.mk b/target/linux/ramips/rt305x/profiles/wiznet.mk
new file mode 100644
index 000000000000..f8e83242898d
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/wiznet.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/WIZFI630A
+	NAME:=WIZnet WizFi630A
+	PACKAGES:=\
+		kmod-usb2 
+endef
+
+define Profile/WIZFI630A/Description
+	Package set for WIZnet WizFi630A board
+endef
+$(eval $(call Profile,WIZFI630A))
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From adamk at mcservices.com.au  Thu Aug 27 19:03:35 2015
From: adamk at mcservices.com.au (Adam Kuklycz)
Date: Fri, 28 Aug 2015 09:03:35 +1000
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
 uClibc-ng
In-Reply-To: <55DEFFE6.2010900@mcservices.com.au>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org> <1440613687.15478.58.camel@synopsys.com>
 <55DE506A.6000504@mcservices.com.au> <55DED95B.2080809@openwrt.org>
 <55DEFFE6.2010900@mcservices.com.au>
Message-ID: <55DF9747.5020205@mcservices.com.au>

Just following up on the suspected memory leak, and image build sizes.

With the memory leak, it's not a memory leak as such rather than 
conntrackd filling things up with a log file.

After 22 hours of running:

root at gateway-openwrt:/tmp/log# ls -l
-rw-------    1 root     root      30080612 Aug 28 08:44 
conntrackd-stats.log
drwxr-xr-x    2 root     root            60 Aug 27 10:37 ddns
-rw-r--r--    1 root     root             0 Aug 25 13:06 lastlog
-rw-r--r--    1 root     root             0 Aug 27 10:36 log.nmbd
-rw-r--r--    1 root     root             0 Aug 27 10:36 log.smbd
-rw-r--r--    1 root     root             0 Aug 25 13:06 wtmp

Deleting the log file and then shutting down conntrackd cleared the used 
space.  I might look at omitting conntrackd from the builds in future.

Now for the build sizes.

musl does produce a larger image.  Below is the result of a 
configuration file I have used for trunk builds with releases 457xx and 
have reused for a build on r46734 the only changes being I selected 
either uclibc or musl for the toolchain, otherwise the config file used 
is identical.

MUSL:

-rw-r--r-- 1 adamk adamk  8126468 Aug 27 23:15 
openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin

UCLIBC:

-rw-r--r-- 1 adamk adamk  7864324 Aug 27 14:19 
openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin


Now, for stability sakes I'll want to reduce the image size anyway, with 
the bloat from latest kernels blowing things out by a good 300KB as 
well, but it looks like using musl adds around 300KB too.

Have the devs determined that perhaps the increased performance of using 
musl outweighs the hit on image sizes?

Cheers
Adam


On 27/08/15 22:17, Adam Kuklycz wrote:
> Hi Felix
>
> Thanks for clarifying.  I've also noticed what appears to be a memory 
> leak in my latest build as well which I am working on drilling down 
> now.  After a couple days of uptime the device is out of memory.  It's 
> much more pronounced when doing downloads with many connections 
> simultaneously.
>
> So all that said, yes I do agree there is always more bloat with each 
> kernel update sadly.  I'm busy now doing builds with both uclibc and 
> musl and will be interested to see the size comparisons. Will take 
> several hours so will report back in the morning (Australian time)
>
> Cheers
>
>
> On 27/08/15 19:33, Felix Fietkau wrote:
>> On 2015-08-27 01:48, Adam Kuklycz wrote:
>>> Hi all,
>>>
>>> I was wondering why OpenWRT switched to musl -- is it purely because
>>> uclibc hasn't actually maintained their code properly?
>> That's only part of the reason. Aside from the maintainenance, the code
>> quality of uClibc is also poor compared to musl.
>> musl also has better runtime performance and uses less RAM.
>>
>>> One of the things I have noticed since the CC trunk builds I did with
>>> kernel 3.18.11 + uclibc is that the image sizes have ballooned out by a
>>> fair bit.
>>>
>>> For example, a build on trunk r45705 which uses uclibc and kernel
>>> 3.18.11 would allow for most features to be included in a build e.g.
>>> openvpn, luci + ssl support, more connecting protocols than just pppoe
>>> and so on with a router sporting 8MB of flash.
>>>
>>> Now with recent trunk builds, with musl and kernel 4.1.x, I've had to
>>> cut features considerably just to make it fit.  Just adding openvpn 
>>> with
>>> openssl support means that an image prior that built at 7MB would
>>> balloon out to 8MB which would mean that the image would not be 
>>> produced
>>> as it is too big.
>> Last time I compared musl vs uClibc images, the size difference was
>> neglegible. I'd say it's more likely that the switch to Linux 4.1 caused
>> the size increase (the kernel does get more bloated with each new 
>> release).
>>
>> - Felix
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Thu Aug 27 19:11:14 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Fri, 28 Aug 2015 01:11:14 +0200
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
 uClibc-ng
In-Reply-To: <55DF9747.5020205@mcservices.com.au>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org> <1440613687.15478.58.camel@synopsys.com>
 <55DE506A.6000504@mcservices.com.au> <55DED95B.2080809@openwrt.org>
 <55DEFFE6.2010900@mcservices.com.au> <55DF9747.5020205@mcservices.com.au>
Message-ID: <55DF9912.9070808@openwrt.org>

On 2015-08-28 01:03, Adam Kuklycz wrote:
> Just following up on the suspected memory leak, and image build sizes.
> 
> With the memory leak, it's not a memory leak as such rather than 
> conntrackd filling things up with a log file.
> 
> After 22 hours of running:
> 
> root at gateway-openwrt:/tmp/log# ls -l
> -rw-------    1 root     root      30080612 Aug 28 08:44 
> conntrackd-stats.log
> drwxr-xr-x    2 root     root            60 Aug 27 10:37 ddns
> -rw-r--r--    1 root     root             0 Aug 25 13:06 lastlog
> -rw-r--r--    1 root     root             0 Aug 27 10:36 log.nmbd
> -rw-r--r--    1 root     root             0 Aug 27 10:36 log.smbd
> -rw-r--r--    1 root     root             0 Aug 25 13:06 wtmp
> 
> Deleting the log file and then shutting down conntrackd cleared the used 
> space.  I might look at omitting conntrackd from the builds in future.
> 
> Now for the build sizes.
> 
> musl does produce a larger image.  Below is the result of a 
> configuration file I have used for trunk builds with releases 457xx and 
> have reused for a build on r46734 the only changes being I selected 
> either uclibc or musl for the toolchain, otherwise the config file used 
> is identical.
> 
> MUSL:
> 
> -rw-r--r-- 1 adamk adamk  8126468 Aug 27 23:15 
> openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin
> 
> UCLIBC:
> 
> -rw-r--r-- 1 adamk adamk  7864324 Aug 27 14:19 
> openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin
> 
> 
> Now, for stability sakes I'll want to reduce the image size anyway, with 
> the bloat from latest kernels blowing things out by a good 300KB as 
> well, but it looks like using musl adds around 300KB too.
> 
> Have the devs determined that perhaps the increased performance of using 
> musl outweighs the hit on image sizes?
Images are padded, often to 256 KB (which is the size increase of your
image). This means that it might be that musl just slightly increases
the image size enough to push it to the next 256KB boundary.

Comparing the size of 
build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/root.squashfs-raw
between uclibc and musl should be more accurate.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From adamk at mcservices.com.au  Thu Aug 27 19:34:01 2015
From: adamk at mcservices.com.au (Adam Kuklycz)
Date: Fri, 28 Aug 2015 09:34:01 +1000
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
 uClibc-ng
In-Reply-To: <55DF9912.9070808@openwrt.org>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org> <1440613687.15478.58.camel@synopsys.com>
 <55DE506A.6000504@mcservices.com.au> <55DED95B.2080809@openwrt.org>
 <55DEFFE6.2010900@mcservices.com.au> <55DF9747.5020205@mcservices.com.au>
 <55DF9912.9070808@openwrt.org>
Message-ID: <55DF9E69.5090307@mcservices.com.au>

Fair enough.

MUSL:
-rw-r--r--  1 adamk adamk  6700676 Aug 27 23:15 root.squashfs

UCLIBC:
-rw-r--r--  1 adamk adamk  6601764 Aug 27 14:19 root.squashfs

So about 100KB difference.

Running Ubuntu 14.04.2 LTS x64 here.

I guess what I am looking at is the final product, which is around 300KB 
bigger in size.  Regardless, I'm going to need to reduce features for 
routers with 8MB of flash, as kernel bloat also adds around another 300KB.



On 28/08/15 09:11, Felix Fietkau wrote:
> On 2015-08-28 01:03, Adam Kuklycz wrote:
>> Just following up on the suspected memory leak, and image build sizes.
>>
>> With the memory leak, it's not a memory leak as such rather than
>> conntrackd filling things up with a log file.
>>
>> After 22 hours of running:
>>
>> root at gateway-openwrt:/tmp/log# ls -l
>> -rw-------    1 root     root      30080612 Aug 28 08:44
>> conntrackd-stats.log
>> drwxr-xr-x    2 root     root            60 Aug 27 10:37 ddns
>> -rw-r--r--    1 root     root             0 Aug 25 13:06 lastlog
>> -rw-r--r--    1 root     root             0 Aug 27 10:36 log.nmbd
>> -rw-r--r--    1 root     root             0 Aug 27 10:36 log.smbd
>> -rw-r--r--    1 root     root             0 Aug 25 13:06 wtmp
>>
>> Deleting the log file and then shutting down conntrackd cleared the used
>> space.  I might look at omitting conntrackd from the builds in future.
>>
>> Now for the build sizes.
>>
>> musl does produce a larger image.  Below is the result of a
>> configuration file I have used for trunk builds with releases 457xx and
>> have reused for a build on r46734 the only changes being I selected
>> either uclibc or musl for the toolchain, otherwise the config file used
>> is identical.
>>
>> MUSL:
>>
>> -rw-r--r-- 1 adamk adamk  8126468 Aug 27 23:15
>> openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin
>>
>> UCLIBC:
>>
>> -rw-r--r-- 1 adamk adamk  7864324 Aug 27 14:19
>> openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin
>>
>>
>> Now, for stability sakes I'll want to reduce the image size anyway, with
>> the bloat from latest kernels blowing things out by a good 300KB as
>> well, but it looks like using musl adds around 300KB too.
>>
>> Have the devs determined that perhaps the increased performance of using
>> musl outweighs the hit on image sizes?
> Images are padded, often to 256 KB (which is the size increase of your
> image). This means that it might be that musl just slightly increases
> the image size enough to push it to the next 256KB boundary.
>
> Comparing the size of
> build_dir/target-mips_34kc_musl-1.1.10/linux-ar71xx_generic/root.squashfs-raw
> between uclibc and musl should be more accurate.
>
> - Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Fri Aug 28 02:27:09 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Fri, 28 Aug 2015 08:27:09 +0200
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
 uClibc-ng
In-Reply-To: <55DF9E69.5090307@mcservices.com.au>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org> <1440613687.15478.58.camel@synopsys.com>
 <55DE506A.6000504@mcservices.com.au> <55DED95B.2080809@openwrt.org>
 <55DEFFE6.2010900@mcservices.com.au> <55DF9747.5020205@mcservices.com.au>
 <55DF9912.9070808@openwrt.org> <55DF9E69.5090307@mcservices.com.au>
Message-ID: <55DFFF3D.90907@openwrt.org>

On 2015-08-28 01:34, Adam Kuklycz wrote:
> Fair enough.
> 
> MUSL:
> -rw-r--r--  1 adamk adamk  6700676 Aug 27 23:15 root.squashfs
> 
> UCLIBC:
> -rw-r--r--  1 adamk adamk  6601764 Aug 27 14:19 root.squashfs
> 
> So about 100KB difference.
> 
> Running Ubuntu 14.04.2 LTS x64 here.
> 
> I guess what I am looking at is the final product, which is around 300KB 
> bigger in size.  Regardless, I'm going to need to reduce features for 
> routers with 8MB of flash, as kernel bloat also adds around another 300KB.
Can you please post the output of running ./scripts/diffconfig.sh?

Thanks,

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From adamk at mcservices.com.au  Fri Aug 28 03:33:37 2015
From: adamk at mcservices.com.au (Adam Kuklycz)
Date: Fri, 28 Aug 2015 17:33:37 +1000
Subject: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of
 uClibc-ng
In-Reply-To: <55DFFF3D.90907@openwrt.org>
References: <1440612682-13834-1-git-send-email-abrodkin@synopsys.com>
 <55DE0371.4080600@openwrt.org> <1440613687.15478.58.camel@synopsys.com>
 <55DE506A.6000504@mcservices.com.au> <55DED95B.2080809@openwrt.org>
 <55DEFFE6.2010900@mcservices.com.au> <55DF9747.5020205@mcservices.com.au>
 <55DF9912.9070808@openwrt.org> <55DF9E69.5090307@mcservices.com.au>
 <55DFFF3D.90907@openwrt.org>
Message-ID: <55E00ED1.9030503@mcservices.com.au>

Hi Felix

Here is the output you requested.  Let me know if there's anything else 
you'd like.

adamk at Precision-M4500:~/ChaosCalmer-r46734$ ./scripts/diffconfig.sh
CONFIG_TARGET_ar71xx=y
CONFIG_TARGET_ar71xx_generic=y
CONFIG_TARGET_ar71xx_generic_Default=y
CONFIG_DEVEL=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_IB=y
CONFIG_IB_STANDALONE=y
CONFIG_MAKE_TOOLCHAIN=y
CONFIG_OPENSSL_WITH_EC=y
CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y
CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y
CONFIG_OPENVPN_openssl_ENABLE_HTTP=y
CONFIG_OPENVPN_openssl_ENABLE_LZO=y
CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y
CONFIG_OPENVPN_openssl_ENABLE_PF=y
CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y
CONFIG_OPENVPN_openssl_ENABLE_SERVER=y
CONFIG_OPENVPN_openssl_ENABLE_SMALL=y
CONFIG_OPENVPN_openssl_ENABLE_SOCKS=y
CONFIG_PACKAGE_6in4=y
CONFIG_PACKAGE_6rd=y
CONFIG_PACKAGE_SAMBA_MAX_DEBUG_LEVEL=-1
CONFIG_PACKAGE_aiccu=y
CONFIG_PACKAGE_arptables=y
CONFIG_PACKAGE_block-mount=y
CONFIG_PACKAGE_ca-certificates=y
CONFIG_PACKAGE_chat=y
CONFIG_PACKAGE_comgt=y
CONFIG_PACKAGE_comgt-directip=y
CONFIG_PACKAGE_comgt-ncm=y
CONFIG_PACKAGE_conntrack-tools=y
CONFIG_PACKAGE_ddns-scripts=y
CONFIG_PACKAGE_gre=y
CONFIG_PACKAGE_grev4=y
CONFIG_PACKAGE_grev6=y
CONFIG_PACKAGE_hd-idle=y
CONFIG_PACKAGE_hostapd-utils=y
CONFIG_PACKAGE_iftop=y
CONFIG_PACKAGE_ip=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-account=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-geoip=y
CONFIG_PACKAGE_iptables-mod-ipopt=y
CONFIG_PACKAGE_iptables-mod-iprange=y
CONFIG_PACKAGE_iptables-mod-nat-extra=y
CONFIG_PACKAGE_iptaccount=y
CONFIG_PACKAGE_iputils-arping=y
CONFIG_PACKAGE_iputils-ping=y
CONFIG_PACKAGE_iputils-ping6=y
CONFIG_PACKAGE_iputils-tracepath=y
CONFIG_PACKAGE_iputils-tracepath6=y
CONFIG_PACKAGE_iputils-traceroute6=y
CONFIG_PACKAGE_kmod-arptables=y
CONFIG_PACKAGE_kmod-fs-msdos=y
CONFIG_PACKAGE_kmod-fs-ntfs=y
CONFIG_PACKAGE_kmod-fs-vfat=y
CONFIG_PACKAGE_kmod-fuse=y
CONFIG_PACKAGE_kmod-gre=y
CONFIG_PACKAGE_kmod-ifb=y
CONFIG_PACKAGE_kmod-ipt-account=y
CONFIG_PACKAGE_kmod-ipt-compat-xtables=y
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y
CONFIG_PACKAGE_kmod-ipt-geoip=y
CONFIG_PACKAGE_kmod-ipt-ipopt=y
CONFIG_PACKAGE_kmod-ipt-iprange=y
CONFIG_PACKAGE_kmod-ipt-ipset=y
CONFIG_PACKAGE_kmod-ipt-nat-extra=y
CONFIG_PACKAGE_kmod-iptunnel=y
CONFIG_PACKAGE_kmod-iptunnel4=y
CONFIG_PACKAGE_kmod-mii=y
CONFIG_PACKAGE_kmod-nf-conntrack-netlink=y
CONFIG_PACKAGE_kmod-nfnetlink=y
CONFIG_PACKAGE_kmod-nls-cp437=y
CONFIG_PACKAGE_kmod-nls-iso8859-1=y
CONFIG_PACKAGE_kmod-sched=y
CONFIG_PACKAGE_kmod-sched-connmark=y
CONFIG_PACKAGE_kmod-sched-core=y
CONFIG_PACKAGE_kmod-scsi-core=y
CONFIG_PACKAGE_kmod-sit=y
CONFIG_PACKAGE_kmod-tun=y
CONFIG_PACKAGE_kmod-usb-net=y
CONFIG_PACKAGE_kmod-usb-net-cdc-mbim=y
CONFIG_PACKAGE_kmod-usb-net-cdc-ncm=y
CONFIG_PACKAGE_kmod-usb-net-huawei-cdc-ncm=y
CONFIG_PACKAGE_kmod-usb-net-qmi-wwan=y
CONFIG_PACKAGE_kmod-usb-net-sierrawireless=y
CONFIG_PACKAGE_kmod-usb-printer=y
CONFIG_PACKAGE_kmod-usb-serial=y
CONFIG_PACKAGE_kmod-usb-serial-option=y
CONFIG_PACKAGE_kmod-usb-serial-sierrawireless=y
CONFIG_PACKAGE_kmod-usb-serial-wwan=y
CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_kmod-usb-wdm=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblzo=y
CONFIG_PACKAGE_libmnl=y
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_libnet-1.2.x=y
CONFIG_PACKAGE_libnetfilter-conntrack=y
CONFIG_PACKAGE_libnetfilter-cthelper=y
CONFIG_PACKAGE_libnetfilter-cttimeout=y
CONFIG_PACKAGE_libnetfilter-queue=y
CONFIG_PACKAGE_libnetsnmp=y
CONFIG_PACKAGE_libnfnetlink=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_libpolarssl=y
CONFIG_PACKAGE_libpthread=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libsysfs=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuci-lua=y
CONFIG_PACKAGE_libusb-1.0=y
CONFIG_PACKAGE_libustream-polarssl=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-commands=y
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_luci-app-diag-core=y
CONFIG_PACKAGE_luci-app-diag-devinfo=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-hd-idle=y
CONFIG_PACKAGE_luci-app-mwan3=y
CONFIG_PACKAGE_luci-app-ntpc=y
CONFIG_PACKAGE_luci-app-openvpn=y
CONFIG_PACKAGE_luci-app-p910nd=y
CONFIG_PACKAGE_luci-app-qos=y
CONFIG_PACKAGE_luci-app-radvd=y
CONFIG_PACKAGE_luci-app-samba=y
CONFIG_PACKAGE_luci-app-sqm=y
CONFIG_PACKAGE_luci-app-upnp=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-proto-3g=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-ssl=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_miniupnpd=y
CONFIG_PACKAGE_mtr=y
CONFIG_PACKAGE_mwan3=y
CONFIG_PACKAGE_netdiscover=y
CONFIG_PACKAGE_ntfs-3g=y
CONFIG_PACKAGE_ntpclient=y
CONFIG_PACKAGE_openssl-util=y
CONFIG_PACKAGE_openvpn-easy-rsa=y
CONFIG_PACKAGE_openvpn-openssl=y
CONFIG_PACKAGE_p910nd=y
CONFIG_PACKAGE_px5g=y
CONFIG_PACKAGE_qos-scripts=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_samba36-server=y
CONFIG_PACKAGE_snmpd=y
CONFIG_PACKAGE_sqm-scripts=y
CONFIG_PACKAGE_tc=y
CONFIG_PACKAGE_tcpdump-mini=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_umbim=y
CONFIG_PACKAGE_uqmi=y
CONFIG_PACKAGE_usb-modeswitch=y
CONFIG_PACKAGE_usbreset=y
CONFIG_PACKAGE_usbutils=y
CONFIG_PACKAGE_wifitoggle=y
CONFIG_PACKAGE_wireless-tools=y
CONFIG_PACKAGE_wpad=y
# CONFIG_PACKAGE_wpad-mini is not set
CONFIG_PACKAGE_wwan=y
CONFIG_PACKAGE_zabbix-agentd=y
CONFIG_PACKAGE_zabbix-extra-mac80211=y
CONFIG_PACKAGE_zabbix-extra-network=y
CONFIG_PACKAGE_zabbix-extra-wifi=y
CONFIG_PACKAGE_zlib=y
CONFIG_SDK=y
CONFIG_WPA_SUPPLICANT_INTERNAL=y
# CONFIG_UCLIBC_USE_VERSION_0_9_33 is not set
adamk at Precision-M4500:~/ChaosCalmer-r46734$


On 28/08/15 16:27, Felix Fietkau wrote:
> On 2015-08-28 01:34, Adam Kuklycz wrote:
>> Fair enough.
>>
>> MUSL:
>> -rw-r--r--  1 adamk adamk  6700676 Aug 27 23:15 root.squashfs
>>
>> UCLIBC:
>> -rw-r--r--  1 adamk adamk  6601764 Aug 27 14:19 root.squashfs
>>
>> So about 100KB difference.
>>
>> Running Ubuntu 14.04.2 LTS x64 here.
>>
>> I guess what I am looking at is the final product, which is around 300KB
>> bigger in size.  Regardless, I'm going to need to reduce features for
>> routers with 8MB of flash, as kernel bloat also adds around another 300KB.
> Can you please post the output of running ./scripts/diffconfig.sh?
>
> Thanks,
>
> - Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Fri Aug 28 04:57:14 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Fri, 28 Aug 2015 10:57:14 +0200
Subject: [OpenWrt-Devel] [PATCH 0/2] Avoid unnecessary libopenssl build
	dependencies
Message-ID: <cover.1440751910.git.mschiffer@universe-factory.net>

Hi,
these two patches allow building OpenWrt in its default configuration
without having to download and build libopenssl (which seems desirable as
the OpenSSL download links break so often).


Matthias Schiffer (2):
  opkg: work around unconditional libopenssl build dependency
  hostapd: work around unconditional libopenssl build dependency

 package/network/services/hostapd/Makefile | 2 +-
 package/system/opkg/Makefile              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Fri Aug 28 04:57:15 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Fri, 28 Aug 2015 10:57:15 +0200
Subject: [OpenWrt-Devel] [PATCH 1/2] opkg: work around unconditional
	libopenssl build dependency
In-Reply-To: <cover.1440751910.git.mschiffer@universe-factory.net>
References: <cover.1440751910.git.mschiffer@universe-factory.net>
Message-ID: <19282ca72228aac85fcb9adff5332dee773b27cd.1440751910.git.mschiffer@universe-factory.net>

As the OpenWrt build system only resolves build dependencies per directory,
all opkg variants were causing libopenssl to be downloaded and built,
not only opkg-smime. Fix this by applying the same workaround as in
ustream-ssl.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/system/opkg/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 32bcf2b..4da4d46 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -72,7 +72,7 @@ endef
 define Package/opkg-smime
   $(call Package/opkg/Default)
   TITLE+= (with S/MIME signature support)
-  DEPENDS+=+libopenssl
+  DEPENDS+=+PACKAGE_opkg-smime:libopenssl
   VARIANT:=smime
 endef
 
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mschiffer at universe-factory.net  Fri Aug 28 04:57:16 2015
From: mschiffer at universe-factory.net (Matthias Schiffer)
Date: Fri, 28 Aug 2015 10:57:16 +0200
Subject: [OpenWrt-Devel] [PATCH 2/2] hostapd: work around unconditional
	libopenssl build dependency
In-Reply-To: <cover.1440751910.git.mschiffer@universe-factory.net>
References: <cover.1440751910.git.mschiffer@universe-factory.net>
Message-ID: <342274378ad9f1e6dc991309b485075ff8ee8a5e.1440751910.git.mschiffer@universe-factory.net>

As the OpenWrt build system only resolves build dependencies per directory,
all hostapd variants were causing libopenssl to be downloaded and built,
not only wpad-mesh. Fix this by applying the same workaround as in
ustream-ssl.

Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/network/services/hostapd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index c16cb11..c39b6b4 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -177,7 +177,7 @@ endef
 define Package/wpad-mesh
 $(call Package/wpad/Default)
   TITLE+= (with 802.11s mesh and SAE support)
-  DEPENDS:=$(DRV_DEPENDS) +libubus +libopenssl + at CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
+  DEPENDS:=$(DRV_DEPENDS) +libubus +PACKAGE_wpad-mesh:libopenssl + at CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
   CONFLICTS:=@WPA_SUPPLICANT_INTERNAL
   VARIANT:=wpad-mesh
 endef
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From fercerpav at gmail.com  Fri Aug 28 06:09:38 2015
From: fercerpav at gmail.com (Paul Fertser)
Date: Fri, 28 Aug 2015 13:09:38 +0300
Subject: [OpenWrt-Devel] [PATCH] target: ar71xx: add support for Comfast
	CF-E316N v2 board
Message-ID: <1440756578-25758-1-git-send-email-fercerpav@gmail.com>

This adds full support (sans sysupgrading from vendor firmware) for the COMFAST
CF-E316N v2 (aka CF-E316V2, CF-E316N-V2 and CF-E316Nv2.0, no FCC ID) by
Shenzhen Four Seas Global Link Network Technology Co., Ltd (this company is
actively refusing to provide GPL'd sources for the OpenWrt version they ship
with the device, damn them).

Signed-off-by: Paul Fertser <fercerpav at gmail.com>
---
 target/linux/ar71xx/base-files/etc/diag.sh         |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds     |   6 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ar71xx/config-4.1                     |   1 +
 .../files/arch/mips/ath79/mach-cf-e316n-v2.c       | 128 +++++++++++++++++++++
 target/linux/ar71xx/generic/profiles/comfast.mk    |  19 +++
 target/linux/ar71xx/image/Makefile                 |   8 ++
 .../700-MIPS-ath79-openwrt-machines.patch          |  51 +++++---
 9 files changed, 204 insertions(+), 16 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c
 create mode 100644 target/linux/ar71xx/generic/profiles/comfast.mk

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 36de775..1b1f6c7 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -56,6 +56,9 @@ get_status_led() {
 	cap4200ag)
 		status_led="senao:green:pwr"
 		;;
+	cf-e316n-v2)
+		status_led="$(ar71xx_board_name):blue:wan"
+		;;
 	cpe510)
 		status_led="tp-link:green:link4"
 		;;
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 e7f7a4c..6ecc0e2 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -96,6 +96,12 @@ carambola2)
 	ucidef_set_led_wlan "wlan" "WLAN" "carambola2:green:wlan" "phy0tpt"
 	;;
 
+cf-e316n-v2)
+	ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0"
+	ucidef_set_led_netdev "wan" "WAN" "$board:blue:wan" "eth1"
+	ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
+	;;
+
 cpe510)
 	ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20"
 	ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index e1f345e..d495940 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -392,6 +392,9 @@ ar71xx_board_detect() {
 	*CAP4200AG)
 		name="cap4200ag"
 		;;
+	*"COMFAST CF-E316N v2")
+		name="cf-e316n-v2"
+		;;
 	*"CPE210/220/510/520")
 		name="cpe510"
 		tplink_pharos_board_detect
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index c1962e4..673ee4e 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -199,6 +199,7 @@ platform_check_image() {
 	ap81 | \
 	ap83 | \
 	ap132 | \
+	cf-e316n-v2 | \
 	dgl-5500-a1 |\
 	dhp-1565-a1 |\
 	dir-505-a1 | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 21c4601..97cbc13 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -50,6 +50,7 @@ CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
 CONFIG_ATH79_MACH_BSB=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
+CONFIG_ATH79_MACH_CF_E316N_V2=y
 CONFIG_ATH79_MACH_CPE510=y
 CONFIG_ATH79_MACH_DB120=y
 CONFIG_ATH79_MACH_DGL_5500_A1=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c
new file mode 100644
index 0000000..c310a1b
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c
@@ -0,0 +1,128 @@
+/*
+ *  COMFAST CF-E316N v2
+ *  by Shenzhen Four Seas Global Link Network Technology Co., Ltd
+ *
+ *  aka CF-E316V2, CF-E316N-V2 and CF-E316Nv2.0 (no FCC ID)
+ *
+ *  Copyright (C) 2015 Paul Fertser <fercerpav at gmail.com>
+ *
+ *  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.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/timer.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+static struct gpio_led cf_e316n_v2_leds_gpio[] __initdata = {
+	{
+		.name		= "cf-e316n-v2:blue:diag",
+		.gpio		= 0,
+		.active_low	= 0,
+	}, {
+		.name		= "cf-e316n-v2:red:diag",
+		.gpio		= 2,
+		.active_low	= 0,
+	}, {
+		.name		= "cf-e316n-v2:green:diag",
+		.gpio		= 3,
+		.active_low	= 0,
+	}, {
+		.name		= "cf-e316n-v2:blue:wlan",
+		.gpio		= 12,
+		.active_low	= 1,
+	}, {
+		.name		= "cf-e316n-v2:blue:wan",
+		.gpio		= 17,
+		.active_low	= 1,
+	}, {
+		.name		= "cf-e316n-v2:blue:lan",
+		.gpio		= 19,
+		.active_low	= 1,
+	},
+};
+
+static struct gpio_keys_button cf_e316n_v2_gpio_keys[] __initdata = {
+	{
+		.desc		= "Reset button",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = 60,
+		.gpio		= 20,
+		.active_low	= 1,
+	},
+};
+
+/* There's a Pericon Technology PT7A7514 connected to GPIO 16 */
+#define EXT_WATCHDOG_GPIO	16
+static struct timer_list gpio_wdt_timer;
+
+static void gpio_wdt_toggle(unsigned long period)
+{
+	static int state;
+	state = !state;
+	gpio_set_value(EXT_WATCHDOG_GPIO, state);
+	mod_timer(&gpio_wdt_timer, jiffies + period);
+}
+
+static void __init cf_e316n_v2_setup(void)
+{
+	u8 *maclan = (u8 *) KSEG1ADDR(0x1f010000);
+	u8 *macwlan = (u8 *) KSEG1ADDR(0x1f011002);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1f011000);
+	u8 tmpmac[ETH_ALEN];
+
+	gpio_request(EXT_WATCHDOG_GPIO, "PT7A7514 watchdog");
+	gpio_direction_output(EXT_WATCHDOG_GPIO, 0);
+	setup_timer(&gpio_wdt_timer, gpio_wdt_toggle, msecs_to_jiffies(500));
+	gpio_wdt_toggle(msecs_to_jiffies(1));
+
+	ath79_register_m25p80(NULL);
+
+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP);
+	ath79_register_mdio(1, 0x0);
+
+	/* GMAC0 is connected to the PHY0 of the internal switch */
+	ath79_switch_data.phy4_mii_en = 1;
+	ath79_switch_data.phy_poll_mask = BIT(0);
+	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+	ath79_eth0_data.phy_mask = BIT(0);
+	ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
+	ath79_init_mac(ath79_eth0_data.mac_addr, maclan, 0);
+	ath79_register_eth(0);
+
+	/* GMAC1 is connected to the internal switch */
+	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+	ath79_init_mac(ath79_eth1_data.mac_addr, maclan, 2);
+	ath79_register_eth(1);
+
+	/* Enable 2x Skyworks SE2576L WLAN power amplifiers */
+	gpio_request(13, "RF Amp 1");
+	gpio_direction_output(13, 1);
+	gpio_request(14, "RF Amp 2");
+	gpio_direction_output(14, 1);
+	ath79_init_mac(tmpmac, macwlan, 0);
+	ath79_register_wmac(ee, tmpmac);
+
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(cf_e316n_v2_leds_gpio),
+				 cf_e316n_v2_leds_gpio);
+
+	ath79_register_gpio_keys_polled(1, 20,
+					ARRAY_SIZE(cf_e316n_v2_gpio_keys),
+					cf_e316n_v2_gpio_keys);
+}
+
+MIPS_MACHINE(ATH79_MACH_CF_E316N_V2, "CF-E316N-V2", "COMFAST CF-E316N v2",
+	     cf_e316n_v2_setup);
diff --git a/target/linux/ar71xx/generic/profiles/comfast.mk b/target/linux/ar71xx/generic/profiles/comfast.mk
new file mode 100644
index 0000000..5d447e5
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/comfast.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/CF-E316N-V2
+        NAME:=COMFAST CF-E316N v2
+        PACKAGES:=
+endef
+
+define Profile/CF-E316N-V2/Description
+        Package set optimised for the COMFAST CF-E316N v2
+        by Shenzhen Four Seas Global Link Network Technology Co., Ltd
+        aka CF-E316V2, CF-E316N-V2 and CF-E316Nv2.0 (no FCC ID)
+endef
+
+$(eval $(call Profile,CF-E316N-V2))
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 8f609de..e72f524 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -188,6 +188,14 @@ define Device/carambola2
 endef
 TARGET_DEVICES += carambola2
 
+define Device/cf-e316n-v2
+  BOARDNAME = CF-E316N-V2
+  IMAGE_SIZE = 16192k
+  CONSOLE = ttyS0,115200
+  MTDPARTS = spi0.0:64k(u-boot)ro,64k(art)ro,16192k(firmware),64k(nvram)ro
+endef
+TARGET_DEVICES += cf-e316n-v2
+
 define Device/wndr3700
   BOARDNAME = WNDR3700
   NETGEAR_KERNEL_MAGIC = 0x33373030
diff --git a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
index 02ebd1b..ade0c2c 100644
--- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
+++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
@@ -1,6 +1,8 @@
---- a/arch/mips/ath79/machtypes.h
-+++ b/arch/mips/ath79/machtypes.h
-@@ -16,24 +16,207 @@
+Index: linux-4.1.5/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-4.1.5.orig/arch/mips/ath79/machtypes.h	2015-08-16 16:57:42.480656824 +0100
++++ linux-4.1.5/arch/mips/ath79/machtypes.h	2015-08-16 16:59:33.868656175 +0100
+@@ -16,24 +16,208 @@
  
  enum ath79_mach_type {
  	ATH79_MACH_GENERIC = 0,
@@ -28,6 +30,7 @@
 +	ATH79_MACH_BHU_BXU2000N2_A1,	/* BHU BXU2000n-2 A1 */
 +	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
 +	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
++	ATH79_MACH_CF_E316N_V2,		/* COMFAST CF-E316N v2 */
 +	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
  	ATH79_MACH_DB120,		/* Atheros DB120 reference board */
  	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
@@ -208,9 +211,11 @@
  };
  
  #endif /* _ATH79_MACHTYPE_H */
---- a/arch/mips/ath79/Kconfig
-+++ b/arch/mips/ath79/Kconfig
-@@ -2,6 +2,90 @@ if ATH79
+Index: linux-4.1.5/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-4.1.5.orig/arch/mips/ath79/Kconfig	2015-08-16 16:57:42.480656824 +0100
++++ linux-4.1.5/arch/mips/ath79/Kconfig	2015-08-16 17:03:19.472654861 +0100
+@@ -2,6 +2,90 @@
  
  menu "Atheros AR71XX/AR724X/AR913X machine selection"
  
@@ -301,7 +306,7 @@
  config ATH79_MACH_AP121
  	bool "Atheros AP121 reference board"
  	select SOC_AR933X
-@@ -11,62 +95,1107 @@ config ATH79_MACH_AP121
+@@ -11,62 +95,1107 @@
  	select ATH79_DEV_M25P80
  	select ATH79_DEV_USB
  	select ATH79_DEV_WMAC
@@ -1437,7 +1442,7 @@
  
  config ATH79_MACH_UBNT_XM
  	bool "Ubiquiti Networks XM/UniFi boards"
-@@ -83,6 +1212,97 @@ config ATH79_MACH_UBNT_XM
+@@ -83,6 +1212,106 @@
  	  Say 'Y' here if you want your kernel to support the
  	  Ubiquiti Networks XM (rev 1.0) board.
  
@@ -1511,6 +1516,15 @@
 +	select ATH79_DEV_USB
 +	select ATH79_DEV_WMAC
 +
++config ATH79_MACH_CF_E316N_V2
++	bool "COMFAST CF-E316N v2 board"
++	select SOC_AR934X
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_WMAC
++
 +config ATH79_MACH_BHU_BXU2000N2_A
 +	bool "BHU BXU2000n-2 rev. A support"
 +	select SOC_AR934X
@@ -1535,7 +1549,7 @@
  endmenu
  
  config SOC_AR71XX
-@@ -134,7 +1354,10 @@ config ATH79_DEV_DSA
+@@ -134,7 +1364,10 @@
  config ATH79_DEV_ETH
  	def_bool n
  
@@ -1547,7 +1561,7 @@
  	def_bool n
  
  config ATH79_DEV_GPIO_BUTTONS
-@@ -164,6 +1387,11 @@ config ATH79_PCI_ATH9K_FIXUP
+@@ -164,6 +1397,11 @@
  	def_bool n
  
  config ATH79_ROUTERBOOT
@@ -1559,9 +1573,11 @@
  	def_bool n
  
  endif
---- a/arch/mips/ath79/Makefile
-+++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,133 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)		+= route
+Index: linux-4.1.5/arch/mips/ath79/Makefile
+===================================================================
+--- linux-4.1.5.orig/arch/mips/ath79/Makefile	2015-08-16 16:57:42.480656824 +0100
++++ linux-4.1.5/arch/mips/ath79/Makefile	2015-08-16 17:05:19.072654165 +0100
+@@ -38,9 +38,134 @@
  #
  # Machines
  #
@@ -1583,6 +1599,7 @@
 +obj-$(CONFIG_ATH79_MACH_AW_NR580)	+= mach-aw-nr580.o
 +obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)+= mach-bhu-bxu2000n2-a.o
 +obj-$(CONFIG_ATH79_MACH_CAP4200AG)	+= mach-cap4200ag.o
++obj-$(CONFIG_ATH79_MACH_CF_E316N_V2)	+= mach-cf-e316n-v2.o
 +obj-$(CONFIG_ATH79_MACH_CPE510)		+= mach-cpe510.o
  obj-$(CONFIG_ATH79_MACH_DB120)		+= mach-db120.o
 +obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)	+= mach-dlan-pro-500-wp.o
@@ -1695,9 +1712,11 @@
 +obj-$(CONFIG_ATH79_MACH_ZCN_1523H)	+= mach-zcn-1523h.o
 +obj-$(CONFIG_ATH79_MACH_CARAMBOLA2)	+= mach-carambola2.o
 +obj-$(CONFIG_ATH79_MACH_NBG6716)	+= mach-nbg6716.o
---- a/arch/mips/ath79/prom.c
-+++ b/arch/mips/ath79/prom.c
-@@ -130,6 +130,13 @@ void __init prom_init(void)
+Index: linux-4.1.5/arch/mips/ath79/prom.c
+===================================================================
+--- linux-4.1.5.orig/arch/mips/ath79/prom.c	2015-08-16 16:57:42.480656824 +0100
++++ linux-4.1.5/arch/mips/ath79/prom.c	2015-08-16 16:57:42.476656824 +0100
+@@ -130,6 +130,13 @@
  		initrd_end = initrd_start + fw_getenvl("initrd_size");
  	}
  #endif
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From a.eberhardt at cygnusnetworks.de  Fri Aug 28 06:35:31 2015
From: a.eberhardt at cygnusnetworks.de (Anselm Eberhardt)
Date: Fri, 28 Aug 2015 12:35:31 +0200
Subject: [OpenWrt-Devel] [PATCH] [package] firewall: Remove src_port from
	firewall.config to receive dhcpv6 replies
Message-ID: <5341AE61-2D75-4E63-AA61-53251F65A1DF@cygnusnetworks.de>

From: Anselm Eberhardt <a.eberhardt at cygnusnetworks.de>

Remove src_port from firewall.config to receive dhcpv6 replies. Fixes #20295.

Signed-off-by: Anselm Eberhardt <a.eberhardt at cygnusnetworks.de>
---
package/network/config/firewall/files/firewall.config | 1 -
1 file changed, 1 deletion(-)

diff --git a/package/network/config/firewall/files/firewall.config b/package/network/config/firewall/files/firewall.config
index 7be01d2..ba7e4ec 100644
--- a/package/network/config/firewall/files/firewall.config
+++ b/package/network/config/firewall/files/firewall.config
@@ -60,7 +60,6 @@ config rule
       option src              wan
       option proto            udp
       option src_ip           fe80::/10
-       option src_port         547
       option dest_ip          fe80::/10
       option dest_port        546
       option family           ipv6
--
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From john at phrozen.org  Fri Aug 28 06:37:17 2015
From: john at phrozen.org (John Crispin)
Date: Fri, 28 Aug 2015 12:37:17 +0200
Subject: [OpenWrt-Devel] [PATCH] [package] firewall: Remove src_port
 from firewall.config to receive dhcpv6 replies
In-Reply-To: <5341AE61-2D75-4E63-AA61-53251F65A1DF@cygnusnetworks.de>
References: <5341AE61-2D75-4E63-AA61-53251F65A1DF@cygnusnetworks.de>
Message-ID: <55E039DD.4030401@phrozen.org>



On 28/08/2015 12:35, Anselm Eberhardt wrote:
> From: Anselm Eberhardt <a.eberhardt at cygnusnetworks.de>
> 
> Remove src_port from firewall.config to receive dhcpv6 replies. Fixes #20295.
> 
> Signed-off-by: Anselm Eberhardt <a.eberhardt at cygnusnetworks.de>

Hi,

the patch is whitespace broken i am afraid. please use git to send the
patch to avoid these issues

	John



> ---
> package/network/config/firewall/files/firewall.config | 1 -
> 1 file changed, 1 deletion(-)
> 
> diff --git a/package/network/config/firewall/files/firewall.config b/package/network/config/firewall/files/firewall.config
> index 7be01d2..ba7e4ec 100644
> --- a/package/network/config/firewall/files/firewall.config
> +++ b/package/network/config/firewall/files/firewall.config
> @@ -60,7 +60,6 @@ config rule
>        option src              wan
>        option proto            udp
>        option src_ip           fe80::/10
> -       option src_port         547
>        option dest_ip          fe80::/10
>        option dest_port        546
>        option family           ipv6
> --
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From a.eberhardt at cygnusnetworks.de  Fri Aug 28 06:54:13 2015
From: a.eberhardt at cygnusnetworks.de (Anselm Eberhardt)
Date: Fri, 28 Aug 2015 12:54:13 +0200
Subject: [OpenWrt-Devel] [PATCH] [package] firewall: Remove src_port
	from firewall.config to receive dhcpv6 replies
In-Reply-To: <55E039DD.4030401@phrozen.org>
References: <5341AE61-2D75-4E63-AA61-53251F65A1DF@cygnusnetworks.de>
 <55E039DD.4030401@phrozen.org>
Message-ID: <88CFB446-10A5-4241-8FF9-1FB084DFD70A@cygnusnetworks.de>

From: Anselm Eberhardt <a.eberhardt at cygnusnetworks.de>

Remove src_port from firewall.config to receive dhcpv6 replies. Fixes #20295.

Signed-off-by: Anselm Eberhardt <a.eberhardt at cygnusnetworks.de>
---
 package/network/config/firewall/files/firewall.config | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/network/config/firewall/files/firewall.config b/package/network/config/firewall/files/firewall.config
index 7be01d2..ba7e4ec 100644
--- a/package/network/config/firewall/files/firewall.config
+++ b/package/network/config/firewall/files/firewall.config
@@ -60,7 +60,6 @@ config rule
        option src              wan
        option proto            udp
        option src_ip           fe80::/10
-       option src_port         547
        option dest_ip          fe80::/10
        option dest_port        546
        option family           ipv6
-- 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From pepe2k at gmail.com  Fri Aug 28 07:04:16 2015
From: pepe2k at gmail.com (Piotr Dymacz)
Date: Fri, 28 Aug 2015 13:04:16 +0200
Subject: [OpenWrt-Devel] [PATCH] ramips: Added WIZnet WizFi630A Platform
	based on Ralink RT5350
In-Reply-To: <1440697155-1021-1-git-send-email-tw@wiznet.eu>
References: <CAMTkhzObfiNnzydxbbd-OpteztQV-MKueSRfg+Yt8DGfi+WWcw@mail.gmail.com>
 <1440697155-1021-1-git-send-email-tw@wiznet.eu>
Message-ID: <CAMTkhzM+A0PnHw8_PSrxqrkZGNzbepeeON2k9yzwb3KON3eddQ@mail.gmail.com>

Hello Tobias,

Thanks for all fixes, but I'm afraid that there are still some
problems with new version of your patch (only cosmetic).
Please, see my (this time just a few) comments inline, below.

Cheers,
Piotr

2015-08-27 19:39 GMT+02:00 Tobias Welz <tw at wiznet.eu>:
> This patch is to add the WIZnet WizFi630A board as a new platform.
>
> Signed-off-by: Tobias Welz <tw at wiznet.eu>
> ---
>  .../linux/ramips/base-files/etc/board.d/02_network |   10 ++
>  target/linux/ramips/base-files/etc/diag.sh         |    3 +
>  target/linux/ramips/base-files/lib/ramips.sh       |    3 +
>  .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
>  target/linux/ramips/dts/WIZFI630A.dts              |  176 ++++++++++++++++++++
>  target/linux/ramips/image/Makefile                 |    4 +-
>  target/linux/ramips/rt305x/profiles/wiznet.mk      |   17 ++
>  7 files changed, 213 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
>  create mode 100644 target/linux/ramips/rt305x/profiles/wiznet.mk
>
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
> index 6a2f042248d3..20f3367ac329 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -217,6 +217,12 @@ ramips_setup_interfaces()
>                 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
>                 ucidef_add_switch_vlan "switch0" "2" "5 6t"
>                 ;;
> +       wizfi630a)
> +               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
> +               ucidef_add_switch "switch0" "1" "1"
> +               ucidef_add_switch_vlan "switch0" "1" "1 2 6t"
> +               ucidef_add_switch_vlan "switch0" "2" "0 6t"
> +               ;;
>         y1s)
>                 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>                 ucidef_add_switch "switch0" "1" "1"
> @@ -327,6 +333,10 @@ ramips_setup_macs()
>                 wan_mac=$(mtd_get_mac_binary factory 4)
>                 lan_mac=$wan_mac
>                 ;;
> +       wizfi630a)
> +               lan_mac=$(mtd_get_mac_binary factory 4)
> +               wan_mac=$(mtd_get_mac_binary factory 40)
> +               ;;
>         wsr-1166)
>                 local index="$(find_mtd_index "board_data")"
>                 wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
> diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
> index a4911b023cba..dfa0d02371ef 100644
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -165,6 +165,9 @@ get_status_led() {
>         wzr-agl300nh)
>                 status_led="$board:green:router"
>                 ;;
> +       wizfi630a)
> +               status_led="$board::run"
> +               ;;
>         wsr-1166|\
>         wsr-600)
>                 status_led="$board:orange:diag"
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
> index 5cafd4593d60..7cdf22512afa 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -367,6 +367,9 @@ ramips_board_detect() {
>         *"WIZARD 8800")
>                 name="wizard8800"
>                 ;;
> +       *"WizFi630A")
> +               name="wizfi630a"
> +               ;;

Last line here has trailing white spaces.

Please, take a look at this small git grep command:
https://www.snip2code.com/Snippet/2032/Git-grep-for-trailing-whitespace

>         *"WL-330N")
>                 name="wl-330n"
>                 ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 53e7070c99c9..b907faa57885 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -107,6 +107,7 @@ platform_check_image() {
>         whr-300hp2|\
>         whr-600d|\
>         whr-g300n|\
> +       wizfi630a|\
>         wl-330n|\
>         wl-330n3g|\
>         wl-341v3|\
> diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/WIZFI630A.dts
> new file mode 100644
> index 000000000000..545a7730af7d
> --- /dev/null
> +++ b/target/linux/ramips/dts/WIZFI630A.dts
> @@ -0,0 +1,176 @@
> +/dts-v1/;
> +
> +/include/ "rt5350.dtsi"
> +
> +/ {
> +       compatible = "wizfi630a", "ralink,rt5350-soc";
> +       model = "WIZnet WizFi630A";
> +
> +       chosen {
> +               bootargs = "console=ttyS1,115200";
> +       };
> +
> +       palmbus at 10000000 {
> +               gpio1: gpio at 660 {
> +                       status = "okay";
> +               };
> +
> +               spi at b00 {
> +                       status = "okay";
> +
> +                       m25p80 at 0 {
> +                               #address-cells = <1>;
> +                               #size-cells = <1>;
> +                               compatible = "w25q128";
> +                               reg = <0>;
> +                               linux,modalias = "m25p80", "w25q128";
> +                               spi-max-frequency = <10000000>;
> +
> +                               partition at 0 {
> +                                       label = "uboot";
> +                                       reg = <0x0 0x30000>;
> +                                       read-only;
> +                               };
> +
> +                               partition at 30000 {
> +                                       label = "uboot-env";
> +                                       reg = <0x30000 0x10000>;
> +                                       read-only;
> +                               };
> +
> +                               factory: partition at 40000 {
> +                                       label = "factory";
> +                                       reg = <0x40000 0x10000>;
> +                                       read-only;
> +                               };
> +
> +                               partition at 50000 {
> +                                       label = "firmware";
> +                                       reg = <0x50000 0xfb0000>;
> +                               };
> +                       };
> +               };
> +
> +               uart at 500 {
> +                       compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
> +                       reg = <0x500 0x100>;
> +                       resets = <&rstctrl 12>;
> +                       reset-names = "uart";
> +                       interrupt-parent = <&intc>;
> +                       interrupts = <5>;
> +                       reg-shift = <2>;
> +                       status = "okay";
> +               };
> +
> +               uartlite at c00 {
> +                       compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
> +                       reg = <0xc00 0x100>;
> +                       resets = <&rstctrl 19>;
> +                       reset-names = "uartl";
> +                       interrupt-parent = <&intc>;
> +                       interrupts = <12>;
> +                       reg-shift = <2>;
> +                       pinctrl-names = "default";
> +                       pinctrl-0 = <&uartlite_pins>;
> +               };
> +       };
> +
> +       pinctrl {
> +               state_default: pinctrl0 {
> +                       gpio {
> +                               ralink,group = "i2c", "jtag" ;
> +                               ralink,function = "gpio";
> +                       };
> +               };
> +
> +               uartf_gpio_pins: uartf_gpio {
> +                       uartf_gpio {
> +                               ralink,group = "uartf";
> +                               ralink,function = "uartf";
> +                       };
> +               };
> +
> +               uartlite_pins: uartlite {
> +                       uart {
> +                               ralink,group = "uartlite";
> +                               ralink,function = "uartlite";
> +                       };
> +               };
> +       };
> +
> +       ethernet at 10100000 {
> +               mtd-mac-address = <&factory 0x4>;
> +       };
> +
> +       esw at 10110000 {
> +               ralink,portmap = <0x17>;
> +       };
> +
> +       wmac at 10180000 {
> +               ralink,mtd-eeprom = <&factory 0>;
> +       };
> +
> +       ehci at 101c0000 {
> +               status = "okay";
> +       };
> +
> +       ohci at 101c1000 {
> +               status = "okay";
> +       };
> +
> +       gpio-export {
> +               compatible = "gpio-export";
> +               #size-cells = <0>;
> +       };
> +
> +       gpio-leds {
> +               compatible = "gpio-leds";

New line here, please.

> +               run {
> +                       label = "wizfi630a::run";
> +                       gpios = <&gpio0 1 1>;
> +               };

New line here, please.

> +               uart1 {
> +                       label = "wizfi630a::uart1";
> +                       gpios = <&gpio0 18 1>;
> +               };

New line here, please.

> +               uart2 {
> +                       label = "wizfi630a::uart2";
> +                       gpios = <&gpio0 21 1>;
> +               };

New line here, please.

> +               wps {
> +                       label = "wizfi630a::wps";
> +                       gpios = <&gpio0 20 1>;
> +               };
> +       };
> +
> +       gpio-keys-polled {
> +               compatible = "gpio-keys-polled";
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               poll-interval = <20>;
> +
> +               reset {
> +                       label = "reset";
> +                       gpios = <&gpio0 17 1>;
> +                       linux,code = <0x198>;
> +               };
> +
> +               wps {
> +                       label = "wps";
> +                       gpios = <&gpio0 0 1>;
> +                       linux,code = <0x211>;
> +               };
> +
> +               scm1 {
> +                       label = "SCM1";
> +                       gpios = <&gpio0 19 1>;
> +                       linux,code = <0x100>;
> +               };
> +
> +               scm2 {
> +                       label = "SCM2";
> +                       gpios = <&gpio0 2 1>;
> +                       linux,code = <0x101>;
> +               };
> +       };
> +};
> diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
> index 2f4d4cbc617d..ac2e83cbb3de 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -608,7 +608,6 @@ Image/Build/Profile/W502U=$(call BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
>
>  Image/Build/Profile/WCR150GN=$(call BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
>
> -
>  Image/Build/Profile/MZK-DP150N=$(call BuildFirmware/Default4M/$(1),$(1),mzk-dp150n,MZK-DP150N)
>
>  buffalo_whrg300n_mtd_size=3801088
> @@ -631,6 +630,8 @@ Image/Build/Profile/WHRG300N=$(call BuildFirmware/WHRG300N/$(1),$(1))
>
>  Image/Build/Profile/WIZARD8800=$(call BuildFirmware/Default8M/$(1),$(1),wizard-8800,WIZARD8800,Linux Kernel Image)
>
> +Image/Build/Profile/WIZFI630A=$(call BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
> +
>  Image/Build/Profile/WL-330N=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n,WL-330N)
>
>  Image/Build/Profile/WL-330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL-330N3G)
> @@ -763,6 +764,7 @@ define Image/Build/Profile/Default
>         $(call Image/Build/Profile/WCR150GN,$(1))
>         $(call Image/Build/Profile/WHRG300N,$(1))
>         $(call Image/Build/Profile/WIZARD8800,$(1))
> +       $(call Image/Build/Profile/WIZFI630A,$(1))
>         $(call Image/Build/Profile/WL-330N,$(1))
>         $(call Image/Build/Profile/WL-330N3G,$(1))
>         $(call Image/Build/Profile/WL-341V3,$(1))
> diff --git a/target/linux/ramips/rt305x/profiles/wiznet.mk b/target/linux/ramips/rt305x/profiles/wiznet.mk
> new file mode 100644
> index 000000000000..f8e83242898d
> --- /dev/null
> +++ b/target/linux/ramips/rt305x/profiles/wiznet.mk
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/WIZFI630A
> +       NAME:=WIZnet WizFi630A
> +       PACKAGES:=\
> +               kmod-usb2
> +endef
> +
> +define Profile/WIZFI630A/Description
> +       Package set for WIZnet WizFi630A board
> +endef
> +$(eval $(call Profile,WIZFI630A))
> --
> 1.7.10.4
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From tw at wiznet.eu  Fri Aug 28 08:10:37 2015
From: tw at wiznet.eu (Tobias Welz)
Date: Fri, 28 Aug 2015 14:10:37 +0200
Subject: [OpenWrt-Devel] [PATCH] ramips: Added WIZnet WizFi630A Platform
	based on Ralink RT5350
In-Reply-To: <CAMTkhzM+A0PnHw8_PSrxqrkZGNzbepeeON2k9yzwb3KON3eddQ@mail.gmail.com>
References: <CAMTkhzM+A0PnHw8_PSrxqrkZGNzbepeeON2k9yzwb3KON3eddQ@mail.gmail.com>
Message-ID: <1440763837-12931-1-git-send-email-tw@wiznet.eu>

This patch is to add the WIZnet WizFi630A board as a new platform. The board is in mini pci express form factor.

Signed-off-by: Tobias Welz <tw at wiznet.eu>
---
 .../linux/ramips/base-files/etc/board.d/02_network |   10 ++
 target/linux/ramips/base-files/etc/diag.sh         |    3 +
 target/linux/ramips/base-files/lib/ramips.sh       |    3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |    1 +
 target/linux/ramips/dts/WIZFI630A.dts              |  180 ++++++++++++++++++++
 target/linux/ramips/image/Makefile                 |    4 +-
 target/linux/ramips/rt305x/profiles/wiznet.mk      |   17 ++
 7 files changed, 217 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
 create mode 100644 target/linux/ramips/rt305x/profiles/wiznet.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 6a2f042248d3..20f3367ac329 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -217,6 +217,12 @@ ramips_setup_interfaces()
 		ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
 		ucidef_add_switch_vlan "switch0" "2" "5 6t"
 		;;
+	wizfi630a)
+		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+		ucidef_add_switch "switch0" "1" "1"
+		ucidef_add_switch_vlan "switch0" "1" "1 2 6t"
+		ucidef_add_switch_vlan "switch0" "2" "0 6t"
+		;;
 	y1s)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 		ucidef_add_switch "switch0" "1" "1"
@@ -327,6 +333,10 @@ ramips_setup_macs()
 		wan_mac=$(mtd_get_mac_binary factory 4)
 		lan_mac=$wan_mac
 		;;
+	wizfi630a)
+		lan_mac=$(mtd_get_mac_binary factory 4)
+		wan_mac=$(mtd_get_mac_binary factory 40)
+		;;
 	wsr-1166)
 		local index="$(find_mtd_index "board_data")"
 		wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index a4911b023cba..dfa0d02371ef 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -165,6 +165,9 @@ get_status_led() {
 	wzr-agl300nh)
 		status_led="$board:green:router"
 		;;
+	wizfi630a)
+		status_led="$board::run"
+		;;
 	wsr-1166|\
 	wsr-600)
 		status_led="$board:orange:diag"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 5cafd4593d60..7cdf22512afa 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -367,6 +367,9 @@ ramips_board_detect() {
 	*"WIZARD 8800")
 		name="wizard8800"
 		;;
+	*"WizFi630A")
+		name="wizfi630a"
+		;;                
 	*"WL-330N")
 		name="wl-330n"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 53e7070c99c9..b907faa57885 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -107,6 +107,7 @@ platform_check_image() {
 	whr-300hp2|\
 	whr-600d|\
 	whr-g300n|\
+	wizfi630a|\
 	wl-330n|\
 	wl-330n3g|\
 	wl-341v3|\
diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/WIZFI630A.dts
new file mode 100644
index 000000000000..f2818ce9df8a
--- /dev/null
+++ b/target/linux/ramips/dts/WIZFI630A.dts
@@ -0,0 +1,180 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "wizfi630a", "ralink,rt5350-soc";
+	model = "WIZnet WizFi630A";
+
+	chosen {
+		bootargs = "console=ttyS1,115200";
+	};
+
+	palmbus at 10000000 {
+		gpio1: gpio at 660 {
+			status = "okay";
+		};
+
+		spi at b00 {
+			status = "okay";
+
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "w25q128";
+				reg = <0>;
+				linux,modalias = "m25p80", "w25q128";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "uboot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "uboot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0xfb0000>;
+				};
+			};
+		};
+
+		uart at 500 {
+			compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+			reg = <0x500 0x100>;
+			resets = <&rstctrl 12>;
+			reset-names = "uart";
+			interrupt-parent = <&intc>;
+			interrupts = <5>;
+			reg-shift = <2>;
+			status = "okay";
+		};
+
+		uartlite at c00 {
+			compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
+			reg = <0xc00 0x100>;
+			resets = <&rstctrl 19>;
+			reset-names = "uartl";
+			interrupt-parent = <&intc>;
+			interrupts = <12>;
+			reg-shift = <2>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&uartlite_pins>;
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag" ;
+				ralink,function = "gpio";
+			};
+		};
+
+		uartf_gpio_pins: uartf_gpio {
+			uartf_gpio {
+				ralink,group = "uartf";
+				ralink,function = "uartf";
+			};
+		};
+
+		uartlite_pins: uartlite {
+			uart {
+				ralink,group = "uartlite";
+				ralink,function = "uartlite";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x17>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		run {
+			label = "wizfi630a::run";
+			gpios = <&gpio0 1 1>;
+		};
+
+		wps {
+			label = "wizfi630a::wps";
+			gpios = <&gpio0 20 1>;
+		};
+
+		uart1 {
+			label = "wizfi630a::uart1";
+			gpios = <&gpio0 18 1>;
+		};
+
+		uart2 {
+			label = "wizfi630a::uart2";
+			gpios = <&gpio0 21 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 17 1>;
+			linux,code = <0x198>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
+		};
+		
+		scm1 {
+			label = "SCM1";
+			gpios = <&gpio0 19 1>;
+			linux,code = <0x100>;
+		};
+
+		scm2 {
+			label = "SCM2";
+			gpios = <&gpio0 2 1>;
+			linux,code = <0x101>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 2f4d4cbc617d..ac2e83cbb3de 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -608,7 +608,6 @@ Image/Build/Profile/W502U=$(call BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
 
 Image/Build/Profile/WCR150GN=$(call BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN)
 
-
 Image/Build/Profile/MZK-DP150N=$(call BuildFirmware/Default4M/$(1),$(1),mzk-dp150n,MZK-DP150N)
 
 buffalo_whrg300n_mtd_size=3801088
@@ -631,6 +630,8 @@ Image/Build/Profile/WHRG300N=$(call BuildFirmware/WHRG300N/$(1),$(1))
 
 Image/Build/Profile/WIZARD8800=$(call BuildFirmware/Default8M/$(1),$(1),wizard-8800,WIZARD8800,Linux Kernel Image)
 
+Image/Build/Profile/WIZFI630A=$(call BuildFirmware/Default16M/$(1),$(1),wizfi630a,WIZFI630A)
+
 Image/Build/Profile/WL-330N=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n,WL-330N)
 
 Image/Build/Profile/WL-330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL-330N3G)
@@ -763,6 +764,7 @@ define Image/Build/Profile/Default
 	$(call Image/Build/Profile/WCR150GN,$(1))
 	$(call Image/Build/Profile/WHRG300N,$(1))
 	$(call Image/Build/Profile/WIZARD8800,$(1))
+	$(call Image/Build/Profile/WIZFI630A,$(1))
 	$(call Image/Build/Profile/WL-330N,$(1))
 	$(call Image/Build/Profile/WL-330N3G,$(1))
 	$(call Image/Build/Profile/WL-341V3,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/wiznet.mk b/target/linux/ramips/rt305x/profiles/wiznet.mk
new file mode 100644
index 000000000000..f8e83242898d
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/wiznet.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/WIZFI630A
+	NAME:=WIZnet WizFi630A
+	PACKAGES:=\
+		kmod-usb2 
+endef
+
+define Profile/WIZFI630A/Description
+	Package set for WIZnet WizFi630A board
+endef
+$(eval $(call Profile,WIZFI630A))
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From fkooman at tuxed.net  Fri Aug 28 09:27:48 2015
From: fkooman at tuxed.net (=?UTF-8?Q?Fran=c3=a7ois_Kooman?=)
Date: Fri, 28 Aug 2015 15:27:48 +0200
Subject: [OpenWrt-Devel] [PATCH] extra configuration options for OpenVPN in
	init script
Message-ID: <55E061D4.1070204@tuxed.net>

Hi Mirko,

To accompany my patch to the OpenVPN configuration module for luci [0]
to support some extra fields here also the change to the OpenVPN init
script.

It adds the following fields:

tls_version_min
tls_version_max
key_direction

They are needed to support "eduVPN" [1]. The change here is not
depending on the change in [0] so can be done without any side effect.

Thanks in advance for your consideration.

Cheers,
Fran?ois

[0] https://github.com/openwrt/luci/issues/436
[1] https://wiki.surfnet.nl/display/eduvpn/eduVPN

-------------- next part --------------
A non-text attachment was scrubbed...
Name: openwrt_openvpn_extra_config_fields.patch
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150828/d51b7a0a/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From ronaldo at ronaldoafonso.com.br  Fri Aug 28 15:09:25 2015
From: ronaldo at ronaldoafonso.com.br (Ronaldo Afonso)
Date: Fri, 28 Aug 2015 16:09:25 -0300
Subject: [OpenWrt-Devel] Registering an ubus namespace using Lua
Message-ID: <CA+H=DN6H6+gywJhyOEaDvxAgG1c+AY_segjottBDsoJmUK_yzg@mail.gmail.com>

  Hi all,

  Can anyone provide me with an example of registering an ubus namespace
using Lua?

  Thanks in advance.

-- 
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150828/a808d013/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From blogic at openwrt.org  Fri Aug 28 15:12:36 2015
From: blogic at openwrt.org (John Crispin)
Date: Fri, 28 Aug 2015 21:12:36 +0200
Subject: [OpenWrt-Devel] Registering an ubus namespace using Lua
In-Reply-To: <CA+H=DN6H6+gywJhyOEaDvxAgG1c+AY_segjottBDsoJmUK_yzg@mail.gmail.com>
References: <CA+H=DN6H6+gywJhyOEaDvxAgG1c+AY_segjottBDsoJmUK_yzg@mail.gmail.com>
Message-ID: <55E0B2A4.6030908@openwrt.org>

Hi,

have a look here please -->
http://git.openwrt.org/?p=project/ubus.git;a=tree;f=lua;
	John



On 28/08/2015 21:09, Ronaldo Afonso wrote:
>   Hi all,
> 
>   Can anyone provide me with an example of registering an ubus namespace
> using Lua?
> 
>   Thanks in advance.
> 
> -- 
> Ronaldo Afonso
> 11 9 5252 0484
> www.ronaldoafonso.com.br <http://www.ronaldoafonso.com.br>
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ronaldo at ronaldoafonso.com.br  Fri Aug 28 15:14:12 2015
From: ronaldo at ronaldoafonso.com.br (Ronaldo Afonso)
Date: Fri, 28 Aug 2015 16:14:12 -0300
Subject: [OpenWrt-Devel] Registering an ubus namespace using Lua
Message-ID: <CA+H=DN6+PTZncJCc9=JiZW6+pectCASoGDP9MYMSHMmHLfwB7g@mail.gmail.com>

  Hi all,

  Can anyone provide me with an example of registering an ubus namespace
using Lua?

  Thanks in advance.

-- 
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150828/421b2ed6/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From ronaldo at ronaldoafonso.com.br  Fri Aug 28 15:56:59 2015
From: ronaldo at ronaldoafonso.com.br (Ronaldo Afonso)
Date: Fri, 28 Aug 2015 16:56:59 -0300
Subject: [OpenWrt-Devel] Registering an ubus namespace using Lua
In-Reply-To: <55E0B2A4.6030908@openwrt.org>
References: <CA+H=DN6H6+gywJhyOEaDvxAgG1c+AY_segjottBDsoJmUK_yzg@mail.gmail.com>
 <55E0B2A4.6030908@openwrt.org>
Message-ID: <CA+H=DN7tP_3jOD+H9y_=r0nRKU51aapMC_MH4hhAvMBA-SLodQ@mail.gmail.com>

 Thanks Jonh

2015-08-28 16:12 GMT-03:00 John Crispin <blogic at openwrt.org>:

> Hi,
>
> have a look here please -->
> http://git.openwrt.org/?p=project/ubus.git;a=tree;f=lua;
>         John
>
>
>
> On 28/08/2015 21:09, Ronaldo Afonso wrote:
> >   Hi all,
> >
> >   Can anyone provide me with an example of registering an ubus namespace
> > using Lua?
> >
> >   Thanks in advance.
> >
> > --
> > Ronaldo Afonso
> > 11 9 5252 0484
> > www.ronaldoafonso.com.br <http://www.ronaldoafonso.com.br>
> >
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel at lists.openwrt.org
> > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> >
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>



-- 
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150828/001ef454/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From rlindeman at caengineering.com  Fri Aug 28 16:05:15 2015
From: rlindeman at caengineering.com (Ryan Lindeman)
Date: Fri, 28 Aug 2015 14:05:15 -0600
Subject: [OpenWrt-Devel] [PATCH] build: fixes feeds with Makefile in root
	directory (#20392)
Message-ID: <1440792315-16093-1-git-send-email-rlindeman@caengineering.com>

This patch addresses an error caused by adding feeds that contain a Makefile
in the root directory. The error is typically shown as follows:
.../info/.files-packageinfo.mk:1: * target pattern contains no `%'. Stop.
OR
.../info/.files-targetinfo.mk:1: * target pattern contains no `%'. Stop.

The root cause of the error is due to problems with the $(FILELIST): rule in
the include/scan.mk file which attempts to strip off the $(SCAN_DIR)/ and
/Makefile: ... contents of the lines provided by the FIND_L command. When a
feed contains a single Makefile in the root directory the /Makefile: ...
portion is not removed since the $(SCAN_DIR)/ has already removed the
preceding / before the Makefile. This then causes extra characters to be
evaluated by grep in the $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: rule which
is where the above error is eventually reported by Make.

The solution is to allow for a portion of the $(SCAN_DIR) to be included in the
results produced by the $(FILELIST): rule. This patch creates a new variable
called PREFIX_DIR which becomes the directory portion of $(SCAN_DIR) removed.
This variable is specified by the update_index method of the scripts/feeds
file. Since the include/scan.mk file is also used to scan the packages folder
the default value for PREFIX_DIR must be empty (which is specified at the top
of the include/scan.mk file). These changes results in the
info/.files-$(SCAN_TARGET).mk files to include the remainder of the
$(SCAN_DIR) path not removed so the $(SCAN_DIR) path information is removed
from the PackageDir rule specified in include/scan.mk. This has the added
benefit of simplifying the readability of this rule IMHO.

Signed-off-by: Ryan Lindeman <rlindeman at caengineering.com>
---
 include/scan.mk |   21 +++++++++++----------
 scripts/feeds   |    4 ++--
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/include/scan.mk b/include/scan.mk
index 5af0359..8561b30 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -8,6 +8,7 @@ include $(TOPDIR)/include/host.mk
 SCAN_TARGET ?= packageinfo
 SCAN_NAME ?= package
 SCAN_DIR ?= package
+PREFIX_DIR ?=
 TARGET_STAMP:=$(TMP_DIR)/info/.files-$(SCAN_TARGET).stamp
 FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
 OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
@@ -28,15 +29,15 @@ endef
 
 define PackageDir
   $(TMP_DIR)/.$(SCAN_TARGET): $(TMP_DIR)/info/.$(SCAN_TARGET)-$(1)
-  $(TMP_DIR)/info/.$(SCAN_TARGET)-$(1): $(SCAN_DIR)/$(2)/Makefile $(SCAN_STAMP) $(foreach DEP,$(DEPS_$(SCAN_DIR)/$(2)/Makefile) $(SCAN_DEPS),$(wildcard $(if $(filter /%,$(DEP)),$(DEP),$(SCAN_DIR)/$(2)/$(DEP))))
+  $(TMP_DIR)/info/.$(SCAN_TARGET)-$(1): $(2)/Makefile $(SCAN_STAMP) $(foreach DEP,$(DEPS_$(2)/Makefile) $(SCAN_DEPS),$(wildcard $(if $(filter /%,$(DEP)),$(DEP),$(2)/$(DEP))))
 	{ \
-		$$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \
-		echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \
+		$$(call progress,Collecting $(SCAN_NAME) info: $(2)) \
+		echo Source-Makefile: $(2)/Makefile; \
 		$(if $(3),echo Override: $(3),true); \
-		$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || { \
-			mkdir -p "$(TOPDIR)/logs/$(SCAN_DIR)/$(2)"; \
-			$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) > $(TOPDIR)/logs/$(SCAN_DIR)/$(2)/dump.txt 2>&1; \
-			$$(call progress,ERROR: please fix $(SCAN_DIR)/$(2)/Makefile - see logs/$(SCAN_DIR)/$(2)/dump.txt for details\n) \
+		$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(2) $(SCAN_MAKEOPTS) 2>/dev/null || { \
+			mkdir -p "$(TOPDIR)/logs/$(2)"; \
+			$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(2) $(SCAN_MAKEOPTS) > $(TOPDIR)/logs/$(2)/dump.txt 2>&1; \
+			$$(call progress,ERROR: please fix $(2)/Makefile - see logs/$(2)/dump.txt for details\n) \
 			rm -f $$@; \
 		}; \
 		echo; \
@@ -55,11 +56,11 @@ endif
 
 $(FILELIST): $(OVERRIDELIST)
 	rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
-	$(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
+	$(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if $(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -aHE 'call $(GREP_STRING)' | sed -e 's#^$(PREFIX_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f include/scan.awk > $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
 	( \
-		cat $< | awk '{print "$(SCAN_DIR)/" $$0 "/Makefile" }' | xargs grep -HE '^ *SCAN_DEPS *= *' | awk -F: '{ gsub(/^.*DEPS *= */, "", $$2); print "DEPS_" $$1 "=" $$2 }'; \
+		cat $< | awk '{print "$(if $(PREFIX_DIR),$(PREFIX_DIR)/)" $$0 "/Makefile" }' | xargs grep -HE '^ *SCAN_DEPS *= *' | awk -F: '{ gsub(/^.*DEPS *= */, "", $$2); print "DEPS_" $$1 "=" $$2 }'; \
 		awk -F/ -v deps="$$DEPS" -v of="$(OVERRIDELIST)" ' \
 		BEGIN { \
 			while (getline < (of)) \
@@ -73,7 +74,7 @@ $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
 			pkg=""; \
 			if($$NF in override) \
 				pkg=override[$$NF]; \
-			print "$$(eval $$(call PackageDir," info "," dir "," pkg "))"; \
+			print "$$(eval $$(call PackageDir," info ",$(if $(PREFIX_DIR),$(PREFIX_DIR)/)" dir "," pkg "))"; \
 		} ' < $<; \
 		true; \
 	) > $@
diff --git a/scripts/feeds b/scripts/feeds
index 79b5284..ddaf9f5 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -99,8 +99,8 @@ sub update_index($)
 	-d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 1;
 
 	system("$mk -s prepare-mk OPENWRT_BUILD= TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
-	system("$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPS=\"$ENV{TOPDIR}/include/package*.mk\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
-	system("$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"targetinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"target\" SCAN_DEPS=\"profiles/*.mk $ENV{TOPDIR}/include/target.mk\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" SCAN_MAKEOPTS=\"TARGET_BUILD=1\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+	system("$mk -s -f include/scan.mk IS_TTY=1 PREFIX_DIR=\"feeds\" SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPS=\"$ENV{TOPDIR}/include/package*.mk\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+	system("$mk -s -f include/scan.mk IS_TTY=1 PREFIX_DIR=\"feeds\" SCAN_TARGET=\"targetinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"target\" SCAN_DEPS=\"profiles/*.mk $ENV{TOPDIR}/include/target.mk\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" SCAN_MAKEOPTS=\"TARGET_BUILD=1\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
 	system("ln -sf $name.tmp/.packageinfo ./feeds/$name.index");
 	system("ln -sf $name.tmp/.targetinfo ./feeds/$name.targetindex");
 
-- 
1.7.9.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From leitec at staticky.com  Fri Aug 28 16:06:12 2015
From: leitec at staticky.com (Claudio Leite)
Date: Fri, 28 Aug 2015 16:06:12 -0400
Subject: [OpenWrt-Devel] [PATCH 1/2] mvsw61xx: use standard swconfig
	get_port_link
Message-ID: <1440792373-30272-1-git-send-email-leitec@staticky.com>

The previous "link" and "status" functions were non-standard,
and thus less useful for parsing.

Signed-off-by: Claudio Leite <leitec at staticky.com>
---

If accepted this should be also pushed to CC, assuming                          
that's still possible.


 .../linux/generic/files/drivers/net/phy/mvsw61xx.c | 92 +++++-----------------
 1 file changed, 18 insertions(+), 74 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
index 9417fd4..346acb2 100644
--- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
+++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
@@ -219,73 +219,32 @@ mvsw61xx_set_pvid(struct switch_dev *dev, int port, int val)
 }
 
 static int
-mvsw61xx_get_port_status(struct switch_dev *dev,
-		const struct switch_attr *attr, struct switch_val *val)
+mvsw61xx_get_port_link(struct switch_dev *dev, int port,
+		struct switch_port_link *link)
 {
-	struct mvsw61xx_state *state = get_state(dev);
-	char *buf = state->buf;
 	u16 status, speed;
-	int len;
-
-	status = sr16(dev, MV_PORTREG(STATUS, val->port_vlan));
-	speed = (status & MV_PORT_STATUS_SPEED_MASK) >>
-			MV_PORT_STATUS_SPEED_SHIFT;
-
-	len = sprintf(buf, "link: ");
-	if (status & MV_PORT_STATUS_LINK) {
-		len += sprintf(buf + len, "up, speed: ");
-
-		switch (speed) {
-		case MV_PORT_STATUS_SPEED_10:
-			len += sprintf(buf + len, "10");
-			break;
-		case MV_PORT_STATUS_SPEED_100:
-			len += sprintf(buf + len, "100");
-			break;
-		case MV_PORT_STATUS_SPEED_1000:
-			len += sprintf(buf + len, "1000");
-			break;
-		}
 
-		len += sprintf(buf + len, " Mbps, duplex: ");
+	status = sr16(dev, MV_PORTREG(STATUS, port));
 
-		if (status & MV_PORT_STATUS_FDX)
-			len += sprintf(buf + len, "full");
-		else
-			len += sprintf(buf + len, "half");
-	} else {
-		len += sprintf(buf + len, "down");
-	}
-
-	val->value.s = buf;
-
-	return 0;
-}
+	link->link = status & MV_PORT_STATUS_LINK;
+	if (!link->link)
+		return 0;
 
-static int
-mvsw61xx_get_port_speed(struct switch_dev *dev,
-		const struct switch_attr *attr, struct switch_val *val)
-{
-	u16 status, speed;
+	link->duplex = status & MV_PORT_STATUS_FDX;
 
-	status = sr16(dev, MV_PORTREG(STATUS, val->port_vlan));
 	speed = (status & MV_PORT_STATUS_SPEED_MASK) >>
 			MV_PORT_STATUS_SPEED_SHIFT;
 
-	val->value.i = 0;
-
-	if (status & MV_PORT_STATUS_LINK) {
-		switch (speed) {
-		case MV_PORT_STATUS_SPEED_10:
-			val->value.i = 10;
-			break;
-		case MV_PORT_STATUS_SPEED_100:
-			val->value.i = 100;
-			break;
-		case MV_PORT_STATUS_SPEED_1000:
-			val->value.i = 1000;
-			break;
-		}
+	switch (speed) {
+	case MV_PORT_STATUS_SPEED_10:
+		link->speed = SWITCH_PORT_SPEED_10;
+		break;
+	case MV_PORT_STATUS_SPEED_100:
+		link->speed = SWITCH_PORT_SPEED_100;
+		break;
+	case MV_PORT_STATUS_SPEED_1000:
+		link->speed = SWITCH_PORT_SPEED_1000;
+		break;
 	}
 
 	return 0;
@@ -727,22 +686,6 @@ static const struct switch_attr mvsw61xx_port[] = {
 		.get = mvsw61xx_get_port_qmode,
 		.set = mvsw61xx_set_port_qmode,
 	},
-	[MVSW61XX_PORT_STATUS] = {
-		.id = MVSW61XX_PORT_STATUS,
-		.type = SWITCH_TYPE_STRING,
-		.description = "Return port status",
-		.name = "status",
-		.get = mvsw61xx_get_port_status,
-		.set = NULL,
-	},
-	[MVSW61XX_PORT_LINK] = {
-		.id = MVSW61XX_PORT_LINK,
-		.type = SWITCH_TYPE_INT,
-		.description = "Get link speed",
-		.name = "link",
-		.get = mvsw61xx_get_port_speed,
-		.set = NULL,
-	},
 };
 
 static const struct switch_dev_ops mvsw61xx_ops = {
@@ -758,6 +701,7 @@ static const struct switch_dev_ops mvsw61xx_ops = {
 		.attr = mvsw61xx_port,
 		.n_attr = ARRAY_SIZE(mvsw61xx_port),
 	},
+	.get_port_link = mvsw61xx_get_port_link,
 	.get_port_pvid = mvsw61xx_get_pvid,
 	.set_port_pvid = mvsw61xx_set_pvid,
 	.get_vlan_ports = mvsw61xx_get_vlan_ports,
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From leitec at staticky.com  Fri Aug 28 16:06:13 2015
From: leitec at staticky.com (Claudio Leite)
Date: Fri, 28 Aug 2015 16:06:13 -0400
Subject: [OpenWrt-Devel] [PATCH 2/2] mvsw61xx: match swconfig function names
In-Reply-To: <1440792373-30272-1-git-send-email-leitec@staticky.com>
References: <1440792373-30272-1-git-send-email-leitec@staticky.com>
Message-ID: <1440792373-30272-2-git-send-email-leitec@staticky.com>

Signed-off-by: Claudio Leite <leitec at staticky.com>
---
 target/linux/generic/files/drivers/net/phy/mvsw61xx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
index 346acb2..c1e1b9a 100644
--- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
+++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
@@ -196,7 +196,7 @@ mvsw61xx_set_port_qmode(struct switch_dev *dev,
 }
 
 static int
-mvsw61xx_get_pvid(struct switch_dev *dev, int port, int *val)
+mvsw61xx_get_port_pvid(struct switch_dev *dev, int port, int *val)
 {
 	struct mvsw61xx_state *state = get_state(dev);
 
@@ -206,7 +206,7 @@ mvsw61xx_get_pvid(struct switch_dev *dev, int port, int *val)
 }
 
 static int
-mvsw61xx_set_pvid(struct switch_dev *dev, int port, int val)
+mvsw61xx_set_port_pvid(struct switch_dev *dev, int port, int val)
 {
 	struct mvsw61xx_state *state = get_state(dev);
 
@@ -702,8 +702,8 @@ static const struct switch_dev_ops mvsw61xx_ops = {
 		.n_attr = ARRAY_SIZE(mvsw61xx_port),
 	},
 	.get_port_link = mvsw61xx_get_port_link,
-	.get_port_pvid = mvsw61xx_get_pvid,
-	.set_port_pvid = mvsw61xx_set_pvid,
+	.get_port_pvid = mvsw61xx_get_port_pvid,
+	.set_port_pvid = mvsw61xx_set_port_pvid,
 	.get_vlan_ports = mvsw61xx_get_vlan_ports,
 	.set_vlan_ports = mvsw61xx_set_vlan_ports,
 	.apply_config = mvsw61xx_apply,
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From leitec at staticky.com  Fri Aug 28 20:29:01 2015
From: leitec at staticky.com (Claudio Leite)
Date: Fri, 28 Aug 2015 20:29:01 -0400
Subject: [OpenWrt-Devel] [PATCH v2] mvsw61xx: use standard swconfig
	get_port_link
In-Reply-To: <1440792373-30272-1-git-send-email-leitec@staticky.com>
References: <1440792373-30272-1-git-send-email-leitec@staticky.com>
Message-ID: <1440808141-15700-1-git-send-email-leitec@staticky.com>

The previous "link" and "status" functions were non-standard,
and thus less useful for parsing.

Signed-off-by: Claudio Leite <leitec at staticky.com>
---
v2: remove enums as well

If accepted this should be also pushed to CC, assuming
that's still possible.

 .../linux/generic/files/drivers/net/phy/mvsw61xx.c | 94 +++++-----------------
 1 file changed, 18 insertions(+), 76 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
index 9417fd4..07b4343 100644
--- a/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
+++ b/target/linux/generic/files/drivers/net/phy/mvsw61xx.c
@@ -219,73 +219,32 @@ mvsw61xx_set_pvid(struct switch_dev *dev, int port, int val)
 }
 
 static int
-mvsw61xx_get_port_status(struct switch_dev *dev,
-		const struct switch_attr *attr, struct switch_val *val)
+mvsw61xx_get_port_link(struct switch_dev *dev, int port,
+		struct switch_port_link *link)
 {
-	struct mvsw61xx_state *state = get_state(dev);
-	char *buf = state->buf;
 	u16 status, speed;
-	int len;
-
-	status = sr16(dev, MV_PORTREG(STATUS, val->port_vlan));
-	speed = (status & MV_PORT_STATUS_SPEED_MASK) >>
-			MV_PORT_STATUS_SPEED_SHIFT;
-
-	len = sprintf(buf, "link: ");
-	if (status & MV_PORT_STATUS_LINK) {
-		len += sprintf(buf + len, "up, speed: ");
-
-		switch (speed) {
-		case MV_PORT_STATUS_SPEED_10:
-			len += sprintf(buf + len, "10");
-			break;
-		case MV_PORT_STATUS_SPEED_100:
-			len += sprintf(buf + len, "100");
-			break;
-		case MV_PORT_STATUS_SPEED_1000:
-			len += sprintf(buf + len, "1000");
-			break;
-		}
 
-		len += sprintf(buf + len, " Mbps, duplex: ");
+	status = sr16(dev, MV_PORTREG(STATUS, port));
 
-		if (status & MV_PORT_STATUS_FDX)
-			len += sprintf(buf + len, "full");
-		else
-			len += sprintf(buf + len, "half");
-	} else {
-		len += sprintf(buf + len, "down");
-	}
-
-	val->value.s = buf;
-
-	return 0;
-}
+	link->link = status & MV_PORT_STATUS_LINK;
+	if (!link->link)
+		return 0;
 
-static int
-mvsw61xx_get_port_speed(struct switch_dev *dev,
-		const struct switch_attr *attr, struct switch_val *val)
-{
-	u16 status, speed;
+	link->duplex = status & MV_PORT_STATUS_FDX;
 
-	status = sr16(dev, MV_PORTREG(STATUS, val->port_vlan));
 	speed = (status & MV_PORT_STATUS_SPEED_MASK) >>
 			MV_PORT_STATUS_SPEED_SHIFT;
 
-	val->value.i = 0;
-
-	if (status & MV_PORT_STATUS_LINK) {
-		switch (speed) {
-		case MV_PORT_STATUS_SPEED_10:
-			val->value.i = 10;
-			break;
-		case MV_PORT_STATUS_SPEED_100:
-			val->value.i = 100;
-			break;
-		case MV_PORT_STATUS_SPEED_1000:
-			val->value.i = 1000;
-			break;
-		}
+	switch (speed) {
+	case MV_PORT_STATUS_SPEED_10:
+		link->speed = SWITCH_PORT_SPEED_10;
+		break;
+	case MV_PORT_STATUS_SPEED_100:
+		link->speed = SWITCH_PORT_SPEED_100;
+		break;
+	case MV_PORT_STATUS_SPEED_1000:
+		link->speed = SWITCH_PORT_SPEED_1000;
+		break;
 	}
 
 	return 0;
@@ -676,8 +635,6 @@ enum {
 enum {
 	MVSW61XX_PORT_MASK,
 	MVSW61XX_PORT_QMODE,
-	MVSW61XX_PORT_STATUS,
-	MVSW61XX_PORT_LINK,
 };
 
 static const struct switch_attr mvsw61xx_global[] = {
@@ -727,22 +684,6 @@ static const struct switch_attr mvsw61xx_port[] = {
 		.get = mvsw61xx_get_port_qmode,
 		.set = mvsw61xx_set_port_qmode,
 	},
-	[MVSW61XX_PORT_STATUS] = {
-		.id = MVSW61XX_PORT_STATUS,
-		.type = SWITCH_TYPE_STRING,
-		.description = "Return port status",
-		.name = "status",
-		.get = mvsw61xx_get_port_status,
-		.set = NULL,
-	},
-	[MVSW61XX_PORT_LINK] = {
-		.id = MVSW61XX_PORT_LINK,
-		.type = SWITCH_TYPE_INT,
-		.description = "Get link speed",
-		.name = "link",
-		.get = mvsw61xx_get_port_speed,
-		.set = NULL,
-	},
 };
 
 static const struct switch_dev_ops mvsw61xx_ops = {
@@ -758,6 +699,7 @@ static const struct switch_dev_ops mvsw61xx_ops = {
 		.attr = mvsw61xx_port,
 		.n_attr = ARRAY_SIZE(mvsw61xx_port),
 	},
+	.get_port_link = mvsw61xx_get_port_link,
 	.get_port_pvid = mvsw61xx_get_pvid,
 	.set_port_pvid = mvsw61xx_set_pvid,
 	.get_vlan_ports = mvsw61xx_get_vlan_ports,
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Fri Aug 28 21:26:00 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Fri, 28 Aug 2015 21:26:00 -0400
Subject: [OpenWrt-Devel] Mailling list issues?
Message-ID: <55E10A28.8000505@daniel.thecshore.com>

Hi all,

Is there an issue with the mailing list?  I sent a patch series 
(actually accidentally twice because the abort failed when I tried to 
cancel the first with no cover letter), but I haven't seen the mails on 
the list.

Is my mail out there or what's the story?

Regards,

Daniel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From adamk at mcservices.com.au  Fri Aug 28 21:51:55 2015
From: adamk at mcservices.com.au (Adam Kuklycz)
Date: Sat, 29 Aug 2015 11:51:55 +1000
Subject: [OpenWrt-Devel] [CC 15.05-rc3] mwan3: Update
In-Reply-To: <20150810083608.AEC3628BE4C@arrakis.dune.hu>
References: <20150810083608.AEC3628BE4C@arrakis.dune.hu>
Message-ID: <55E1103B.7010005@mcservices.com.au>

Hi there,

I didn't see this fix come into the main CC trunk?

The package does generate these annoying messages in the syslog whenever 
a user is on the overview page on the router:

Sat Aug 29 11:45:26 2015 daemon.err uhttpd[2507]: uci: Entry not found
Sat Aug 29 11:45:31 2015 daemon.err uhttpd[2507]: uci: Entry not found



On 10/08/15 18:36, jow at openwrt.org wrote:
> The mwan3 package has been rebuilt and was uploaded to the Chaos Calmer
> 15.05 Release Candicate 3 repository.
>
>
> VERSION
>
> 1.6-1 => 1.6-2
>
>
> CHANGELOG
>
> [Thu, 23 Jul 2015 13:51:04 +0200 75f9788]
>
> Update to version 1.6-2
>
> Fix malformed uci commands. (issue #1502)
>
>
> CHANGES
>
>   net/mwan3/Makefile             |    2 +-
>   net/mwan3/files/usr/sbin/mwan3 |    8 ++++----
>   2 files changed, 5 insertions(+), 5 deletions(-)
>
>
> REFERENCES
>
>   * https://github.com/openwrt/packages/commit/75f978879e2b98065d86d4bcb377c0f3e677557d
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sat Aug 29 04:53:56 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sat, 29 Aug 2015 04:53:56 -0400
Subject: [OpenWrt-Devel] Mailling list issues?
In-Reply-To: <55E10A28.8000505@daniel.thecshore.com>
References: <55E10A28.8000505@daniel.thecshore.com>
Message-ID: <55E17324.8050102@daniel.thecshore.com>

On 2015-08-28 9:26 PM, Daniel Dickinson wrote:
> Hi all,
>
> Is there an issue with the mailing list?  I sent a patch series
> (actually accidentally twice because the abort failed when I tried to
> cancel the first with no cover letter), but I haven't seen the mails on
> the list.
>
> Is my mail out there or what's the story?

That was actually a combination of the same issue (mails not getting 
sent for hours) as well as screwing up batch send of the series.

Today's problem makes me suspect issues with my ISP, possibly due to 
them doing some kind of greylisting of similar thing on outgoing mail 
sent via postfix on my linux system, in an effort to prevent spam.

Mail sent through Mozilla gets through immediately which is what makes 
me suspect the latter.

Thanks for the reply though.

Regards,

Daniel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From fercerpav at gmail.com  Sat Aug 29 07:33:33 2015
From: fercerpav at gmail.com (Paul Fertser)
Date: Sat, 29 Aug 2015 14:33:33 +0300
Subject: [OpenWrt-Devel] [PATCH] nls.mk: add -rpath-link when needed for NLS
	support
Message-ID: <1440848013-1222-1-git-send-email-fercerpav@gmail.com>

When a package links to a shared library that depends on libiconv or
libintl shared libraries, specifying directory pathes to them via -L
switches is not enough, see "man 1 ld" -rpath-link description.

Signed-off-by: Paul Fertser <fercerpav at gmail.com>
---
 include/nls.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/nls.mk b/include/nls.mk
index 118000d..51463b9 100644
--- a/include/nls.mk
+++ b/include/nls.mk
@@ -28,12 +28,12 @@ PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl
 ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
 ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
 ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
-ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib
+ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib
 
 INTL_DEPENDS:=+BUILD_NLS:libintl-full
 INTL_CFLAGS:=-I$(INTL_PREFIX)/include
 INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
-INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib
+INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib
 
 TARGET_CFLAGS += $(ICONV_CFLAGS) $(INTL_CFLAGS)
 TARGET_CPPFLAGS += $(ICONV_CPPFLAGS) $(INTL_CPPFLAGS)
-- 
2.0.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From cyrus at openwrt.org  Sat Aug 29 10:21:50 2015
From: cyrus at openwrt.org (Steven Barth)
Date: Sat, 29 Aug 2015 16:21:50 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 1/2] Revert "kernel: disable
 multicast-to-unicast translation for ipv6 neighbor solicitation (#17625)"
In-Reply-To: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>
References: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>
Message-ID: <55E1BFFE.4050400@openwrt.org>

Hi Linus,

one of these two kernel patches break IPv6 over WiFi completely.

https://dev.openwrt.org/changeset/46719 works
https://dev.openwrt.org/changeset/46723 is broken with default settings,
but works when setting option igmp_snooping 0.

symptoms are:
"IPv6: wlan0: IPv6 duplicate address fe80::[...] detected!"
in the client's kernel log when connecting using WiFi.

Connecting through Ethernet (bridged to said WiFi) works as expected
though. Since the link-local is marked as dadfailed over WiFi,
IPv6 connectivity is completely broken, obviously the DAD failed
is a false positive.

Router is ar71xx / ath9k.
Client is iwlwfi.

Let me know if you need more info.



Cheers,

Steven
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From shengkai_81 at 163.com  Sat Aug 29 10:54:30 2015
From: shengkai_81 at 163.com (shengkai)
Date: Sat, 29 Aug 2015 22:54:30 +0800 (CST)
Subject: [OpenWrt-Devel] Ask help for v4l2 build error.
Message-ID: <4dc7e272.108cc.14f79f3e377.Coremail.shengkai_81@163.com>

Hi All,


I used the 15.05 load and configured the "libv4l2" and "v4l2", but I hit following error. After defined the "ICONV_CONST" in config.h, then hit another issue.
Appreciat your help in advance!


mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libintl-stub/include -fpic -std=gnu99 -MT libdvbv5_la-parse_string.lo -MD -MP -MF .deps/libdvbv5_la-parse_string.Tpo -c parse_string.c -o libdvbv5_la-parse_string.o
parse_string.c: In function 'dvb_iconv_to_charset':
parse_string.c:323:14: error: 'ICONV_CONST' undeclared (first use in this function)
   iconv(cd, (ICONV_CONST char **)&src, &len, &p, &destlen);
              ^
parse_string.c:323:14: note: each undeclared identifier is reported only once for each function it appears in
parse_string.c:323:26: error: expected ')' before 'char'
   iconv(cd, (ICONV_CONST char **)&src, &len, &p, &destlen);
                          ^
make[7]: *** [libdvbv5_la-parse_string.lo] Error 1
-----------------
After defined the "ICONV_CONST", hit following error.


parse_string.c:(.text+0xa4): undefined reference to `iconv_open'
parse_string.c:(.text+0x110): undefined reference to `iconv'
parse_string.c:(.text+0x130): undefined reference to `iconv_close'
collect2: error: ld returned 1 exit status


Thanks,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150829/8adeb2e3/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From yszhou4tech at gmail.com  Sat Aug 29 12:13:22 2015
From: yszhou4tech at gmail.com (Yousong Zhou)
Date: Sun, 30 Aug 2015 00:13:22 +0800
Subject: [OpenWrt-Devel] [PATCH] uboot-sunxi: fix mmc transfer timeout for
	slow sdcards.
Message-ID: <1440864802-968-1-git-send-email-yszhou4tech@gmail.com>

This should fix a issue reported in ticket #20387.

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 ...et-transfer-timeout-according-to-byte_cnt.patch |   36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 package/boot/uboot-sunxi/patches/004-sunxi-mmc-set-transfer-timeout-according-to-byte_cnt.patch

diff --git a/package/boot/uboot-sunxi/patches/004-sunxi-mmc-set-transfer-timeout-according-to-byte_cnt.patch b/package/boot/uboot-sunxi/patches/004-sunxi-mmc-set-transfer-timeout-according-to-byte_cnt.patch
new file mode 100644
index 0000000..180b60b
--- /dev/null
+++ b/package/boot/uboot-sunxi/patches/004-sunxi-mmc-set-transfer-timeout-according-to-byte_cnt.patch
@@ -0,0 +1,36 @@
+From 8a5481e2e51a86e858c4f1481729421f26cc240c Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech at gmail.com>
+Date: Sat, 29 Aug 2015 21:26:11 +0800
+Subject: [PATCH] sunxi: mmc: set transfer timeout according to byte_cnt.
+
+Originally a timeout value of 2 seconds was used regardless of the size
+of data to be transfered.  This prevented slow devices from working
+correctly while there was no much gain for faster devices, e.g. it takes
+3708ms for a transfer of uImage of size 1899008 bytes.
+
+Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
+---
+ drivers/mmc/sunxi_mmc.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
+index e7ab828..7a990f7 100644
+--- a/drivers/mmc/sunxi_mmc.c
++++ b/drivers/mmc/sunxi_mmc.c
+@@ -257,9 +257,11 @@ static int mmc_trans_data_by_cpu(struct mmc *mmc, struct mmc_data *data)
+ 	const uint32_t status_bit = reading ? SUNXI_MMC_STATUS_FIFO_EMPTY :
+ 					      SUNXI_MMC_STATUS_FIFO_FULL;
+ 	unsigned i;
+-	unsigned byte_cnt = data->blocksize * data->blocks;
+-	unsigned timeout_msecs = 2000;
+ 	unsigned *buff = (unsigned int *)(reading ? data->dest : data->src);
++	unsigned byte_cnt = data->blocksize * data->blocks;
++	unsigned timeout_msecs = byte_cnt >> 8;
++	if (timeout_msecs < 2000)
++		timeout_msecs = 2000;
+ 
+ 	/* Always read / write data through the CPU */
+ 	setbits_le32(&mmchost->reg->gctrl, SUNXI_MMC_GCTRL_ACCESS_BY_AHB);
+-- 
+1.7.10.4
+
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From lazar at onion.io  Sat Aug 29 14:20:53 2015
From: lazar at onion.io (Lazar Demin)
Date: Sun, 30 Aug 2015 02:20:53 +0800
Subject: [OpenWrt-Devel] Using procd for USB hotplug detection
Message-ID: <CAPWOPQNirUeMjknT7Vwc+KFENBhaOA2ZjKp3BHVOvxBC4AKpTA@mail.gmail.com>

Hi,

I am trying to figure out how I can use procd to detect when a new usb
device comes up.

The wiki (http://wiki.openwrt.org/doc/techref/procd) was pretty vague
on the proper usage of procd.
The procd init script wiki
(http://wiki.openwrt.org/inbox/procd-init-scripts) wasn't particularly
illuminating either and looks like its mostly geared towards whether
or not to restart the daemon based on if a configuration file (or
network interface) has changed.

Is there a way to use procd to detect a new usb device in a similar
way to the hotplug deamon? Can somebody point me in the right
direction?

I'm currently using fstab to automatically mount any usb-storage, but
ideally I would like to know the device name and type.


Much appreciated,
Lazar
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From ardeleanalex at gmail.com  Sat Aug 29 15:03:29 2015
From: ardeleanalex at gmail.com (Alexandru Ardelean)
Date: Sat, 29 Aug 2015 22:03:29 +0300
Subject: [OpenWrt-Devel] Using procd for USB hotplug detection
In-Reply-To: <CAPWOPQNirUeMjknT7Vwc+KFENBhaOA2ZjKp3BHVOvxBC4AKpTA@mail.gmail.com>
References: <CAPWOPQNirUeMjknT7Vwc+KFENBhaOA2ZjKp3BHVOvxBC4AKpTA@mail.gmail.com>
Message-ID: <CA+U=Dsp1REWSAaK+VxpQz5PPMt0=ds_3SSTrVcyXkC2TRNNEKg@mail.gmail.com>

procd is for service handling mostly; so, start/stop/etc
basically you'd need to have another service that does usb-device handling
(of that device).

what i'd do, is to write a hotplug script, add it under /etc/hotplug.d and
then call whatever needs to be called from that script
it can be a ubus call to procd, or to some other service (ubus or not ubus)


On Sat, Aug 29, 2015 at 9:20 PM, Lazar Demin <lazar at onion.io> wrote:

> Hi,
>
> I am trying to figure out how I can use procd to detect when a new usb
> device comes up.
>
> The wiki (http://wiki.openwrt.org/doc/techref/procd) was pretty vague
> on the proper usage of procd.
> The procd init script wiki
> (http://wiki.openwrt.org/inbox/procd-init-scripts) wasn't particularly
> illuminating either and looks like its mostly geared towards whether
> or not to restart the daemon based on if a configuration file (or
> network interface) has changed.
>
> Is there a way to use procd to detect a new usb device in a similar
> way to the hotplug deamon? Can somebody point me in the right
> direction?
>
> I'm currently using fstab to automatically mount any usb-storage, but
> ideally I would like to know the device name and type.
>
>
> Much appreciated,
> Lazar
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150829/002f9125/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From zajec5 at gmail.com  Sat Aug 29 19:49:41 2015
From: zajec5 at gmail.com (=?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?=)
Date: Sun, 30 Aug 2015 01:49:41 +0200
Subject: [OpenWrt-Devel] [PATCH 14.07][RFC] dnsmasq: backport CVE-2015-3294
	security fix
Message-ID: <1440892181-15616-1-git-send-email-zajec5@gmail.com>

Upstream release 2.73 included CVE-2015-3294 fix, let's backport patch
fixing this security issue.
This avoids bumpping version to 2.73 which introduced many new features.
This way we keep dnsmasq safe and don't risk new problems.

Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
---
This was compile-tested only so far. If noone objects, I'll test it on
brcm47xx and then push.
---
 .../patches/003-Fix-crash-on-receipt-of-certa      | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 package/network/services/dnsmasq/patches/003-Fix-crash-on-receipt-of-certa

diff --git a/package/network/services/dnsmasq/patches/003-Fix-crash-on-receipt-of-certa b/package/network/services/dnsmasq/patches/003-Fix-crash-on-receipt-of-certa
new file mode 100644
index 0000000..eb3075d
--- /dev/null
+++ b/package/network/services/dnsmasq/patches/003-Fix-crash-on-receipt-of-certa
@@ -0,0 +1,37 @@
+From: Simon Kelley <simon at thekelleys.org.uk>
+Date: Thu, 9 Apr 2015 21:48:00 +0100
+Subject: [PATCH] Fix crash on receipt of certain malformed DNS requests.
+
+---
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1198,7 +1198,10 @@ unsigned int extract_request(struct dns_header *header, size_t qlen, char *name,
+ size_t setup_reply(struct dns_header *header, size_t qlen,
+ 		struct all_addr *addrp, unsigned int flags, unsigned long ttl)
+ {
+-  unsigned char *p = skip_questions(header, qlen);
++  unsigned char *p;
++
++  if (!(p = skip_questions(header, qlen)))
++    return 0;
+   
+   /* clear authoritative and truncated flags, set QR flag */
+   header->hb3 = (header->hb3 & ~(HB3_AA | HB3_TC)) | HB3_QR;
+@@ -1214,7 +1217,7 @@ size_t setup_reply(struct dns_header *header, size_t qlen,
+     SET_RCODE(header, NOERROR); /* empty domain */
+   else if (flags == F_NXDOMAIN)
+     SET_RCODE(header, NXDOMAIN);
+-  else if (p && flags == F_IPV4)
++  else if (flags == F_IPV4)
+     { /* we know the address */
+       SET_RCODE(header, NOERROR);
+       header->ancount = htons(1);
+@@ -1222,7 +1225,7 @@ size_t setup_reply(struct dns_header *header, size_t qlen,
+       add_resource_record(header, NULL, NULL, sizeof(struct dns_header), &p, ttl, NULL, T_A, C_IN, "4", addrp);
+     }
+ #ifdef HAVE_IPV6
+-  else if (p && flags == F_IPV6)
++  else if (flags == F_IPV6)
+     {
+       SET_RCODE(header, NOERROR);
+       header->ancount = htons(1);
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From john at phrozen.org  Sun Aug 30 00:15:41 2015
From: john at phrozen.org (John Crispin)
Date: Sun, 30 Aug 2015 06:15:41 +0200
Subject: [OpenWrt-Devel] Using procd for USB hotplug detection
In-Reply-To: <CA+U=Dsp1REWSAaK+VxpQz5PPMt0=ds_3SSTrVcyXkC2TRNNEKg@mail.gmail.com>
References: <CAPWOPQNirUeMjknT7Vwc+KFENBhaOA2ZjKp3BHVOvxBC4AKpTA@mail.gmail.com>
 <CA+U=Dsp1REWSAaK+VxpQz5PPMt0=ds_3SSTrVcyXkC2TRNNEKg@mail.gmail.com>
Message-ID: <55E2836D.5020608@phrozen.org>

use block-mount that is what its there for.

On 29/08/2015 21:03, Alexandru Ardelean wrote:
> procd is for service handling mostly; so, start/stop/etc
> basically you'd need to have another service that does usb-device
> handling (of that device).
> 
> what i'd do, is to write a hotplug script, add it under /etc/hotplug.d
> and then call whatever needs to be called from that script
> it can be a ubus call to procd, or to some other service (ubus or not ubus)
> 
> 
> On Sat, Aug 29, 2015 at 9:20 PM, Lazar Demin <lazar at onion.io
> <mailto:lazar at onion.io>> wrote:
> 
>     Hi,
> 
>     I am trying to figure out how I can use procd to detect when a new usb
>     device comes up.
> 
>     The wiki (http://wiki.openwrt.org/doc/techref/procd) was pretty vague
>     on the proper usage of procd.
>     The procd init script wiki
>     (http://wiki.openwrt.org/inbox/procd-init-scripts) wasn't particularly
>     illuminating either and looks like its mostly geared towards whether
>     or not to restart the daemon based on if a configuration file (or
>     network interface) has changed.
> 
>     Is there a way to use procd to detect a new usb device in a similar
>     way to the hotplug deamon? Can somebody point me in the right
>     direction?
> 
>     I'm currently using fstab to automatically mount any usb-storage, but
>     ideally I would like to know the device name and type.
> 
> 
>     Much appreciated,
>     Lazar
>     _______________________________________________
>     openwrt-devel mailing list
>     openwrt-devel at lists.openwrt.org <mailto:openwrt-devel at lists.openwrt.org>
>     https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From bruce at perens.com  Sun Aug 30 00:34:54 2015
From: bruce at perens.com (Bruce Perens)
Date: Sat, 29 Aug 2015 21:34:54 -0700
Subject: [OpenWrt-Devel] Ubiquiti NanoBeam M2 400 working with 15.03-rc3
Message-ID: <CAK2MWOuS_gy+3S=ikmVdTBF7oBnjgN5tadg=cHi45WpbuQxHTA@mail.gmail.com>

The new hardware compatibility list won't keep edits at the moment, or I'd
edit this myself.
Ubiquity Nanobeam M2 400 works fine with 15.03-rc3 .
18dB gain parabolic dish with the 2.4 GHz WiFi hardware integrated, costs
about $100.

    Thanks

    Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150829/77c4a07f/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From openwrt at daniel.thecshore.com  Sun Aug 30 02:31:03 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 30 Aug 2015 02:31:03 -0400
Subject: [OpenWrt-Devel] CC: grub2 disable stack protector
Message-ID: <55E2A327.6060201@daniel.thecshore.com>

Can changeset 46126 that explicity disables the stack protector for 
grub2 be backported to Chaos Calmer?

I know stack protector isn't enabled by default in Chaos Calmer but it's 
the only thing that I had block a build of Chaos Calmer with stack 
protector enabled and it would be kind of nice if it didn't take 
patching openwrt tree to use stack protector in CC.

Regards,

Daniel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From openwrt at daniel.thecshore.com  Sun Aug 30 02:43:04 2015
From: openwrt at daniel.thecshore.com (Daniel Dickinson)
Date: Sun, 30 Aug 2015 02:43:04 -0400
Subject: [OpenWrt-Devel] CC: grub2 disable stack protector
In-Reply-To: <55E2A327.6060201@daniel.thecshore.com>
References: <55E2A327.6060201@daniel.thecshore.com>
Message-ID: <55E2A5F8.3020901@daniel.thecshore.com>

NVM.  It seems that the infrastructure that changeset depends on isn't 
in CC.  I guess I'll just disable stack protector for x86.

Regards,

Daniel

On 2015-08-30 2:31 AM, Daniel Dickinson wrote:
> Can changeset 46126 that explicity disables the stack protector for
> grub2 be backported to Chaos Calmer?
>
> I know stack protector isn't enabled by default in Chaos Calmer but it's
> the only thing that I had block a build of Chaos Calmer with stack
> protector enabled and it would be kind of nice if it didn't take
> patching openwrt tree to use stack protector in CC.
>
> Regards,
>
> Daniel
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Sun Aug 30 09:49:50 2015
From: linus.luessing at c0d3.blue (Linus =?utf-8?Q?L=C3=BCssing?=)
Date: Sun, 30 Aug 2015 15:49:50 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 1/2] Revert "kernel: disable
 multicast-to-unicast translation for ipv6 neighbor solicitation (#17625)"
In-Reply-To: <55E1BFFE.4050400@openwrt.org>
References: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>
 <55E1BFFE.4050400@openwrt.org>
Message-ID: <20150830134950.GA7005@odroid>

Hi Steven,

Thanks for the feedback.

On Sat, Aug 29, 2015 at 04:21:50PM +0200, Steven Barth wrote:
> Let me know if you need more info.

Could you make a tcpdump for ICMPv6 on the wifi of the client?
Please start it before connecting and let it run for about three
minutes after connecting to the wifi.

On the router side, what's the output of:

* /sys/class/net/$bridged-wifi/brport/hairpin
* /sys/class/net/$bridged-wifi/brport/multicast_to_unicast
* /tmp/run/hostapd-*, ap-isolate=...

Cheers, Linus
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From hannu.nyman at iki.fi  Sun Aug 30 10:37:52 2015
From: hannu.nyman at iki.fi (Hannu Nyman)
Date: Sun, 30 Aug 2015 17:37:52 +0300
Subject: [OpenWrt-Devel] [PATCH] opkg: Extend 'opkg list' command to
 optionally display package size
Message-ID: <55E31540.3050600@iki.fi>

'opkg list' command only displays the available packages' name, version and 
description.
It would be useful to also see the approximate size of the available package.

This patch extends "opkg list" command with "--size" to optionally show also 
the *.ipk size in the listing.
* Default behaviour is to print the list of available packages as earlier: 
"name - version - description"
* with "--size" the output of is "name - version - size - description".

All current functionality should continue working without any change. Luci 
might be extended to utilize the new options to e.g. answer 
https://github.com/openwrt/luci/issues/19

Signed-off-by: Hannu Nyman < hannu.nyman at iki.fi>

---

Tested with ar71xx / WNDR3700:

opkg package size increase is minimal:

root at OpenWrt2:~# ls -l /bin/opkg
-rwxr-xr-x    1 root     root        101532 Aug 29 23:05 /bin/opkg

root at OpenWrt2:~# opkg install 
/tmp/opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-9_ar71xx.ipk
Upgrading opkg on root from 9c97d5ecd795709c8584e972bfdf3aee3a5b846d-8 to 
9c97d5ecd795709c8584e972bfdf3aee3a5b846d-9...
Configuring opkg.

root at OpenWrt2:~# ls -l /bin/opkg
-rwxr-xr-x    1 root     root        101548 Aug 29 23:05 /bin/opkg

--size works as expected:
(packages not from "packages" feed have been removed for clarity)

root at OpenWrt2:/tmp# opkg list j*
jansson - 2.7-1 - Jansson is a C library for encoding, decoding and 
manipulating JSON data
joe - 4.0-4 - Joe is world-famous Wordstar like text editor, that also features
  Emacs and Pico emulation
jpeg-tools - 9a-1 - The Independent JPEG Group's JPEG manipulation tools
json4lua - 0.9.53-1 - JSON and JSONRPC for Lua

root at OpenWrt2:/tmp# opkg list --size j*
jansson - 2.7-1 - 19182 - Jansson is a C library for encoding, decoding and 
manipulating JSON data
joe - 4.0-4 - 173911 - Joe is world-famous Wordstar like text editor, that 
also features
  Emacs and Pico emulation
jpeg-tools - 9a-1 - 31188 - The Independent JPEG Group's JPEG manipulation tools
json4lua - 0.9.53-1 - 7205 - JSON and JSONRPC for Lua

-------------
https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/packages/

jansson_2.7-1_ar71xx.ipk                           26-Aug-2015 
05:20               19182
joe_4.0-4_ar71xx.ipk                               26-Aug-2015 
05:20              173911
jpeg-tools_9a-1_ar71xx.ipk                         26-Aug-2015 
00:04               31188
json4lua_0.9.53-1_ar71xx.ipk                       26-Aug-2015 
05:21                7205



-------------- next part --------------
Index: package/system/opkg/Makefile
===================================================================
--- package/system/opkg/Makefile	(revision 46751)
+++ package/system/opkg/Makefile	(working copy)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -12,7 +12,7 @@
 PKG_NAME:=opkg
 PKG_REV:=9c97d5ecd795709c8584e972bfdf3aee3a5b846d
 PKG_VERSION:=$(PKG_REV)
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=$(PKG_REV)
Index: package/system/opkg/patches/250-add-print-package-size.patch
===================================================================
--- package/system/opkg/patches/250-add-print-package-size.patch	(revision 0)
+++ package/system/opkg/patches/250-add-print-package-size.patch	(working copy)
@@ -0,0 +1,74 @@
+--- a/libopkg/opkg_conf.c
++++ b/libopkg/opkg_conf.c
+@@ -69,6 +69,7 @@ opkg_option_t options[] = {
+ 	  { "proxy_passwd", OPKG_OPT_TYPE_STRING, &_conf.proxy_passwd },
+ 	  { "proxy_user", OPKG_OPT_TYPE_STRING, &_conf.proxy_user },
+ 	  { "query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all },
++	  { "size", OPKG_OPT_TYPE_BOOL, &_conf.size },
+ 	  { "tmp_dir", OPKG_OPT_TYPE_STRING, &_conf.tmp_dir },
+ 	  { "verbosity", OPKG_OPT_TYPE_INT, &_conf.verbosity },
+ #if defined(HAVE_OPENSSL)
+--- a/libopkg/opkg_conf.h
++++ b/libopkg/opkg_conf.h
+@@ -88,6 +88,7 @@ struct opkg_conf
+      int query_all;
+      int verbosity;
+      int noaction;
++     int size;
+      int download_only;
+      char *cache;
+ 
+--- a/src/opkg-cl.c
++++ b/src/opkg-cl.c
+@@ -52,6 +52,7 @@ enum {
+ 	ARGS_OPT_AUTOREMOVE,
+ 	ARGS_OPT_CACHE,
+ 	ARGS_OPT_FORCE_SIGNATURE,
++	ARGS_OPT_SIZE,
+ };
+ 
+ static struct option long_options[] = {
+@@ -98,6 +99,7 @@ static struct option long_options[] = {
+ 	{"offline-root", 1, 0, 'o'},
+ 	{"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
+ 	{"add-dest", 1, 0, ARGS_OPT_ADD_DEST},
++	{"size", 0, 0, ARGS_OPT_SIZE},
+ 	{"test", 0, 0, ARGS_OPT_NOACTION},
+ 	{"tmp-dir", 1, 0, 't'},
+ 	{"tmp_dir", 1, 0, 't'},
+@@ -207,6 +209,9 @@ args_parse(int argc, char *argv[])
+ 			}
+ 			free(tuple);
+ 			break;
++		case ARGS_OPT_SIZE:
++			conf->size = 1;
++			break;
+ 		case ARGS_OPT_NOACTION:
+ 			conf->noaction = 1;
+ 			break;
+@@ -310,6 +315,7 @@ usage()
+ 	printf("\t--download-only	No action -- download only\n");
+ 	printf("\t--nodeps		Do not follow dependencies\n");
+ 	printf("\t--nocase		Perform case insensitive pattern matching\n");
++	printf("\t--size			Print package size when listing available packages\n");
+ 	printf("\t--force-removal-of-dependent-packages\n");
+ 	printf("\t			Remove package and all dependencies\n");
+ 	printf("\t--autoremove		Remove packages that were installed\n");
+--- a/libopkg/opkg_cmd.c
++++ b/libopkg/opkg_cmd.c
+@@ -47,10 +47,12 @@ static void
+ print_pkg(pkg_t *pkg)
+ {
+ 	char *version = pkg_version_str_alloc(pkg);
++	printf("%s - %s", pkg->name, version);
++	if (conf->size)
++		printf(" - %lu", pkg->size);
+ 	if (pkg->description)
+-		printf("%s - %s - %s\n", pkg->name, version, pkg->description);
+-	else
+-		printf("%s - %s\n", pkg->name, version);
++		printf(" - %s", pkg->description);
++	printf("\n");
+ 	free(version);
+ }
+ 
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From dirkneukirchen at web.de  Sun Aug 30 12:26:37 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 30 Aug 2015 18:26:37 +0200
Subject: [OpenWrt-Devel] [PATCH] yaffs2: remove __TIME__ __DATE__ macros
Message-ID: <1440951997-10442-1-git-send-email-dirkneukirchen@web.de>

prevent compiler errors with gcc 4.9
increase reproducibility

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 target/linux/generic/files/fs/yaffs2/yaffs_vfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/generic/files/fs/yaffs2/yaffs_vfs.c b/target/linux/generic/files/fs/yaffs2/yaffs_vfs.c
index 6540434..864a5dc 100644
--- a/target/linux/generic/files/fs/yaffs2/yaffs_vfs.c
+++ b/target/linux/generic/files/fs/yaffs2/yaffs_vfs.c
@@ -3250,7 +3250,7 @@ static int yaffs_proc_read(char *page,
 	if (step == 0)
 		buf +=
 		    sprintf(buf,
-			    "Multi-version YAFFS built:" __DATE__ " " __TIME__
+			    "Multi-version YAFFS."
 			    "\n");
 	else if (step == 1)
 		buf += sprintf(buf, "\n");
@@ -3601,7 +3601,7 @@ static int __init init_yaffs_fs(void)
 	struct file_system_to_install *fsinst;
 
 	yaffs_trace(YAFFS_TRACE_ALWAYS,
-		"yaffs built " __DATE__ " " __TIME__ " Installing.");
+		"yaffs Installing.");
 
 	mutex_init(&yaffs_context_lock);
 
@@ -3642,7 +3642,7 @@ static void __exit exit_yaffs_fs(void)
 	struct file_system_to_install *fsinst;
 
 	yaffs_trace(YAFFS_TRACE_ALWAYS,
-		"yaffs built " __DATE__ " " __TIME__ " removing.");
+		"yaffs removing.");
 
 	remove_proc_entry("yaffs", YPROC_ROOT);
 
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 30 12:26:45 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 30 Aug 2015 18:26:45 +0200
Subject: [OpenWrt-Devel] [PATCH] include/image.mk: make tar reproducible
Message-ID: <1440952005-10523-1-git-send-email-dirkneukirchen@web.de>

several packages reported different file order between builds
make binutils, kmod-sched reproducible

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 include/image.mk   | 2 +-
 scripts/ipkg-build | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 73fc805..f8601f0 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -245,7 +245,7 @@ define Image/mkfs/cpiogz
 endef
 
 define Image/mkfs/targz
-	$(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE),-$(PROFILE))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ .
+	$(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE),-$(PROFILE))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 --sort=name -C $(TARGET_DIR)/ .
 endef
 
 E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index cd70c1f..a54e9b5 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -139,20 +139,20 @@ mkdir $tmp_dir
 
 echo $CONTROL > $tmp_dir/tarX
 # Preserve permissions (-p) when creating data.tar.gz as non-root user
-( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX --format=gnu -czpf $tmp_dir/data.tar.gz --mtime="$TIMESTAMP" . )
+( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX --format=gnu --sort=name -czpf $tmp_dir/data.tar.gz --mtime="$TIMESTAMP" . )
 
 installed_size=`stat -c "%s" $tmp_dir/data.tar.gz`
 sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \
 	$pkg_dir/$CONTROL/control
 
-( cd $pkg_dir/$CONTROL && $TAR $ogargs --format=gnu -czf $tmp_dir/control.tar.gz --mtime="$TIMESTAMP" . )
+( cd $pkg_dir/$CONTROL && $TAR $ogargs --format=gnu --sort=name -czf $tmp_dir/control.tar.gz --mtime="$TIMESTAMP" . )
 rm $tmp_dir/tarX
 
 echo "2.0" > $tmp_dir/debian-binary
 
 pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
 rm -f $pkg_file
-( cd $tmp_dir && $TAR --format=gnu -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
+( cd $tmp_dir && $TAR --format=gnu --sort=name -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
 
 rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
 rmdir $tmp_dir
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Sun Aug 30 12:26:51 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Sun, 30 Aug 2015 18:26:51 +0200
Subject: [OpenWrt-Devel] [PATCH] openvpn: remove __DATE__ from options output
Message-ID: <1440952011-10585-1-git-send-email-dirkneukirchen@web.de>

reported by:
https://reproducible.debian.net/openwrt/dbd/ar71xx/base/openvpn-nossl_2.3.7-1_ar71xx.ipk.html

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 .../openvpn/patches/001-reproducible-remove_DATE.patch         | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch

diff --git a/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch b/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch
new file mode 100644
index 0000000..3ceef6f
--- /dev/null
+++ b/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch
@@ -0,0 +1,10 @@
+--- a/src/openvpn/options.c
++++ b/src/openvpn/options.c
+@@ -102,7 +102,6 @@ const char title_string[] =
+   " [MH]"
+ #endif
+   " [IPv6]"
+-  " built on " __DATE__
+ ;
+ 
+ #ifndef ENABLE_SMALL
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From jogo at openwrt.org  Sun Aug 30 13:42:47 2015
From: jogo at openwrt.org (Jonas Gorski)
Date: Sun, 30 Aug 2015 19:42:47 +0200
Subject: [OpenWrt-Devel] [PATCH] include/image.mk: make tar reproducible
In-Reply-To: <1440952005-10523-1-git-send-email-dirkneukirchen@web.de>
References: <1440952005-10523-1-git-send-email-dirkneukirchen@web.de>
Message-ID: <CAOiHx=mJN_ZqbG9a6wA_Zqjaw_Ojcdb2Fjcbt1Jvbd5Ppa8CGA@mail.gmail.com>

Hi,

On Sun, Aug 30, 2015 at 6:26 PM, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
> several packages reported different file order between builds
> make binutils, kmod-sched reproducible
>
> Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>

These are stil not reproducible for others, because ...
> ---
>  include/image.mk   | 2 +-
>  scripts/ipkg-build | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/image.mk b/include/image.mk
> index 73fc805..f8601f0 100644
> --- a/include/image.mk
> +++ b/include/image.mk
> @@ -245,7 +245,7 @@ define Image/mkfs/cpiogz
>  endef
>
>  define Image/mkfs/targz
> -       $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE),-$(PROFILE))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ .
> +       $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE),-$(PROFILE))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 --sort=name -C $(TARGET_DIR)/ .
>  endef
>
>  E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
> diff --git a/scripts/ipkg-build b/scripts/ipkg-build
> index cd70c1f..a54e9b5 100755
> --- a/scripts/ipkg-build
> +++ b/scripts/ipkg-build
> @@ -139,20 +139,20 @@ mkdir $tmp_dir
>
>  echo $CONTROL > $tmp_dir/tarX
>  # Preserve permissions (-p) when creating data.tar.gz as non-root user
> -( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX --format=gnu -czpf $tmp_dir/data.tar.gz --mtime="$TIMESTAMP" . )
> +( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX --format=gnu --sort=name -czpf $tmp_dir/data.tar.gz --mtime="$TIMESTAMP" . )
>
>  installed_size=`stat -c "%s" $tmp_dir/data.tar.gz`
>  sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \
>         $pkg_dir/$CONTROL/control
>
> -( cd $pkg_dir/$CONTROL && $TAR $ogargs --format=gnu -czf $tmp_dir/control.tar.gz --mtime="$TIMESTAMP" . )
> +( cd $pkg_dir/$CONTROL && $TAR $ogargs --format=gnu --sort=name -czf $tmp_dir/control.tar.gz --mtime="$TIMESTAMP" . )
>  rm $tmp_dir/tarX
>
>  echo "2.0" > $tmp_dir/debian-binary
>
>  pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
>  rm -f $pkg_file
> -( cd $tmp_dir && $TAR --format=gnu -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
> +( cd $tmp_dir && $TAR --format=gnu --sort=name -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )

this $TAR invocation does not use $ogargs, so the outer .ipk will use
the current user as the owner for its contents. I don't think this
omission is intentional, but I haven't tested if anything breaks when
adding it.


>
>  rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
>  rmdir $tmp_dir


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


From thess at kitschensync.net  Sun Aug 30 15:36:27 2015
From: thess at kitschensync.net (Ted Hess)
Date: Sun, 30 Aug 2015 15:36:27 -0400
Subject: [OpenWrt-Devel] [PATCH] nls.mk: add -rpath-link when needed
In-Reply-To: <mailman.2208.1440874980.3606.openwrt-devel@lists.openwrt.org>
References: <mailman.2208.1440874980.3606.openwrt-devel@lists.openwrt.org>
Message-ID: <9CCD0C0DB8D149DCA0831BF15DED536B@fortmeadow.com>

+1 on this. I have tested this already on about 10 packages OK.

After this patch is applied, I think there are approx. 24 packages which are potentially affected - though somewhat benign. Updating 
them to remove unnecessary LDFLAGS fixups would be a good thing to do. I have put together a list of candidates for these updates 
and will be submitting patches for them after the new nls.mk has been checked in and new builds are tested.

/ted

Here's the list I am working on at the moment:

The following are in the dev repo:
package/libs/elfutils    (remove TARGET_LDFLAGS)

The following are in the packages repo:
mail/alpine        (remove unecessary DISABLE_NLS; package-defaults.mk sets it correctly)
utils/crelay        (remove TARGET_LDFLAGS)
utils/lcd4linux    (remove EXTRA_LDFLAGS)
utils/dosfstools    (fixup LDFLAGS, LDLIBS)
utils/smstools3    (remove TARGET_LDFLAGS; fixup USER_LDFLAGS)

net/seafile-server    (fixup TARGET_LDFLAGS)
net/seafile-ccnet    (fixup TARGET_LDFLAGS)
net/dmapd          (remove TARGET_LDFLAGS)

lang/vala        (remove TARGET_LDFLAGs)

multimedia/minidlna    (remove LDFLAGS and ICONV_LIBS)
multimedia/gstreamer1    (remove EXTRA_LDFLAGS)
multimedia/gst1-plugins-*    (remove EXTRA_LDFLAGS)

sound/mpd    (remove TARGET_LDFLAGS)

Remove TARGET_LDFLAGS from:
--------------
libs/vips
libs/libsoup
libs/libmms
libs/libsearpc
libs/libimobiledevice
libs/libdmapsharing
libs/apr-util    (remove explicit -liconv)


-----Original Message----- 
Date: Sat, 29 Aug 2015 14:33:33 +0300
From: Paul Fertser <fercerpav at gmail.com>
To: openwrt-devel at lists.openwrt.org
Cc: Paul Fertser <fercerpav at gmail.com>
Subject: [OpenWrt-Devel] [PATCH] nls.mk: add -rpath-link when needed
for NLS support
Message-ID: <1440848013-1222-1-git-send-email-fercerpav at gmail.com>

When a package links to a shared library that depends on libiconv or
libintl shared libraries, specifying directory pathes to them via -L
switches is not enough, see "man 1 ld" -rpath-link description.

Signed-off-by: Paul Fertser <fercerpav at gmail.com>
---
include/nls.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/nls.mk b/include/nls.mk
index 118000d..51463b9 100644
--- a/include/nls.mk
+++ b/include/nls.mk
@@ -28,12 +28,12 @@ PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl
ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
-ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib
+ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib

INTL_DEPENDS:=+BUILD_NLS:libintl-full
INTL_CFLAGS:=-I$(INTL_PREFIX)/include
INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
-INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib
+INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib

TARGET_CFLAGS += $(ICONV_CFLAGS) $(INTL_CFLAGS)
TARGET_CPPFLAGS += $(ICONV_CPPFLAGS) $(INTL_CPPFLAGS)
-- 
2.0.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Sun Aug 30 18:54:06 2015
From: linus.luessing at c0d3.blue (Linus =?utf-8?Q?L=C3=BCssing?=)
Date: Mon, 31 Aug 2015 00:54:06 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 1/2] Revert "kernel: disable
 multicast-to-unicast translation for ipv6 neighbor solicitation (#17625)"
In-Reply-To: <20150830134950.GA7005@odroid>
References: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>
 <55E1BFFE.4050400@openwrt.org> <20150830134950.GA7005@odroid>
Message-ID: <20150830225406.GH2892@odroid>

On Sun, Aug 30, 2015 at 03:49:50PM +0200, Linus L?ssing wrote:
> Hi Steven,
> 
> Thanks for the feedback.
> 
> On Sat, Aug 29, 2015 at 04:21:50PM +0200, Steven Barth wrote:
> > Let me know if you need more info.
> 
> Could you make a tcpdump for ICMPv6 on the wifi of the client?
> Please start it before connecting and let it run for about three
> minutes after connecting to the wifi.

Ok, I was able to easily reproduce the issue here. Looking at the
tcpdump the wifi client receives its own Neighbor Solicitation
again, reflected through the bridge-hairpin option.

The Linux IPv6 stack seems to interpret the reflected NS as an
address collision with another host. It seems a little weird that
the Linux kernel does that for NS - I think an IPv6 implementation
should only interpret Neighbor Advertisements as address conflicts
if I remember the RFCs correctly.


My current thought to fix this issue is to patch the
multicast-to-unicast patch in the following way:

Only transmit multicast-to-unicast'ed packets if the mangled,
now unicast MAC destination address differs from the MAC source.


We need to think about what'd happen for non-multicast-to-unicast'ed
multicast packets which get reflected back to the wifi interface
though. This should only happen if a multicast router is on one of
the wifi clients / STAs, I think. Will need to check whether the
Linux kernel interprets multicast packets without a mangled
MAC destination as duplicates, too.

Cheers, Linus
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Sun Aug 30 19:07:58 2015
From: linus.luessing at c0d3.blue (Linus =?utf-8?Q?L=C3=BCssing?=)
Date: Mon, 31 Aug 2015 01:07:58 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 1/2] Revert "kernel: disable
 multicast-to-unicast translation for ipv6 neighbor solicitation (#17625)"
In-Reply-To: <20150830225406.GH2892@odroid>
References: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>
 <55E1BFFE.4050400@openwrt.org> <20150830134950.GA7005@odroid>
 <20150830225406.GH2892@odroid>
Message-ID: <20150830230758.GI2892@odroid>

PS: Out of curiousity, can someone with deeper knowledge into 802.11
tell me, when an STA sends a multicast packet to its master which
then rebroadcasts it at e.g. 1MBit/s, how does the originating STA
know that its a rebroadcast of its own frame and refrain from
forwarding it internally?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 31 01:22:59 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 31 Aug 2015 07:22:59 +0200
Subject: [OpenWrt-Devel] [PATCH] ipkg-build: add ogargs to outer tar/ipk
Message-ID: <1440998579-16188-1-git-send-email-dirkneukirchen@web.de>

prevent name:uid leaks of build system

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 requires "include/image.mk: make tar reproducible"


 scripts/ipkg-build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index f9d00af..fb1321a 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -152,7 +152,7 @@ echo "2.0" > $tmp_dir/debian-binary
 
 pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
 rm -f $pkg_file
-( cd $tmp_dir && $TAR --format=gnu --sort=name -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
+( cd $tmp_dir && $TAR $ogargs --format=gnu --sort=name -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
 
 rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
 rmdir $tmp_dir
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 31 01:23:13 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 31 Aug 2015 07:23:13 +0200
Subject: [OpenWrt-Devel] [PATCH] include/image.mk: make tar reproducible
In-Reply-To: <CAOiHx=mJN_ZqbG9a6wA_Zqjaw_Ojcdb2Fjcbt1Jvbd5Ppa8CGA@mail.gmail.com>
References: <1440952005-10523-1-git-send-email-dirkneukirchen@web.de>
 <CAOiHx=mJN_ZqbG9a6wA_Zqjaw_Ojcdb2Fjcbt1Jvbd5Ppa8CGA@mail.gmail.com>
Message-ID: <55E3E4C1.90104@web.de>

On 30.08.2015 19:42, Jonas Gorski wrote:
> Hi,
> 
> On Sun, Aug 30, 2015 at 6:26 PM, Dirk Neukirchen <dirkneukirchen at web.de> wrote:
>> several packages reported different file order between builds
>> make binutils, kmod-sched reproducible
>>
>> Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
> 
> These are stil not reproducible for others, because ...
>> ---
>>  include/image.mk   | 2 +-
>>  scripts/ipkg-build | 6 +++---
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/image.mk b/include/image.mk
>> index 73fc805..f8601f0 100644
>> --- a/include/image.mk
>> +++ b/include/image.mk
>> @@ -245,7 +245,7 @@ define Image/mkfs/cpiogz
>>  endef
>>
>>  define Image/mkfs/targz
>> -       $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE),-$(PROFILE))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ .
>> +       $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE),-$(PROFILE))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 --sort=name -C $(TARGET_DIR)/ .
>>  endef
>>
>>  E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
>> diff --git a/scripts/ipkg-build b/scripts/ipkg-build
>> index cd70c1f..a54e9b5 100755
>> --- a/scripts/ipkg-build
>> +++ b/scripts/ipkg-build
>> @@ -139,20 +139,20 @@ mkdir $tmp_dir
>>
>>  echo $CONTROL > $tmp_dir/tarX
>>  # Preserve permissions (-p) when creating data.tar.gz as non-root user
>> -( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX --format=gnu -czpf $tmp_dir/data.tar.gz --mtime="$TIMESTAMP" . )
>> +( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX --format=gnu --sort=name -czpf $tmp_dir/data.tar.gz --mtime="$TIMESTAMP" . )
>>
>>  installed_size=`stat -c "%s" $tmp_dir/data.tar.gz`
>>  sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \
>>         $pkg_dir/$CONTROL/control
>>
>> -( cd $pkg_dir/$CONTROL && $TAR $ogargs --format=gnu -czf $tmp_dir/control.tar.gz --mtime="$TIMESTAMP" . )
>> +( cd $pkg_dir/$CONTROL && $TAR $ogargs --format=gnu --sort=name -czf $tmp_dir/control.tar.gz --mtime="$TIMESTAMP" . )
>>  rm $tmp_dir/tarX
>>
>>  echo "2.0" > $tmp_dir/debian-binary
>>
>>  pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
>>  rm -f $pkg_file
>> -( cd $tmp_dir && $TAR --format=gnu -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
>> +( cd $tmp_dir && $TAR --format=gnu --sort=name -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
> 
> this $TAR invocation does not use $ogargs, so the outer .ipk will use
> the current user as the owner for its contents. I don't think this
> omission is intentional, but I haven't tested if anything breaks when
> adding it.
> 
> 

Adding $ogargs does not seem to break anything - it currently works
with extracting name:ID thepeople/1008 on the device.

Currently OpenWrt reproducible page does not change more between
different builds. 
This is documented (uid is not yet varied between rebuilds of OpenWrt.)

So this still fixes the file ordering for inner and outer tar.
(https://reproducible.debian.net/openwrt/dbd/ramips/base/binutils_2.24-3_ramips.ipk.html)

I sent a separate patch on top of this one to add $oargs.

>>
>>  rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
>>  rmdir $tmp_dir
> 
> 
> Jonas
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From cyrus at openwrt.org  Mon Aug 31 05:29:45 2015
From: cyrus at openwrt.org (Steven Barth)
Date: Mon, 31 Aug 2015 11:29:45 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 1/2] Revert "kernel: disable
	multicast-to-unicast translation for ipv6 neighbor
	solicitation (#17625)"
In-Reply-To: <20150830225406.GH2892@odroid>
References: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>
 <55E1BFFE.4050400@openwrt.org> <20150830134950.GA7005@odroid>
 <20150830225406.GH2892@odroid>
Message-ID: <74C8AA72-D005-4ED6-B20D-E816ED85D8D7@openwrt.org>




>Ok, I was able to easily reproduce the issue here. Looking at the
>tcpdump the wifi client receives its own Neighbor Solicitation
>again, reflected through the bridge-hairpin option.

Why are we reflecting packets back to the originator anyway? Could it not be excluded?

Btw. once we are bit more stable i will try to test how the igmpv3/mldv2 querier / proxy I wrote interacts here (disabling kernel querier).
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From linus.luessing at c0d3.blue  Mon Aug 31 06:19:44 2015
From: linus.luessing at c0d3.blue (Linus =?utf-8?Q?L=C3=BCssing?=)
Date: Mon, 31 Aug 2015 12:19:44 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 1/2] Revert "kernel: disable
 multicast-to-unicast translation for ipv6 neighbor solicitation (#17625)"
In-Reply-To: <74C8AA72-D005-4ED6-B20D-E816ED85D8D7@openwrt.org>
References: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>
 <55E1BFFE.4050400@openwrt.org> <20150830134950.GA7005@odroid>
 <20150830225406.GH2892@odroid>
 <74C8AA72-D005-4ED6-B20D-E816ED85D8D7@openwrt.org>
Message-ID: <20150831101943.GK2892@odroid>

On Mon, Aug 31, 2015 at 11:29:45AM +0200, Steven Barth wrote:
> 
> 
> 
> >Ok, I was able to easily reproduce the issue here. Looking at the
> >tcpdump the wifi client receives its own Neighbor Solicitation
> >again, reflected through the bridge-hairpin option.
> 
> Why are we reflecting packets back to the originator anyway? Could it not be excluded?

Currently the multicast-to-unicast patch reflects it back as it
detected that the originator itself is a listener of the multicast
group of the Neighbor Solicitation.

I had somehow expected that mac80211 would exclude it. But looks like it
doesn't. And yes, we can exclude/drop that unicast'ed multicast
packet with src==dst on the bridge side already like I said
before for a suggested fix. But it's not 100% sufficient yet, we'd
have issues again once a multicast router/querier is on an STA.

Cheers, Linus

> 
> Btw. once we are bit more stable i will try to test how the igmpv3/mldv2 querier / proxy I wrote interacts here (disabling kernel querier).

I'd be interested to hear about that :).
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From attila at lendvai.name  Mon Aug 31 06:57:08 2015
From: attila at lendvai.name (Attila Lendvai)
Date: Mon, 31 Aug 2015 12:57:08 +0200
Subject: [OpenWrt-Devel] [PATCH] Restore buildability of the AP121 target
Message-ID: <CAE4vfcLGO9sE8BDcF1VTEzmkQfi81jkDt9Q3Hedh1ovXv28Dwg@mail.gmail.com>

hi!

resending this patch properly, including a signed-off entry.

it would be nice if this could make its way into CC, because this is a
regression.

the obsolete copy is this: https://patchwork.ozlabs.org/patch/508527/

-- 
? attila lendvai
? PGP: 963F 5D5F 45C7 DFCD 0A39
--
?In a democracy, mass opinion creates power. Power diverts funds to
the manufacturers of opinion, who manufacture more, etc. [...] This
feedback loop generates a playing field on which the most competitive
ideas are not those which best correspond to reality, but those which
produce the strongest feedback.?
	? Mencius Moldbug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Restore-buildability-of-the-AP121-target.patch
Type: text/x-patch
Size: 3338 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150831/5dc57014/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From attila at lendvai.name  Mon Aug 31 06:58:25 2015
From: attila at lendvai.name (Attila Lendvai)
Date: Mon, 31 Aug 2015 12:58:25 +0200
Subject: [OpenWrt-Devel] [PATCH] AP121 target: fix board detection in
	ar71xx.sh
Message-ID: <CAE4vfcKEgZwQvwMmR2Qp1sciwJ03ajf1c8_Nx3rm+-x5npuxzA@mail.gmail.com>

hi!

resending this patch properly, including a signed-off entry.

it would be nice if this could make its way into CC, because this
fixes a regression.

the obsolete copy is this: https://patchwork.ozlabs.org/patch/508527/

-- 
? attila lendvai
? PGP: 963F 5D5F 45C7 DFCD 0A39
--
We are all work-in-progress.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-AP121-target-fix-board-detection-in-ar71xx.sh.patch
Type: text/x-patch
Size: 773 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150831/be7fc7df/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From linus.luessing at c0d3.blue  Mon Aug 31 08:04:21 2015
From: linus.luessing at c0d3.blue (Linus =?utf-8?Q?L=C3=BCssing?=)
Date: Mon, 31 Aug 2015 14:04:21 +0200
Subject: [OpenWrt-Devel] [PATCHv3 openwrt 1/2] Revert "kernel: disable
 multicast-to-unicast translation for ipv6 neighbor solicitation (#17625)"
In-Reply-To: <20150831101943.GK2892@odroid>
References: <1440343170-13040-5-git-send-email-linus.luessing@c0d3.blue>
 <55E1BFFE.4050400@openwrt.org> <20150830134950.GA7005@odroid>
 <20150830225406.GH2892@odroid>
 <74C8AA72-D005-4ED6-B20D-E816ED85D8D7@openwrt.org>
 <20150831101943.GK2892@odroid>
Message-ID: <20150831120421.GL2892@odroid>

On Mon, Aug 31, 2015 at 12:19:44PM +0200, Linus L?ssing wrote:
> I had somehow expected that mac80211 would exclude it. But looks like it
> doesn't.

Looks like mac80211 on an STA does that for frames with a
multicast destination (to prevent getting the own multicast
packets echo'd back once the AP rebroadcasts them, I guess). E.g.
ap-isolation + bridge-hairpin without multicast-to-unicast works
fine. So maybe the simple fix for the multicast-to-unicast patch
is sufficient.

The unicast-to-multicast patch mangled the destination to a
unicast one and mac80211 does not seem to consider their source
address.

Going to make and try a patch for the bridge now.

Cheers, Linus
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From dmaces at nd.edu  Mon Aug 31 12:11:34 2015
From: dmaces at nd.edu (=?UTF-8?q?D=2E=20Andrei=20M=C4=83ce=C8=99?=)
Date: Mon, 31 Aug 2015 12:11:34 -0400
Subject: [OpenWrt-Devel] [PATCH] ramips: enable external amplifier for
	Xiaomi MiWiFi Mini
Message-ID: <55e5bb81.0314320a.a482.3a7e@mx.google.com>

Attempt to boost the 2.4 GHz signal, currently very low.

Signed-off-by: D. Andrei M?ce? <dmaces at nd.edu>
---
 target/linux/ramips/dts/MIWIFI-MINI.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts b/target/linux/ramips/dts/MIWIFI-MINI.dts
index fa9846c..dad99c3 100644
--- a/target/linux/ramips/dts/MIWIFI-MINI.dts
+++ b/target/linux/ramips/dts/MIWIFI-MINI.dts
@@ -113,6 +113,11 @@
 				ralink,group = "i2c", "rgmii1";
 				ralink,function = "gpio";
 			};
+
+			pa {
+				ralink,group = "pa";
+				ralink,function = "pa";
+			};
 		};
 	};
 
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

From zefir.kurtisi at neratec.com  Mon Aug 31 13:02:40 2015
From: zefir.kurtisi at neratec.com (Zefir Kurtisi)
Date: Mon, 31 Aug 2015 19:02:40 +0200
Subject: [OpenWrt-Devel] ubus: potential regression in request processing
In-Reply-To: <55DEFFBD.3000406@nbd.name>
References: <55DEF9E6.601@neratec.com> <55DEFFBD.3000406@nbd.name>
Message-ID: <55E488B0.2000100@neratec.com>

On 08/27/2015 02:17 PM, Felix Fietkau wrote:
> [...]
> This change (mostly untested) might fix the issue while still preserving
> processing of pending notifications, what do you think?
> 
> [...]

Thank you for the suggestion, Felix. Alas, while trying to dig deeper, I noticed
another recent modification that bricked my host-based test environment.

I use to test and debug ubus based modules on host, which so far worked as
expected. Moving ubus and libubox to HEAD, there seem some undocumented
requirements introduced to get the system running again.

Here's how to reproduce:
* build on host
* run ubusd -s /tmp/ubus.sock
* run examples/server -s /tmp/ubus.sock
=> server fails to register


Must be something with access rights to directories, since the same sources work
on target as expected - with the only difference being run as root.


I'll test your suggested patches once I get back to a working status.


Cheers
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From nbd at openwrt.org  Mon Aug 31 13:19:50 2015
From: nbd at openwrt.org (Felix Fietkau)
Date: Mon, 31 Aug 2015 19:19:50 +0200
Subject: [OpenWrt-Devel] ubus: potential regression in request processing
In-Reply-To: <55E488B0.2000100@neratec.com>
References: <55DEF9E6.601@neratec.com> <55DEFFBD.3000406@nbd.name>
 <55E488B0.2000100@neratec.com>
Message-ID: <55E48CB6.2050401@openwrt.org>

On 2015-08-31 19:02, Zefir Kurtisi wrote:
> On 08/27/2015 02:17 PM, Felix Fietkau wrote:
>> [...]
>> This change (mostly untested) might fix the issue while still preserving
>> processing of pending notifications, what do you think?
>> 
>> [...]
> 
> Thank you for the suggestion, Felix. Alas, while trying to dig deeper, I noticed
> another recent modification that bricked my host-based test environment.
> 
> I use to test and debug ubus based modules on host, which so far worked as
> expected. Moving ubus and libubox to HEAD, there seem some undocumented
> requirements introduced to get the system running again.
> 
> Here's how to reproduce:
> * build on host
> * run ubusd -s /tmp/ubus.sock
> * run examples/server -s /tmp/ubus.sock
> => server fails to register
> 
> 
> Must be something with access rights to directories, since the same sources work
> on target as expected - with the only difference being run as root.
Can't reproduce this on my host (tried on Mac OS X and Linux).

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From benjamin.agor at vivint.com  Mon Aug 31 14:05:40 2015
From: benjamin.agor at vivint.com (Ben Agor)
Date: Mon, 31 Aug 2015 18:05:40 +0000 (UTC)
Subject: [OpenWrt-Devel] [rt3050f] A small question
References: <3b8b627bf677b4e4fed6395d08e9741e@localhost>
 <d784c79b0f77f12b0cc88f5fdd85daa9@astrumtech.net>
Message-ID: <loom.20150831T200313-359@post.gmane.org>

Layne Edwards <ledwards <at> astrumtech.net> writes:

> 
> 
> Andrew,
> Did you modify the eeprom extract hotplug for your board?
> trunk/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
> Regards,Layne

Hi Layne or who it may concern,

I'm having a similar problem. I'm wondering what I need to change in the 
10-rt2x00-eeprom file. The contents of mine are below. I appreciate your help:



#!/bin/sh

rt2x00_eeprom_die() {
        echo "rt2x00 eeprom: " "$*"
        exit 1
}

rt2x00_eeprom_extract() {
        local part=$1
        local offset=$2
        local count=$3
        local mtd

        . /lib/functions.sh

        mtd=$(find_mtd_part $part)
        [ -n "$mtd" ] || \
                rt2x00_eeprom_die "no mtd device found for partition $part"

        dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count
2>/dev/null || \
                rt2x00_eeprom_die "failed to extract from $mtd"
}

FW="/lib/firmware/$FIRMWARE"
[ -e "$FW" ] && exit 0

. /lib/ramips.sh

board=$(ramips_board_name)

case "$FIRMWARE" in
"soc_wmac.eeprom")
        case $board in
        *)
                rt2x00_eeprom_die "Please define mtd-eeprom in $board DTS file!"
                ;;
        esac
        ;;

"rt2x00pci_1_0.eeprom")
        case $board in
        cy-swr1100)
                rt2x00_eeprom_extract "factory" 8192 512
                ;;
        br-6475nd | rt-n56u | whr-600d | whr-1166d)
                rt2x00_eeprom_extract "factory" 32768 512
                ;;
        esac
        ;;
esac


-Thanks, Ben
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From Alexey.Brodkin at synopsys.com  Mon Aug 31 14:43:29 2015
From: Alexey.Brodkin at synopsys.com (Alexey Brodkin)
Date: Mon, 31 Aug 2015 18:43:29 +0000
Subject: [OpenWrt-Devel] [PATCH 0/3] Add support of ARC architecture
In-Reply-To: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
References: <1440673433-25446-1-git-send-email-abrodkin@synopsys.com>
Message-ID: <1441046609.2935.11.camel@synopsys.com>

Hello,

On Thu, 2015-08-27 at 14:03 +0300, Alexey Brodkin wrote:
> This patch series adds support for the Synopsys DesignWare ARC architecture.
> 
> DesignWare ARC700 is family of 32-bit CPUs developed by Synopsys, Inc.
> 
> Since version 3.9 ARC architecture is supported in mainline Linux developemnt.
> Since version 2014.04 ARC architecture is supported in mainline U-Boot.
> For quite some time ARC architecture is supported in upstream uClibc
> development but since there were no recent releases of uClibc support of
> ARC is available from uClibc's fork uClibc-ng now.
> 
> Here we add toolchain for ARC architecture and 2 target boards that could
> be used for trying OpenWRT on ARC.
> 
> Alexey Brodkin (3):
>   toolchain: add support of ARC architecture
>   ARC: specify location of output elf
>   linux: add support of Synopsys ARC boards

I'm wondering if there're any comment on this series?
Otherwise any chance for it to be applied?

-Alexey
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mhei at heimpold.de  Mon Aug 31 15:57:03 2015
From: mhei at heimpold.de (Michael Heimpold)
Date: Mon, 31 Aug 2015 21:57:03 +0200
Subject: [OpenWrt-Devel] [PATCH 0/5] packages: uboot-mxs: various fixes
Message-ID: <1441051029-9447-1-git-send-email-mhei@heimpold.de>

This patch series is the first step to bring OpenWrt's Duckbill
support back in shape. U-Boot mainline support is still on my
TODO list, so for the meantime, handle this with a proper patch.

Michael Heimpold (5):
  packages: uboot-mxs: place binaries in the designated path
  packages: uboot-mxs: do no modify the U-Boot image, copy as-is
  packages: uboot-mxs: bless UBOOT_IMAGE with a meaning, otherwise we
    could drop this C&P left-over
  target/mxs: adopt SD card generation to fixed U-Boot path
  packages: uboot-mxs: fix I2SE Duckbill variant

 package/boot/uboot-mxs/Makefile                    |   10 +--
 .../uboot-mxs/patches/001-add-i2se-duckbill.patch  |   82 +++++++++++---------
 target/linux/mxs/image/Makefile                    |    4 +-
 3 files changed, 52 insertions(+), 44 deletions(-)

-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mhei at heimpold.de  Mon Aug 31 15:57:04 2015
From: mhei at heimpold.de (Michael Heimpold)
Date: Mon, 31 Aug 2015 21:57:04 +0200
Subject: [OpenWrt-Devel] [PATCH 1/5] packages: uboot-mxs: place binaries in
	the designated path
In-Reply-To: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
References: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
Message-ID: <1441051029-9447-2-git-send-email-mhei@heimpold.de>

Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---
 package/boot/uboot-mxs/Makefile |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile
index 1686f60..a6a137c 100644
--- a/package/boot/uboot-mxs/Makefile
+++ b/package/boot/uboot-mxs/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013 OpenWrt.org
+# Copyright (C) 2013-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -40,7 +40,6 @@ endef
 UBOOTS := \
 	mx23_olinuxino \
 	duckbill
-	
 
 define Package/uboot/template
 define Package/uboot-mxs-$(1)
@@ -76,10 +75,9 @@ define Build/Compile
 		CROSS_COMPILE=$(TARGET_CROSS) u-boot.sb
 endef
 
-
 define Package/uboot/install/default
 	$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
-	dd if=$(PKG_BUILD_DIR)/u-boot.sb of=$(BIN_DIR)/uboot-$(BOARD)-$(1).sb bs=512 seek=4
+	dd if=$(PKG_BUILD_DIR)/u-boot.sb of=$(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb bs=512 seek=4
 endef
 
 define Package/uboot/install/template
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mhei at heimpold.de  Mon Aug 31 15:57:05 2015
From: mhei at heimpold.de (Michael Heimpold)
Date: Mon, 31 Aug 2015 21:57:05 +0200
Subject: [OpenWrt-Devel] [PATCH 2/5] packages: uboot-mxs: do no modify the
	U-Boot image, copy as-is
In-Reply-To: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
References: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
Message-ID: <1441051029-9447-3-git-send-email-mhei@heimpold.de>

Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---
 package/boot/uboot-mxs/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile
index a6a137c..eee73d2 100644
--- a/package/boot/uboot-mxs/Makefile
+++ b/package/boot/uboot-mxs/Makefile
@@ -77,7 +77,7 @@ endef
 
 define Package/uboot/install/default
 	$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
-	dd if=$(PKG_BUILD_DIR)/u-boot.sb of=$(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb bs=512 seek=4
+	$(CP) $(PKG_BUILD_DIR)/u-boot.sb $(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb
 endef
 
 define Package/uboot/install/template
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mhei at heimpold.de  Mon Aug 31 15:57:06 2015
From: mhei at heimpold.de (Michael Heimpold)
Date: Mon, 31 Aug 2015 21:57:06 +0200
Subject: [OpenWrt-Devel] [PATCH 3/5] packages: uboot-mxs: bless UBOOT_IMAGE
	with a meaning, otherwise we could drop this C&P left-over
In-Reply-To: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
References: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
Message-ID: <1441051029-9447-4-git-send-email-mhei@heimpold.de>

Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---
 package/boot/uboot-mxs/Makefile |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile
index eee73d2..373b8d8 100644
--- a/package/boot/uboot-mxs/Makefile
+++ b/package/boot/uboot-mxs/Makefile
@@ -62,7 +62,7 @@ endef
 ifdef BUILD_VARIANT
 $(eval $(call uboot/$(BUILD_VARIANT)))
 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
-UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
+UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot.sb)
 endif
 
 define Build/Configure
@@ -72,12 +72,12 @@ endef
 
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
-		CROSS_COMPILE=$(TARGET_CROSS) u-boot.sb
+		CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_IMAGE)
 endef
 
 define Package/uboot/install/default
 	$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
-	$(CP) $(PKG_BUILD_DIR)/u-boot.sb $(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb
+	$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb
 endef
 
 define Package/uboot/install/template
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mhei at heimpold.de  Mon Aug 31 15:57:07 2015
From: mhei at heimpold.de (Michael Heimpold)
Date: Mon, 31 Aug 2015 21:57:07 +0200
Subject: [OpenWrt-Devel] [PATCH 4/5] target/mxs: adopt SD card generation to
	fixed U-Boot path
In-Reply-To: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
References: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
Message-ID: <1441051029-9447-5-git-send-email-mhei@heimpold.de>

Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---
 target/linux/mxs/image/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/mxs/image/Makefile b/target/linux/mxs/image/Makefile
index 256d4e6..7e6a1a0 100644
--- a/target/linux/mxs/image/Makefile
+++ b/target/linux/mxs/image/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013 OpenWrt.org
+# Copyright (C) 2013-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -57,7 +57,7 @@ define Image/Build/SDCard
 		$(KDIR)/root.$(1) \
 		$(CONFIG_MXS_SD_BOOT_PARTSIZE) \
 		$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
-		$(BIN_DIR)/uboot-mxs-$(3).sb
+		$(BIN_DIR)/uboot-mxs-$(3)/uboot-mxs-$(3).sb
 endef
 
 define Image/Build/Profile/olinuxino-maxi
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From mhei at heimpold.de  Mon Aug 31 15:57:08 2015
From: mhei at heimpold.de (Michael Heimpold)
Date: Mon, 31 Aug 2015 21:57:08 +0200
Subject: [OpenWrt-Devel] [PATCH 5/5] packages: uboot-mxs: fix I2SE Duckbill
	variant
In-Reply-To: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
References: <1441051029-9447-1-git-send-email-mhei@heimpold.de>
Message-ID: <1441051029-9447-6-git-send-email-mhei@heimpold.de>

The current patch to add Duckbill support is wrong and does not
even compile. So replace this patch with a working one.

Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---
 .../uboot-mxs/patches/001-add-i2se-duckbill.patch  |   82 +++++++++++---------
 1 file changed, 46 insertions(+), 36 deletions(-)

diff --git a/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch b/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch
index 30bb840..f410b19 100644
--- a/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch
+++ b/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch
@@ -1,20 +1,20 @@
-From 201bd7bba4a7c08c49d4ec36da651eec1c3d156b Mon Sep 17 00:00:00 2001
+From 4d9a32780ec795b9edc83c7b3a1e947cec49a5a4 Mon Sep 17 00:00:00 2001
 From: Michael Heimpold <mhei at heimpold.de>
-Date: Mon, 24 Nov 2014 23:29:30 +0100
+Date: Sat, 15 Aug 2015 20:26:18 +0200
 Subject: [PATCH] Add support for I2SE Duckbill boards
 
 Signed-off-by: Michael Heimpold <mhei at heimpold.de>
 ---
- arch/arm/Kconfig                  |   6 ++
- arch/arm/include/asm/mach-types.h |  14 +++
- board/i2se/duckbill/Kconfig       |  15 ++++
- board/i2se/duckbill/MAINTAINERS   |   6 ++
- board/i2se/duckbill/Makefile      |  12 +++
- board/i2se/duckbill/duckbill.c    | 103 +++++++++++++++++++++
- board/i2se/duckbill/iomux.c       | 125 ++++++++++++++++++++++++++
- configs/duckbill_defconfig        |   4 +
- include/configs/duckbill.h        | 183 ++++++++++++++++++++++++++++++++++++++
- 9 files changed, 468 insertions(+)
+ arch/arm/Kconfig                  |    6 ++
+ arch/arm/include/asm/mach-types.h |   13 +++
+ board/i2se/duckbill/Kconfig       |   15 ++++
+ board/i2se/duckbill/MAINTAINERS   |    6 ++
+ board/i2se/duckbill/Makefile      |   12 +++
+ board/i2se/duckbill/duckbill.c    |  112 +++++++++++++++++++++++
+ board/i2se/duckbill/iomux.c       |  125 ++++++++++++++++++++++++++
+ configs/duckbill_defconfig        |    9 ++
+ include/configs/duckbill.h        |  177 +++++++++++++++++++++++++++++++++++++
+ 9 files changed, 475 insertions(+)
  create mode 100644 board/i2se/duckbill/Kconfig
  create mode 100644 board/i2se/duckbill/MAINTAINERS
  create mode 100644 board/i2se/duckbill/Makefile
@@ -24,22 +24,22 @@ Signed-off-by: Michael Heimpold <mhei at heimpold.de>
  create mode 100644 include/configs/duckbill.h
 
 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 5eb1d03..03ffb99 100644
+index 9908b43..7c795ac 100644
 --- a/arch/arm/Kconfig
 +++ b/arch/arm/Kconfig
-@@ -293,6 +293,11 @@ config TARGET_MX28EVK
+@@ -178,6 +178,11 @@ config TARGET_MX28EVK
  	select CPU_ARM926EJS
  	select SUPPORT_SPL
  
 +config TARGET_DUCKBILL
-+	bool "I2SE Duckbill"
++	bool "Support I2SE Duckbill"
 +	select CPU_ARM926EJS
 +	select SUPPORT_SPL
 +
  config TARGET_MX23_OLINUXINO
  	bool "Support mx23_olinuxino"
  	select CPU_ARM926EJS
-@@ -922,6 +927,7 @@ source "board/genesi/mx51_efikamx/Kconfig"
+@@ -926,6 +931,7 @@ source "board/genesi/mx51_efikamx/Kconfig"
  source "board/gumstix/pepper/Kconfig"
  source "board/h2200/Kconfig"
  source "board/hale/tt01/Kconfig"
@@ -48,19 +48,18 @@ index 5eb1d03..03ffb99 100644
  source "board/imx31_phycore/Kconfig"
  source "board/isee/igep0033/Kconfig"
 diff --git a/arch/arm/include/asm/mach-types.h b/arch/arm/include/asm/mach-types.h
-index d4a447b..5c71573 100644
+index 5afe791..330a88d 100644
 --- a/arch/arm/include/asm/mach-types.h
 +++ b/arch/arm/include/asm/mach-types.h
-@@ -1108,6 +1108,8 @@ extern unsigned int __machine_arch_type;
+@@ -1109,6 +1109,7 @@ extern unsigned int __machine_arch_type;
  #define MACH_TYPE_COLIBRI_T30          4493
  #define MACH_TYPE_APALIS_T30           4513
  #define MACH_TYPE_OMAPL138_LCDK        2495
 +#define MACH_TYPE_DUCKBILL             4754
-+
  
  #ifdef CONFIG_ARCH_EBSA110
  # ifdef machine_arch_type
-@@ -14261,6 +14263,18 @@ extern unsigned int __machine_arch_type;
+@@ -14262,6 +14263,18 @@ extern unsigned int __machine_arch_type;
  # define machine_is_apalis_t30()	(0)
  #endif
  
@@ -132,10 +131,10 @@ index 0000000..b5577e3
 +endif
 diff --git a/board/i2se/duckbill/duckbill.c b/board/i2se/duckbill/duckbill.c
 new file mode 100644
-index 0000000..3fa3ddb
+index 0000000..7794f65
 --- /dev/null
 +++ b/board/i2se/duckbill/duckbill.c
-@@ -0,0 +1,103 @@
+@@ -0,0 +1,112 @@
 +/*
 + * I2SE Duckbill board
 + *
@@ -221,6 +220,15 @@ index 0000000..3fa3ddb
 +
 +	return ret;
 +}
++
++void mx28_adjust_mac(int dev_id, unsigned char *mac)
++{
++	mac[0] = 0x00;
++	mac[1] = 0x01;
++
++	if (dev_id == 1) /* Let MAC1 be MAC0 + 1 by default */
++		mac[5] += 1;
++}
 +#endif
 +
 +int misc_init_r(void)
@@ -372,22 +380,27 @@ index 0000000..538e138
 +}
 diff --git a/configs/duckbill_defconfig b/configs/duckbill_defconfig
 new file mode 100644
-index 0000000..d86f5e2
+index 0000000..2edf895
 --- /dev/null
 +++ b/configs/duckbill_defconfig
-@@ -0,0 +1,4 @@
+@@ -0,0 +1,9 @@
++CONFIG_ARM=y
++CONFIG_TARGET_DUCKBILL=y
 +CONFIG_SPL=y
 +CONFIG_SYS_EXTRA_OPTIONS="ENV_IS_IN_MMC"
-++S:CONFIG_ARM=y
-++S:CONFIG_TARGET_DUCKBILL=y
++# CONFIG_CMD_IMLS is not set
++# CONFIG_CMD_FLASH is not set
++# CONFIG_SPI_FLASH is not set
++# CONFIG_CMD_FPGA is not set
++CONFIG_CMD_PING=y
 diff --git a/include/configs/duckbill.h b/include/configs/duckbill.h
 new file mode 100644
-index 0000000..38df7b3
+index 0000000..46e403b
 --- /dev/null
 +++ b/include/configs/duckbill.h
-@@ -0,0 +1,183 @@
+@@ -0,0 +1,177 @@
 +/*
-+ * Copyright (C) 2014 Michael Heimpold <mhei at heimpold.de>
++ * Copyright (C) 2014-2015 Michael Heimpold <mhei at heimpold.de>
 + *
 + * SPDX-License-Identifier:	GPL-2.0+
 + */
@@ -404,7 +417,6 @@ index 0000000..38df7b3
 +
 +/* U-Boot Commands */
 +#define CONFIG_SYS_NO_FLASH
-+#include <config_cmd_default.h>
 +#define CONFIG_DISPLAY_CPUINFO
 +#define CONFIG_DOS_PARTITION
 +
@@ -414,16 +426,11 @@ index 0000000..38df7b3
 +#define CONFIG_CMD_EXT4
 +#define CONFIG_CMD_EXT4_WRITE
 +#define CONFIG_CMD_FAT
++#define CONFIG_CMD_FUSE
 +#define CONFIG_CMD_GPIO
 +#define CONFIG_CMD_I2C
-+#define CONFIG_CMD_ITEST
 +#define CONFIG_CMD_MII
 +#define CONFIG_CMD_MMC
-+#define CONFIG_CMD_NET
-+#define CONFIG_CMD_NFS
-+#define CONFIG_CMD_PING
-+#define CONFIG_CMD_SAVEENV
-+#define CONFIG_CMD_SETEXPR
 +#define CONFIG_CMD_SPI
 +#define CONFIG_CMD_UNZIP
 +
@@ -569,3 +576,6 @@ index 0000000..38df7b3
 +#include <configs/mxs.h>
 +
 +#endif /* __CONFIGS_DUCKBILL_H__ */
+-- 
+1.7.10.4
+
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From dirkneukirchen at web.de  Mon Aug 31 17:32:20 2015
From: dirkneukirchen at web.de (Dirk Neukirchen)
Date: Mon, 31 Aug 2015 23:32:20 +0200
Subject: [OpenWrt-Devel] [PATCH] ugps: fix filename to eliminate build
	problems
Message-ID: <1441056740-26060-1-git-send-email-dirkneukirchen@web.de>

due to ordering PKG_SOURCE_VERSION is not defined leading
to a filename "ugps-.tar.bz2"
This errors out when an older version is in the dl/ dir (or LOCALMIRROR)

fix order and use uhttpd file naming scheme to visibly include date

Signed-off-by: Dirk Neukirchen <dirkneukirchen at web.de>
---
 package/utils/ugps/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile
index 1c8ac6f..e30578f 100644
--- a/package/utils/ugps/Makefile
+++ b/package/utils/ugps/Makefile
@@ -11,11 +11,11 @@ PKG_NAME:=ugps
 PKG_VERSION:=2015-08-17
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=git://git.openwrt.org/project/ugps.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=971e6703eb9bed936cc62cd335105bd2acca14ef
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.bz2
 
 PKG_MAINTAINER:=John Crispin <blogic at openwrt.org>
 PKG_LICENSE:=GPL-2.0+
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


From kerry9842 at gmail.com  Mon Aug 31 23:23:37 2015
From: kerry9842 at gmail.com (John kerry)
Date: Tue, 1 Sep 2015 11:23:37 +0800
Subject: [OpenWrt-Devel] AR9344 OpenWrt (Scanning Device)
Message-ID: <CAGUNxBGrPxdDCRNxAQPwBn19x7V7wFYHrBvmLG14W7fiP4FqSw@mail.gmail.com>

Hi,

I am working on AR9344 openWrt project. When I am doing scanning the device
wireless It's taking very long time to display the Scanning devices.

Could anyone help me, how I can reduce the delay.

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150901/5cdf4e68/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

