[LEDE-DEV] [PATCH] mdnsd: interface: enable looped back messages

2016-05-22 Thread Eyal Birger
When the IP_MULTICAST_LOOP/IPV6_MULTICAST_LOOP socket options are not enabled,
locally generated queries are ignored by mdnsd; This prevents local
applications from being able to discover locally published services.

Signed-off-by: Eyal Birger 
---
 interface.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/interface.c b/interface.c
index c8d8972..9ca85e1 100644
--- a/interface.c
+++ b/interface.c
@@ -315,7 +315,7 @@ interface_mcast_setup4(struct interface *iface)
 {
struct ip_mreqn mreq;
uint8_t ttl = 255;
-   int no = 0;
+   int yes = 1;
struct sockaddr_in sa = { 0 };
int fd = iface->fd.fd;
 
@@ -345,7 +345,7 @@ interface_mcast_setup4(struct interface *iface)
return -1;
}
 
-   if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &no, sizeof(no)) < 0)
+   if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 
0)
fprintf(stderr, "ioctl failed: IP_MULTICAST_LOOP\n");
 
return 0;
@@ -356,7 +356,7 @@ interface_socket_setup6(struct interface *iface)
 {
struct ipv6_mreq mreq;
int ttl = 255;
-   int no = 0;
+   int yes = 1;
struct sockaddr_in6 sa = { 0 };
int fd = iface->fd.fd;
 
@@ -379,7 +379,7 @@ interface_socket_setup6(struct interface *iface)
return -1;
}
 
-   if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &no, sizeof(no)) 
< 0)
+   if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &yes, 
sizeof(yes)) < 0)
fprintf(stderr, "ioctl failed: IPV6_MULTICAST_LOOP\n");
 
return 0;
-- 
1.9.1


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


[LEDE-DEV] [PATCH 0/2] fstools: block.c: Add support for checking vfat

2016-05-22 Thread lede
[PATCH 1/2] block.c: Make static string a const char * instead char *
[PATCH 2/2] block.c: Add support for checking vfat filesystems

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


[LEDE-DEV] [PATCH 2/2] block.c: Add support for checking vfat filesystems

2016-05-22 Thread lede
From: Daniel Dickinson 

vfat is a common filesystem which users may want to mount on an
OpenWrt/LEDE device, so support peforming filesystem checks
before mount for vfat.

Signed-off-by: Daniel Dickinson 
---
 block.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/block.c b/block.c
index 71ffd0b..a6295a5 100644
--- a/block.c
+++ b/block.c
@@ -628,31 +628,37 @@ static void check_filesystem(struct blkid_struct_probe 
*pr)
pid_t pid;
struct stat statbuf;
const char *e2fsck = "/usr/sbin/e2fsck";
+   const char *dosfsck = "/usr/sbin/dosfsck";
+   const char *ckfs;
 
/* UBIFS does not need stuff like fsck */
if (!strncmp(pr->id->name, "ubifs", 5))
return;
 
-   if (strncmp(pr->id->name, "ext", 3)) {
+   if (!strncmp(pr->id->name, "vfat", 4)) {
+   ckfs = dosfsck;
+   } else if (!strncmp(pr->id->name, "ext", 3)) {
+   ckfs = e2fsck;
+   } else {
ULOG_ERR("check_filesystem: %s is not supported\n", 
pr->id->name);
return;
}
 
-   if (stat(e2fsck, &statbuf) < 0) {
-   ULOG_ERR("check_filesystem: %s not found\n", e2fsck);
+   if (stat(ckfs, &statbuf) < 0) {
+   ULOG_ERR("check_filesystem: %s not found\n", ckfs);
return;
}
 
pid = fork();
if (!pid) {
-   execl(e2fsck, e2fsck, "-p", pr->dev, NULL);
+   execl(ckfs, ckfs, "-p", pr->dev, NULL);
exit(-1);
} else if (pid > 0) {
int status;
 
waitpid(pid, &status, 0);
if (WEXITSTATUS(status))
-   ULOG_ERR("check_filesystem: %s returned %d\n", e2fsck, 
WEXITSTATUS(status));
+   ULOG_ERR("check_filesystem: %s returned %d\n", ckfs, 
WEXITSTATUS(status));
}
 }
 
-- 
1.9.1


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


[LEDE-DEV] [PATCH 1/2] block.c: Make static string a const char * instead char *

2016-05-22 Thread lede
From: Daniel Dickinson 

There is no reason for e2fsck string to be altered, and the
only places where is used take const char * as parameters
so make e2fsck a const char *.

Signed-off-by: Daniel Dickinson 
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index ef58665..71ffd0b 100644
--- a/block.c
+++ b/block.c
@@ -627,7 +627,7 @@ static void check_filesystem(struct blkid_struct_probe *pr)
 {
pid_t pid;
struct stat statbuf;
-   char *e2fsck = "/usr/sbin/e2fsck";
+   const char *e2fsck = "/usr/sbin/e2fsck";
 
/* UBIFS does not need stuff like fsck */
if (!strncmp(pr->id->name, "ubifs", 5))
-- 
1.9.1


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


[LEDE-DEV] [PATCH 2/2] block.c: Add ability to mount with ACL and XATTR support

2016-05-22 Thread lede
From: Daniel Dickinson 

Some users will want to use OpenWrt/LEDE devices as NAS
devices and have full POSIX ACL and user_xattr support
(along with other possible use cases), therefore add
support to mount with POSIX ACLs and/or user XATTR
support.

Signed-off-by: Daniel Dickinson 
---
 block.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/block.c b/block.c
index d30b1f6..971f822 100644
--- a/block.c
+++ b/block.c
@@ -170,6 +170,10 @@ static const struct mount_flag mount_flags[] = {
{ "relatime",   MS_RELATIME },
{ "norelatime", ~MS_RELATIME},
{ "strictatime",MS_STRICTATIME  },
+   { "acl",MS_POSIXACL },
+   { "noacl",  ~MS_POSIXACL},
+   { "nouser_xattr",   MS_NOUSER   },
+   { "user_xattr", ~MS_NOUSER  },
 };
 
 static char *blobmsg_get_strdup(struct blob_attr *attr)
-- 
1.9.1


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


[LEDE-DEV] [PATCH 1/2] block.c: Use instead of defining mount flags ourselves

2016-05-22 Thread lede
From: Daniel Dickinson 

Let's use the cannonical source of mount flags instead of
defining the flags ourselves.

Signed-off-by: Daniel Dickinson 
---
 block.c | 14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/block.c b/block.c
index ef58665..d30b1f6 100644
--- a/block.c
+++ b/block.c
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -147,18 +149,6 @@ struct mount_flag {
int32_t flag;
 };
 
-#ifndef MS_DIRSYNC
-#  define MS_DIRSYNC   (1 << 7)
-#endif
-
-#ifndef MS_RELATIME
-#  define MS_RELATIME  (1 << 21)
-#endif
-
-#ifndef MS_STRICTATIME
-#  define MS_STRICTATIME   (1 << 24)
-#endif
-
 static const struct mount_flag mount_flags[] = {
{ "sync",   MS_SYNCHRONOUS  },
{ "async",  ~MS_SYNCHRONOUS },
-- 
1.9.1


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


[LEDE-DEV] [PATCH 0/2] fstools: block.c: Add ACL & XATTR support

2016-05-22 Thread lede
Tested on ar71xx (Netgear WNDR3800) on ext4 with the right kernel support.

[PATCH 1/2] block.c: Use  instead of defining mount flags
[PATCH 2/2] block.c: Add ability to mount with ACL and XATTR support

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


Re: [LEDE-DEV] WRT1900ACS - Kernel 4.4.11 boot failure

2016-05-22 Thread Dheeran Senthilvel

> On 21-May-2016, at 7:55 PM, Dheeran Senthilvel  wrote:
> 
> 
>> On 21-May-2016, at 6:48 PM, Felix Fietkau  wrote:
>> 
>> On 2016-05-21 14:05, Dheeran Senthilvel wrote:
>>> Hi Guys,
>>> 
>>> Nice work there getting everything to Linux 4.4.11. Tested the new
>>> build (r321 dated 20/05/2016) Everything is seems to work pretty
>>> decently, except that upon reboot (both manually or through command
>>> line) the device is struck. When serially accessed an error is seen
>> Please make a clean build from the latest version and reflash the image
>> from the boot loader. I just pushed some flash driver fixes...
>> 
>> - Felix
> 
> Thanks will try and will reply.
> 

Hi, 

Pretty quick work there, having merged the new mwlwifi driver. The 
driver does improve performance - 374MBytes/s@2.4g and 1645MBytes/s@5g using 
iperf for 30sec flooding. Also the long pings reported previously on OEM and 
lede/openwrt seems to have been rectified on this new driver.

Also the LEDs now work by default. Thanks again for that quick fix.

But the NAND fix did not fix my problem of reboot/boot crashing. Same 
error

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


Re: [LEDE-DEV] [PATCH 0/2] fstools: block.c: Add support for checking vfat

2016-05-22 Thread Daniel Curran-Dickinson
On Sun, 2016-05-22 at 05:22 -0400, l...@daniel.thecshore.com wrote: 
> [PATCH 1/2] block.c: Make static string a const char * instead char *
> [PATCH 2/2] block.c: Add support for checking vfat filesystems

I forgot to mention I have tested both vfat and ext4 on ar71xx (Netgear
WNDR3800).

Filesystem check and repair occurs correctly on hotplug in both cases.

Regards,

Daniel

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


Re: [LEDE-DEV] WRT1900ACS - Kernel 4.4.11 boot failure

2016-05-22 Thread Felix Fietkau
On 2016-05-22 11:32, Dheeran Senthilvel wrote:
> 
>> On 21-May-2016, at 7:55 PM, Dheeran Senthilvel  wrote:
>> 
>> 
>>> On 21-May-2016, at 6:48 PM, Felix Fietkau  wrote:
>>> 
>>> On 2016-05-21 14:05, Dheeran Senthilvel wrote:
 Hi Guys,

 Nice work there getting everything to Linux 4.4.11. Tested the new
 build (r321 dated 20/05/2016) Everything is seems to work pretty
 decently, except that upon reboot (both manually or through command
 line) the device is struck. When serially accessed an error is seen
>>> Please make a clean build from the latest version and reflash the image
>>> from the boot loader. I just pushed some flash driver fixes...
>>> 
>>> - Felix
>> 
>> Thanks will try and will reply.
>> 
> 
> Hi, 
> 
>   Pretty quick work there, having merged the new mwlwifi driver. The 
> driver does improve performance - 374MBytes/s@2.4g and 1645MBytes/s@5g using 
> iperf for 30sec flooding. Also the long pings reported previously on OEM and 
> lede/openwrt seems to have been rectified on this new driver.
> 
>   Also the LEDs now work by default. Thanks again for that quick fix.
> 
>   But the NAND fix did not fix my problem of reboot/boot crashing. Same 
> error
Did you do a clean build?

- Felix


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


Re: [LEDE-DEV] WRT1900ACS - Kernel 4.4.11 boot failure

2016-05-22 Thread Dheeran Senthilvel

> On 22-May-2016, at 3:02 PM, Dheeran Senthilvel  wrote:
> 
> 
>> On 21-May-2016, at 7:55 PM, Dheeran Senthilvel  wrote:
>> 
>> 
>>> On 21-May-2016, at 6:48 PM, Felix Fietkau  wrote:
>>> 
>>> On 2016-05-21 14:05, Dheeran Senthilvel wrote:
 Hi Guys,

 Nice work there getting everything to Linux 4.4.11. Tested the new
 build (r321 dated 20/05/2016) Everything is seems to work pretty
 decently, except that upon reboot (both manually or through command
 line) the device is struck. When serially accessed an error is seen
>>> Please make a clean build from the latest version and reflash the image
>>> from the boot loader. I just pushed some flash driver fixes...
>>> 
>>> - Felix
>> 
>> Thanks will try and will reply.
>> 
> 
> Hi, 
> 
>   Pretty quick work there, having merged the new mwlwifi driver. The 
> driver does improve performance - 374MBytes/s@2.4g and 1645MBytes/s@5g using 
> iperf for 30sec flooding. Also the long pings reported previously on OEM and 
> lede/openwrt seems to have been rectified on this new driver.
> 
>   Also the LEDs now work by default. Thanks again for that quick fix.
> 
>   But the NAND fix did not fix my problem of reboot/boot crashing. Same 
> error
> 
> Regards
> Dheeran

Running r339

root@lede:/# uname -a 

Linux lede 4.4.11 #1 SMP Sat May 21 22:47:44 UTC 2016 armv7l GNU/Linux

This is serial output after reboot command 

[ 1237.769778] br-lan: port 3(wlan0) entered disabled state
[ 1237.775198] br-lan: port 2(wlan1) entered disabled state
[ 1237.780566] br-lan: port 1(eth1) entered disabled state
[ 1237.788228] device eth1 left promiscuous mode
[ 1237.792676] br-lan: port 1(eth1) entered disabled state
[ 1237.803425] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 1237.810859] device wlan0 left promiscuous mode
[ 1237.815361] br-lan: port 3(wlan0) entered disabled state
[ 1237.820853] device wlan1 left promiscuous mode
[ 1237.825347] br-lan: port 2(wlan1) entered disabled state
[ 1239.000372] UBIFS (ubi1:0): un-mount UBI device 1
[ 1239.005105] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" stops
crond[985]: USER root pid 2226 cmd /sbin/fan_ctrl.sh
[ 1242.121994] reboot: Restarting system
S-ENV offset == 0x24

If you need anything else please mail me i will definitely try to my best to 
help to diagnose the problem.

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


Re: [LEDE-DEV] WRT1900ACS - Kernel 4.4.11 boot failure

2016-05-22 Thread Dheeran Senthilvel

> On 22-May-2016, at 3:21 PM, Dheeran Senthilvel  wrote:
> 
> 
>> On 22-May-2016, at 3:02 PM, Dheeran Senthilvel  wrote:
>> 
>> 
>>> On 21-May-2016, at 7:55 PM, Dheeran Senthilvel  
>>> wrote:
>>> 
>>> 
 On 21-May-2016, at 6:48 PM, Felix Fietkau  wrote:
 
 On 2016-05-21 14:05, Dheeran Senthilvel wrote:
> Hi Guys,
>   
> Nice work there getting everything to Linux 4.4.11. Tested the new
> build (r321 dated 20/05/2016) Everything is seems to work pretty
> decently, except that upon reboot (both manually or through command
> line) the device is struck. When serially accessed an error is seen
 Please make a clean build from the latest version and reflash the image
 from the boot loader. I just pushed some flash driver fixes...
 
 - Felix
>>> 
>>> Thanks will try and will reply.
>>> 
>> 
>> Hi, 
>> 
>>  Pretty quick work there, having merged the new mwlwifi driver. The 
>> driver does improve performance - 374MBytes/s@2.4g and 1645MBytes/s@5g using 
>> iperf for 30sec flooding. Also the long pings reported previously on OEM and 
>> lede/openwrt seems to have been rectified on this new driver.
>> 
>>  Also the LEDs now work by default. Thanks again for that quick fix.
>> 
>>  But the NAND fix did not fix my problem of reboot/boot crashing. Same 
>> error
>> 
>> Regards
>> Dheeran
> 
> Running r339
> 
> root@lede:/# uname -a 
> 
> Linux lede 4.4.11 #1 SMP Sat May 21 22:47:44 UTC 2016 armv7l GNU/Linux
> 
> This is serial output after reboot command 
> 
> [ 1237.769778] br-lan: port 3(wlan0) entered disabled state
> [ 1237.775198] br-lan: port 2(wlan1) entered disabled state
> [ 1237.780566] br-lan: port 1(eth1) entered disabled state
> [ 1237.788228] device eth1 left promiscuous mode
> [ 1237.792676] br-lan: port 1(eth1) entered disabled state
> [ 1237.803425] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
> [ 1237.810859] device wlan0 left promiscuous mode
> [ 1237.815361] br-lan: port 3(wlan0) entered disabled state
> [ 1237.820853] device wlan1 left promiscuous mode
> [ 1237.825347] br-lan: port 2(wlan1) entered disabled state
> [ 1239.000372] UBIFS (ubi1:0): un-mount UBI device 1
> [ 1239.005105] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" stops
> crond[985]: USER root pid 2226 cmd /sbin/fan_ctrl.sh
> [ 1242.121994] reboot: Restarting system
> S-ENV offset == 0x24
> 
> If you need anything else please mail me i will definitely try to my best to 
> help to diagnose the problem.
> 
> Regards
> Dheeran

Haven’t setup a build system on my PC. Currently testing from the snapshot from 
the repos


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


Re: [LEDE-DEV] WRT1900ACS - Kernel 4.4.11 boot failure

2016-05-22 Thread Dheeran Senthilvel

> On 22-May-2016, at 3:22 PM, Dheeran Senthilvel  wrote:
> 
> 
>> On 22-May-2016, at 3:21 PM, Dheeran Senthilvel  wrote:
>> 
>> 
>>> On 22-May-2016, at 3:02 PM, Dheeran Senthilvel  
>>> wrote:
>>> 
>>> 
 On 21-May-2016, at 7:55 PM, Dheeran Senthilvel  
 wrote:
 
 
> On 21-May-2016, at 6:48 PM, Felix Fietkau  wrote:
> 
> On 2016-05-21 14:05, Dheeran Senthilvel wrote:
>> Hi Guys,
>>  
>> Nice work there getting everything to Linux 4.4.11. Tested the new
>> build (r321 dated 20/05/2016) Everything is seems to work pretty
>> decently, except that upon reboot (both manually or through command
>> line) the device is struck. When serially accessed an error is seen
> Please make a clean build from the latest version and reflash the image
> from the boot loader. I just pushed some flash driver fixes...
> 
> - Felix
 
 Thanks will try and will reply.
 
>>> 
>>> Hi, 
>>> 
>>> Pretty quick work there, having merged the new mwlwifi driver. The 
>>> driver does improve performance - 374MBytes/s@2.4g and 1645MBytes/s@5g 
>>> using iperf for 30sec flooding. Also the long pings reported previously on 
>>> OEM and lede/openwrt seems to have been rectified on this new driver.
>>> 
>>> Also the LEDs now work by default. Thanks again for that quick fix.
>>> 
>>> But the NAND fix did not fix my problem of reboot/boot crashing. Same 
>>> error
>>> 
>>> Regards
>>> Dheeran
>> 
>> Running r339
>> 
>> root@lede:/# uname -a 
>> 
>> Linux lede 4.4.11 #1 SMP Sat May 21 22:47:44 UTC 2016 armv7l GNU/Linux
>> 
>> This is serial output after reboot command 
>> 
>> [ 1237.769778] br-lan: port 3(wlan0) entered disabled state
>> [ 1237.775198] br-lan: port 2(wlan1) entered disabled state
>> [ 1237.780566] br-lan: port 1(eth1) entered disabled state
>> [ 1237.788228] device eth1 left promiscuous mode
>> [ 1237.792676] br-lan: port 1(eth1) entered disabled state
>> [ 1237.803425] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
>> [ 1237.810859] device wlan0 left promiscuous mode
>> [ 1237.815361] br-lan: port 3(wlan0) entered disabled state
>> [ 1237.820853] device wlan1 left promiscuous mode
>> [ 1237.825347] br-lan: port 2(wlan1) entered disabled state
>> [ 1239.000372] UBIFS (ubi1:0): un-mount UBI device 1
>> [ 1239.005105] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" stops
>> crond[985]: USER root pid 2226 cmd /sbin/fan_ctrl.sh
>> [ 1242.121994] reboot: Restarting system
>> S-ENV offset == 0x24
>> 
>> If you need anything else please mail me i will definitely try to my best to 
>> help to diagnose the problem.
>> 
>> Regards
>> Dheeran
> 
> Haven’t setup a build system on my PC. Currently testing from the snapshot 
> from the repos
> 

root@lede:/# env
SHLVL=3
HOME=/root
mtdparts=armada-nand:2048K(uboot)ro,256K(u_env),256K(s_env),1m@9m(devinfo),40m@10m(kernel),34m@16m(rootfs),40m@50m(alt_kernel),34m@56m(alt_rootfs),80m@10m(ubifs
),-@90m(syscfg)
PS1=\u@\h:\w\$
mangled_fs=jffs2
TERM=linux
PATH=/usr/sbin:/usr/bin:/sbin:/bin
PWD=/




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


[LEDE-DEV] Reboot failure on C2600 v1.1

2016-05-22 Thread A. Benz

Hi

Would appreciate pointers as to what might be causing this (or how to 
investigate further):


Issuing "reboot" works fine on a rev 1.0 TPLink Archer C2600, however it 
doesn't seem to work on a rev 1.1.

They apparently are exactly the same apart from the flash chip.


Please see log http://paste.debian.net/693335/
Which shows logs from a v1.1.

Please note this is on 3.18, I realize work is being done to jump to 4.4 
but I thought I'd mention it now to possibly amend the patchset if needed.


--

Regards,
A. Benz

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


Re: [LEDE-DEV] Device profiles have broken ImageBuilder somewhat

2016-05-22 Thread Felix Fietkau
On 2016-05-22 08:19, Daniel Dickinson wrote:
> Hi Felix,
> 
> The recent changes to the device profile stuff has caused issues with
> ImageBuilder.  In ar71xx, if one selects the Default profile during the
> core build, then even if you set make PROFILE=SOMEBOARD image, the
> ImageBuilder tries to build the image for every device instead of just
> the one you specified.  If you image is too large for some of the
> devices in the set of all devices, your build will fail on that device's
> image generation.
Thanks for reporting this. Fixed in e00770f

- Felix

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


[LEDE-DEV] A note on my use of RFC

2016-05-22 Thread Daniel Curran-Dickinson
Hi all,

There seems to be some confusion because of the way I use RFC.  I've
(unless otherwise stated in the PR) intended RFC for looking over code
and commenting before I debug and test (e.g. to make sure the approach
is even in the right ballpark).

I will try to make that clear in the PR from now on, since that seems to
be non-standard usage and people expect RFC to be working code.

Regards,

Daniel

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


[LEDE-DEV] [PATCH 1/2] x86_64: enable mmc to support booting off sd

2016-05-22 Thread Russell Senior

Improved support for PCEngines APU

Signed-off-by: Russell Senior 
---
 target/linux/x86/64/config-default | 8 
 1 file changed, 8 insertions(+)

diff --git a/target/linux/x86/64/config-default 
b/target/linux/x86/64/config-default
index 8b62b86..89a8a4c 100644
--- a/target/linux/x86/64/config-default
+++ b/target/linux/x86/64/config-default
@@ -141,6 +141,14 @@ CONFIG_MEMORY_BALLOON=y
 # CONFIG_MEMORY_HOTPLUG is not set
 CONFIG_MFD_CORE=y
 # CONFIG_MFD_INTEL_LPSS_ACPI is not set
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_RICOH_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PCI=y
+# CONFIG_MMC_SDHCI_PLTFM is not set
+# CONFIG_MMC_TIFM_SD is not set
+# CONFIG_MMC_WBSD is not set
 CONFIG_MODULES_USE_ELF_RELA=y
 # CONFIG_MPSC is not set
 CONFIG_MUTEX_SPIN_ON_OWNER=y
-- 
2.8.2



-- 
Russell Senior, President
russ...@personaltelco.net

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


[LEDE-DEV] [PATCH 2/2] x86: fix sysupgrade to work on mmcblk

2016-05-22 Thread Russell Senior

Reworks block device detection slightly and accomodates the different
partition naming scheme, e.g. mmcblk0p1 vs sda1

Signed-off-by: Russell Senior 
---
 target/linux/x86/base-files/lib/upgrade/platform.sh | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh 
b/target/linux/x86/base-files/lib/upgrade/platform.sh
index 29eac77..04508b7 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -17,11 +17,14 @@ platform_export_bootpart() {

PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02)
uuid="${disk#PARTUUID=}"
uuid="${uuid%-02}"
-   for disk in /dev/*; do
-   [ -b "$disk" ] || continue
+   for disk in $(find /dev -type b); do
set -- $(dd if=$disk bs=1 skip=440 
count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
if [ "$4$3$2$1" = "$uuid" ]; then
-   export BOOTPART="${disk}1"
+   if echo $disk | grep -q mmc - ; 
then
+   export 
BOOTPART="${disk}p1
+   else
+   export 
BOOTPART="${disk}1"
+   fi
return 0
fi
done
-- 
2.8.2



-- 
Russell Senior, President
russ...@personaltelco.net

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


[LEDE-DEV] [PATCH netifd] bridge: make learning and unicast-flood configurable per bridge port

2016-05-22 Thread Linus Lüssing
Tuning these two options allows a more fine grained configuration of the
forwarding database (fdb) of a bridge.

The former allows to enable or disable the learning of the presence of
MAC addresses behind a bridge port. (default: enabled on all ports)

The latter allows to tune the behaviour in case a destination MAC address
of a frame is unknown to the fdb, like only flooding on specific ports or
not flooding on any port. (default: flood on all ports, except incoming)

This can be useful to create a dumb hub, for instance for monitoring
purposes. Or in larger layer 2 mesh networks to avoid keeping redundant
databases (e.g. with the batman-adv translation table).

Signed-off-by: Linus Lüssing 
---
 device.c   |   18 ++
 device.h   |6 ++
 system-linux.c |   18 ++
 3 files changed, 42 insertions(+)

diff --git a/device.c b/device.c
index 9344e1b..0e07615 100644
--- a/device.c
+++ b/device.c
@@ -51,6 +51,8 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] 
= {
[DEV_ATTR_MULTICAST_TO_UNICAST] = { .name = "multicast_to_unicast", 
.type = BLOBMSG_TYPE_BOOL },
[DEV_ATTR_MULTICAST_ROUTER] = { .name = "multicast_router", .type = 
BLOBMSG_TYPE_INT32 },
[DEV_ATTR_MULTICAST] = { .name ="multicast", .type = BLOBMSG_TYPE_BOOL 
},
+   [DEV_ATTR_LEARNING] = { .name ="learning", .type = BLOBMSG_TYPE_BOOL },
+   [DEV_ATTR_UNICAST_FLOOD] = { .name ="unicast_flood", .type = 
BLOBMSG_TYPE_BOOL },
 };
 
 const struct uci_blob_param_list device_attr_list = {
@@ -177,6 +179,8 @@ device_merge_settings(struct device *dev, struct 
device_settings *n)
s->multicast : os->multicast;
n->multicast_to_unicast = s->multicast_to_unicast;
n->multicast_router = s->multicast_router;
+   n->learning = s->learning;
+   n->unicast_flood = s->unicast_flood;
n->flags = s->flags | os->flags | os->valid_flags;
 }
 
@@ -295,6 +299,16 @@ device_init_settings(struct device *dev, struct blob_attr 
**tb)
s->flags |= DEV_OPT_MULTICAST;
}
 
+   if ((cur = tb[DEV_ATTR_LEARNING])) {
+   s->learning = blobmsg_get_bool(cur);
+   s->flags |= DEV_OPT_LEARNING;
+   }
+
+   if ((cur = tb[DEV_ATTR_UNICAST_FLOOD])) {
+   s->unicast_flood = blobmsg_get_bool(cur);
+   s->flags |= DEV_OPT_UNICAST_FLOOD;
+   }
+
device_set_disabled(dev, disabled);
 }
 
@@ -939,6 +953,10 @@ device_dump_status(struct blob_buf *b, struct device *dev)
blobmsg_add_u32(b, "multicast_router", 
st.multicast_router);
if (st.flags & DEV_OPT_MULTICAST)
blobmsg_add_u8(b, "multicast", st.multicast);
+   if (st.flags & DEV_OPT_LEARNING)
+   blobmsg_add_u8(b, "learning", st.learning);
+   if (st.flags & DEV_OPT_UNICAST_FLOOD)
+   blobmsg_add_u8(b, "unicast_flood", st.unicast_flood);
}
 
s = blobmsg_open_table(b, "statistics");
diff --git a/device.h b/device.h
index ac77cfb..4a88c05 100644
--- a/device.h
+++ b/device.h
@@ -45,6 +45,8 @@ enum {
DEV_ATTR_MULTICAST_TO_UNICAST,
DEV_ATTR_MULTICAST_ROUTER,
DEV_ATTR_MULTICAST,
+   DEV_ATTR_LEARNING,
+   DEV_ATTR_UNICAST_FLOOD,
__DEV_ATTR_MAX,
 };
 
@@ -88,6 +90,8 @@ enum {
DEV_OPT_MULTICAST_TO_UNICAST= (1 << 14),
DEV_OPT_MULTICAST_ROUTER= (1 << 15),
DEV_OPT_MULTICAST   = (1 << 16),
+   DEV_OPT_LEARNING= (1 << 17),
+   DEV_OPT_UNICAST_FLOOD   = (1 << 18),
 };
 
 /* events broadcasted to all users of a device */
@@ -149,6 +153,8 @@ struct device_settings {
bool multicast_to_unicast;
unsigned int multicast_router;
bool multicast;
+   bool learning;
+   bool unicast_flood;
 };
 
 /*
diff --git a/system-linux.c b/system-linux.c
index 351a994..621f99b 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -372,6 +372,16 @@ static void 
system_bridge_set_startup_query_interval(struct device *dev, const c
  dev->ifname, val);
 }
 
+static void system_bridge_set_learning(struct device *dev, const char *val)
+{
+   system_set_dev_sysctl("/sys/class/net/%s/brport/learning", dev->ifname, 
val);
+}
+
+static void system_bridge_set_unicast_flood(struct device *dev, const char 
*val)
+{
+   system_set_dev_sysctl("/sys/class/net/%s/brport/unicast_flood", 
dev->ifname, val);
+}
+
 static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz)
 {
int fd = -1, ret = -1;
@@ -648,6 +658,14 @@ int system_bridge_addif(struct device *bridge, struct 
device *dev)
system_bridge_set_multicast_router(dev, buf, false);
}
 
+   if (dev->settings.flags & DEV_OPT_LEARNING &&
+   !dev->settings.learning)
+   system_bridge_set_learning(dev, "0");
+
+   if (dev->s

Re: [LEDE-DEV] [PATCH 2/2] x86: fix sysupgrade to work on mmcblk

2016-05-22 Thread Russell Senior

Oops, broken.  Please wait for v2.

run testing++


-- 
Russell Senior, President
russ...@personaltelco.net

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


Re: [LEDE-DEV] A note on my use of RFC

2016-05-22 Thread Daniel Curran-Dickinson
On Sun, 2016-05-22 at 16:03 -0400, Daniel Curran-Dickinson wrote: 
> Hi all,
> 
> There seems to be some confusion because of the way I use RFC.  I've
> (unless otherwise stated in the PR) intended RFC for looking over code
> and commenting before I debug and test (e.g. to make sure the approach
> is even in the right ballpark).
> 
> I will try to make that clear in the PR from now on, since that seems to
> be non-standard usage and people expect RFC to be working code.

Also, since it seems to be non-standard usage I will use URFC (Untest
Request For Comments) so as to alert the reader it's not a standard RFC,
but is intended as code/design review before the code gets tested and
debugged.

Regards,

Daniel

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


[LEDE-DEV] A question on procd interface_trigger vs raw_trifger

2016-05-22 Thread Daniel Dickinson
Hi,

I've noticed that network_trigger has gone away and is replaced by
interface_trigger, but have seen raw_trigger too, and am not clear on
when one would use which.


Can you clarify?

Regard,

Daniel

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


[LEDE-DEV] [Bug Report][Lantiq][ARV7518pw] Kernel Oops after booting

2016-05-22 Thread Mohammed Berdai
Hi everyone,

I started building and testing LEDE DD for some Lantiq based routers mainly 
(ARV4518 / ARV7518 / ARV7519RW22)

Since I couldn't find a bug tracker site I thought it would be OK to send a bug 
report here.

I've built LEDE DD (r343) for ARV7518pw with LuCi and no extra tweaks or 
configs.

After flashing and booting for the first time I get a Kernel Oops.

Here is the entire bootlog

## Booting kernel from Legacy Image at b002 ...
   Image Name:   MIPS LEDE Linux-4.4.11
   Created:  2016-05-22  17:51:00 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:1498139 Bytes =  1.4 MB
   Load Address: 80002000
   Entry Point:  80002000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

[0.00] Linux version 4.4.11 (rave@ravebox) (gcc version 5.3.0 (LEDE GCC 
5.3.0 r343) ) #5 Sun May 22 21:23:45 UTC 2016
[0.00] SoC: Danube rev 1.5
[0.00] bootconsole [early0] enabled
[0.00] CPU0 revision is: 00019641 (MIPS 24KEc)
[0.00] MIPS: machine is ARV7518PW - Astoria Networks
[0.00] Determined physical RAM map:
[0.00]  memory: 0400 @  (usable)
[0.00] Initrd not found or empty - disabling initrd
[0.00] Zone ranges:
[0.00]   Normal   [mem 0x-0x03ff]
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x-0x03ff]
[0.00] Initmem setup node 0 [mem 0x-0x03ff]
[0.00] Primary instruction cache 16kB, VIPT, 4-way, linesize 32 bytes.
[0.00] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 
bytes
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 16256
[0.00] Kernel command line: console=ttyLTQ0,115200 init=/etc/preinit
[0.00] PID hash table entries: 256 (order: -2, 1024 bytes)
[0.00] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[0.00] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[0.00] Writing ErrCtl register=0005adf8
[0.00] Readback ErrCtl register=0005adf8
[0.00] Memory: 58924K/65536K available (3518K kernel code, 162K rwdata, 
868K rodata, 1196K init, 199K bss, 6612K reserved, 0K cma-reserved)
[0.00] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[0.00] NR_IRQS:256
[0.00] CPU Clock: 333MHz
[0.00] clocksource: MIPS: mask: 0x max_cycles: 0x, 
max_idle_ns: 11467562657 ns
[0.17] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 
12884901885ns
[0.007952] Calibrating delay loop... 221.18 BogoMIPS (lpj=442368)
[0.050555] pid_max: default: 32768 minimum: 301
[0.055539] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.062086] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.078608] clocksource: jiffies: mask: 0x max_cycles: 0x, 
max_idle_ns: 764504178510 ns
[0.088588] pinctrl core: initialized pinctrl subsystem
[0.095054] NET: Registered protocol family 16
[0.10] pinctrl-xway 1e100b10.pinmux: Init done
[0.115432] dma-xway 1e104100.dma: Init done - hw rev: 3, ports: 5, 
channels: 20
[0.17] PCI host bridge /fpi@1000/pci@E105400 ranges:
[0.150146]  MEM 0x1800..0x19ff
[0.155414]   IO 0x1ae0..0x1aff
[0.164265] ath9k,eeprom 107f0400.ath9k_eep: endian check enabled.
[0.170401] ath9k,eeprom 107f0400.ath9k_eep: pci slot: 14
[0.175842] ath9k,eeprom 107f0400.ath9k_eep: loaded ath9k eeprom
[0.211057] usbcore: registered new interface driver usbfs
[0.216723] usbcore: registered new interface driver hub
[0.222145] usbcore: registered new device driver usb
[0.227759] PCI host bridge to bus :00
[0.231814] pci_bus :00: root bus resource [mem 0x1800-0x19ff]
[0.238734] pci_bus :00: root bus resource [io  0x]
[0.244724] pci_bus :00: root bus resource [??? 0x flags 0x0]
[0.251576] pci_bus :00: No busn resource found for root bus, will use 
[bus 00-ff]
[0.259721] pci :00:0e.0: fixup device configuration
[0.266161] pci :00:0e.0: fixup info: [168c:ff1d] revision 01 class 
0x02
[0.274202] pci :00:0e.0: BAR 0: assigned [mem 0x1800-0x1800]
[0.282584] clocksource: Switched to clocksource MIPS
[0.290772] NET: Registered protocol family 2
[0.296646] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[0.303603] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[0.309991] TCP: Hash tables configured (established 1024 bind 1024)
[0.316574] UDP hash table entries: 256 (order: 0, 4096 bytes)
[0.322399] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[0.329162] NET: Registered protoc

[LEDE-DEV] [PATCHv3] Fix the logged CPU variant

2016-05-22 Thread Xotic750
From: Graham Fairweather 

This patch fixes the logged detected CPU ID when an equivalent is used,
like in the case where we have a bcm6369 and configuration for a
bcm6368 is used.
So, it will display 'Detected Broadcom 0x6369 CPU revision b2' instead of
'Detected Broadcom 0x6368 CPU revision b2'.
More info can be found at:
https://forum.openwrt.org/viewtopic.php?id=64621
https://github.com/Xotic750/mirror-lede/tree/fix_cpu_id
Signed-off-by: Graham Fairweather 
---
 .../330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch  | 9 +
 .../330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch  | 9 +
 2 files changed, 18 insertions(+)

diff --git 
a/target/linux/brcm63xx/patches-4.1/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
 
b/target/linux/brcm63xx/patches-4.1/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
index 661abf6..23491aa 100644
--- 
a/target/linux/brcm63xx/patches-4.1/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
+++ 
b/target/linux/brcm63xx/patches-4.1/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
@@ -41,6 +41,15 @@ Subject: [PATCH 40/53] MIPS: BCM63XX: add a new cpu variant 
helper
bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
  
switch (bcm63xx_cpu_id) {
+@@ -377,7 +387,7 @@ void __init bcm63xx_cpu_init(void)
+   bcm63xx_memory_size = detect_memory_size();
+ 
+   printk(KERN_INFO "Detected Broadcom 0x%04x CPU revision %02x\n",
+- bcm63xx_cpu_id, bcm63xx_cpu_rev);
++ bcm63xx_cpu_variant, bcm63xx_cpu_rev);
+   printk(KERN_INFO "CPU frequency is %u MHz\n",
+  bcm63xx_cpu_freq / 100);
+   printk(KERN_INFO "%uMB of RAM installed\n",
 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
 @@ -19,6 +19,7 @@
diff --git 
a/target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
 
b/target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
index 661abf6..330a9e6 100644
--- 
a/target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
+++ 
b/target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
@@ -41,6 +41,15 @@ Subject: [PATCH 40/53] MIPS: BCM63XX: add a new cpu variant 
helper
bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
  
switch (bcm63xx_cpu_id) {
+@@ -377,7 +387,7 @@ void __init bcm63xx_cpu_init(void)
+   bcm63xx_memory_size = detect_memory_size();
+ 
+   pr_info("Detected Broadcom 0x%04x CPU revision %02x\n",
+-  bcm63xx_cpu_id, bcm63xx_cpu_rev);
++  bcm63xx_cpu_variant, bcm63xx_cpu_rev);
+   pr_info("CPU frequency is %u MHz\n",
+   bcm63xx_cpu_freq / 100);
+   pr_info("%uMB of RAM installed\n",
 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
 @@ -19,6 +19,7 @@
-- 
2.5.5


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


[LEDE-DEV] [PATCHv4 1/1] [brcm63xx] Fix the logged CPU variant

2016-05-22 Thread Xotic750
From: Graham Fairweather 

This patch fixes the logged detected CPU ID when an equivalent is used,
like in the case where we have a bcm6369 and configuration for a
bcm6368 is used.
So, it will display 'Detected Broadcom 0x6369 CPU revision b2' instead of
'Detected Broadcom 0x6368 CPU revision b2'.
More info can be found at:
https://forum.openwrt.org/viewtopic.php?id=64621
https://github.com/Xotic750/mirror-lede/tree/fix_cpu_id
Signed-off-by: Graham Fairweather 
---
 .../330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch  | 9 +
 .../330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch  | 9 +
 2 files changed, 18 insertions(+)

diff --git 
a/target/linux/brcm63xx/patches-4.1/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
 
b/target/linux/brcm63xx/patches-4.1/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
index 661abf6..23491aa 100644
--- 
a/target/linux/brcm63xx/patches-4.1/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
+++ 
b/target/linux/brcm63xx/patches-4.1/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
@@ -41,6 +41,15 @@ Subject: [PATCH 40/53] MIPS: BCM63XX: add a new cpu variant 
helper
bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
  
switch (bcm63xx_cpu_id) {
+@@ -377,7 +387,7 @@ void __init bcm63xx_cpu_init(void)
+   bcm63xx_memory_size = detect_memory_size();
+ 
+   printk(KERN_INFO "Detected Broadcom 0x%04x CPU revision %02x\n",
+- bcm63xx_cpu_id, bcm63xx_cpu_rev);
++ bcm63xx_cpu_variant, bcm63xx_cpu_rev);
+   printk(KERN_INFO "CPU frequency is %u MHz\n",
+  bcm63xx_cpu_freq / 100);
+   printk(KERN_INFO "%uMB of RAM installed\n",
 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
 @@ -19,6 +19,7 @@
diff --git 
a/target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
 
b/target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
index 661abf6..330a9e6 100644
--- 
a/target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
+++ 
b/target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch
@@ -41,6 +41,15 @@ Subject: [PATCH 40/53] MIPS: BCM63XX: add a new cpu variant 
helper
bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
  
switch (bcm63xx_cpu_id) {
+@@ -377,7 +387,7 @@ void __init bcm63xx_cpu_init(void)
+   bcm63xx_memory_size = detect_memory_size();
+ 
+   pr_info("Detected Broadcom 0x%04x CPU revision %02x\n",
+-  bcm63xx_cpu_id, bcm63xx_cpu_rev);
++  bcm63xx_cpu_variant, bcm63xx_cpu_rev);
+   pr_info("CPU frequency is %u MHz\n",
+   bcm63xx_cpu_freq / 100);
+   pr_info("%uMB of RAM installed\n",
 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
 @@ -19,6 +19,7 @@
-- 
2.5.5


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


[LEDE-DEV] [PATCHv3 1/1] [brcm63xx] Add initial support for EVG2000

2016-05-22 Thread Xotic750
From: Graham Fairweather 

This patch adds support for the Netgear EVG2000 VoIP Gateway to the
bcm63xx targets.
Ran 'make target/linux/refresh V=s' after update to kernel 4.4.10 from
4.4.8 where the initial patch was added.
This device was not sold to the general public, but rather is/was
provided by telcos to customers in Sweden, Australia, Singapore and
other parts of asia.
System-On-Chip: Broadcom BCM6369 (2 * BMIPS4350 v3.1 / 400 MHz)
Flash size: 16 MiB
RAM size: 64 MiB
Wireless: BCM4322 802.11b/g/n (onboard)
Ethernet: Broadcom BCM53115
USB: 2 x USB 2.0
Known issues:
 - Unable to detect 53115 switch. This appear to be a problem with
probing for the PHY using MDIO and results in error 5. Doesn't seem to
be a problem with the configuration, and could use someone with
experience to have a look at it.
 - Uses the b43 driver as using the OpenWRT/LEDE broadcom-wl driver
fails to load the firmware for the 4322, so 802.11n is not supported.
The factory build uses a newer broadcom-wl driver.
 - No support for the 2 VoIP ports (not attempted)
More info on the device and the research can be found at:
https://wiki.openwrt.org/toh/netgear/evg2000
https://wikidevi.com/wiki/Netgear_EVG2000
https://github.com/Xotic750/mirror-lede/tree/evg2000
https://forum.openwrt.org/viewtopic.php?id=63950
Signed-off-by: Graham Fairweather 
---
 .../linux/brcm63xx/base-files/etc/board.d/01_leds  |   7 ++
 .../brcm63xx/base-files/etc/board.d/02_network |   1 +
 target/linux/brcm63xx/base-files/etc/diag.sh   |   3 +
 .../base-files/etc/uci-defaults/09_fix_crc |   2 +-
 target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |   3 +
 .../lib/preinit/05_init_interfaces_brcm63xx|   1 +
 target/linux/brcm63xx/dts/evg2000.dts  | 103 +
 target/linux/brcm63xx/image/Makefile   |   2 +
 .../brcm63xx/patches-4.1/575-board_EVG2000.patch   |  62 +
 ...-m25p80-use-parsers-if-provided-in-flash-.patch |   2 +-
 ...CES-m25p80-add-support-for-limiting-reads.patch |   4 +-
 .../414-MTD-m25p80-allow-passing-pp_data.patch |   2 +-
 .../brcm63xx/patches-4.4/575-board_EVG2000.patch   |  62 +
 target/linux/brcm63xx/profiles/netgear.mk  |  10 ++
 14 files changed, 259 insertions(+), 5 deletions(-)
 create mode 100644 target/linux/brcm63xx/dts/evg2000.dts
 create mode 100644 target/linux/brcm63xx/patches-4.1/575-board_EVG2000.patch
 create mode 100644 target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch

diff --git a/target/linux/brcm63xx/base-files/etc/board.d/01_leds 
b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
index 8339254..4163214 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
@@ -24,6 +24,13 @@ dgnd3700v1_dgnd3800b)
ucidef_set_led_usbdev "usb1" "USB1" "DGND3700v1_3800B:green:usb-back" 
"1-1"
ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" 
"1-2"
;;
+evg2000)
+   ucidef_set_led_netdev "lan" "LAN" "EVG2000:green:lan" "eth0"
+   ucidef_set_led_netdev "wan" "WAN" "EVG2000:green:wan" "eth1"
+   ucidef_set_led_netdev "wlan0" "WIFI" "EVG2000:green:wireless" "wlan0"
+   ucidef_set_led_usbdev "usb1" "USB1" "EVG2000:green:voip1" "1-1"
+   ucidef_set_led_usbdev "usb2" "USB2" "EVG2000:green:voip2" "1-2"
+   ;;
 fast2704n)
ucidef_set_led_netdev "wan" "WAN" "F@ST2704N:green:inet" "eth0.2"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network 
b/target/linux/brcm63xx/base-files/etc/board.d/02_network
index f96da08..83367c1 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network
@@ -11,6 +11,7 @@ board_config_update
 case "$(brcm63xx_board_name)" in
 
 cvg834g |\
+evg2000 |\
 rta770bw |\
 rta770w |\
 spw303v |\
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index b864964..6ac2459 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -70,6 +70,9 @@ set_state() {
dgnd3700v1_dgnd3800b)
status_led="DGND3700v1_3800B:green:power"
;;
+   evg2000)
+   status_led="EVG2000:green:power"
+   ;;
fast2504n)
status_led="fast2504n:green:ok"
;;
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 70dbe2a..1201168 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
@@ -21,6 +21,7 @@ case "$(brcm63xx_board_name)" in
cpva642 |\
ct-6373 |\
dsl-274xb-f |\
+   evg2000 |\
hg622 |\
magic |\
p870hw-51a_v2 |\
@@ -37,4 +38,3 @@ case "$(brcm63xx_board_name)" in
do_fixc

[LEDE-DEV] [PATCH 1/2] ar71xx/cpe510: split profile into 2 profiles cpe210 and cpe510

2016-05-22 Thread Alexander Couzens
Split profile into 2GHz and 5GHz. The 5GHz devices are
quite "special". The 2 GHz works perfect.

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |  1 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |  1 +
 .../ar71xx/base-files/etc/board.d/03_gpio_switches |  1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |  6 -
 .../ar71xx/base-files/lib/upgrade/platform.sh  |  1 +
 .../ar71xx/files/arch/mips/ath79/mach-cpe510.c | 30 +-
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |  1 +
 target/linux/ar71xx/image/Makefile | 12 ++---
 8 files changed, 43 insertions(+), 10 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index f6ea9a8..023d91e 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -127,6 +127,7 @@ cf-e316n-v2)
ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
;;
 
+cpe210|\
 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/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index e7da065..3eb415f 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -72,6 +72,7 @@ bsb)
ucidef_set_interface_wlan
;;
 
+cpe210|\
 cpe510)
ucidef_add_switch "switch0" \
"0@eth0" "5:lan" "4:wan"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches 
b/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches
index 8abcfc0..00cc167 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches
+++ b/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches
@@ -17,6 +17,7 @@ nanostation-m)
 nanostation-m-xw)
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
;;
+cpe210|\
 cpe510)
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index eb87dd4..ce3e40e 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -446,7 +446,11 @@ ar71xx_board_detect() {
*"COMFAST CF-E316N v2")
name="cf-e316n-v2"
;;
-   *"CPE210/220/510/520")
+   *"CPE210/220")
+   name="cpe210"
+   tplink_pharos_board_detect
+   ;;
+   *"CPE510/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 0d6aa6b..0985d33 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -280,6 +280,7 @@ platform_check_image() {
return 0
;;
 
+   cpe210|\
cpe510)
tplink_pharos_check_image "$1" && return 0
return 1
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
index 5cb052a..74daf43 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
@@ -78,12 +78,8 @@ static struct gpio_keys_button cpe510_gpio_keys[] __initdata 
= {
}
 };
 
-
-static void __init cpe510_setup(void)
+static void __init cpe_setup(u8 *mac)
 {
-   u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
-   u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
-
/* Disable JTAG, enabling GPIOs 0-3 */
/* Configure OBS4 line, for GPIO 4*/
ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE,
@@ -105,9 +101,31 @@ static void __init cpe510_setup(void)
ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
ath79_register_eth(1);
+}
+
+
+static void __init cpe210_setup(void)
+{
+   u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
+   u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+   cpe_setup(mac);
 
ath79_register_wmac(ee, mac);
 }
 
-MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE210/220/510/520",
+static void __init cpe510_setup(void)
+{
+   u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
+   u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+   cpe_setup(mac);
+
+   ath79_register_wmac(ee, mac);
+}
+
+MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210", "TP-LINK CPE210/220",
+cpe210_setup);
+
+MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520",
 cpe510_setup);
diff --git a/target/linux/ar71xx/f

[LEDE-DEV] [PATCH 2/2] [RFC] ar71xx/cpe510: use second wifi calibration table

2016-05-22 Thread Alexander Couzens
The cpe510 has two calibration tables. The first calibration
table requires to modify ath9k driver to work (patched tx gain table).

Signed-off-by: Alexander Couzens 
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
index 74daf43..875589d 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
@@ -117,7 +117,7 @@ static void __init cpe210_setup(void)
 static void __init cpe510_setup(void)
 {
u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
-   u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+   u8 *ee = (u8 *) KSEG1ADDR(0x1fff5000);
 
cpe_setup(mac);
 
-- 
2.8.2


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


Re: [LEDE-DEV] [PATCH 2/2] [RFC] ar71xx/cpe510: use second wifi calibration table

2016-05-22 Thread John Crispin


On 23/05/2016 03:23, Alexander Couzens wrote:
> The cpe510 has two calibration tables. The first calibration
> table requires to modify ath9k driver to work (patched tx gain table).
> 

Hi,

why is this a RFC ? i am failing to see what we should comment on

John


> Signed-off-by: Alexander Couzens 
> ---
>  target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c 
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
> index 74daf43..875589d 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
> @@ -117,7 +117,7 @@ static void __init cpe210_setup(void)
>  static void __init cpe510_setup(void)
>  {
>   u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
> - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
> + u8 *ee = (u8 *) KSEG1ADDR(0x1fff5000);
>  
>   cpe_setup(mac);
>  
> 

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